state = AppState.valueOf((String) attributes.get("state")); if (attributes.containsKey("memory")) { memory = (Integer) attributes.get("memory");
state = AppState.valueOf((String) attributes.get("state")); if (attributes.containsKey("memory")) { memory = (Integer) attributes.get("memory");
@SuppressWarnings("unchecked") private CloudApplication mapCloudApplication(Map<String, Object> resource) { UUID appId = resourceMapper.getGuidOfResource(resource); CloudApplication cloudApp = null; if (resource != null) { int running = getRunningInstances(appId, CloudApplication.AppState.valueOf( CloudEntityResourceMapper.getEntityAttribute(resource, "state", String.class))); ((Map<String, Object>)resource.get("entity")).put("running_instances", running); cloudApp = resourceMapper.mapResource(resource, CloudApplication.class); cloudApp.setUris(findApplicationUris(cloudApp.getMeta().getGuid())); } return cloudApp; }
app.setInstances(getAttributeOfV2Resource(resource, "instances", Integer.class)); app.setServices(new ArrayList<String>()); app.setState(CloudApplication.AppState.valueOf(getAttributeOfV2Resource(resource, "state", String.class)));
app.setInstances(getEntityAttribute(resource, "instances", Integer.class)); app.setServices(new ArrayList<String>()); app.setState(CloudApplication.AppState.valueOf(getEntityAttribute(resource, "state", String.class)));
@SuppressWarnings("unchecked") private CloudApplication mapCloudApplication(Map<String, Object> resource) { UUID appId = resourceMapper.getGuidOfV2Resource(resource); CloudApplication cloudApp = null; if (resource != null) { int running = getRunningInstances(appId, CloudApplication.AppState.valueOf(CloudEntityResourceMapper.getAttributeOfV2Resource(resource, "state", String.class))); ((Map<String, Object>) resource.get("entity")).put("running_instances", running); cloudApp = resourceMapper.mapResource(resource, CloudApplication.class); cloudApp.setUris(findApplicationUris(cloudApp.getMeta() .getGuid())); } return cloudApp; }