Indentation correction
diff --git a/src/main/java/net/floodlightcontroller/core/web/OFPortStatsEntryMod.java b/src/main/java/net/floodlightcontroller/core/web/OFPortStatsEntryMod.java
index 222f279..77dea99 100644
--- a/src/main/java/net/floodlightcontroller/core/web/OFPortStatsEntryMod.java
+++ b/src/main/java/net/floodlightcontroller/core/web/OFPortStatsEntryMod.java
@@ -7,17 +7,16 @@
@JsonSerialize(using = OFPortStatsEntrySerializer.class)
public class OFPortStatsEntryMod {
- private OFPortStatsEntry portStatsEntry = null;
+ private OFPortStatsEntry portStatsEntry = null;
- public OFPortStatsEntryMod() {
- }
+ public OFPortStatsEntryMod() {
+ }
- public OFPortStatsEntryMod(OFPortStatsEntry portStatsEntry) {
- this.portStatsEntry = portStatsEntry;
- }
+ public OFPortStatsEntryMod(OFPortStatsEntry portStatsEntry) {
+ this.portStatsEntry = portStatsEntry;
+ }
- public OFPortStatsEntry getPortStatsEntry() {
- return portStatsEntry;
- }
+ public OFPortStatsEntry getPortStatsEntry() {
+ return portStatsEntry;
+ }
}
-
diff --git a/src/main/java/net/floodlightcontroller/core/web/SwitchResourceBase.java b/src/main/java/net/floodlightcontroller/core/web/SwitchResourceBase.java
index 38b0d1e..5f7b94d 100644
--- a/src/main/java/net/floodlightcontroller/core/web/SwitchResourceBase.java
+++ b/src/main/java/net/floodlightcontroller/core/web/SwitchResourceBase.java
@@ -45,7 +45,7 @@
/**
* Base class for server resources related to switches
- *
+ *
* @author readams
*/
@@ -69,9 +69,8 @@
"from the switch",
recommendation = LogMessageDoc.CHECK_SWITCH + " " +
LogMessageDoc.GENERIC_ACTION)
-
protected List<OFStatsReply> getSwitchStatistics(long switchId,
- OFStatsType statType) {
+ OFStatsType statType) {
IFloodlightProviderService floodlightProvider =
(IFloodlightProviderService) getContext().getAttributes().
get(IFloodlightProviderService.class.getCanonicalName());
@@ -80,18 +79,18 @@
Future<List<OFStatsReply>> future;
List<OFStatsReply> values = null;
if (sw != null) {
- OFStatsRequest<?> req = null;
+ OFStatsRequest<?> req = null;
if (statType == OFStatsType.FLOW) {
- log.debug("Switch Flow Stats req sent for switch {}",
- sw.getStringId());
+ log.debug("Switch Flow Stats req sent for switch {}",
+ sw.getStringId());
OFMatchV3 match = sw.getFactory().buildMatchV3()
- .setOxmList(OFOxmList.EMPTY).build();
- req = sw.getFactory()
- .buildFlowStatsRequest()
- .setMatch(match)
- .setOutPort(OFPort.ANY)
- .setTableId(TableId.ALL)
- .setXid(sw.getNextTransactionId()).build();
+ .setOxmList(OFOxmList.EMPTY).build();
+ req = sw.getFactory()
+ .buildFlowStatsRequest()
+ .setMatch(match)
+ .setOutPort(OFPort.ANY)
+ .setTableId(TableId.ALL)
+ .setXid(sw.getNextTransactionId()).build();
} /*else if (statType == OFStatisticsType.AGGREGATE) {
OFAggregateStatisticsRequest specificReq = new OFAggregateStatisticsRequest();
OFMatch match = new OFMatch();
@@ -101,7 +100,7 @@
specificReq.setTableId((byte) 0xff);
req.setStatistics(Collections.singletonList((OFStatistics) specificReq));
requestLength += specificReq.getLength();
- } /*else if (statType == OFStatisticsType.QUEUE) {
+ } /*else if (statType == OFStatisticsType.QUEUE) {
OFQueueStatisticsRequest specificReq = new OFQueueStatisticsRequest();
specificReq.setPortNumber(OFPort.OFPP_ALL.getValue());
// LOOK! openflowj does not define OFPQ_ALL! pulled this from openflow.h
@@ -109,10 +108,10 @@
specificReq.setQueueId(0xffffffff);
req.setStatistics(Collections.singletonList((OFStatistics) specificReq));
requestLength += specificReq.getLength();
- } else if (statType == OFStatisticsType.DESC ||
+ } else if (statType == OFStatisticsType.DESC ||
statType == OFStatisticsType.TABLE) {
// pass - nothing todo besides set the type above
- }*/
+ }*/
// XXX S fix when we fix stats
try {
future = sw.getStatistics(req);
@@ -125,39 +124,40 @@
}
protected List<OFPortStatsEntryMod> getSwitchPortStatistics(long switchId) {
- IFloodlightProviderService floodlightProvider =
- (IFloodlightProviderService) getContext().getAttributes().
- get(IFloodlightProviderService.class.getCanonicalName());
+ IFloodlightProviderService floodlightProvider =
+ (IFloodlightProviderService) getContext().getAttributes().
+ get(IFloodlightProviderService.class.getCanonicalName());
- IOFSwitch sw = floodlightProvider.getSwitches().get(switchId);
- Future<List<OFStatsReply>> future;
- List<OFStatsReply> values = null;
- List<OFPortStatsEntryMod> portStats = null;
+ IOFSwitch sw = floodlightProvider.getSwitches().get(switchId);
+ Future<List<OFStatsReply>> future;
+ List<OFStatsReply> values = null;
+ List<OFPortStatsEntryMod> portStats = null;
- if (sw != null) {
- log.debug("Switch Port Stats: req sent for all "
- + "ports in switch {}", sw.getStringId());
- OFPortStatsRequest req = sw.getFactory()
- .buildPortStatsRequest()
- .setPortNo(OFPort.ANY).setXid
- (sw.getNextTransactionId()).build();
+ if (sw != null) {
+ log.debug("Switch Port Stats: req sent for all "
+ + "ports in switch {}", sw.getStringId());
+ OFPortStatsRequest req = sw.getFactory()
+ .buildPortStatsRequest()
+ .setPortNo(OFPort.ANY).setXid
+ (sw.getNextTransactionId()).build();
try {
future = sw.getStatistics(req);
values = future.get(10, TimeUnit.SECONDS);
portStats = new ArrayList<OFPortStatsEntryMod>();
- for (OFPortStatsEntry entry : ((OFPortStatsReply)values.get(0)).getEntries()) {
+ for (OFPortStatsEntry entry : ((OFPortStatsReply) values.get(0))
+ .getEntries()) {
OFPortStatsEntryMod entryMod = new OFPortStatsEntryMod(entry);
portStats.add(entryMod);
}
- log.debug("Switch Port Stats Entries from switch {} are {}",
- sw.getStringId(), portStats);
+ log.debug("Switch Port Stats Entries from switch {} are {}",
+ sw.getStringId(), portStats);
} catch (Exception e) {
log.error("Failure retrieving statistics from switch " + sw, e);
}
- }
+ }
- return portStats;
+ return portStats;
}
protected Object getSwitchStatistics(String switchId, OFStatsType statType) {
@@ -170,13 +170,13 @@
get(IFloodlightProviderService.class.getCanonicalName());
IOFSwitch sw = floodlightProvider.getSwitches().get(switchId);
- //uture<OFFeaturesReply> future;
+ // uture<OFFeaturesReply> future;
OFFeaturesReply featuresReply = null;
if (sw != null) {
- // XXX S fix when we fix stats
+ // XXX S fix when we fix stats
try {
- //future = sw.getFeaturesReplyFromSwitch();
- //featuresReply = future.get(10, TimeUnit.SECONDS);
+ // future = sw.getFeaturesReplyFromSwitch();
+ // featuresReply = future.get(10, TimeUnit.SECONDS);
} catch (Exception e) {
log.error("Failure getting features reply from switch" + sw, e);
}
diff --git a/src/main/java/net/floodlightcontroller/core/web/SwitchStatisticsResource.java b/src/main/java/net/floodlightcontroller/core/web/SwitchStatisticsResource.java
index 8c794ab..28be9a4 100644
--- a/src/main/java/net/floodlightcontroller/core/web/SwitchStatisticsResource.java
+++ b/src/main/java/net/floodlightcontroller/core/web/SwitchStatisticsResource.java
@@ -25,10 +25,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
/**
* Return switch statistics information for specific switches
- *
+ *
* @author readams
*/
public class SwitchStatisticsResource extends SwitchResourceBase {
@@ -61,6 +60,6 @@
result.put(switchId, values);
return result;
- //return toRepresentation(result, null);
+ // return toRepresentation(result, null);
}
}
diff --git a/src/main/java/net/floodlightcontroller/core/web/serializers/OFPortStatsEntrySerializer.java b/src/main/java/net/floodlightcontroller/core/web/serializers/OFPortStatsEntrySerializer.java
index c9293f7..cf3062a 100644
--- a/src/main/java/net/floodlightcontroller/core/web/serializers/OFPortStatsEntrySerializer.java
+++ b/src/main/java/net/floodlightcontroller/core/web/serializers/OFPortStatsEntrySerializer.java
@@ -18,9 +18,9 @@
@Override
public void serialize(OFPortStatsEntryMod portStatModEntry, JsonGenerator jGen,
- SerializerProvider sp) throws IOException, JsonGenerationException {
+ SerializerProvider sp) throws IOException, JsonGenerationException {
- OFPortStatsEntry portStatEntry = portStatModEntry.getPortStatsEntry();
+ OFPortStatsEntry portStatEntry = portStatModEntry.getPortStatsEntry();
jGen.writeStartObject();
jGen.writeNumberField("portNumber", portStatEntry.getPortNo().getPortNumber());
jGen.writeNumberField("receivePackets", portStatEntry.getRxPackets().getValue());
@@ -31,8 +31,10 @@
jGen.writeNumberField("transmitDropped", portStatEntry.getTxDropped().getValue());
jGen.writeNumberField("receiveErrors", portStatEntry.getRxErrors().getValue());
jGen.writeNumberField("transmitErrors", portStatEntry.getTxErrors().getValue());
- jGen.writeNumberField("receiveFrameErrors", portStatEntry.getRxFrameErr().getValue());
- jGen.writeNumberField("receiveOverrunErrors", portStatEntry.getRxOverErr().getValue());
+ jGen.writeNumberField("receiveFrameErrors", portStatEntry.getRxFrameErr()
+ .getValue());
+ jGen.writeNumberField("receiveOverrunErrors", portStatEntry.getRxOverErr()
+ .getValue());
jGen.writeNumberField("receiveCRCErrors", portStatEntry.getRxCrcErr().getValue());
jGen.writeNumberField("collisions", portStatEntry.getCollisions().getValue());