Search in sources :

Example 11 with OdlInterfaceRpcService

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService in project genius by opendaylight.

the class ArpUtilImpl method getEgressAction.

private List<Action> getEgressAction(String interfaceName) {
    List<Action> actions = new ArrayList<>();
    try {
        GetEgressActionsForInterfaceInputBuilder egressAction = new GetEgressActionsForInterfaceInputBuilder().setIntfName(interfaceName);
        OdlInterfaceRpcService intfRpc = odlInterfaceRpcService;
        if (intfRpc == null) {
            LOG.error("Unable to obtain interfaceMgrRpc service, ignoring egress actions for interfaceName {}", interfaceName);
            return actions;
        }
        Future<RpcResult<GetEgressActionsForInterfaceOutput>> result = intfRpc.getEgressActionsForInterface(egressAction.build());
        RpcResult<GetEgressActionsForInterfaceOutput> rpcResult = result.get();
        if (!rpcResult.isSuccessful()) {
            LOG.warn("RPC Call to Get egress actions for interface {} returned with Errors {}", interfaceName, rpcResult.getErrors());
        } else {
            actions = rpcResult.getResult().getAction();
        }
    } catch (InterruptedException | ExecutionException e) {
        LOG.error("Exception when egress actions for interface {}", interfaceName, e);
    }
    return actions;
}
Also used : OdlInterfaceRpcService(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService) Action(org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action) GetEgressActionsForInterfaceInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetEgressActionsForInterfaceInputBuilder) ArrayList(java.util.ArrayList) RpcResult(org.opendaylight.yangtools.yang.common.RpcResult) GetEgressActionsForInterfaceOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetEgressActionsForInterfaceOutput) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

RpcResult (org.opendaylight.yangtools.yang.common.RpcResult)8 BigInteger (java.math.BigInteger)6 ExecutionException (java.util.concurrent.ExecutionException)6 GetDpidFromInterfaceInput (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetDpidFromInterfaceInput)4 GetDpidFromInterfaceInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetDpidFromInterfaceInputBuilder)4 GetDpidFromInterfaceOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetDpidFromInterfaceOutput)3 GetEgressActionsForInterfaceInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetEgressActionsForInterfaceInputBuilder)3 ArrayList (java.util.ArrayList)2 Action (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action)2 GetEgressActionsForInterfaceOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetEgressActionsForInterfaceOutput)2 Nonnull (javax.annotation.Nonnull)1 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)1 ActionInfo (org.opendaylight.genius.mdsalutil.ActionInfo)1 ActionNxResubmit (org.opendaylight.genius.mdsalutil.actions.ActionNxResubmit)1 ActionOutput (org.opendaylight.genius.mdsalutil.actions.ActionOutput)1 ActionPushVlan (org.opendaylight.genius.mdsalutil.actions.ActionPushVlan)1 ActionRegLoad (org.opendaylight.genius.mdsalutil.actions.ActionRegLoad)1 ActionSetFieldVlanVid (org.opendaylight.genius.mdsalutil.actions.ActionSetFieldVlanVid)1 VpnInterfaces (org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.VpnInterfaces)1 VpnInterface (org.opendaylight.yang.gen.v1.urn.huawei.params.xml.ns.yang.l3vpn.rev140815.vpn.interfaces.VpnInterface)1