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


Java Instructions.MeterInstruction方法代码示例

本文整理汇总了Java中org.onosproject.net.flow.instructions.Instructions.MeterInstruction方法的典型用法代码示例。如果您正苦于以下问题:Java Instructions.MeterInstruction方法的具体用法?Java Instructions.MeterInstruction怎么用?Java Instructions.MeterInstruction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.onosproject.net.flow.instructions.Instructions的用法示例。


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

示例1: DefaultTrafficTreatment

import org.onosproject.net.flow.instructions.Instructions; //导入方法依赖的package包/类
/**
 * Creates a new traffic treatment from the specified list of instructions.
 *
 * @param deferred deferred instructions
 * @param immediate immediate instructions
 * @param table table transition instruction
 * @param clear instruction to clear the deferred actions list
 */
private DefaultTrafficTreatment(List<Instruction> deferred,
                               List<Instruction> immediate,
                               Instructions.TableTypeTransition table,
                               boolean clear,
                               Instructions.MetadataInstruction meta,
                               Instructions.MeterInstruction meter) {
    this.immediate = ImmutableList.copyOf(checkNotNull(immediate));
    this.deferred = ImmutableList.copyOf(checkNotNull(deferred));
    this.all = new ImmutableList.Builder<Instruction>()
            .addAll(immediate)
            .addAll(deferred)
            .build();
    this.table = table;
    this.meta = meta;
    this.hasClear = clear;
    this.meter = meter;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:DefaultTrafficTreatment.java

示例2: add

import org.onosproject.net.flow.instructions.Instructions; //导入方法依赖的package包/类
@Override
public Builder add(Instruction instruction) {

    switch (instruction.type()) {
        case NOACTION:
        case OUTPUT:
        case GROUP:
        case QUEUE:
        case L0MODIFICATION:
        case L1MODIFICATION:
        case L2MODIFICATION:
        case L3MODIFICATION:
        case L4MODIFICATION:
        case EXTENSION:
            current.add(instruction);
            break;
        case TABLE:
            table = (Instructions.TableTypeTransition) instruction;
            break;
        case METADATA:
            meta = (Instructions.MetadataInstruction) instruction;
            break;
        case METER:
            meter = (Instructions.MeterInstruction) instruction;
            break;
        default:
            throw new IllegalArgumentException("Unknown instruction type: " +
                                                       instruction.type());
    }

    return this;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:33,代码来源:DefaultTrafficTreatment.java

示例3: buildMeter

import org.onosproject.net.flow.instructions.Instructions; //导入方法依赖的package包/类
private OFInstruction buildMeter(Instructions.MeterInstruction metered) {
    return factory().instructions().meter(metered.meterId().id());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:4,代码来源:FlowModBuilderVer13.java

示例4: metered

import org.onosproject.net.flow.instructions.Instructions; //导入方法依赖的package包/类
@Override
public Instructions.MeterInstruction metered() {
    return meter;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:DefaultTrafficTreatment.java

示例5: metered

import org.onosproject.net.flow.instructions.Instructions; //导入方法依赖的package包/类
@Override
public Instructions.MeterInstruction metered() {
    return null;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:IntentTestsMocks.java

示例6: encode

import org.onosproject.net.flow.instructions.Instructions; //导入方法依赖的package包/类
/**
 * Encodes the given instruction into JSON.
 *
 * @return JSON object node representing the instruction
 */
public ObjectNode encode() {
    final ObjectNode result = context.mapper().createObjectNode()
            .put(InstructionCodec.TYPE, instruction.type().toString());

    switch (instruction.type()) {
        case OUTPUT:
            final Instructions.OutputInstruction outputInstruction =
                    (Instructions.OutputInstruction) instruction;
            result.put(InstructionCodec.PORT, outputInstruction.port().toString());
            break;

        case NOACTION:
            break;

        case GROUP:
            final Instructions.GroupInstruction groupInstruction =
                    (Instructions.GroupInstruction) instruction;
            result.put(InstructionCodec.GROUP_ID, groupInstruction.groupId().toString());
            break;

        case METER:
            final Instructions.MeterInstruction meterInstruction =
                    (Instructions.MeterInstruction) instruction;
            result.put(InstructionCodec.METER_ID, meterInstruction.meterId().toString());
            break;

        case TABLE:
            final Instructions.TableTypeTransition tableTransitionInstruction =
                    (Instructions.TableTypeTransition) instruction;
            result.put(InstructionCodec.TABLE_ID, tableTransitionInstruction.tableId().toString());
            break;

        case QUEUE:
            final Instructions.SetQueueInstruction setQueueInstruction =
                    (Instructions.SetQueueInstruction) instruction;
            result.put(InstructionCodec.QUEUE_ID, setQueueInstruction.queueId());
            result.put(InstructionCodec.PORT, setQueueInstruction.port().toString());
            break;

        case L0MODIFICATION:
            encodeL0(result);
            break;

        case L1MODIFICATION:
            encodeL1(result);
            break;

        case L2MODIFICATION:
            encodeL2(result);
            break;

        case L3MODIFICATION:
            encodeL3(result);
            break;

        case L4MODIFICATION:
            encodeL4(result);
            break;

        case EXTENSION:
            encodeExtension(result);
            break;

        default:
            log.info("Cannot convert instruction type of {}", instruction.type());
            break;
    }
    return result;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:75,代码来源:EncodeInstructionCodecHelper.java

示例7: metered

import org.onosproject.net.flow.instructions.Instructions; //导入方法依赖的package包/类
/**
 * Returns the meter instruction if there is one.
 *
 * @return a meter instruction that may be null
 */
Instructions.MeterInstruction metered();
 
开发者ID:shlee89,项目名称:athena,代码行数:7,代码来源:TrafficTreatment.java


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