本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action类的典型用法代码示例。如果您正苦于以下问题:Java Action类的具体用法?Java Action怎么用?Java Action使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Action类属于org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list包,在下文中一共展示了Action类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindScfOnVpnInterface
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
public void bindScfOnVpnInterface(String ifName, int scfTag) {
LOG.debug("bind SCF tag {} on iface {}", scfTag, ifName);
if (isServiceBoundOnInterface(NwConstants.SCF_SERVICE_INDEX, ifName)) {
LOG.info("SCF is already bound on Interface {} for Ingress. Binding aborted", ifName);
return;
}
Action loadReg2Action = new ActionRegLoad(1, NxmNxReg2.class, 0, 31, scfTag).buildAction();
List<Instruction> instructions =
Arrays.asList(MDSALUtil.buildApplyActionsInstruction(Collections.singletonList(loadReg2Action)),
MDSALUtil.buildAndGetGotoTableInstruction(NwConstants.SCF_DOWN_SUB_FILTER_TCP_BASED_TABLE,
1 /*instructionKey, not sure why it is needed*/));
BoundServices boundServices =
InterfaceServiceUtil.getBoundServices(ifName, NwConstants.SCF_SERVICE_INDEX,
CloudServiceChainConstants.DEFAULT_SCF_FLOW_PRIORITY,
CloudServiceChainConstants.COOKIE_SCF_BASE,
instructions);
interfaceManager.bindService(ifName, ServiceModeIngress.class, boundServices);
}
示例2: getEgressActions
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
private List<Action> getEgressActions(String interfaceName, int actionKey) {
List<Action> actions = Collections.emptyList();
try {
GetEgressActionsForInterfaceInputBuilder egressAction =
new GetEgressActionsForInterfaceInputBuilder().setIntfName(interfaceName).setActionKey(actionKey);
Future<RpcResult<GetEgressActionsForInterfaceOutput>> result =
interfaceManager.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.warn("Exception when egress actions for interface {}", interfaceName, e);
}
return actions;
}
示例3: buildBucketForDcGwLbGroup
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
private Bucket buildBucketForDcGwLbGroup(String ipAddress, BigInteger dpnId,
int index) {
List<Action> listAction = new ArrayList<>();
// ActionKey 0 goes to mpls label.
int actionKey = 1;
listAction.add(new ActionPushMpls().buildAction());
listAction.add(new ActionRegMove(actionKey++, FibConstants.NXM_REG_MAPPING
.get(index), 0, 19).buildAction());
String tunnelInterfaceName = getTunnelInterfaceName(dpnId, new IpAddress(ipAddress.toCharArray()));
List<Action> egressActions = getEgressActions(tunnelInterfaceName, actionKey++);
if (!egressActions.isEmpty()) {
listAction.addAll(getEgressActions(tunnelInterfaceName, actionKey++));
} else {
// clear off actions if there is no egress actions.
listAction = Collections.emptyList();
}
return MDSALUtil.buildBucket(listAction, MDSALUtil.GROUP_WEIGHT, index,
MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP);
}
示例4: wrapActionsIntoApplyActionsInstruction
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
public static InstructionsBuilder wrapActionsIntoApplyActionsInstruction(List<Action> theActions) {
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(theActions);
// Wrap our Apply Action in an Instruction
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(0);
ib.setKey(new InstructionKey(0));
// Put our Instruction in a list of Instructions
List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
return new InstructionsBuilder().setInstruction(instructions);
}
示例5: createIngressClassifierSfcTunnelTrafficCaptureFlow
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
public Flow createIngressClassifierSfcTunnelTrafficCaptureFlow(NodeId nodeId) {
MatchBuilder match = new MatchBuilder();
OpenFlow13Utils.addMatchTunId(match, SFC_TUNNEL_ID);
OpenFlow13Utils.addMatchEthNsh(match);
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE,
actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
String flowIdStr = INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_FLOW_NAME + nodeId.getValue();
return OpenFlow13Utils.createFlowBuilder(NwConstants.INTERNAL_TUNNEL_TABLE,
INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_PRIORITY,
INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_COOKIE,
INGRESS_CLASSIFIER_CAPTURE_SFC_TUNNEL_TRAFFIC_FLOW_NAME, flowIdStr, match, isb).build();
}
示例6: createIngressClassifierFilterEthNshFlow
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
public Flow createIngressClassifierFilterEthNshFlow(NodeId nodeId) {
MatchBuilder match = new MatchBuilder();
OpenFlow13Utils.addMatchEthNsh(match);
OpenFlow13Utils.addMatchTunDstIp(match, NULL_IP);
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.LPORT_DISPATCHER_TABLE,
actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
String flowIdStr = INGRESS_CLASSIFIER_FILTER_ETHNSH_FLOW_NAME + nodeId.getValue();
return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE,
INGRESS_CLASSIFIER_FILTER_ETH_NSH_PRIORITY, INGRESS_CLASSIFIER_FILTER_COOKIE,
INGRESS_CLASSIFIER_FILTER_ETHNSH_FLOW_NAME, flowIdStr, match, isb).build();
}
示例7: createIngressClassifierFilterChainEgressFlow
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
public Flow createIngressClassifierFilterChainEgressFlow(NodeId nodeId, long nsp, short egressNsi) {
MatchBuilder match = new MatchBuilder();
OpenFlow13Utils.addMatchNsp(match, nsp);
OpenFlow13Utils.addMatchNsi(match, egressNsi);
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionNxMoveNsc4ToReg6Register(actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxPopNsh(actionList.size()));
actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.EGRESS_LPORT_DISPATCHER_TABLE,
actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
String flowIdStr = INGRESS_CLASSIFIER_FILTER_NSH_CHAIN_EGRESS_FLOW_NAME + nodeId.getValue() + "_" + nsp;
return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE,
INGRESS_CLASSIFIER_FILTER_CHAIN_EGRESS_PRIORITY, INGRESS_CLASSIFIER_FILTER_COOKIE,
INGRESS_CLASSIFIER_FILTER_NSH_CHAIN_EGRESS_FLOW_NAME, flowIdStr, match, isb).build();
}
示例8: createIngressClassifierAclFlow
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
public Flow createIngressClassifierAclFlow(NodeId nodeId, MatchBuilder match, Long port, long nsp, short nsi) {
OpenFlow13Utils.addMatchInPort(match, nodeId, port);
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionNxPushNsh(actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadNshMdtype(NSH_MDTYPE_ONE, actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadNp(NSH_NP_ETH, actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadNsp((int) nsp, actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadNsi(nsi, actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadNshc1(ACL_FLAG_CONTEXT_VALUE, actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadNshc2(DEFAULT_NSH_CONTEXT_VALUE, actionList.size()));
actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.LPORT_DISPATCHER_TABLE,
actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
// The flowIdStr needs to be unique, so the best way to make it unique is to use the match
String flowIdStr = INGRESS_CLASSIFIER_ACL_FLOW_NAME + "_" + nodeId.getValue() + match.build().toString();
return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_ACL_TABLE,
INGRESS_CLASSIFIER_ACL_PRIORITY, INGRESS_CLASSIFIER_ACL_COOKIE, INGRESS_CLASSIFIER_ACL_FLOW_NAME,
flowIdStr, match, isb).build();
}
示例9: createIngressClassifierAclNoMatchFlow
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
public Flow createIngressClassifierAclNoMatchFlow(NodeId nodeId) {
// This is a MatchAny flow
MatchBuilder match = new MatchBuilder();
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionResubmitTable(NwConstants.LPORT_DISPATCHER_TABLE,
actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
String flowIdStr = INGRESS_CLASSIFIER_ACL_FLOW_NAME + "_" + nodeId.getValue();
return OpenFlow13Utils.createFlowBuilder(NwConstants.INGRESS_SFC_CLASSIFIER_ACL_TABLE,
INGRESS_CLASSIFIER_ACL_NOMATCH_PRIORITY, INGRESS_CLASSIFIER_ACL_COOKIE,
INGRESS_CLASSIFIER_ACL_FLOW_NAME, flowIdStr, match, isb).build();
}
示例10: createEgressClassifierNextHopNoC1C2Flow
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
public Flow createEgressClassifierNextHopNoC1C2Flow(NodeId nodeId) {
MatchBuilder match = new MatchBuilder();
OpenFlow13Utils.addMatchNshNsc1(match, DEFAULT_NSH_CONTEXT_VALUE);
OpenFlow13Utils.addMatchNshNsc2(match, DEFAULT_NSH_CONTEXT_VALUE);
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionNxMoveReg0ToNsc1Register(actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxMoveTunIdToNsc2Register(actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxMoveReg6ToNsc4Register(actionList.size()));
actionList.add(OpenFlow13Utils.createActionNxLoadTunId(SFC_TUNNEL_ID, actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
OpenFlow13Utils.appendGotoTableInstruction(isb, NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE);
String flowIdStr = EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_FLOW_NAME + nodeId.getValue();
return OpenFlow13Utils.createFlowBuilder(NwConstants.EGRESS_SFC_CLASSIFIER_NEXTHOP_TABLE,
EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_PRIORITY, EGRESS_CLASSIFIER_NEXTHOP_COOKIE,
EGRESS_CLASSIFIER_NEXTHOP_NOC1C2_FLOW_NAME, flowIdStr, match, isb).build();
}
示例11: createEgressClassifierTransportEgressRemoteFlow
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
public Flow createEgressClassifierTransportEgressRemoteFlow(NodeId nodeId, long nsp, long outport,
String firstHopIp) {
MatchBuilder match = OpenFlow13Utils.getNspMatch(nsp);
Long ipl = InetAddresses.coerceToInteger(InetAddresses.forString(firstHopIp)) & 0xffffffffL;
List<Action> actionList = new ArrayList<>();
actionList.add(OpenFlow13Utils.createActionNxLoadTunIpv4Dst(ipl, actionList.size()));
actionList.add(OpenFlow13Utils.createActionOutPort("output:" + outport, actionList.size()));
InstructionsBuilder isb = OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(actionList);
String flowIdStr = EGRESS_CLASSIFIER_TPORTEGRESS_FLOW_NAME + nodeId.getValue() + "_" + nsp;
return OpenFlow13Utils.createFlowBuilder(NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE,
EGRESS_CLASSIFIER_EGRESS_REMOTE_PRIORITY, EGRESS_CLASSIFIER_TPORTEGRESS_COOKIE,
EGRESS_CLASSIFIER_TPORTEGRESS_FLOW_NAME, flowIdStr, match, isb).build();
}
示例12: bindService
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
private void bindService(InstanceIdentifier<BoundServices> id, short serviceId, String serviceName,
int servicePriority, short serviceDestTable, BigInteger serviceTableCookie, List<Action> extraActions) {
InstructionsBuilder isb = extraActions.isEmpty()
? new InstructionsBuilder()
: OpenFlow13Utils.wrapActionsIntoApplyActionsInstruction(extraActions);
isb = OpenFlow13Utils.appendGotoTableInstruction(isb, serviceDestTable);
StypeOpenflow stypeOpenflow = new StypeOpenflowBuilder()
.setFlowCookie(serviceTableCookie)
.setFlowPriority(servicePriority)
.setInstruction(isb.build().getInstruction())
.build();
BoundServices boundServices = new BoundServicesBuilder().setServiceName(serviceName)
.setServicePriority(serviceId).setServiceType(ServiceTypeFlowBased.class)
.addAugmentation(StypeOpenflow.class, stypeOpenflow).build();
LOG.info("Binding Service ID [{}] name [{}] priority [{}] table [{}] cookie [{}] extraActions [{}]",
serviceId, serviceName, servicePriority, serviceDestTable, serviceTableCookie, extraActions);
MDSALUtil.syncWrite(this.dataBroker, LogicalDatastoreType.CONFIGURATION, id, boundServices);
}
示例13: createIngressClassifierFilterChainEgressFlow
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
@Test
public void createIngressClassifierFilterChainEgressFlow() {
Flow flow = openflowProvider.createIngressClassifierFilterChainEgressFlow(nodeId, NSP, EGRESS_NSI);
assertEquals(flow.getTableId().shortValue(), NwConstants.INGRESS_SFC_CLASSIFIER_FILTER_TABLE);
assertEquals(flow.getPriority().intValue(), OpenFlow13Provider.INGRESS_CLASSIFIER_FILTER_CHAIN_EGRESS_PRIORITY);
assertEquals(flow.getId().getValue(),
OpenFlow13Provider.INGRESS_CLASSIFIER_FILTER_NSH_CHAIN_EGRESS_FLOW_NAME
+ nodeId.getValue() + "_" + NSP);
assertEquals(flow.getCookie().getValue(), OpenFlow13Provider.INGRESS_CLASSIFIER_FILTER_COOKIE);
checkMatchNsp(flow.getMatch(), NSP);
checkMatchNsi(flow.getMatch(), EGRESS_NSI);
assertEquals(1, flow.getInstructions().getInstruction().size());
Instruction curInstruction = flow.getInstructions().getInstruction().get(0).getInstruction();
List<Action> actionList = checkApplyActionSize(curInstruction, 3);
checkActionMoveNsc4(actionList.get(0), true);
checkActionMoveTunReg(actionList.get(0), NxmNxReg6.class, false);
checkActionPopNsh(actionList.get(1));
checkActionResubmit(curInstruction, NwConstants.EGRESS_LPORT_DISPATCHER_TABLE);
}
示例14: createEgressClassifierFilterNshFlow
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
@Test
public void createEgressClassifierFilterNshFlow() {
Flow flow = openflowProvider.createEgressClassifierFilterNshFlow(nodeId);
assertEquals(flow.getTableId().shortValue(), NwConstants.EGRESS_SFC_CLASSIFIER_FILTER_TABLE);
assertEquals(flow.getPriority().intValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_FILTER_NSH_PRIORITY);
assertEquals(flow.getId().getValue(),
OpenFlow13Provider.EGRESS_CLASSIFIER_FILTER_NSH_FLOW_NAME + nodeId.getValue());
assertEquals(flow.getCookie().getValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_FILTER_COOKIE);
checkMatchNshMdType1(flow.getMatch());
assertEquals(2, flow.getInstructions().getInstruction().size());
List<Action> actionList;
actionList = checkApplyActionSize(flow.getInstructions().getInstruction().get(0).getInstruction(), 1);
checkActionLoadNshc1(actionList.get(0), OpenFlow13Provider.DEFAULT_NSH_CONTEXT_VALUE);
checkActionGotoTable(flow.getInstructions().getInstruction().get(1).getInstruction(),
NwConstants.EGRESS_SFC_CLASSIFIER_NEXTHOP_TABLE);
}
示例15: createEgressClassifierTransportEgressRemoteFlow
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action; //导入依赖的package包/类
@Test
public void createEgressClassifierTransportEgressRemoteFlow() {
Flow flow = openflowProvider.createEgressClassifierTransportEgressRemoteFlow(nodeId, NSP, OUT_PORT, SFF_IP_STR);
assertEquals(flow.getTableId().shortValue(), NwConstants.EGRESS_SFC_CLASSIFIER_EGRESS_TABLE);
assertEquals(flow.getPriority().intValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_EGRESS_REMOTE_PRIORITY);
assertEquals(flow.getId().getValue(),
OpenFlow13Provider.EGRESS_CLASSIFIER_TPORTEGRESS_FLOW_NAME + nodeId.getValue() + "_" + NSP);
assertEquals(flow.getCookie().getValue(), OpenFlow13Provider.EGRESS_CLASSIFIER_TPORTEGRESS_COOKIE);
checkMatchNsp(flow.getMatch(), NSP);
assertEquals(1, flow.getInstructions().getInstruction().size());
List<Action> actionList = checkApplyActionSize(
flow.getInstructions().getInstruction().get(0).getInstruction(), 2);
checkActionLoadTunIpv4(actionList.get(0), SFF_IP_STR);
checkActionOutport(actionList.get(1), "output:" + OUT_PORT);
}