@@ -44,66 +44,66 @@ public class VMTemplateHostVO implements VMTemplateStorageResourceAssoc, DataObj
4444 @ Id
4545 @ GeneratedValue (strategy =GenerationType .IDENTITY )
4646 Long id ;
47-
47+
4848 @ Column (name ="host_id" )
4949 private long hostId ;
50-
50+
5151 @ Column (name ="template_id" )
5252 private long templateId ;
53-
53+
5454 @ Column (name =GenericDaoBase .CREATED_COLUMN )
5555 private Date created = null ;
56-
56+
5757 @ Column (name ="last_updated" )
5858 @ Temporal (value =TemporalType .TIMESTAMP )
5959 private Date lastUpdated = null ;
60-
60+
6161 @ Column (name ="download_pct" )
6262 private int downloadPercent ;
63-
63+
6464 @ Column (name ="size" )
6565 private long size ;
66-
66+
6767 @ Column (name ="physical_size" )
6868 private long physicalSize ;
69-
69+
7070 @ Column (name ="download_state" )
7171 @ Enumerated (EnumType .STRING )
7272 private Status downloadState ;
73-
73+
7474 @ Column (name ="local_path" )
7575 private String localDownloadPath ;
76-
76+
7777 @ Column (name ="error_str" )
7878 private String errorString ;
79-
79+
8080 @ Column (name ="job_id" )
81- private String jobId ;
82-
81+ private String jobId ;
82+
8383 @ Column (name ="install_path" )
8484 private String installPath ;
85-
85+
8686 @ Column (name ="url" )
8787 private String downloadUrl ;
8888
8989 @ Column (name ="is_copy" )
9090 private boolean isCopy = false ;
91-
91+
9292 @ Column (name ="destroyed" )
9393 boolean destroyed = false ;
94-
94+
9595 @ Column (name ="update_count" , updatable = true , nullable =false )
9696 protected long updatedCount ;
97-
97+
9898 @ Column (name = "updated" )
9999 @ Temporal (value = TemporalType .TIMESTAMP )
100100 Date updated ;
101-
101+
102102 @ Column (name = "state" )
103103 @ Enumerated (EnumType .STRING )
104104 ObjectInDataStoreStateMachine .State state ;
105-
106-
105+
106+
107107 @ Override
108108 public String getInstallPath () {
109109 return installPath ;
@@ -156,12 +156,12 @@ public Date getCreated() {
156156 public Date getLastUpdated () {
157157 return lastUpdated ;
158158 }
159-
159+
160160 @ Override
161161 public void setLastUpdated (Date date ) {
162162 lastUpdated = date ;
163163 }
164-
164+
165165 @ Override
166166 public void setInstallPath (String installPath ) {
167167 this .installPath = installPath ;
@@ -197,7 +197,7 @@ public VMTemplateHostVO(long hostId, long templateId, Date lastUpdated,
197197 }
198198
199199 protected VMTemplateHostVO () {
200-
200+
201201 }
202202
203203 @ Override
@@ -234,7 +234,7 @@ public String getJobId() {
234234 public boolean equals (Object obj ) {
235235 if (obj instanceof VMTemplateHostVO ) {
236236 VMTemplateHostVO other = (VMTemplateHostVO )obj ;
237- return (this .templateId ==other .getTemplateId () && this .hostId ==other .getHostId ());
237+ return (this .templateId ==other .getTemplateId () && this .hostId ==other .getHostId ());
238238 }
239239 return false ;
240240 }
@@ -253,8 +253,8 @@ public void setSize(long size) {
253253 public long getSize () {
254254 return size ;
255255 }
256-
257-
256+
257+
258258 public void setPhysicalSize (long physicalSize ) {
259259 this .physicalSize = physicalSize ;
260260 }
@@ -286,12 +286,12 @@ public void setCopy(boolean isCopy) {
286286 public boolean isCopy () {
287287 return isCopy ;
288288 }
289-
289+
290290 @ Override
291291 public long getTemplateSize () {
292292 return -1 ;
293293 }
294-
294+
295295 @ Override
296296 public String toString () {
297297 return new StringBuilder ("TmplHost[" ).append (id ).append ("-" ).append (templateId ).append ("-" ).append (hostId ).append (installPath ).append ("]" ).toString ();
@@ -302,21 +302,32 @@ public ObjectInDataStoreStateMachine.State getState() {
302302 // TODO Auto-generated method stub
303303 return this .state ;
304304 }
305-
305+
306306 public long getUpdatedCount () {
307307 return this .updatedCount ;
308308 }
309-
309+
310310 public void incrUpdatedCount () {
311311 this .updatedCount ++;
312312 }
313313
314314 public void decrUpdatedCount () {
315315 this .updatedCount --;
316316 }
317-
317+
318318 public Date getUpdated () {
319319 return updated ;
320320 }
321321
322+ @ Override
323+ public long getObjectId () {
324+ return this .getTemplateId ();
325+ }
326+
327+ @ Override
328+ public long getDataStoreId () {
329+ return this .getHostId ();
330+ }
331+
332+
322333}
0 commit comments