Search in sources :

Example 6 with VpcProvider

use of com.cloud.network.element.VpcProvider in project cloudstack by apache.

the class NetworkACLManagerImpl method applyACLToPrivateGw.

private boolean applyACLToPrivateGw(final PrivateGateway gateway, final List<? extends NetworkACLItem> rules) throws ResourceUnavailableException {
    List<VpcProvider> vpcElements = null;
    vpcElements = new ArrayList<VpcProvider>();
    vpcElements.add((VpcProvider) _ntwkModel.getElementImplementingProvider(Network.Provider.VPCVirtualRouter.getName()));
    if (vpcElements == null) {
        throw new CloudRuntimeException("Failed to initialize vpc elements");
    }
    try {
        for (final VpcProvider provider : vpcElements) {
            return provider.applyACLItemsToPrivateGw(gateway, rules);
        }
    } catch (final Exception ex) {
        s_logger.debug("Failed to apply acl to private gateway " + gateway);
    }
    return false;
}
Also used : VpcProvider(com.cloud.network.element.VpcProvider) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException) ResourceUnavailableException(com.cloud.exception.ResourceUnavailableException) InvalidParameterValueException(com.cloud.exception.InvalidParameterValueException) CloudRuntimeException(com.cloud.utils.exception.CloudRuntimeException)

Aggregations

VpcProvider (com.cloud.network.element.VpcProvider)6 StaticNatServiceProvider (com.cloud.network.element.StaticNatServiceProvider)5 Provider (com.cloud.network.Network.Provider)4 ActionEvent (com.cloud.event.ActionEvent)2 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)2 CloudRuntimeException (com.cloud.utils.exception.CloudRuntimeException)2 ConcurrentOperationException (com.cloud.exception.ConcurrentOperationException)1 ResourceUnavailableException (com.cloud.exception.ResourceUnavailableException)1 Account (com.cloud.user.Account)1 DB (com.cloud.utils.db.DB)1 TransactionCallbackNoReturn (com.cloud.utils.db.TransactionCallbackNoReturn)1 TransactionStatus (com.cloud.utils.db.TransactionStatus)1 ReservationContext (com.cloud.vm.ReservationContext)1 ReservationContextImpl (com.cloud.vm.ReservationContextImpl)1 CallContext (org.apache.cloudstack.context.CallContext)1