本文整理汇总了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());
}
示例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
}
示例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
}
示例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;
}
示例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;
}
}
示例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;
}
示例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();
}
}
示例8: processGroupDesc
import org.projectfloodlight.openflow.protocol.OFGroupDescStatsReply; //导入依赖的package包/类
private void processGroupDesc(OFGroupDescStatsReply gdsr) {
log.info("Sw: {} Group Desc {}", getStringId(), gdsr);
}