3535import java .util .Iterator ;
3636import java .util .Map ;
3737
38- @ APICommand (name = "createCacheStore " , description = "create cache store." , responseObject = ImageStoreResponse .class )
39- public class CreateCacheStoreCmd extends BaseCmd {
38+ @ APICommand (name = "createSecondaryStagingStore " , description = "create secondary staging store." , responseObject = ImageStoreResponse .class )
39+ public class CreateSecondaryStagingStoreCmd extends BaseCmd {
4040 public static final Logger s_logger = Logger .getLogger (AddImageStoreCmd .class .getName ());
41- private static final String s_name = "createcachestoreresponse " ;
41+ private static final String s_name = "createsecondarystagingstoreresponse " ;
4242
4343 /////////////////////////////////////////////////////
4444 //////////////// API parameters /////////////////////
4545 /////////////////////////////////////////////////////
4646
47- @ Parameter (name = ApiConstants .URL , type = CommandType .STRING , required = true , description = "the URL for the cache store" )
47+ @ Parameter (name = ApiConstants .URL , type = CommandType .STRING , required = true , description = "the URL for the staging store" )
4848 private String url ;
4949
5050 @ Parameter (name =ApiConstants .ZONE_ID , type =CommandType .UUID , entityType =ZoneResponse .class ,
51- description = "the Zone ID for the image store" )
51+ description = "the Zone ID for the staging store" )
5252 private Long zoneId ;
5353
5454
55- @ Parameter (name = ApiConstants .DETAILS , type = CommandType .MAP , description = "the details for the image store" )
55+ @ Parameter (name = ApiConstants .DETAILS , type = CommandType .MAP , description = "the details for the staging store" )
5656 private Map <String , String > details ;
5757
5858 @ Parameter (name =ApiConstants .SCOPE , type =CommandType .STRING ,
59- required = false , description = "the scope of the image store: zone only for now" )
59+ required = false , description = "the scope of the staging store: zone only for now" )
6060 private String scope ;
6161
6262 @ Parameter (name =ApiConstants .PROVIDER , type =CommandType .STRING ,
63- required = false , description = "the cache store provider name" )
63+ required = false , description = "the staging store provider name" )
6464 private String providerName ;
6565
6666 /////////////////////////////////////////////////////
@@ -75,25 +75,25 @@ public Long getZoneId() {
7575 return zoneId ;
7676 }
7777
78- public Map <String , String > getDetails () {
79- Map <String , String > detailsMap = null ;
80- if (details != null && !details .isEmpty ()) {
81- detailsMap = new HashMap <String , String >();
82- Collection <?> props = details .values ();
83- Iterator <?> iter = props .iterator ();
84- while (iter .hasNext ()) {
85- HashMap <String , String > detail = (HashMap <String , String >) iter .next ();
86- String key = detail .get ("key" );
87- String value = detail .get ("value" );
88- detailsMap .put (key , value );
89- }
90- }
91- return detailsMap ;
78+ public Map <String , String > getDetails () {
79+ Map <String , String > detailsMap = null ;
80+ if (details != null && !details .isEmpty ()) {
81+ detailsMap = new HashMap <String , String >();
82+ Collection <?> props = details .values ();
83+ Iterator <?> iter = props .iterator ();
84+ while (iter .hasNext ()) {
85+ HashMap <String , String > detail = (HashMap <String , String >) iter .next ();
86+ String key = detail .get ("key" );
87+ String value = detail .get ("value" );
88+ detailsMap .put (key , value );
89+ }
90+ }
91+ return detailsMap ;
9292 }
9393
9494 public String getScope () {
9595 return this .scope ;
96- }
96+ }
9797
9898 public String getProviderName () {
9999 return this .providerName ;
@@ -117,13 +117,13 @@ public long getEntityOwnerId() {
117117 @ Override
118118 public void execute (){
119119 try {
120- ImageStore result = _storageService .createCacheStore (this );
120+ ImageStore result = _storageService .createSecondaryStagingStore (this );
121121 ImageStoreResponse storeResponse = null ;
122122 if (result != null ) {
123- storeResponse = _responseGenerator .createImageStoreResponse (result );
124- storeResponse .setResponseName (getCommandName ());
125- storeResponse .setObjectName ("secondarystorage" );
126- this .setResponseObject (storeResponse );
123+ storeResponse = _responseGenerator .createImageStoreResponse (result );
124+ storeResponse .setResponseName (getCommandName ());
125+ storeResponse .setObjectName ("secondarystorage" );
126+ this .setResponseObject (storeResponse );
127127 } else {
128128 throw new ServerApiException (ApiErrorCode .INTERNAL_ERROR , "Failed to add secondary storage" );
129129 }
0 commit comments