当前位置: 首页>>代码示例>>Java>>正文


Java ActionBuilder.setAction方法代码示例

本文整理汇总了Java中org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder.setAction方法的典型用法代码示例。如果您正苦于以下问题:Java ActionBuilder.setAction方法的具体用法?Java ActionBuilder.setAction怎么用?Java ActionBuilder.setAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder的用法示例。


在下文中一共展示了ActionBuilder.setAction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createSetSrcUDPPort

import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
 * Create Set Source UDP Port Instruction
 *
 * @param ib      Map InstructionBuilder without any instructions
 * @param udpport Integer representing a source UDP port
 * @return ib Map InstructionBuilder with instructions
 */
public static InstructionBuilder createSetSrcUDPPort(InstructionBuilder ib, PortNumber udpport) {

    List<Action> actionList = new ArrayList<>();
    ActionBuilder ab = new ActionBuilder();
    SetFieldBuilder setFieldBuilder = new SetFieldBuilder();

    // Build the Destination TCP Port
    PortNumber udpsrcport = new PortNumber(udpport);
    UdpMatchBuilder udpmatch = new UdpMatchBuilder();
    udpmatch.setUdpSourcePort(udpsrcport);

    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;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:31,代码来源:OfInstructionUtils.java

示例2: createDecNwTtlInstructions

import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
 * Create Decrement TTL Instruction
 *
 * @param ib Map InstructionBuilder without any instructions
 * @return ib Map InstructionBuilder with instructions
 */
public static InstructionBuilder createDecNwTtlInstructions(InstructionBuilder ib) {
    DecNwTtlBuilder decNwTtlBuilder = new DecNwTtlBuilder();
    DecNwTtl decNwTtl = decNwTtlBuilder.build();
    ActionBuilder ab = new ActionBuilder();
    ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).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;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:28,代码来源:OfInstructionUtils.java

示例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;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:31,代码来源:OfInstructionUtils.java

示例4: 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 nodeName Uri Prefix, containing nodeConnectorType and dpId (aka NodeId)
 * @param ib Map InstructionBuilder without any instructions
 * @return ib Map InstructionBuilder with instructions
 */
public static InstructionBuilder createSendToControllerInstructions(String nodeName, InstructionBuilder ib) {

    List<Action> actionList = new ArrayList<>();
    ActionBuilder ab = new ActionBuilder();

    OutputActionBuilder output = new OutputActionBuilder();
    output.setMaxLength(MAX_LENGTH);
    NodeId nodeId = new NodeId(nodeName);
    output.setOutputNodeConnector(new NodeConnectorId(nodeId.getValue() + ":"
            + OutputPortValues.CONTROLLER.toString()));
    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;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:32,代码来源:OfInstructionUtils.java

示例5: 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;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:30,代码来源:OfInstructionUtils.java

示例6: createPopVlanInstructions

import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
 * Create Pop Vlan Instruction - this remove vlan header
 *
 * @param ib Map InstructionBuilder without any instructions
 * @return ib Map InstructionBuilder with instructions
 */
public static InstructionBuilder createPopVlanInstructions(InstructionBuilder ib) {

    List<Action> actionList = new ArrayList<>();
    ActionBuilder ab = new ActionBuilder();

    PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
    ab.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(popVlanActionBuilder.build()).build());
    ab.setOrder(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;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:26,代码来源:OfInstructionUtils.java

示例7: 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;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:31,代码来源:OfInstructionUtils.java

示例8: 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;
}
 
开发者ID:opendaylight,项目名称:faas,代码行数:29,代码来源:OfInstructionUtils.java

示例9: 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;
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:30,代码来源:InstructionUtils.java

示例10: 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;
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:30,代码来源:InstructionUtils.java

示例11: 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;
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:32,代码来源:InstructionUtils.java

示例12: createPopVlanInstructions

import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
 * Create Pop Vlan Instruction - this remove vlan header
 *
 * @param ib Map InstructionBuilder without any instructions
 * @return ib Map InstructionBuilder with instructions
 */
public static InstructionBuilder createPopVlanInstructions(InstructionBuilder ib) {

    List<Action> actionList = Lists.newArrayList();
    ActionBuilder ab = new ActionBuilder();

    PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
    ab.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(popVlanActionBuilder.build()).build());
    ab.setOrder(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;
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:26,代码来源:InstructionUtils.java

示例13: 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;
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:31,代码来源:InstructionUtils.java

示例14: createNwDstInstructions

import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder; //导入方法依赖的package包/类
/**
 * Create Set IPv4 Destination Instruction
 *
 * @param ib        Map InstructionBuilder without any instructions
 * @param prefixdst String containing an IPv4 prefix
 * @return ib Map InstructionBuilder with instructions
 */
public static InstructionBuilder createNwDstInstructions(InstructionBuilder ib, Ipv4Prefix prefixdst) {

    List<Action> actionList = Lists.newArrayList();
    ActionBuilder ab = new ActionBuilder();

    SetNwDstActionBuilder setNwDstActionBuilder = new SetNwDstActionBuilder();
    Ipv4Builder ipdst = new Ipv4Builder();
    ipdst.setIpv4Address(prefixdst);
    setNwDstActionBuilder.setAddress(ipdst.build());
    ab.setAction(new SetNwDstActionCaseBuilder().setSetNwDstAction(setNwDstActionBuilder.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;
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:31,代码来源:InstructionUtils.java

示例15: 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 = Lists.newArrayList();
    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;
}
 
开发者ID:sdnhub,项目名称:SDNHub_Opendaylight_Tutorial,代码行数:29,代码来源:InstructionUtils.java


注:本文中的org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder.setAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。