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