本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder.setKey方法的典型用法代码示例。如果您正苦于以下问题:Java ActionBuilder.setKey方法的具体用法?Java ActionBuilder.setKey怎么用?Java ActionBuilder.setKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder
的用法示例。
在下文中一共展示了ActionBuilder.setKey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSrcArpMacInstructions
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Set ARP_SHA Instructions
* @param ib Map InstructionBuilder
* @param macsrc the macsrc
* @return instructionbuilder with new instructions
*/
public static InstructionBuilder createSrcArpMacInstructions(InstructionBuilder ib, MacAddress macsrc) {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
ArpMatchBuilder arpmatch = new ArpMatchBuilder();
ArpSourceHardwareAddressBuilder arpsrc = new ArpSourceHardwareAddressBuilder();
arpsrc.setAddress(macsrc);
arpmatch.setArpSourceHardwareAddress(arpsrc.build());
setFieldBuilder.setLayer3Match(arpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例2: createDlDstInstructions
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
public static InstructionBuilder createDlDstInstructions(InstructionBuilder ib, MacAddress macAddress) {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetDlDstActionBuilder dlDstActionBuilder= new SetDlDstActionBuilder();
dlDstActionBuilder.setAddress(macAddress);
ab.setAction(new SetDlDstActionCaseBuilder().setSetDlDstAction(dlDstActionBuilder.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例3: createSetDstUDPPort
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Create Set Destination UDP Port Instruction
*
* @param ib Map InstructionBuilder without any instructions
* @param udpport Integer representing a destination UDP port
* @return ib Map InstructionBuilder with instructions
*/
public static InstructionBuilder createSetDstUDPPort(InstructionBuilder ib, PortNumber udpport) {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
// Build the Destination TCP Port
PortNumber udpdstport = new PortNumber(udpport);
UdpMatchBuilder udpmatch = new UdpMatchBuilder();
udpmatch.setUdpDestinationPort(udpdstport);
setFieldBuilder.setLayer4Match(udpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例4: createSrcArpIpInstructions
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Set ARP_SPA Instructions
* @param ib Map InstructionBuilder
* @param srciparp the srciparp
* @return instructionbuilder with new attributes
*/
public static InstructionBuilder createSrcArpIpInstructions(InstructionBuilder ib, Ipv4Prefix srciparp) {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
ArpMatchBuilder arpmatch = new ArpMatchBuilder();
arpmatch.setArpSourceTransportAddress(srciparp);
setFieldBuilder.setLayer3Match(arpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例5: createDstArpIpInstructions
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Set ARP_TPA Instructions
* @param ib Map InstructionBuilder
* @param dstiparp the dstiparp
* @return instructionbuilder with new attributes
*/
public static InstructionBuilder createDstArpIpInstructions(InstructionBuilder ib, Ipv4Prefix dstiparp) {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
ArpMatchBuilder arpmatch = new ArpMatchBuilder();
arpmatch.setArpTargetTransportAddress(dstiparp);
setFieldBuilder.setLayer3Match(arpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例6: createSetDstTCPPort
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Create Set Destination TCP Port Instruction
*
* @param ib Map InstructionBuilder without any instructions
* @param tcpport Integer representing a source TCP port
* @return ib Map InstructionBuilder with instructions
*/
public static InstructionBuilder createSetDstTCPPort(InstructionBuilder ib, PortNumber tcpport) {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
// Build the Destination TCP Port
PortNumber tcpdstport = new PortNumber(tcpport);
TcpMatchBuilder tcpmatch = new TcpMatchBuilder();
tcpmatch.setTcpDestinationPort(tcpdstport);
setFieldBuilder.setLayer4Match(tcpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例7: createOutputPortInstructions
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Create Output Port Instruction
*
* @param ib Map InstructionBuilder without any instructions
* @param dpidLong Long the datapath ID of a switch/node
* @param port Long representing a port on a switch/node
* @return ib InstructionBuilder Map with instructions
*/
public static InstructionBuilder createOutputPortInstructions(InstructionBuilder ib, Long dpidLong, Long port) {
NodeConnectorId ncid = new NodeConnectorId("openflow:" + dpidLong + ":" + port);
LOG.debug("createOutputPortInstructions() Node Connector ID is - Type=openflow: DPID={} inPort={} ",
dpidLong, port);
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder oab = new OutputActionBuilder();
oab.setOutputNodeConnector(ncid);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(oab.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例8: createNwSrcInstructions
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Create Set IPv4 Source Instruction
*
* @param ib Map InstructionBuilder without any instructions
* @param prefixsrc String containing an IPv4 prefix
* @return ib Map InstructionBuilder with instructions
*/
public static InstructionBuilder createNwSrcInstructions(InstructionBuilder ib, Ipv4Prefix prefixsrc) {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetNwSrcActionBuilder setNwsrcActionBuilder = new SetNwSrcActionBuilder();
Ipv4Builder ipsrc = new Ipv4Builder();
ipsrc.setIpv4Address(prefixsrc);
setNwsrcActionBuilder.setAddress(ipsrc.build());
ab.setAction(new SetNwSrcActionCaseBuilder().setSetNwSrcAction(setNwsrcActionBuilder.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例9: createDropInstructions
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Create Drop Instruction
*
* @param ib Map InstructionBuilder without any instructions
* @return ib Map InstructionBuilder with instructions
*/
public static InstructionBuilder createDropInstructions(InstructionBuilder ib) {
DropActionBuilder dab = new DropActionBuilder();
DropAction dropAction = dab.build();
ActionBuilder ab = new ActionBuilder();
ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
// Add our drop action to a list
List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例10: createSetTunnelIdInstructions
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Create Set Tunnel ID Instruction Builder
*
* @param ib Map InstructionBuilder without any instructions
* @param tunnelId BigInteger representing a tunnel ID
* @return ib Map InstructionBuilder with instructions
*/
public static InstructionBuilder createSetTunnelIdInstructions(InstructionBuilder ib, BigInteger tunnelId) {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
// Build the Set Tunnel Field Action
TunnelBuilder tunnel = new TunnelBuilder();
tunnel.setTunnelId(tunnelId);
setFieldBuilder.setTunnel(tunnel.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap the Apply Action in an InstructionBuilder and return
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例11: createSetSrcTCPPort
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Create Set Source TCP Port Instruction
*
* @param ib Map InstructionBuilder without any instructions
* @param tcpport Integer representing a source TCP port
* @return ib Map InstructionBuilder with instructions
*/
public static InstructionBuilder createSetSrcTCPPort(InstructionBuilder ib, PortNumber tcpport) {
List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
// Build the Destination TCP Port
PortNumber tcpsrcport = new PortNumber(tcpport);
TcpMatchBuilder tcpmatch = new TcpMatchBuilder();
tcpmatch.setTcpSourcePort(tcpsrcport);
setFieldBuilder.setLayer4Match(tcpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例12: createSendToControllerInstructions
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Create Send to Controller Reserved Port Instruction (packet_in)
*
* @param ib Map InstructionBuilder without any instructions
* @return ib Map InstructionBuilder with instructions
*/
public static InstructionBuilder createSendToControllerInstructions(InstructionBuilder ib) {
List<Action> actionList = Lists.newArrayList();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
output.setMaxLength(MAX_LENGTH);
Uri value = new Uri("CONTROLLER");
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例13: createNormalInstructions
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Create NORMAL Reserved Port Instruction (packet_in)
*
* @param ib Map InstructionBuilder without any instructions
* @return ib Map InstructionBuilder with instructions
*/
public static InstructionBuilder createNormalInstructions(InstructionBuilder ib) {
List<Action> actionList = Lists.newArrayList();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder output = new OutputActionBuilder();
Uri value = new Uri("NORMAL");
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例14: createOutputPortInstructions
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Create Output Port Instruction
*
* @param ib Map InstructionBuilder without any instructions
* @param dpidLong Long the datapath ID of a switch/node
* @param port Long representing a port on a switch/node
* @return ib InstructionBuilder Map with instructions
*/
public static InstructionBuilder createOutputPortInstructions(InstructionBuilder ib, Long dpidLong, Long port) {
NodeConnectorId ncid = new NodeConnectorId("openflow:" + dpidLong + ":" + port);
logger.debug("createOutputPortInstructions() Node Connector ID is - Type=openflow: DPID={} inPort={} ",
dpidLong, port);
List<Action> actionList = Lists.newArrayList();
ActionBuilder ab = new ActionBuilder();
OutputActionBuilder oab = new OutputActionBuilder();
oab.setOutputNodeConnector(ncid);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(oab.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}
示例15: createNwSrcInstructions
import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
* Create Set IPv4 Source Instruction
*
* @param ib Map InstructionBuilder without any instructions
* @param prefixsrc String containing an IPv4 prefix
* @return ib Map InstructionBuilder with instructions
*/
public static InstructionBuilder createNwSrcInstructions(InstructionBuilder ib, Ipv4Prefix prefixsrc) {
List<Action> actionList = Lists.newArrayList();
ActionBuilder ab = new ActionBuilder();
SetNwSrcActionBuilder setNwsrcActionBuilder = new SetNwSrcActionBuilder();
Ipv4Builder ipsrc = new Ipv4Builder();
ipsrc.setIpv4Address(prefixsrc);
setNwsrcActionBuilder.setAddress(ipsrc.build());
ab.setAction(new SetNwSrcActionCaseBuilder().setSetNwSrcAction(setNwsrcActionBuilder.build()).build());
ab.setOrder(0);
ab.setKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Wrap our Apply Action in an Instruction
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
return ib;
}