root / src / com / rackspace / cloud / files / api / client / Container.java @ a2b9aced
History | View | Annotate | Download (3.5 kB)
1 |
package com.rackspace.cloud.files.api.client; |
---|---|
2 |
|
3 |
import java.util.Map; |
4 |
|
5 |
import com.rackspace.cloud.servers.api.client.Entity; |
6 |
|
7 |
/**
|
8 |
* @author Phillip Toohill dead2hill@gmail.com
|
9 |
*
|
10 |
*/
|
11 |
public class Container extends Entity { |
12 |
|
13 |
private static final long serialVersionUID = 5994739895998309675L; |
14 |
public static final String MYSHARED="MyShared"; |
15 |
public static final String OTHERS="Others"; |
16 |
public static final String TRASH="trash"; |
17 |
public static final String PITHOS="pithos"; |
18 |
// Regular attributes
|
19 |
private String name; |
20 |
private int count; |
21 |
private long bytes; |
22 |
private String otherUser=null; |
23 |
// CDN attributes
|
24 |
private boolean cdnEnabled; |
25 |
private int Ttl; |
26 |
public String cdnUrl; |
27 |
public boolean logRetention; |
28 |
|
29 |
private Map<String, String> xContainerPolicy; |
30 |
|
31 |
public String toXML() { |
32 |
String xml = ""; |
33 |
xml = "<container xmlns=\"http://docs.rackspacecloud.com/servers/api/v1.0\" name=\""
|
34 |
+ getName() + "\"></server>";
|
35 |
return xml;
|
36 |
} |
37 |
|
38 |
|
39 |
|
40 |
public Container() { |
41 |
// TODO Auto-generated constructor stub
|
42 |
} |
43 |
|
44 |
public Container(String otherUser){ |
45 |
this.otherUser = otherUser;
|
46 |
} |
47 |
|
48 |
public void setOtherUser(String otherUser) { |
49 |
this.otherUser = otherUser;
|
50 |
} |
51 |
|
52 |
public String getOtherUser() { |
53 |
return otherUser;
|
54 |
} |
55 |
|
56 |
/**
|
57 |
* @return the name
|
58 |
*/
|
59 |
public String getName() { |
60 |
return name;
|
61 |
} |
62 |
|
63 |
/**
|
64 |
* @param name
|
65 |
* the name to set
|
66 |
*/
|
67 |
public void setName(String name) { |
68 |
this.name = name;
|
69 |
} |
70 |
|
71 |
/**
|
72 |
* @return the count
|
73 |
*/
|
74 |
public int getCount() { |
75 |
return count;
|
76 |
} |
77 |
|
78 |
/**
|
79 |
* @param count
|
80 |
* the count to set
|
81 |
*/
|
82 |
public void setCount(int count) { |
83 |
this.count = count;
|
84 |
} |
85 |
|
86 |
/**
|
87 |
* @return the bytes
|
88 |
*/
|
89 |
public long getBytes() { |
90 |
return bytes;
|
91 |
} |
92 |
|
93 |
/**
|
94 |
* @param l
|
95 |
* the bytes to set
|
96 |
*/
|
97 |
public void setBytes(long l) { |
98 |
this.bytes = l;
|
99 |
} |
100 |
|
101 |
/**
|
102 |
* @return the cdnEnabled
|
103 |
*/
|
104 |
public boolean isCdnEnabled() { |
105 |
return cdnEnabled;
|
106 |
} |
107 |
|
108 |
/**
|
109 |
* @param cdnEnabled
|
110 |
* the cdnEnabled to set
|
111 |
*/
|
112 |
public void setCdnEnabled(boolean cdnEnabled) { |
113 |
this.cdnEnabled = cdnEnabled;
|
114 |
} |
115 |
|
116 |
/**
|
117 |
* @return the ttl
|
118 |
*/
|
119 |
public int getTtl() { |
120 |
return Ttl;
|
121 |
} |
122 |
|
123 |
/**
|
124 |
* @param ttl
|
125 |
* the ttl to set
|
126 |
*/
|
127 |
public void setTtl(int ttl) { |
128 |
Ttl = ttl; |
129 |
} |
130 |
|
131 |
/**
|
132 |
* @return the cdnUrl
|
133 |
*/
|
134 |
public String getCdnUrl() { |
135 |
return cdnUrl;
|
136 |
} |
137 |
|
138 |
/**
|
139 |
* @param cdnUrl
|
140 |
* the cdnUrl to set
|
141 |
*/
|
142 |
public void setCdnUrl(String cdnUrl) { |
143 |
this.cdnUrl = cdnUrl;
|
144 |
} |
145 |
|
146 |
/**
|
147 |
* @return the logRetention
|
148 |
*/
|
149 |
public boolean isLogRetention() { |
150 |
return logRetention;
|
151 |
} |
152 |
|
153 |
/**
|
154 |
* @param logRetention
|
155 |
* the logRetention to set
|
156 |
*/
|
157 |
public void setLogRetention(boolean logRetention) { |
158 |
this.logRetention = logRetention;
|
159 |
} |
160 |
|
161 |
public Map<String, String> getxContainerPolicy() { |
162 |
return xContainerPolicy;
|
163 |
} |
164 |
|
165 |
public void setxContainerPolicy(Map<String, String> xContainerPolicy) { |
166 |
this.xContainerPolicy = xContainerPolicy;
|
167 |
} |
168 |
|
169 |
@Override
|
170 |
public String toString() { |
171 |
return "Container [name=" + name + ", count=" + count + ", bytes=" |
172 |
+ bytes + ", cdnEnabled=" + cdnEnabled + ", Ttl=" + Ttl |
173 |
+ ", cdnUrl=" + cdnUrl + ", logRetention=" + logRetention |
174 |
+ ", xContainerPolicy=" + xContainerPolicy + ", getId()=" |
175 |
+ getId() + ", getModifiedBy()=" + getModifiedBy()
|
176 |
+ ", getVersion()=" + getVersion() + ", getVersionTimestamp()=" |
177 |
+ getVersionTimestamp() + ", getObjectUUID()="
|
178 |
+ getObjectUUID() + ", getObjectHash()=" + getObjectHash()
|
179 |
+ ", getObjectSharing()=" + getObjectSharing()
|
180 |
+ ", getMetadata()=" + getMetadata() + "]"; |
181 |
} |
182 |
|
183 |
} |