Statistics
| Branch: | Revision:

root / src / com / rackspace / cloud / files / api / client / Container.java @ 4daf0073

History | View | Annotate | Download (2.1 kB)

1 f8be9cce Phillip Toohill
package com.rackspace.cloud.files.api.client;
2 f8be9cce Phillip Toohill
3 f8be9cce Phillip Toohill
import com.rackspace.cloud.servers.api.client.Entity;
4 f8be9cce Phillip Toohill
5 f8be9cce Phillip Toohill
/**
6 f8be9cce Phillip Toohill
 * @author Phillip Toohill dead2hill@gmail.com
7 4daf0073 Phillip Toohill
 * 
8 f8be9cce Phillip Toohill
 */
9 f8be9cce Phillip Toohill
public class Container extends Entity {
10 f8be9cce Phillip Toohill
11 f8be9cce Phillip Toohill
        private static final long serialVersionUID = 5994739895998309675L;
12 4daf0073 Phillip Toohill
13 4daf0073 Phillip Toohill
        // Regular attributes
14 f8be9cce Phillip Toohill
        private String name;
15 f8be9cce Phillip Toohill
        private int count;
16 f8be9cce Phillip Toohill
        private int bytes;
17 4daf0073 Phillip Toohill
18 f8be9cce Phillip Toohill
        // CDN attributes
19 f8be9cce Phillip Toohill
        private boolean cdnEnabled;
20 f8be9cce Phillip Toohill
        private int Ttl;
21 f8be9cce Phillip Toohill
        public String cdnUrl;
22 f8be9cce Phillip Toohill
        public boolean logRetention;
23 f8be9cce Phillip Toohill
24 f8be9cce Phillip Toohill
        public String toXML() {
25 f8be9cce Phillip Toohill
                String xml = "";
26 4daf0073 Phillip Toohill
                xml = "<container xmlns=\"http://docs.rackspacecloud.com/servers/api/v1.0\" name=\""
27 4daf0073 Phillip Toohill
                                + getName() + "\"></server>";
28 f8be9cce Phillip Toohill
                return xml;
29 f8be9cce Phillip Toohill
        }
30 f8be9cce Phillip Toohill
31 f8be9cce Phillip Toohill
        /**
32 f8be9cce Phillip Toohill
         * @return the name
33 f8be9cce Phillip Toohill
         */
34 f8be9cce Phillip Toohill
        public String getName() {
35 f8be9cce Phillip Toohill
                return name;
36 f8be9cce Phillip Toohill
        }
37 f8be9cce Phillip Toohill
38 f8be9cce Phillip Toohill
        /**
39 4daf0073 Phillip Toohill
         * @param name
40 4daf0073 Phillip Toohill
         *            the name to set
41 f8be9cce Phillip Toohill
         */
42 f8be9cce Phillip Toohill
        public void setName(String name) {
43 f8be9cce Phillip Toohill
                this.name = name;
44 f8be9cce Phillip Toohill
        }
45 f8be9cce Phillip Toohill
46 f8be9cce Phillip Toohill
        /**
47 f8be9cce Phillip Toohill
         * @return the count
48 f8be9cce Phillip Toohill
         */
49 f8be9cce Phillip Toohill
        public int getCount() {
50 f8be9cce Phillip Toohill
                return count;
51 f8be9cce Phillip Toohill
        }
52 f8be9cce Phillip Toohill
53 f8be9cce Phillip Toohill
        /**
54 4daf0073 Phillip Toohill
         * @param count
55 4daf0073 Phillip Toohill
         *            the count to set
56 f8be9cce Phillip Toohill
         */
57 f8be9cce Phillip Toohill
        public void setCount(int count) {
58 f8be9cce Phillip Toohill
                this.count = count;
59 f8be9cce Phillip Toohill
        }
60 f8be9cce Phillip Toohill
61 f8be9cce Phillip Toohill
        /**
62 f8be9cce Phillip Toohill
         * @return the bytes
63 f8be9cce Phillip Toohill
         */
64 f8be9cce Phillip Toohill
        public int getBytes() {
65 f8be9cce Phillip Toohill
                return bytes;
66 f8be9cce Phillip Toohill
        }
67 f8be9cce Phillip Toohill
68 f8be9cce Phillip Toohill
        /**
69 4daf0073 Phillip Toohill
         * @param bytes
70 4daf0073 Phillip Toohill
         *            the bytes to set
71 f8be9cce Phillip Toohill
         */
72 f8be9cce Phillip Toohill
        public void setBytes(int bytes) {
73 f8be9cce Phillip Toohill
                this.bytes = bytes;
74 f8be9cce Phillip Toohill
        }
75 f8be9cce Phillip Toohill
76 f8be9cce Phillip Toohill
        /**
77 f8be9cce Phillip Toohill
         * @return the cdnEnabled
78 f8be9cce Phillip Toohill
         */
79 f8be9cce Phillip Toohill
        public boolean isCdnEnabled() {
80 f8be9cce Phillip Toohill
                return cdnEnabled;
81 f8be9cce Phillip Toohill
        }
82 f8be9cce Phillip Toohill
83 f8be9cce Phillip Toohill
        /**
84 4daf0073 Phillip Toohill
         * @param cdnEnabled
85 4daf0073 Phillip Toohill
         *            the cdnEnabled to set
86 f8be9cce Phillip Toohill
         */
87 f8be9cce Phillip Toohill
        public void setCdnEnabled(boolean cdnEnabled) {
88 f8be9cce Phillip Toohill
                this.cdnEnabled = cdnEnabled;
89 f8be9cce Phillip Toohill
        }
90 f8be9cce Phillip Toohill
91 f8be9cce Phillip Toohill
        /**
92 f8be9cce Phillip Toohill
         * @return the ttl
93 f8be9cce Phillip Toohill
         */
94 f8be9cce Phillip Toohill
        public int getTtl() {
95 f8be9cce Phillip Toohill
                return Ttl;
96 f8be9cce Phillip Toohill
        }
97 f8be9cce Phillip Toohill
98 f8be9cce Phillip Toohill
        /**
99 4daf0073 Phillip Toohill
         * @param ttl
100 4daf0073 Phillip Toohill
         *            the ttl to set
101 f8be9cce Phillip Toohill
         */
102 f8be9cce Phillip Toohill
        public void setTtl(int ttl) {
103 f8be9cce Phillip Toohill
                Ttl = ttl;
104 f8be9cce Phillip Toohill
        }
105 f8be9cce Phillip Toohill
106 f8be9cce Phillip Toohill
        /**
107 f8be9cce Phillip Toohill
         * @return the cdnUrl
108 f8be9cce Phillip Toohill
         */
109 f8be9cce Phillip Toohill
        public String getCdnUrl() {
110 f8be9cce Phillip Toohill
                return cdnUrl;
111 f8be9cce Phillip Toohill
        }
112 f8be9cce Phillip Toohill
113 f8be9cce Phillip Toohill
        /**
114 4daf0073 Phillip Toohill
         * @param cdnUrl
115 4daf0073 Phillip Toohill
         *            the cdnUrl to set
116 f8be9cce Phillip Toohill
         */
117 f8be9cce Phillip Toohill
        public void setCdnUrl(String cdnUrl) {
118 f8be9cce Phillip Toohill
                this.cdnUrl = cdnUrl;
119 f8be9cce Phillip Toohill
        }
120 f8be9cce Phillip Toohill
121 f8be9cce Phillip Toohill
        /**
122 f8be9cce Phillip Toohill
         * @return the logRetention
123 f8be9cce Phillip Toohill
         */
124 f8be9cce Phillip Toohill
        public boolean isLogRetention() {
125 f8be9cce Phillip Toohill
                return logRetention;
126 f8be9cce Phillip Toohill
        }
127 f8be9cce Phillip Toohill
128 f8be9cce Phillip Toohill
        /**
129 4daf0073 Phillip Toohill
         * @param logRetention
130 4daf0073 Phillip Toohill
         *            the logRetention to set
131 f8be9cce Phillip Toohill
         */
132 f8be9cce Phillip Toohill
        public void setLogRetention(boolean logRetention) {
133 f8be9cce Phillip Toohill
                this.logRetention = logRetention;
134 f8be9cce Phillip Toohill
        }
135 f8be9cce Phillip Toohill
136 4daf0073 Phillip Toohill
}