@@ -50,7 +50,7 @@ public class StoragePoolVO implements StoragePool, Identity {
5050
5151 @ Column (name ="pool_type" , updatable =false , nullable =false , length =32 )
5252 @ Enumerated (value =EnumType .STRING )
53- private StoragePoolType poolType ;
53+ private StoragePoolType protocol ;
5454
5555 @ Column (name =GenericDao .CREATED_COLUMN )
5656 Date created ;
@@ -78,6 +78,12 @@ public class StoragePoolVO implements StoragePool, Identity {
7878 @ Enumerated (value =EnumType .STRING )
7979 private StoragePoolStatus status ;
8080
81+ @ Column (name ="storage_provider" , updatable =true , nullable =false )
82+ private String storageProvider ;
83+
84+ @ Column (name ="storage_type" , nullable =false )
85+ private String storageType ;
86+
8187 @ Override
8288 public long getId () {
8389 return id ;
@@ -104,7 +110,7 @@ public String getUuid() {
104110
105111 @ Override
106112 public StoragePoolType getPoolType () {
107- return poolType ;
113+ return protocol ;
108114 }
109115
110116 @ Override
@@ -130,6 +136,24 @@ public long getDataCenterId() {
130136 public long getAvailableBytes () {
131137 return availableBytes ;
132138 }
139+
140+ @ Override
141+ public String getStorageProvider () {
142+ return storageProvider ;
143+ }
144+
145+ public void setStorageProvider (String provider ) {
146+ storageProvider = provider ;
147+ }
148+
149+ @ Override
150+ public String getStorageType () {
151+ return storageType ;
152+ }
153+
154+ public void setStorageType (String type ) {
155+ storageType = type ;
156+ }
133157
134158 @ Override
135159 public long getCapacityBytes () {
@@ -189,37 +213,37 @@ public StoragePoolVO(long poolId, String name, String uuid, StoragePoolType type
189213 this .name = name ;
190214 this .id = poolId ;
191215 this .uuid = uuid ;
192- this .poolType = type ;
216+ this .protocol = type ;
193217 this .dataCenterId = dataCenterId ;
194218 this .availableBytes = availableBytes ;
195219 this .capacityBytes = capacityBytes ;
196220 this .hostAddress = hostAddress ;
197221 this .path = hostPath ;
198222 this .port = port ;
199223 this .podId = podId ;
200- this .setStatus (StoragePoolStatus .Up );
224+ this .setStatus (StoragePoolStatus .Creating );
201225 }
202226
203227 public StoragePoolVO (StoragePoolVO that ) {
204- this (that .id , that .name , that .uuid , that .poolType , that .dataCenterId , that .podId , that .availableBytes , that .capacityBytes , that .hostAddress , that .port , that .path );
228+ this (that .id , that .name , that .uuid , that .protocol , that .dataCenterId , that .podId , that .availableBytes , that .capacityBytes , that .hostAddress , that .port , that .path );
205229 }
206230
207231 public StoragePoolVO (StoragePoolType type , String hostAddress , int port , String path ) {
208- this .poolType = type ;
232+ this .protocol = type ;
209233 this .hostAddress = hostAddress ;
210234 this .port = port ;
211235 this .path = path ;
212- this .setStatus (StoragePoolStatus .Up );
236+ this .setStatus (StoragePoolStatus .Creating );
213237 this .uuid = UUID .randomUUID ().toString ();
214238 }
215239
216240 public StoragePoolVO (StoragePoolType type , String hostAddress , int port , String path , String userInfo ) {
217- this .poolType = type ;
241+ this .protocol = type ;
218242 this .hostAddress = hostAddress ;
219243 this .port = port ;
220244 this .path = path ;
221245 this .userInfo = userInfo ;
222- this .setStatus (StoragePoolStatus .Up );
246+ this .setStatus (StoragePoolStatus .Creating );
223247 this .uuid = UUID .randomUUID ().toString ();
224248 }
225249
@@ -259,12 +283,12 @@ public int getPort() {
259283
260284 @ Override
261285 public boolean isShared () {
262- return poolType .isShared ();
286+ return protocol .isShared ();
263287 }
264288
265289 @ Override
266290 public boolean isLocal () {
267- return !poolType .isShared ();
291+ return !protocol .isShared ();
268292 }
269293
270294 @ Transient
@@ -315,6 +339,6 @@ public int hashCode() {
315339
316340 @ Override
317341 public String toString () {
318- return new StringBuilder ("Pool[" ).append (id ).append ("|" ).append (poolType ).append ("]" ).toString ();
342+ return new StringBuilder ("Pool[" ).append (id ).append ("|" ).append (protocol ).append ("]" ).toString ();
319343 }
320344}
0 commit comments