Search in sources :

Example 6 with RemoteAccessVpnResponse

use of com.cloud.api.response.RemoteAccessVpnResponse in project cosmic by MissionCriticalCloud.

the class CreateRemoteAccessVpnCmd method execute.

@Override
public void execute() {
    try {
        final RemoteAccessVpn result = _ravService.startRemoteAccessVpn(publicIpId, getOpenFirewall());
        if (result != null) {
            final RemoteAccessVpnResponse response = _responseGenerator.createRemoteAccessVpnResponse(result);
            response.setResponseName(getCommandName());
            setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create remote access vpn");
        }
    } catch (final ResourceUnavailableException ex) {
        s_logger.warn("Exception: ", ex);
        throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
    }
}
Also used : ServerApiException(com.cloud.api.ServerApiException) ResourceUnavailableException(com.cloud.exception.ResourceUnavailableException) RemoteAccessVpnResponse(com.cloud.api.response.RemoteAccessVpnResponse) RemoteAccessVpn(com.cloud.network.RemoteAccessVpn)

Aggregations

RemoteAccessVpnResponse (com.cloud.api.response.RemoteAccessVpnResponse)6 RemoteAccessVpn (com.cloud.network.RemoteAccessVpn)5 ServerApiException (com.cloud.api.ServerApiException)2 ListResponse (com.cloud.api.response.ListResponse)2 ResourceUnavailableException (com.cloud.exception.ResourceUnavailableException)2 ArrayList (java.util.ArrayList)2 IpAddress (com.cloud.network.IpAddress)1 List (java.util.List)1