use of org.opendaylight.genius.mdsalutil.actions.ActionOutput in project genius by opendaylight.
the class TestOdlInterfaceRpcService method getEgressActionsForInterface.
@Override
public Future<RpcResult<GetEgressActionsForInterfaceOutput>> getEgressActionsForInterface(GetEgressActionsForInterfaceInput input) {
RpcResultBuilder<GetEgressActionsForInterfaceOutput> rpcResultBuilder;
List<ActionInfo> listActionInfo = new ArrayList<>();
List<Action> actionsList = new ArrayList<>();
listActionInfo.add(new ActionOutput(1, new Uri(URI)));
for (ActionInfo actionInfo : listActionInfo) {
actionsList.add(actionInfo.buildAction());
}
GetEgressActionsForInterfaceOutputBuilder output = new GetEgressActionsForInterfaceOutputBuilder().setAction(actionsList);
rpcResultBuilder = RpcResultBuilder.success();
rpcResultBuilder.withResult(output.build());
return Futures.immediateFuture(rpcResultBuilder.build());
}
use of org.opendaylight.genius.mdsalutil.actions.ActionOutput in project genius by opendaylight.
the class AlivenessProtocolHandlerLLDP method getInterfaceActions.
private List<ActionInfo> getInterfaceActions(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface interfaceState, long portNum) throws InterruptedException, ExecutionException {
Class<? extends InterfaceType> intfType;
if (interfaceState != null) {
intfType = interfaceState.getType();
} else {
LOG.error("Could not retrieve port type for interface to construct actions");
return Collections.emptyList();
}
List<ActionInfo> actionInfos = new ArrayList<>();
// Set the LLDP service Id which is 0
if (Tunnel.class.equals(intfType)) {
actionInfos.add(new ActionSetFieldTunnelId(BigInteger.ZERO));
}
actionInfos.add(new ActionOutput(new Uri(Long.toString(portNum))));
return actionInfos;
}
use of org.opendaylight.genius.mdsalutil.actions.ActionOutput in project genius by opendaylight.
the class MdSalUtilTest method createGroupEntity.
public GroupEntity createGroupEntity(String nodeid, String inport, int vlanid) {
List<BucketInfo> listBucketInfo = new ArrayList<>();
List<ActionInfo> listActionInfo = new ArrayList<>();
if (vlanid > 0) {
listActionInfo.add(new ActionPushVlan());
listActionInfo.add(new ActionSetFieldVlanVid(vlanid));
}
listActionInfo.add(new ActionOutput(new Uri(inport), 65535));
listBucketInfo.add(new BucketInfo(listActionInfo));
String groupName = "Test Group";
BigInteger dpnId = new BigInteger(nodeid.split(":")[1]);
long id = getUniqueValue(nodeid, inport);
return MDSALUtil.buildGroupEntity(dpnId, id, groupName, GroupTypes.GroupIndirect, listBucketInfo);
}
use of org.opendaylight.genius.mdsalutil.actions.ActionOutput in project genius by opendaylight.
the class DirectTunnelUtils method getEgressActionInfosForInterface.
private static List<ActionInfo> getEgressActionInfosForInterface(String tunnelType, String portNo, Long tunnelKey, int actionKeyStart) {
List<ActionInfo> result = new ArrayList<>();
switch(tunnelType) {
case ITMConstants.TUNNEL_TYPE_GRE:
case ITMConstants.TUNNEL_TYPE_MPLSoGRE:
// Invoke IFM RPC and pass it on to the caller.
LOG.warn("Interface Type {} not handled by ITM", tunnelType);
break;
case ITMConstants.TUNNEL_TYPE_VXLAN:
// TODO tunnel_id to encode GRE key, once it is supported
// Until then, tunnel_id should be "cleaned", otherwise it stores the value coming from a VXLAN tunnel
result.add(new ActionSetFieldTunnelId(actionKeyStart++, BigInteger.valueOf(tunnelKey != null ? tunnelKey : 0L)));
result.add(new ActionOutput(actionKeyStart, new Uri(portNo)));
break;
default:
LOG.warn("Interface Type {} not handled yet", tunnelType);
break;
}
return result;
}
Aggregations