Skip to content

Commit adac413

Browse files
committed
Removing getProperty method from OCCIAplication and ManagerController
classes
1 parent 88b9127 commit adac413

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

src/main/java/org/fogbowcloud/manager/core/ManagerController.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,10 +1644,6 @@ protected FailedBatch getFailedBatches() {
16441644
return failedBatch;
16451645
}
16461646

1647-
public String getProperty(String property) {
1648-
return properties.getProperty(property);
1649-
}
1650-
16511647
protected class FailedBatch {
16521648
private Map<String, FailedBatchType> failedBatches = new HashMap<String, FailedBatchType>();
16531649

src/main/java/org/fogbowcloud/manager/occi/OCCIApplication.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,6 @@ public ResourcesInfo getLocalUserQuota(String localAccessToken) {
196196
return managerFacade.getLocalUserQuota(localAccessToken);
197197
}
198198

199-
public String getProperty(String property) {
200-
return managerFacade.getProperty(property);
201-
}
202-
203199
public String getUser(String authToken) {
204200
return managerFacade.getUser(authToken);
205201
}

src/main/java/org/fogbowcloud/manager/occi/instance/ComputeServerResource.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ public class ComputeServerResource extends ServerResource {
6262

6363
protected void doInit() throws ResourceException {
6464

65-
String instanceDSUrl = ((OCCIApplication) getApplication())
65+
Properties properties = ((OCCIApplication) getApplication()).getProperties();
66+
String instanceDSUrl = properties
6667
.getProperty(ConfigurationConstants.INSTANCE_DATA_STORE_URL);
6768
instanceDB = new InstanceDataStore(instanceDSUrl);
6869

@@ -325,7 +326,7 @@ public StringRepresentation post() {
325326
throw new OCCIException(ErrorType.BAD_REQUEST, ResponseConstants.IRREGULAR_SYNTAX);
326327
}
327328

328-
String imageName = application.getProperty(
329+
String imageName = properties.getProperty(
329330
ConfigurationConstants.OCCI_EXTRA_RESOURCES_PREFIX + osTplResources.get(0).getCategory().getTerm());
330331
if (imageName == null || imageName.isEmpty()) {
331332
throw new OCCIException(ErrorType.BAD_REQUEST,
@@ -338,7 +339,7 @@ public StringRepresentation post() {
338339
// resource tpl
339340
List<Resource> resourceTplResources = filterByRelProperty(RequestConstants.RESOURCE_TPL_OCCI_SCHEME,
340341
resources);
341-
String fogbowRequirements = getRequirements(application, resourceTplResources);
342+
String fogbowRequirements = getRequirements(properties, resourceTplResources);
342343
requestXOCCIAtt.put(RequestAttribute.REQUIREMENTS.getValue(), fogbowRequirements);
343344
requestXOCCIAtt.put(RequestAttribute.INSTANCE_COUNT.getValue(), DEFAULT_INSTANCE_COUNT);
344345

@@ -375,10 +376,10 @@ public StringRepresentation post() {
375376
return new StringRepresentation(ResponseConstants.OK);
376377
}
377378

378-
private String getRequirements(OCCIApplication application, List<Resource> resourceTplResources) {
379+
private String getRequirements(Properties properties, List<Resource> resourceTplResources) {
379380
StringBuilder requirements = new StringBuilder();
380381
for (int i = 0; i < resourceTplResources.size(); i++) {
381-
String currentRequirement = application.getProperty(ConfigurationConstants.OCCI_EXTRA_RESOURCES_PREFIX
382+
String currentRequirement = properties.getProperty(ConfigurationConstants.OCCI_EXTRA_RESOURCES_PREFIX
382383
+ resourceTplResources.get(i).getCategory().getTerm());
383384

384385
if (currentRequirement == null || currentRequirement.isEmpty()) {

0 commit comments

Comments
 (0)