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


Java OFGroupDescStatsReply类代码示例

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


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

示例1: groupStatsEvent

import org.projectfloodlight.openflow.protocol.OFGroupDescStatsReply; //导入依赖的package包/类
@Test
public void groupStatsEvent() {
    TestOpenFlowGroupProviderService testProviderService =
            (TestOpenFlowGroupProviderService) providerService;

    OFGroupStatsReply.Builder rep1 =
            OFFactories.getFactory(OFVersion.OF_13).buildGroupStatsReply();
    rep1.setXid(1);
    controller.processPacket(dpid1, rep1.build());
    OFGroupDescStatsReply.Builder rep2 =
            OFFactories.getFactory(OFVersion.OF_13).buildGroupDescStatsReply();
    assertNull("group entries is not set yet", testProviderService.getGroupEntries());

    rep2.setXid(2);
    controller.processPacket(dpid1, rep2.build());
    assertNotNull("group entries should be set", testProviderService.getGroupEntries());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:OpenFlowGroupProviderTest.java

示例2: serializeGroupDescReply

import org.projectfloodlight.openflow.protocol.OFGroupDescStatsReply; //导入依赖的package包/类
/***
 * Serializes Group Desc Reply
 * @author Naveen
 * @param groupDescReplies
 * @param jGen
 * @throws IOException
 * @throws JsonProcessingException
 */
public static void serializeGroupDescReply(List<OFGroupDescStatsReply> groupDescReplies, JsonGenerator jGen) throws IOException, JsonProcessingException{
	OFGroupDescStatsReply groupDescReply = groupDescReplies.get(0);
	jGen.writeStringField("version", groupDescReply.getVersion().toString()); //return the enum name
	jGen.writeFieldName("groupDesc");
	jGen.writeStartArray();
	for(OFGroupDescStatsEntry entry : groupDescReply.getEntries()) {
		jGen.writeStartObject();                        
		jGen.writeStringField("groupType",entry.getGroupType().toString());
		jGen.writeStringField("groupNumber",entry.getGroup().toString());                                               
		jGen.writeFieldName("buckets");            
		jGen.writeStartArray();            
		for(OFBucket buckets : entry.getBuckets()) {            	
			jGen.writeStartObject();
			jGen.writeNumberField("weight", buckets.getWeight());
			jGen.writeNumberField("watchPortNumber", buckets.getWatchPort().getPortNumber());
			jGen.writeStringField("watchGroup", buckets.getWatchGroup().toString());            	
			OFActionListSerializer.serializeActions(jGen, buckets.getActions());            	
			jGen.writeEndObject();
		}//End of for loop - buckets
		jGen.writeEndArray();//end of buckets            
		jGen.writeEndObject();//end of group Desc iteration
	}//End of for loop - GroupDescStats
	jGen.writeEndArray();//end of group Desc
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:33,代码来源:StatsReplySerializer.java

示例3: serializeGroupDescReply

import org.projectfloodlight.openflow.protocol.OFGroupDescStatsReply; //导入依赖的package包/类
/***
 * Serializes Group Desc Reply
 * @author Naveen
 * @param groupDescReplies
 * @param jGen
 * @throws IOException
 * @throws JsonProcessingException
 */
public static void serializeGroupDescReply(List<OFGroupDescStatsReply> groupDescReplies, JsonGenerator jGen) throws IOException, JsonProcessingException{
	OFGroupDescStatsReply groupDescReply = groupDescReplies.get(0);
	jGen.writeStringField("version", groupDescReply.getVersion().toString()); //return the enum name
	jGen.writeFieldName("groupDesc");
	jGen.writeStartArray();
	for(OFGroupDescStatsEntry entry : groupDescReply.getEntries()) {
		jGen.writeStartObject();
		jGen.writeStringField("groupType",entry.getGroupType().toString());
		jGen.writeStringField("groupNumber",entry.getGroup().toString());
		jGen.writeFieldName("buckets");
		jGen.writeStartArray();
		for(OFBucket buckets : entry.getBuckets()) {
			jGen.writeStartObject();
			jGen.writeNumberField("weight", buckets.getWeight());
			jGen.writeNumberField("watchPortNumber", buckets.getWatchPort().getPortNumber());
			jGen.writeStringField("watchGroup", buckets.getWatchGroup().toString());
			OFActionListSerializer.serializeActions(jGen, buckets.getActions());
			jGen.writeEndObject();
		}//End of for loop - buckets
		jGen.writeEndArray();//end of buckets
		jGen.writeEndObject();//end of group Desc iteration
	}//End of for loop - GroupDescStats
	jGen.writeEndArray();//end of group Desc
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:33,代码来源:StatsReplySerializer.java

示例4: publishGroupDescStats

import org.projectfloodlight.openflow.protocol.OFGroupDescStatsReply; //导入依赖的package包/类
private synchronized Collection<OFGroupDescStatsEntry> publishGroupDescStats(Dpid dpid,
                                                                             OFGroupDescStatsReply reply) {
    //TODO: Get rid of synchronized
    fullGroupDescStats.putAll(dpid, reply.getEntries());
    if (!reply.getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
        return fullGroupDescStats.removeAll(dpid);
    }
    return null;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:10,代码来源:OpenFlowControllerImpl.java

示例5: processStatsReply

import org.projectfloodlight.openflow.protocol.OFGroupDescStatsReply; //导入依赖的package包/类
private void processStatsReply(OFStatsReply sr) {
    switch (sr.getStatsType()) {
    case AGGREGATE:
        break;
    case DESC:
        break;
    case EXPERIMENTER:
        break;
    case FLOW:
        break;
    case GROUP_DESC:
        processGroupDesc((OFGroupDescStatsReply) sr);
        break;
    case GROUP_FEATURES:
        processGroupFeatures((OFGroupFeaturesStatsReply) sr);
        break;
    case METER_CONFIG:
        break;
    case METER_FEATURES:
        break;
    case PORT_DESC:
        break;
    case TABLE_FEATURES:
        break;
    default:
        break;

    }
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:30,代码来源:OFSwitchImplCPqD13.java

示例6: publishGroupDescStats

import org.projectfloodlight.openflow.protocol.OFGroupDescStatsReply; //导入依赖的package包/类
private synchronized Collection<OFGroupDescStatsEntry> publishGroupDescStats(Dpid dpid,
                                                              OFGroupDescStatsReply reply) {
    //TODO: Get rid of synchronized
    fullGroupDescStats.putAll(dpid, reply.getEntries());
    if (!reply.getFlags().contains(OFStatsReplyFlags.REPLY_MORE)) {
        return fullGroupDescStats.removeAll(dpid);
    }
    return null;
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:10,代码来源:OpenFlowControllerImpl.java

示例7: processGroupDesc

import org.projectfloodlight.openflow.protocol.OFGroupDescStatsReply; //导入依赖的package包/类
private void processGroupDesc(OFGroupDescStatsReply gdsr) {
    log.info("Sw: {} Group Desc {} in driverState {} ", getStringId(), gdsr,
            driverState);

    if (driverState == DriverState.AUDIT_GROUPS)
    {
        auditBucketToGroupIds = new ConcurrentHashMap<List<BucketInfo>, List<Integer>>();
        for (OFGroupDescStatsEntry entry : gdsr.getEntries()) {
            int groupId = entry.getGroup().getGroupNumber();
            OFGroupType groupType = entry.getGroupType();
            List<OFBucket> buckets = entry.getBuckets();
            List<BucketInfo> driverBuckets = new ArrayList<BucketInfo>();
            for (OFBucket bucket : buckets) {
                driverBuckets.add(getDriverBucketFromOFBucket(bucket));
            }
            Collections.sort(driverBuckets);
            List<Integer> groupIds = auditBucketToGroupIds.get(driverBuckets);
            if (groupIds == null)
                groupIds = new ArrayList<Integer>();
            groupIds.add(groupId);
            auditBucketToGroupIds.put(driverBuckets, groupIds);
            ecmpGroups.put(groupId, new EcmpInfo(groupId, groupType, driverBuckets));
        }
        log.debug("processGroupDesc: Groups that are present in "
                + "switch {} are {} ", getStringId(), ecmpGroups);
    }
    else {
        // TODO -- actually do verification
    }
    try {
        nextDriverState();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
 
开发者ID:opennetworkinglab,项目名称:spring-open,代码行数:37,代码来源:OFSwitchImplSpringOpenTTP.java

示例8: processGroupDesc

import org.projectfloodlight.openflow.protocol.OFGroupDescStatsReply; //导入依赖的package包/类
private void processGroupDesc(OFGroupDescStatsReply gdsr) {
    log.info("Sw: {} Group Desc {}", getStringId(), gdsr);
}
 
开发者ID:ravikumaran2015,项目名称:ravikumaran201504,代码行数:4,代码来源:OFSwitchImplCPqD13.java


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