4242
4343@ Entity
4444@ Table (name = "vm_template" )
45- public class VMTemplateVO implements VirtualMachineTemplate , StateObject < TemplateState > {
45+ public class VMTemplateVO implements VirtualMachineTemplate {
4646 @ Id
4747 @ TableGenerator (name = "vm_template_sq" , table = "sequence" , pkColumnName = "name" , valueColumnName = "value" ,
4848 pkColumnValue = "vm_template_seq" , allocationSize = 1 )
@@ -133,9 +133,6 @@ public class VMTemplateVO implements VirtualMachineTemplate, StateObject<Templat
133133 @ Column (name = "size" )
134134 private Long size ;
135135
136- @ Column (name = "state" )
137- private TemplateState state ;
138-
139136 @ Column (name = "update_count" , updatable = true )
140137 protected long updatedCount ;
141138
@@ -157,7 +154,6 @@ public void setUniqueName(String uniqueName) {
157154
158155 public VMTemplateVO () {
159156 this .uuid = UUID .randomUUID ().toString ();
160- this .state = TemplateState .Allocated ;
161157 }
162158
163159 /**
@@ -171,7 +167,6 @@ public VMTemplateVO(long id, String name, ImageFormat format, boolean isPublic,
171167 null , requiresHvm , bits , accountId , cksum , displayText , enablePassword , guestOSId , bootable , hyperType ,
172168 details );
173169 this .uuid = UUID .randomUUID ().toString ();
174- this .state = TemplateState .Allocated ;
175170 }
176171
177172 public VMTemplateVO (long id , String name , ImageFormat format , boolean isPublic , boolean featured ,
@@ -182,7 +177,6 @@ public VMTemplateVO(long id, String name, ImageFormat format, boolean isPublic,
182177 displayText , enablePassword , guestOSId , bootable , hyperType , details );
183178 this .templateTag = templateTag ;
184179 this .uuid = UUID .randomUUID ().toString ();
185- this .state = TemplateState .Allocated ;
186180 this .enableSshKey = sshKeyEnabled ;
187181 }
188182
@@ -192,7 +186,6 @@ public static VMTemplateVO createPreHostIso(Long id, String uniqueName, String n
192186 boolean bootable , HypervisorType hyperType ) {
193187 VMTemplateVO template = new VMTemplateVO (id , uniqueName , name , format , isPublic , featured , type , url , created ,
194188 requiresHvm , bits , accountId , cksum , displayText , enablePassword , guestOSId , bootable , hyperType );
195- template .state = TemplateState .Ready ;
196189 return template ;
197190 }
198191
@@ -219,7 +212,6 @@ public VMTemplateVO(Long id, String uniqueName, String name, ImageFormat format,
219212 this .bootable = bootable ;
220213 this .hypervisorType = hyperType ;
221214 this .uuid = UUID .randomUUID ().toString ();
222- this .state = TemplateState .Allocated ;
223215 }
224216
225217 // Has an extra attribute - isExtractable
@@ -532,10 +524,6 @@ public Long getSize() {
532524 return this .size ;
533525 }
534526
535- public TemplateState getState () {
536- return this .state ;
537- }
538-
539527 public long getUpdatedCount () {
540528 return this .updatedCount ;
541529 }
0 commit comments