use of org.apache.cloudstack.storage.resource.SecondaryStorageResourceHandler in project cloudstack by apache.
the class PremiumSecondaryStorageResource method executeRequest.
@Override
public Answer executeRequest(Command cmd) {
String hypervisor = cmd.getContextParam("hypervisor");
if (hypervisor != null) {
Hypervisor.HypervisorType hypervisorType = Hypervisor.HypervisorType.getType(hypervisor);
if (hypervisorType == null) {
s_logger.error("Unsupported hypervisor type in command context, hypervisor: " + hypervisor);
return defaultAction(cmd);
}
SecondaryStorageResourceHandler handler = getHandler(hypervisorType);
if (handler == null) {
s_logger.error("No handler can be found for hypervisor type in command context, hypervisor: " + hypervisor);
return defaultAction(cmd);
}
return handler.executeRequest(cmd);
}
return defaultAction(cmd);
}
Aggregations