Search in sources :

Example 11 with Site2SiteVpnConnection

use of com.cloud.network.Site2SiteVpnConnection in project cloudstack by apache.

the class ResetVpnConnectionCmd method execute.

@Override
public void execute() {
    try {
        Site2SiteVpnConnection result = _s2sVpnService.resetVpnConnection(this);
        if (result != null) {
            Site2SiteVpnConnectionResponse response = _responseGenerator.createSite2SiteVpnConnectionResponse(result);
            response.setResponseName(getCommandName());
            setResponseObject(response);
        } else {
            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to reset site to site VPN connection");
        }
    } catch (ResourceUnavailableException ex) {
        s_logger.warn("Exception: ", ex);
        throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
    }
}
Also used : ServerApiException(org.apache.cloudstack.api.ServerApiException) ResourceUnavailableException(com.cloud.exception.ResourceUnavailableException) Site2SiteVpnConnectionResponse(org.apache.cloudstack.api.response.Site2SiteVpnConnectionResponse) Site2SiteVpnConnection(com.cloud.network.Site2SiteVpnConnection)

Aggregations

Site2SiteVpnConnection (com.cloud.network.Site2SiteVpnConnection)11 Site2SiteVpnConnectionResponse (com.cloud.api.response.Site2SiteVpnConnectionResponse)4 ResourceUnavailableException (com.cloud.exception.ResourceUnavailableException)4 Site2SiteVpnConnectionResponse (org.apache.cloudstack.api.response.Site2SiteVpnConnectionResponse)4 ServerApiException (com.cloud.api.ServerApiException)3 ArrayList (java.util.ArrayList)3 ServerApiException (org.apache.cloudstack.api.ServerApiException)3 NetworkRuleConflictException (com.cloud.exception.NetworkRuleConflictException)2 List (java.util.List)2 CheckS2SVpnConnectionsCommand (com.cloud.agent.api.CheckS2SVpnConnectionsCommand)1 ListResponse (com.cloud.api.response.ListResponse)1 HostVO (com.cloud.host.HostVO)1 Site2SiteCustomerGatewayVO (com.cloud.network.dao.Site2SiteCustomerGatewayVO)1 Site2SiteVpnConnectionVO (com.cloud.network.dao.Site2SiteVpnConnectionVO)1 DomainRouterVO (com.cloud.vm.DomainRouterVO)1 Date (java.util.Date)1 ListResponse (org.apache.cloudstack.api.response.ListResponse)1 Test (org.junit.Test)1 Matchers.anyLong (org.mockito.Matchers.anyLong)1 Matchers.anyString (org.mockito.Matchers.anyString)1