當前位置: 首頁>>代碼示例>>Java>>正文


Java CloudRuntimeException.getMessage方法代碼示例

本文整理匯總了Java中com.cloud.utils.exception.CloudRuntimeException.getMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java CloudRuntimeException.getMessage方法的具體用法?Java CloudRuntimeException.getMessage怎麽用?Java CloudRuntimeException.getMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.cloud.utils.exception.CloudRuntimeException的用法示例。


在下文中一共展示了CloudRuntimeException.getMessage方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import com.cloud.utils.exception.CloudRuntimeException; //導入方法依賴的package包/類
@Override
public void execute() throws ResourceUnavailableException, ConcurrentOperationException {
    CallContext.current().setEventDetails("Vm Id: " + getId());
    try {
        final UserVm result = _userVmService.expungeVm(this.getId());

        if (result != null) {
            final SuccessResponse response = new SuccessResponse(getCommandName());
            setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to expunge vm");
        }
    } catch (final InvalidParameterValueException ipve) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR, ipve.getMessage());
    } catch (final CloudRuntimeException cre) {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, cre.getMessage());
    }
}
 
開發者ID:MissionCriticalCloud,項目名稱:cosmic,代碼行數:19,代碼來源:ExpungeVMCmd.java

示例2: execute

import com.cloud.utils.exception.CloudRuntimeException; //導入方法依賴的package包/類
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
        ResourceAllocationException {
    try {
        final List<Host> devices = nwDeviceMgr.listNetworkDevice(this);
        final List<NetworkDeviceResponse> nwdeviceResponses = new ArrayList<>();
        final ListResponse<NetworkDeviceResponse> listResponse = new ListResponse<>();
        for (final Host d : devices) {
            final NetworkDeviceResponse response = nwDeviceMgr.getApiResponse(d);
            response.setObjectName("networkdevice");
            response.setResponseName(getCommandName());
            nwdeviceResponses.add(response);
        }

        listResponse.setResponses(nwdeviceResponses);
        listResponse.setResponseName(getCommandName());
        this.setResponseObject(listResponse);
    } catch (final InvalidParameterValueException ipve) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR, ipve.getMessage());
    } catch (final CloudRuntimeException cre) {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, cre.getMessage());
    }
}
 
開發者ID:MissionCriticalCloud,項目名稱:cosmic,代碼行數:24,代碼來源:ListNetworkDeviceCmd.java

示例3: execute

import com.cloud.utils.exception.CloudRuntimeException; //導入方法依賴的package包/類
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
        ResourceAllocationException {
    try {
        final boolean result = nwDeviceMgr.deleteNetworkDevice(this);
        if (result) {
            final SuccessResponse response = new SuccessResponse(getCommandName());
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete network device:" + getId());
        }
    } catch (final InvalidParameterValueException ipve) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR, ipve.getMessage());
    } catch (final CloudRuntimeException cre) {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, cre.getMessage());
    }
}
 
開發者ID:MissionCriticalCloud,項目名稱:cosmic,代碼行數:19,代碼來源:DeleteNetworkDeviceCmd.java

示例4: execute

import com.cloud.utils.exception.CloudRuntimeException; //導入方法依賴的package包/類
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
        ResourceAllocationException {
    try {
        final NiciraNvpDeviceVO niciraNvpDeviceVO = niciraNvpElementService.addNiciraNvpDevice(this);
        if (niciraNvpDeviceVO != null) {
            final NiciraNvpDeviceResponse response = niciraNvpElementService.createNiciraNvpDeviceResponse(niciraNvpDeviceVO);
            response.setObjectName("niciranvpdevice");
            response.setResponseName(getCommandName());
            setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add Nicira NVP device due to internal error.");
        }
    } catch (final InvalidParameterValueException invalidParamExcp) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage());
    } catch (final CloudRuntimeException runtimeExcp) {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage());
    }
}
 
開發者ID:MissionCriticalCloud,項目名稱:cosmic,代碼行數:20,代碼來源:AddNiciraNvpDeviceCmd.java

示例5: execute

import com.cloud.utils.exception.CloudRuntimeException; //導入方法依賴的package包/類
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ResourceAllocationException {
    try {
        final List<NiciraNvpDeviceVO> niciraDevices = niciraNvpElementService.listNiciraNvpDevices(this);
        final ListResponse<NiciraNvpDeviceResponse> response = new ListResponse<>();
        final List<NiciraNvpDeviceResponse> niciraDevicesResponse = new ArrayList<>();

        if (niciraDevices != null && !niciraDevices.isEmpty()) {
            for (final NiciraNvpDeviceVO niciraDeviceVO : niciraDevices) {
                final NiciraNvpDeviceResponse niciraDeviceResponse = niciraNvpElementService.createNiciraNvpDeviceResponse(niciraDeviceVO);
                niciraDevicesResponse.add(niciraDeviceResponse);
            }
        }

        response.setResponses(niciraDevicesResponse);
        response.setResponseName(getCommandName());
        setResponseObject(response);
    } catch (final InvalidParameterValueException invalidParamExcp) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage());
    } catch (final CloudRuntimeException runtimeExcp) {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage());
    }
}
 
開發者ID:MissionCriticalCloud,項目名稱:cosmic,代碼行數:24,代碼來源:ListNiciraNvpDevicesCmd.java

示例6: execute

import com.cloud.utils.exception.CloudRuntimeException; //導入方法依賴的package包/類
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
        ResourceAllocationException {
    try {
        final List<? extends Network> networks = niciraNvpElementService.listNiciraNvpDeviceNetworks(this);
        final ListResponse<NetworkResponse> response = new ListResponse<>();
        final List<NetworkResponse> networkResponses = new ArrayList<>();

        if (networks != null && !networks.isEmpty()) {
            for (final Network network : networks) {
                final NetworkResponse networkResponse = _responseGenerator.createNetworkResponse(ResponseView.Full, network);
                networkResponses.add(networkResponse);
            }
        }

        response.setResponses(networkResponses);
        response.setResponseName(getCommandName());
        setResponseObject(response);
    } catch (final InvalidParameterValueException invalidParamExcp) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage());
    } catch (final CloudRuntimeException runtimeExcp) {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage());
    }
}
 
開發者ID:MissionCriticalCloud,項目名稱:cosmic,代碼行數:25,代碼來源:ListNiciraNvpDeviceNetworksCmd.java

示例7: execute

import com.cloud.utils.exception.CloudRuntimeException; //導入方法依賴的package包/類
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
        ResourceAllocationException {
    try {
        final boolean result = niciraNvpElementService.deleteNiciraNvpDevice(this);
        if (result) {
            final SuccessResponse response = new SuccessResponse(getCommandName());
            response.setResponseName(getCommandName());
            setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete Nicira device.");
        }
    } catch (final InvalidParameterValueException invalidParamExcp) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR, invalidParamExcp.getMessage());
    } catch (final CloudRuntimeException runtimeExcp) {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeExcp.getMessage());
    }
}
 
開發者ID:MissionCriticalCloud,項目名稱:cosmic,代碼行數:19,代碼來源:DeleteNiciraNvpDeviceCmd.java

示例8: execute

import com.cloud.utils.exception.CloudRuntimeException; //導入方法依賴的package包/類
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
        ResourceAllocationException {
    try {
        final Host device = nwDeviceMgr.addNetworkDevice(this);
        final NetworkDeviceResponse response = nwDeviceMgr.getApiResponse(device);
        response.setObjectName("networkdevice");
        response.setResponseName(getCommandName());
        this.setResponseObject(response);
    } catch (final InvalidParameterValueException ipve) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR, ipve.getMessage());
    } catch (final CloudRuntimeException cre) {
        throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, cre.getMessage());
    }
}
 
開發者ID:MissionCriticalCloud,項目名稱:cosmic,代碼行數:16,代碼來源:AddNetworkDeviceCmd.java


注:本文中的com.cloud.utils.exception.CloudRuntimeException.getMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。