当前位置: 首页>>代码示例>>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;未经允许,请勿转载。