use of com.cloud.api.response.NetscalerControlCenterResponse in project cloudstack by apache.
the class RegisterNetscalerControlCenterCmd method execute.
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
try {
NetScalerControlCenterVO nccVO = _netsclarLbService.registerNetscalerControlCenter(this);
if (nccVO != null) {
NetscalerControlCenterResponse response = _netsclarLbService.createNetscalerControlCenterResponse(nccVO);
response.setObjectName("netscalerloadbalancer");
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add netscaler load balancer due to internal error.");
}
} catch (InvalidParameterValueException invalidParamExcp) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage());
} catch (CloudRuntimeException runtimeExcp) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage());
}
}
use of com.cloud.api.response.NetscalerControlCenterResponse in project cloudstack by apache.
the class NetscalerElement method createNetscalerControlCenterResponse.
@Override
public NetscalerControlCenterResponse createNetscalerControlCenterResponse(NetScalerControlCenterVO lncCentersVO) {
NetscalerControlCenterResponse response = new NetscalerControlCenterResponse(lncCentersVO);
response.setObjectName("netscalercontrolcenter");
return response;
}
use of com.cloud.api.response.NetscalerControlCenterResponse in project cloudstack by apache.
the class ListNetscalerControlCenterCmd method execute.
// ///////////////////////////////////////////////////
// ///////////// API Implementation///////////////////
// ///////////////////////////////////////////////////
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException {
try {
List<NetScalerControlCenterVO> lncCenters = _netsclarLbService.listNetscalerControlCenter(this);
if (lncCenters != null) {
ListResponse<NetscalerControlCenterResponse> response = new ListResponse<NetscalerControlCenterResponse>();
List<NetscalerControlCenterResponse> lncCentersResponse = new ArrayList<NetscalerControlCenterResponse>();
if (lncCenters != null && !lncCenters.isEmpty()) {
for (NetScalerControlCenterVO lncCentersVO : lncCenters) {
NetscalerControlCenterResponse lncCentreResponse = _netsclarLbService.createNetscalerControlCenterResponse(lncCentersVO);
lncCentersResponse.add(lncCentreResponse);
}
}
response.setResponses(lncCentersResponse);
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to list Net scalar Control Center due to some internal error.");
}
} catch (InvalidParameterValueException invalidParamExcp) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage());
} catch (CloudRuntimeException runtimeExcp) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage());
}
}
Aggregations