• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java OFMeterModCommand类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFMeterModCommand的典型用法代码示例。如果您正苦于以下问题:Java OFMeterModCommand类的具体用法?Java OFMeterModCommand怎么用?Java OFMeterModCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OFMeterModCommand类属于org.projectfloodlight.openflow.protocol包,在下文中一共展示了OFMeterModCommand类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: deleteMeter

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public ImmutablePair<Long, Boolean> deleteMeter(IOFSwitch sw, final DatapathId dpid, final long meterId) {
    logger.debug("deleting meter {} from switch {}", meterId, dpid);

    OFFactory ofFactory = sw.getOFFactory();

    OFMeterMod.Builder meterDeleteBuilder = ofFactory.buildMeterMod()
            .setMeterId(meterId)
            .setCommand(OFMeterModCommand.DELETE);

    if (sw.getOFFactory().getVersion().compareTo(OF_13) > 0) {
        meterDeleteBuilder.setBands(emptyList());
    } else {
        meterDeleteBuilder.setMeters(emptyList());
    }

    OFMeterMod meterDelete = meterDeleteBuilder.build();

    boolean response = sw.write(meterDelete);
    return new ImmutablePair<>(meterDelete.getXid(), response);
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:21,代码来源:SwitchManager.java


示例2: installMeter

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
private ImmutablePair<Long, Boolean> installMeter(final IOFSwitch sw, final DatapathId dpid, final long bandwidth,
                                                 final long burstSize, final long meterId) {
    logger.debug("installing meter {} on switch {} width bandwidth {}", meterId, dpid, bandwidth);

    Set<OFMeterFlags> flags = new HashSet<>(Arrays.asList(OFMeterFlags.KBPS, OFMeterFlags.BURST));
    OFFactory ofFactory = sw.getOFFactory();

    OFMeterBandDrop.Builder bandBuilder = ofFactory.meterBands()
            .buildDrop()
            .setRate(bandwidth)
            .setBurstSize(burstSize);

    OFMeterMod.Builder meterModBuilder = ofFactory.buildMeterMod()
            .setMeterId(meterId)
            .setCommand(OFMeterModCommand.ADD)
            .setFlags(flags);

    if (sw.getOFFactory().getVersion().compareTo(OF_13) > 0) {
        meterModBuilder.setBands(singletonList(bandBuilder.build()));
    } else {
        meterModBuilder.setMeters(singletonList(bandBuilder.build()));
    }

    OFMeterMod meterMod = meterModBuilder.build();

    boolean response = sw.write(meterMod);
    return new ImmutablePair<>(meterMod.getXid(), response);
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:29,代码来源:SwitchManager.java


示例3: deleteMeter

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
@Test
public void deleteMeter() {
    final Capture<OFMeterMod> capture = prepareForMeterTest();
    switchManager.deleteMeter(dpid, meterId);
    final OFMeterMod meterMod = capture.getValue();
    assertEquals(meterMod.getCommand(), OFMeterModCommand.DELETE);
    assertEquals(meterMod.getMeterId(), meterId);
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:9,代码来源:SwitchManagerTest.java


示例4: readFrom

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public static OFMeterModCommand readFrom(ChannelBuffer bb) throws OFParseError {
    try {
        return ofWireValue(bb.readShort());
    } catch (IllegalArgumentException e) {
        throw new OFParseError(e);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:8,代码来源:OFMeterModCommandSerializerVer13.java


示例5: ofWireValue

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public static OFMeterModCommand ofWireValue(short val) {
    switch(val) {
        case ADD_VAL:
            return OFMeterModCommand.ADD;
        case MODIFY_VAL:
            return OFMeterModCommand.MODIFY;
        case DELETE_VAL:
            return OFMeterModCommand.DELETE;
        default:
            throw new IllegalArgumentException("Illegal wire value for type OFMeterModCommand in version 1.3: " + val);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:13,代码来源:OFMeterModCommandSerializerVer13.java


示例6: toWireValue

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public static short toWireValue(OFMeterModCommand e) {
    switch(e) {
        case ADD:
            return ADD_VAL;
        case MODIFY:
            return MODIFY_VAL;
        case DELETE:
            return DELETE_VAL;
        default:
            throw new IllegalArgumentException("Illegal enum value for type OFMeterModCommand in version 1.3: " + e);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:13,代码来源:OFMeterModCommandSerializerVer13.java


示例7: ofWireValue

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public static OFMeterModCommand ofWireValue(short val) {
    switch(val) {
        case ADD_VAL:
            return OFMeterModCommand.ADD;
        case MODIFY_VAL:
            return OFMeterModCommand.MODIFY;
        case DELETE_VAL:
            return OFMeterModCommand.DELETE;
        default:
            throw new IllegalArgumentException("Illegal wire value for type OFMeterModCommand in version 1.4: " + val);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:13,代码来源:OFMeterModCommandSerializerVer14.java


示例8: toWireValue

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public static short toWireValue(OFMeterModCommand e) {
    switch(e) {
        case ADD:
            return ADD_VAL;
        case MODIFY:
            return MODIFY_VAL;
        case DELETE:
            return DELETE_VAL;
        default:
            throw new IllegalArgumentException("Illegal enum value for type OFMeterModCommand in version 1.4: " + e);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:13,代码来源:OFMeterModCommandSerializerVer14.java


示例9: readFrom

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public static OFMeterModCommand readFrom(ByteBuf bb) throws OFParseError {
    try {
        return ofWireValue(bb.readShort());
    } catch (IllegalArgumentException e) {
        throw new OFParseError(e);
    }
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:8,代码来源:OFMeterModCommandSerializerVer13.java


示例10: ofWireValue

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public static OFMeterModCommand ofWireValue(short val) {
    switch(val) {
        case ADD_VAL:
            return OFMeterModCommand.ADD;
        case MODIFY_VAL:
            return OFMeterModCommand.MODIFY;
        case DELETE_VAL:
            return OFMeterModCommand.DELETE;
        default:
            throw new IllegalArgumentException("Illegal wire value for type OFMeterModCommand in version 1.5: " + val);
    }
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:13,代码来源:OFMeterModCommandSerializerVer15.java


示例11: toWireValue

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public static short toWireValue(OFMeterModCommand e) {
    switch(e) {
        case ADD:
            return ADD_VAL;
        case MODIFY:
            return MODIFY_VAL;
        case DELETE:
            return DELETE_VAL;
        default:
            throw new IllegalArgumentException("Illegal enum value for type OFMeterModCommand in version 1.5: " + e);
    }
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:13,代码来源:OFMeterModCommandSerializerVer15.java


示例12: add

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public OFMeterMod add() {
    validate();
    OFMeterMod.Builder builder = builderMeterMod();
    builder.setCommand(OFMeterModCommand.ADD.ordinal());
    return builder.build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:7,代码来源:MeterModBuilder.java


示例13: remove

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public OFMeterMod remove() {
    validate();
    OFMeterMod.Builder builder = builderMeterMod();
    builder.setCommand(OFMeterModCommand.DELETE.ordinal());
    return builder.build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:7,代码来源:MeterModBuilder.java


示例14: modify

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public OFMeterMod modify() {
    validate();
    OFMeterMod.Builder builder = builderMeterMod();
    builder.setCommand(OFMeterModCommand.MODIFY.ordinal());
    return builder.build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:7,代码来源:MeterModBuilder.java


示例15: writeTo

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public static void writeTo(ChannelBuffer bb, OFMeterModCommand e) {
    bb.writeShort(toWireValue(e));
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:4,代码来源:OFMeterModCommandSerializerVer13.java


示例16: putTo

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public static void putTo(OFMeterModCommand e, PrimitiveSink sink) {
    sink.putShort(toWireValue(e));
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:4,代码来源:OFMeterModCommandSerializerVer13.java


示例17: add

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public OFMeterMod add() {
    validate();
    OFMeterMod.Builder builder = builderMeterMod();
    builder.setCommand(OFMeterModCommand.ADD);
    return builder.build();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:7,代码来源:MeterModBuilder.java


示例18: remove

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public OFMeterMod remove() {
    validate();
    OFMeterMod.Builder builder = builderMeterMod();
    builder.setCommand(OFMeterModCommand.DELETE);
    return builder.build();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:7,代码来源:MeterModBuilder.java


示例19: modify

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public OFMeterMod modify() {
    validate();
    OFMeterMod.Builder builder = builderMeterMod();
    builder.setCommand(OFMeterModCommand.MODIFY);
    return builder.build();
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:7,代码来源:MeterModBuilder.java


示例20: writeTo

import org.projectfloodlight.openflow.protocol.OFMeterModCommand; //导入依赖的package包/类
public static void writeTo(ByteBuf bb, OFMeterModCommand e) {
    bb.writeShort(toWireValue(e));
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:4,代码来源:OFMeterModCommandSerializerVer13.java



注:本文中的org.projectfloodlight.openflow.protocol.OFMeterModCommand类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PurgeLogsRequestProto类代码示例发布时间:2022-05-22
下一篇:
Java DefaultTerminalFactory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap