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


Java OFMeterModFailedCode类代码示例

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


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

示例1: readFrom

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

示例2: ofWireValue

import org.projectfloodlight.openflow.protocol.OFMeterModFailedCode; //导入依赖的package包/类
public static OFMeterModFailedCode ofWireValue(short val) {
    switch(val) {
        case UNKNOWN_VAL:
            return OFMeterModFailedCode.UNKNOWN;
        case METER_EXISTS_VAL:
            return OFMeterModFailedCode.METER_EXISTS;
        case INVALID_METER_VAL:
            return OFMeterModFailedCode.INVALID_METER;
        case UNKNOWN_METER_VAL:
            return OFMeterModFailedCode.UNKNOWN_METER;
        case BAD_COMMAND_VAL:
            return OFMeterModFailedCode.BAD_COMMAND;
        case BAD_FLAGS_VAL:
            return OFMeterModFailedCode.BAD_FLAGS;
        case BAD_RATE_VAL:
            return OFMeterModFailedCode.BAD_RATE;
        case BAD_BURST_VAL:
            return OFMeterModFailedCode.BAD_BURST;
        case BAD_BAND_VAL:
            return OFMeterModFailedCode.BAD_BAND;
        case BAD_BAND_VALUE_VAL:
            return OFMeterModFailedCode.BAD_BAND_VALUE;
        case OUT_OF_METERS_VAL:
            return OFMeterModFailedCode.OUT_OF_METERS;
        case OUT_OF_BANDS_VAL:
            return OFMeterModFailedCode.OUT_OF_BANDS;
        default:
            throw new IllegalArgumentException("Illegal wire value for type OFMeterModFailedCode in version 1.3: " + val);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:31,代码来源:OFMeterModFailedCodeSerializerVer13.java

示例3: toWireValue

import org.projectfloodlight.openflow.protocol.OFMeterModFailedCode; //导入依赖的package包/类
public static short toWireValue(OFMeterModFailedCode e) {
    switch(e) {
        case UNKNOWN:
            return UNKNOWN_VAL;
        case METER_EXISTS:
            return METER_EXISTS_VAL;
        case INVALID_METER:
            return INVALID_METER_VAL;
        case UNKNOWN_METER:
            return UNKNOWN_METER_VAL;
        case BAD_COMMAND:
            return BAD_COMMAND_VAL;
        case BAD_FLAGS:
            return BAD_FLAGS_VAL;
        case BAD_RATE:
            return BAD_RATE_VAL;
        case BAD_BURST:
            return BAD_BURST_VAL;
        case BAD_BAND:
            return BAD_BAND_VAL;
        case BAD_BAND_VALUE:
            return BAD_BAND_VALUE_VAL;
        case OUT_OF_METERS:
            return OUT_OF_METERS_VAL;
        case OUT_OF_BANDS:
            return OUT_OF_BANDS_VAL;
        default:
            throw new IllegalArgumentException("Illegal enum value for type OFMeterModFailedCode in version 1.3: " + e);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:31,代码来源:OFMeterModFailedCodeSerializerVer13.java

示例4: ofWireValue

import org.projectfloodlight.openflow.protocol.OFMeterModFailedCode; //导入依赖的package包/类
public static OFMeterModFailedCode ofWireValue(short val) {
    switch(val) {
        case UNKNOWN_VAL:
            return OFMeterModFailedCode.UNKNOWN;
        case METER_EXISTS_VAL:
            return OFMeterModFailedCode.METER_EXISTS;
        case INVALID_METER_VAL:
            return OFMeterModFailedCode.INVALID_METER;
        case UNKNOWN_METER_VAL:
            return OFMeterModFailedCode.UNKNOWN_METER;
        case BAD_COMMAND_VAL:
            return OFMeterModFailedCode.BAD_COMMAND;
        case BAD_FLAGS_VAL:
            return OFMeterModFailedCode.BAD_FLAGS;
        case BAD_RATE_VAL:
            return OFMeterModFailedCode.BAD_RATE;
        case BAD_BURST_VAL:
            return OFMeterModFailedCode.BAD_BURST;
        case BAD_BAND_VAL:
            return OFMeterModFailedCode.BAD_BAND;
        case BAD_BAND_VALUE_VAL:
            return OFMeterModFailedCode.BAD_BAND_VALUE;
        case OUT_OF_METERS_VAL:
            return OFMeterModFailedCode.OUT_OF_METERS;
        case OUT_OF_BANDS_VAL:
            return OFMeterModFailedCode.OUT_OF_BANDS;
        default:
            throw new IllegalArgumentException("Illegal wire value for type OFMeterModFailedCode in version 1.4: " + val);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:31,代码来源:OFMeterModFailedCodeSerializerVer14.java

示例5: toWireValue

import org.projectfloodlight.openflow.protocol.OFMeterModFailedCode; //导入依赖的package包/类
public static short toWireValue(OFMeterModFailedCode e) {
    switch(e) {
        case UNKNOWN:
            return UNKNOWN_VAL;
        case METER_EXISTS:
            return METER_EXISTS_VAL;
        case INVALID_METER:
            return INVALID_METER_VAL;
        case UNKNOWN_METER:
            return UNKNOWN_METER_VAL;
        case BAD_COMMAND:
            return BAD_COMMAND_VAL;
        case BAD_FLAGS:
            return BAD_FLAGS_VAL;
        case BAD_RATE:
            return BAD_RATE_VAL;
        case BAD_BURST:
            return BAD_BURST_VAL;
        case BAD_BAND:
            return BAD_BAND_VAL;
        case BAD_BAND_VALUE:
            return BAD_BAND_VALUE_VAL;
        case OUT_OF_METERS:
            return OUT_OF_METERS_VAL;
        case OUT_OF_BANDS:
            return OUT_OF_BANDS_VAL;
        default:
            throw new IllegalArgumentException("Illegal enum value for type OFMeterModFailedCode in version 1.4: " + e);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:31,代码来源:OFMeterModFailedCodeSerializerVer14.java

示例6: meterModError

import org.projectfloodlight.openflow.protocol.OFMeterModFailedCode; //导入依赖的package包/类
private void meterModError(OFMeterMod meterMod, OFMeterModFailedCode code,
                           Channel channel) {
    OFMeterModFailedErrorMsg errorMsg = FACTORY.errorMsgs()
            .buildMeterModFailedErrorMsg()
            .setXid(meterMod.getXid())
            .setCode(code)
            .build();
    channel.writeAndFlush(Collections.singletonList(errorMsg));
    log.debug("Sent meterMod error {}", code);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:11,代码来源:DefaultOFSwitch.java

示例7: processMeterMod

import org.projectfloodlight.openflow.protocol.OFMeterModFailedCode; //导入依赖的package包/类
private void processMeterMod(OFMeterMod meterMod, Channel channel) {
    log.debug("processing METER_MOD {} message", meterMod.getCommand());

    long meterModId = meterMod.getMeterId();
    Meter existingMeter = meterService.getMeter(deviceId, MeterId.meterId(meterModId));
    MeterRequest meterRequest = null;
    switch (meterMod.getCommand()) {
        case ADD:
            if (existingMeter != null) {
                meterModError(meterMod, OFMeterModFailedCode.METER_EXISTS, channel);
                return;
            }
            meterRequest = meterRequestBuilder(meterMod).add();
            break;
        case MODIFY:
            if (existingMeter == null) {
                meterModError(meterMod, OFMeterModFailedCode.UNKNOWN_METER, channel);
                return;
            }
            meterRequest = meterRequestBuilder(meterMod).add();
            break;
        case DELETE:
            // non-existing meter id will not result in OFMeterModFailedErrorMsg
            // being sent to the controller
            meterRequest = meterRequestBuilder(meterMod).remove();
            break;
        default:
            log.warn("Unexpected message {} received for switch {}",
                     meterMod.getCommand(), this);
            return;
    }
    meterService.submit(meterRequest);
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:34,代码来源:DefaultOFSwitch.java

示例8: readFrom

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

示例9: ofWireValue

import org.projectfloodlight.openflow.protocol.OFMeterModFailedCode; //导入依赖的package包/类
public static OFMeterModFailedCode ofWireValue(short val) {
    switch(val) {
        case UNKNOWN_VAL:
            return OFMeterModFailedCode.UNKNOWN;
        case METER_EXISTS_VAL:
            return OFMeterModFailedCode.METER_EXISTS;
        case INVALID_METER_VAL:
            return OFMeterModFailedCode.INVALID_METER;
        case UNKNOWN_METER_VAL:
            return OFMeterModFailedCode.UNKNOWN_METER;
        case BAD_COMMAND_VAL:
            return OFMeterModFailedCode.BAD_COMMAND;
        case BAD_FLAGS_VAL:
            return OFMeterModFailedCode.BAD_FLAGS;
        case BAD_RATE_VAL:
            return OFMeterModFailedCode.BAD_RATE;
        case BAD_BURST_VAL:
            return OFMeterModFailedCode.BAD_BURST;
        case BAD_BAND_VAL:
            return OFMeterModFailedCode.BAD_BAND;
        case BAD_BAND_VALUE_VAL:
            return OFMeterModFailedCode.BAD_BAND_VALUE;
        case OUT_OF_METERS_VAL:
            return OFMeterModFailedCode.OUT_OF_METERS;
        case OUT_OF_BANDS_VAL:
            return OFMeterModFailedCode.OUT_OF_BANDS;
        default:
            throw new IllegalArgumentException("Illegal wire value for type OFMeterModFailedCode in version 1.5: " + val);
    }
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:31,代码来源:OFMeterModFailedCodeSerializerVer15.java

示例10: toWireValue

import org.projectfloodlight.openflow.protocol.OFMeterModFailedCode; //导入依赖的package包/类
public static short toWireValue(OFMeterModFailedCode e) {
    switch(e) {
        case UNKNOWN:
            return UNKNOWN_VAL;
        case METER_EXISTS:
            return METER_EXISTS_VAL;
        case INVALID_METER:
            return INVALID_METER_VAL;
        case UNKNOWN_METER:
            return UNKNOWN_METER_VAL;
        case BAD_COMMAND:
            return BAD_COMMAND_VAL;
        case BAD_FLAGS:
            return BAD_FLAGS_VAL;
        case BAD_RATE:
            return BAD_RATE_VAL;
        case BAD_BURST:
            return BAD_BURST_VAL;
        case BAD_BAND:
            return BAD_BAND_VAL;
        case BAD_BAND_VALUE:
            return BAD_BAND_VALUE_VAL;
        case OUT_OF_METERS:
            return OUT_OF_METERS_VAL;
        case OUT_OF_BANDS:
            return OUT_OF_BANDS_VAL;
        default:
            throw new IllegalArgumentException("Illegal enum value for type OFMeterModFailedCode in version 1.5: " + e);
    }
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:31,代码来源:OFMeterModFailedCodeSerializerVer15.java

示例11: writeTo

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

示例12: putTo

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

示例13: writeTo

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


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