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


Java OFStatsType.FLOW属性代码示例

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


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

示例1: ofWireValue

public static OFStatsType ofWireValue(short val) {
    switch(val) {
        case DESC_VAL:
            return OFStatsType.DESC;
        case FLOW_VAL:
            return OFStatsType.FLOW;
        case AGGREGATE_VAL:
            return OFStatsType.AGGREGATE;
        case TABLE_VAL:
            return OFStatsType.TABLE;
        case PORT_VAL:
            return OFStatsType.PORT;
        case QUEUE_VAL:
            return OFStatsType.QUEUE;
        case GROUP_VAL:
            return OFStatsType.GROUP;
        case GROUP_DESC_VAL:
            return OFStatsType.GROUP_DESC;
        case GROUP_FEATURES_VAL:
            return OFStatsType.GROUP_FEATURES;
        case EXPERIMENTER_VAL:
            return OFStatsType.EXPERIMENTER;
        default:
            throw new IllegalArgumentException("Illegal wire value for type OFStatsType in version 1.2: " + val);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:26,代码来源:OFStatsTypeSerializerVer12.java

示例2: ofWireValue

public static OFStatsType ofWireValue(short val) {
    switch(val) {
        case DESC_VAL:
            return OFStatsType.DESC;
        case FLOW_VAL:
            return OFStatsType.FLOW;
        case AGGREGATE_VAL:
            return OFStatsType.AGGREGATE;
        case TABLE_VAL:
            return OFStatsType.TABLE;
        case PORT_VAL:
            return OFStatsType.PORT;
        case QUEUE_VAL:
            return OFStatsType.QUEUE;
        case EXPERIMENTER_VAL:
            return OFStatsType.EXPERIMENTER;
        default:
            throw new IllegalArgumentException("Illegal wire value for type OFStatsType in version 1.0: " + val);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:20,代码来源:OFStatsTypeSerializerVer10.java

示例3: ofWireValue

public static OFStatsType ofWireValue(short val) {
    switch(val) {
        case DESC_VAL:
            return OFStatsType.DESC;
        case FLOW_VAL:
            return OFStatsType.FLOW;
        case AGGREGATE_VAL:
            return OFStatsType.AGGREGATE;
        case TABLE_VAL:
            return OFStatsType.TABLE;
        case PORT_VAL:
            return OFStatsType.PORT;
        case QUEUE_VAL:
            return OFStatsType.QUEUE;
        case GROUP_VAL:
            return OFStatsType.GROUP;
        case GROUP_DESC_VAL:
            return OFStatsType.GROUP_DESC;
        case EXPERIMENTER_VAL:
            return OFStatsType.EXPERIMENTER;
        default:
            throw new IllegalArgumentException("Illegal wire value for type OFStatsType in version 1.1: " + val);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:24,代码来源:OFStatsTypeSerializerVer11.java

示例4: analyzeStatsReply

@SuppressWarnings("unused")
private void analyzeStatsReply(OFMessage reply) {
    log.info("recieved stats reply (xid = {} type: {}) from sw {} ",
            reply.getXid(), reply.getType(), getStringId());
    if (reply.getType() == OFType.STATS_REPLY) {
        OFStatsReply sr = (OFStatsReply) reply;
        if (sr.getStatsType() == OFStatsType.FLOW) {
            OFFlowStatsReply fsr = (OFFlowStatsReply) sr;
            log.info("received flow stats sw {} --> {}", getStringId(), fsr);
            // fsr.getEntries().get(0).getMatch().getMatchFields()
            for (OFFlowStatsEntry e : fsr.getEntries()) {
                for (MatchField<?> mf : e.getMatch().getMatchFields()) {
                    log.info("mf is exact: {} for {}: {}",
                            e.getMatch().isExact(mf),
                            mf.id,
                            e.getMatch().get(mf));
                }
            }

        }
    }
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:22,代码来源:OFSwitchImplBase.java

示例5: ofWireValue

public static OFStatsType ofWireValue(short val) {
    switch(val) {
        case DESC_VAL:
            return OFStatsType.DESC;
        case FLOW_VAL:
            return OFStatsType.FLOW;
        case AGGREGATE_VAL:
            return OFStatsType.AGGREGATE;
        case TABLE_VAL:
            return OFStatsType.TABLE;
        case PORT_VAL:
            return OFStatsType.PORT;
        case QUEUE_VAL:
            return OFStatsType.QUEUE;
        case GROUP_VAL:
            return OFStatsType.GROUP;
        case GROUP_DESC_VAL:
            return OFStatsType.GROUP_DESC;
        case GROUP_FEATURES_VAL:
            return OFStatsType.GROUP_FEATURES;
        case METER_VAL:
            return OFStatsType.METER;
        case METER_CONFIG_VAL:
            return OFStatsType.METER_CONFIG;
        case METER_FEATURES_VAL:
            return OFStatsType.METER_FEATURES;
        case TABLE_FEATURES_VAL:
            return OFStatsType.TABLE_FEATURES;
        case PORT_DESC_VAL:
            return OFStatsType.PORT_DESC;
        case EXPERIMENTER_VAL:
            return OFStatsType.EXPERIMENTER;
        default:
            throw new IllegalArgumentException("Illegal wire value for type OFStatsType in version 1.3: " + val);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:36,代码来源:OFStatsTypeSerializerVer13.java

示例6: ofWireValue

public static OFStatsType ofWireValue(short val) {
    switch(val) {
        case DESC_VAL:
            return OFStatsType.DESC;
        case FLOW_VAL:
            return OFStatsType.FLOW;
        case AGGREGATE_VAL:
            return OFStatsType.AGGREGATE;
        case TABLE_VAL:
            return OFStatsType.TABLE;
        case PORT_VAL:
            return OFStatsType.PORT;
        case QUEUE_VAL:
            return OFStatsType.QUEUE;
        case GROUP_VAL:
            return OFStatsType.GROUP;
        case GROUP_DESC_VAL:
            return OFStatsType.GROUP_DESC;
        case GROUP_FEATURES_VAL:
            return OFStatsType.GROUP_FEATURES;
        case METER_VAL:
            return OFStatsType.METER;
        case METER_CONFIG_VAL:
            return OFStatsType.METER_CONFIG;
        case METER_FEATURES_VAL:
            return OFStatsType.METER_FEATURES;
        case TABLE_FEATURES_VAL:
            return OFStatsType.TABLE_FEATURES;
        case PORT_DESC_VAL:
            return OFStatsType.PORT_DESC;
        case TABLE_DESC_VAL:
            return OFStatsType.TABLE_DESC;
        case QUEUE_DESC_VAL:
            return OFStatsType.QUEUE_DESC;
        case FLOW_MONITOR_VAL:
            return OFStatsType.FLOW_MONITOR;
        case EXPERIMENTER_VAL:
            return OFStatsType.EXPERIMENTER;
        default:
            throw new IllegalArgumentException("Illegal wire value for type OFStatsType in version 1.4: " + val);
    }
}
 
开发者ID:o3project,项目名称:openflowj-otn,代码行数:42,代码来源:OFStatsTypeSerializerVer14.java

示例7: getSwitchStatisticsForTable

protected List<?> getSwitchStatisticsForTable(long switchId,
        OFStatsType statType, String tableType) {
    IFloodlightProviderService floodlightProvider =
            (IFloodlightProviderService) getContext().getAttributes().
            get(IFloodlightProviderService.class.getCanonicalName());
    IOFSwitch sw = floodlightProvider.getSwitches().get(switchId);
    Future<List<OFStatsReply>> future;
    List<OFStatsReply> values = null;
    //getting tableId from CPqD driver
    TableId tableId;
    if (sw != null) {
        if ((tableId = ((OFSwitchImplSpringOpenTTP) sw).getTableId(tableType)) == null) {
            log.error("Invalid tableType {} " + tableType);
            return null;
        }
        OFStatsRequest<?> req = null;
        if (statType == OFStatsType.FLOW) {
            log.debug("Switch Flow Stats req for table {} sent to switch {}",
                    tableType,sw.getStringId());
            OFMatchV3 match = sw.getFactory().buildMatchV3()
                    .setOxmList(OFOxmList.EMPTY).build();
            req = sw.getFactory()
                    .buildFlowStatsRequest()
                    .setMatch(match)
                    .setOutPort(OFPort.ANY)
                    .setTableId(tableId)
                    .setXid(sw.getNextTransactionId()).build();
            List<OFFlowStatsEntryMod> flowStats = new ArrayList<OFFlowStatsEntryMod>();
            try {
                future = sw.getStatistics(req);
                values = future.get(10, TimeUnit.SECONDS);
                for(OFStatsReply value : values){
                    for (OFFlowStatsEntry entry : ((OFFlowStatsReply)value).getEntries()) {
                        OFFlowStatsEntryMod entryMod = new OFFlowStatsEntryMod(entry, sw);
                        flowStats.add(entryMod);
                    }
                }
                log.debug("Switch flow Stats Entries for table {} from switch {} are {}",
                        tableType, sw.getStringId(), flowStats);
            } catch (Exception e) {
                log.error("Failure retrieving per table statistics from switch " + sw, e);
            }
            return flowStats;
        }
    }
    //should never get to this point
    log.error("Failure retrieving  {} table statistics from switch {}",tableType, sw);
    return null;
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:49,代码来源:SwitchResourceBase.java

示例8: handleMessage

@Override
public void handleMessage(Dpid dpid, OFMessage msg) {
    if (providerService == null) {
        // We are shutting down, nothing to be done
        return;
    }
    DeviceId deviceId = DeviceId.deviceId(Dpid.uri(dpid));
    switch (msg.getType()) {
        case FLOW_REMOVED:
            OFFlowRemoved removed = (OFFlowRemoved) msg;

            FlowEntry fr = new FlowEntryBuilder(deviceId, removed, getDriver(deviceId)).build();
            providerService.flowRemoved(fr);
            break;
        case STATS_REPLY:
            if (((OFStatsReply) msg).getStatsType() == OFStatsType.FLOW) {
                pushFlowMetrics(dpid, (OFFlowStatsReply) msg, getDriver(deviceId));
            } else if (((OFStatsReply) msg).getStatsType() == OFStatsType.TABLE) {
                pushTableStatistics(dpid, (OFTableStatsReply) msg);
            } else if (((OFStatsReply) msg).getStatsType() == OFStatsType.FLOW_LIGHTWEIGHT) {
                pushFlowLightWeightMetrics(dpid, (OFFlowLightweightStatsReply) msg);
            }
            break;
        case BARRIER_REPLY:
            try {
                InternalCacheEntry entry = pendingBatches.getIfPresent(msg.getXid());
                if (entry != null) {
                    providerService
                            .batchOperationCompleted(msg.getXid(),
                                                     entry.completed());
                } else {
                    log.warn("Received unknown Barrier Reply: {}",
                             msg.getXid());
                }
            } finally {
                pendingBatches.invalidate(msg.getXid());
            }
            break;
        case ERROR:
            // TODO: This needs to get suppressed in a better way.
            if (msg instanceof OFBadRequestErrorMsg &&
                    ((OFBadRequestErrorMsg) msg).getCode() == OFBadRequestCode.BAD_TYPE) {
                log.debug("Received error message {} from {}", msg, dpid);
            } else {
                log.warn("Received error message {} from {}", msg, dpid);
            }
            handleErrorMsg(deviceId, msg);
            break;
        default:
            log.debug("Unhandled message type: {}", msg.getType());
    }
}
 
开发者ID:opennetworkinglab,项目名称:onos,代码行数:52,代码来源:OpenFlowRuleProvider.java

示例9: ofWireValue

public static OFStatsType ofWireValue(short val) {
    switch(val) {
        case DESC_VAL:
            return OFStatsType.DESC;
        case FLOW_VAL:
            return OFStatsType.FLOW;
        case AGGREGATE_VAL:
            return OFStatsType.AGGREGATE;
        case TABLE_VAL:
            return OFStatsType.TABLE;
        case PORT_VAL:
            return OFStatsType.PORT;
        case QUEUE_VAL:
            return OFStatsType.QUEUE;
        case GROUP_VAL:
            return OFStatsType.GROUP;
        case GROUP_DESC_VAL:
            return OFStatsType.GROUP_DESC;
        case GROUP_FEATURES_VAL:
            return OFStatsType.GROUP_FEATURES;
        case METER_VAL:
            return OFStatsType.METER;
        case METER_CONFIG_VAL:
            return OFStatsType.METER_CONFIG;
        case METER_FEATURES_VAL:
            return OFStatsType.METER_FEATURES;
        case TABLE_FEATURES_VAL:
            return OFStatsType.TABLE_FEATURES;
        case PORT_DESC_VAL:
            return OFStatsType.PORT_DESC;
        case TABLE_DESC_VAL:
            return OFStatsType.TABLE_DESC;
        case QUEUE_DESC_VAL:
            return OFStatsType.QUEUE_DESC;
        case FLOW_MONITOR_VAL:
            return OFStatsType.FLOW_MONITOR;
        case FLOW_LIGHTWEIGHT_VAL:
            return OFStatsType.FLOW_LIGHTWEIGHT;
        case CONTROLLER_STATUS_VAL:
            return OFStatsType.CONTROLLER_STATUS;
        case BUNDLE_FEATURES_VAL:
            return OFStatsType.BUNDLE_FEATURES;
        case EXPERIMENTER_VAL:
            return OFStatsType.EXPERIMENTER;
        default:
            throw new IllegalArgumentException("Illegal wire value for type OFStatsType in version 1.5: " + val);
    }
}
 
开发者ID:floodlight,项目名称:loxigen-artifacts,代码行数:48,代码来源:OFStatsTypeSerializerVer15.java


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