3636@ Entity
3737@ Table (name ="snapshots" )
3838public class SnapshotVO implements Snapshot , Identity {
39-
39+
4040 @ Id
4141 @ GeneratedValue (strategy =GenerationType .IDENTITY )
4242 @ Column (name ="id" )
43- private long id = -1 ;
44-
43+ private final long id = -1 ;
44+
4545 @ Column (name ="data_center_id" )
4646 long dataCenterId ;
4747
4848 @ Column (name ="account_id" )
4949 long accountId ;
50-
50+
5151 @ Column (name ="domain_id" )
5252 long domainId ;
5353
5454 @ Column (name ="volume_id" )
5555 Long volumeId ;
56-
56+
5757 @ Column (name ="disk_offering_id" )
5858 Long diskOfferingId ;
5959
@@ -64,7 +64,7 @@ public class SnapshotVO implements Snapshot, Identity {
6464 @ Expose
6565 @ Column (name ="name" )
6666 String name ;
67-
67+
6868 @ Expose
6969 @ Column (name ="status" , updatable = true , nullable =false )
7070 @ Enumerated (value =EnumType .STRING )
@@ -75,10 +75,10 @@ public class SnapshotVO implements Snapshot, Identity {
7575
7676 @ Column (name ="type_description" )
7777 String typeDescription ;
78-
78+
7979 @ Column (name ="size" )
8080 long size ;
81-
81+
8282 @ Column (name =GenericDao .CREATED_COLUMN )
8383 Date created ;
8484
@@ -87,10 +87,10 @@ public class SnapshotVO implements Snapshot, Identity {
8787
8888 @ Column (name ="backup_snap_id" )
8989 String backupSnapshotId ;
90-
90+
9191 @ Column (name ="swift_id" )
9292 Long swiftId ;
93-
93+
9494 @ Column (name ="sechost_id" )
9595 Long secHostId ;
9696
@@ -100,16 +100,16 @@ public class SnapshotVO implements Snapshot, Identity {
100100 @ Column (name ="hypervisor_type" )
101101 @ Enumerated (value =EnumType .STRING )
102102 HypervisorType hypervisorType ;
103-
103+
104104 @ Expose
105105 @ Column (name ="version" )
106106 String version ;
107-
107+
108108 @ Column (name ="uuid" )
109109 String uuid ;
110-
110+
111111 public SnapshotVO () {
112- this .uuid = UUID .randomUUID ().toString ();
112+ this .uuid = UUID .randomUUID ().toString ();
113113 }
114114
115115 public SnapshotVO (long dcId , long accountId , long domainId , Long volumeId , Long diskOfferingId , String path , String name , short snapshotType , String typeDescription , long size , HypervisorType hypervisorType ) {
@@ -127,11 +127,11 @@ public SnapshotVO(long dcId, long accountId, long domainId, Long volumeId, Long
127127 this .prevSnapshotId = 0 ;
128128 this .hypervisorType = hypervisorType ;
129129 this .version = "2.2" ;
130- this .uuid = UUID .randomUUID ().toString ();
130+ this .uuid = UUID .randomUUID ().toString ();
131131 }
132-
132+
133133 @ Override
134- public Long getId () {
134+ public long getId () {
135135 return id ;
136136 }
137137
@@ -144,6 +144,7 @@ public long getAccountId() {
144144 return accountId ;
145145 }
146146
147+ @ Override
147148 public long getDomainId () {
148149 return domainId ;
149150 }
@@ -165,9 +166,9 @@ public void setVolumeId(Long volumeId) {
165166 public String getPath () {
166167 return path ;
167168 }
168-
169+
169170 public void setPath (String path ) {
170- this .path = path ;
171+ this .path = path ;
171172 }
172173
173174 @ Override
@@ -178,15 +179,15 @@ public String getName() {
178179 public short getsnapshotType () {
179180 return snapshotType ;
180181 }
181-
182+
182183 @ Override
183184 public Type getType () {
184185 if (snapshotType < 0 || snapshotType >= Type .values ().length ) {
185186 return null ;
186187 }
187188 return Type .values ()[snapshotType ];
188189 }
189-
190+
190191 public Long getSwiftId () {
191192 return swiftId ;
192193 }
@@ -205,13 +206,13 @@ public void setSecHostId(Long secHostId) {
205206
206207 @ Override
207208 public HypervisorType getHypervisorType () {
208- return hypervisorType ;
209+ return hypervisorType ;
209210 }
210-
211+
211212 public void setSnapshotType (short snapshotType ) {
212213 this .snapshotType = snapshotType ;
213214 }
214-
215+
215216 @ Override
216217 public boolean isRecursive (){
217218 if ( snapshotType >= Type .HOURLY .ordinal () && snapshotType <= Type .MONTHLY .ordinal () ) {
@@ -239,39 +240,40 @@ public void setVersion(String version) {
239240 this .version = version ;
240241 }
241242
243+ @ Override
242244 public Date getCreated () {
243245 return created ;
244246 }
245247
246248 public Date getRemoved () {
247249 return removed ;
248250 }
249-
250- @ Override
251+
252+ @ Override
251253 public Status getStatus () {
252- return status ;
253- }
254-
255- public void setStatus (Status status ) {
256- this .status = status ;
257- }
258-
259- public String getBackupSnapshotId (){
260- return backupSnapshotId ;
261- }
262-
254+ return status ;
255+ }
256+
257+ public void setStatus (Status status ) {
258+ this .status = status ;
259+ }
260+
261+ public String getBackupSnapshotId (){
262+ return backupSnapshotId ;
263+ }
264+
263265 public long getPrevSnapshotId (){
264- return prevSnapshotId ;
265- }
266-
267- public void setBackupSnapshotId (String backUpSnapshotId ){
268- this .backupSnapshotId = backUpSnapshotId ;
269- }
270-
271- public void setPrevSnapshotId (long prevSnapshotId ){
272- this .prevSnapshotId = prevSnapshotId ;
273- }
274-
266+ return prevSnapshotId ;
267+ }
268+
269+ public void setBackupSnapshotId (String backUpSnapshotId ){
270+ this .backupSnapshotId = backUpSnapshotId ;
271+ }
272+
273+ public void setPrevSnapshotId (long prevSnapshotId ){
274+ this .prevSnapshotId = prevSnapshotId ;
275+ }
276+
275277 public static Type getSnapshotType (String snapshotType ) {
276278 for ( Type type : Type .values ()) {
277279 if ( type .equals (snapshotType )) {
@@ -280,13 +282,13 @@ public static Type getSnapshotType(String snapshotType) {
280282 }
281283 return null ;
282284 }
283-
285+
284286 @ Override
285287 public String getUuid () {
286- return this .uuid ;
288+ return this .uuid ;
287289 }
288-
290+
289291 public void setUuid (String uuid ) {
290- this .uuid = uuid ;
292+ this .uuid = uuid ;
291293 }
292294}
0 commit comments