String status = (String) resource.getPropertyValue(INSTANCE_STATUS_PROPERTY_ID);
String feedName = (String) resource.getPropertyValue(INSTANCE_FEED_NAME_PROPERTY_ID);
String id = (String) resource.getPropertyValue(INSTANCE_ID_PROPERTY_ID);
if (desiredStatus.equals("SUSPENDED")) {
service.suspendInstance(feedName, id);
} else if (status.equals("SUSPENDED") && desiredStatus.equals("RUNNING")) {
service.resumeInstance(feedName, id);
}
}
}