Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Added distributionManagement section to md-sal parent pom."
[controller.git]
/
opendaylight
/
protocol_plugins
/
openflow
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
protocol_plugin
/
openflow
/
internal
/
DescStatisticsConverter.java
diff --git
a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DescStatisticsConverter.java
b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DescStatisticsConverter.java
index 33918c5cde837722777da102f61a5da5e16eda09..28c3dd6b4f7b0df028291dfa9d8d481201806086 100644
(file)
--- a/
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DescStatisticsConverter.java
+++ b/
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DescStatisticsConverter.java
@@
-1,4
+1,3
@@
-
/*
* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
*
/*
* Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
*
@@
-11,25
+10,30
@@
package org.opendaylight.controller.protocol_plugin.openflow.internal;
import java.util.List;
import java.util.List;
+import org.opendaylight.controller.sal.reader.NodeDescription;
import org.openflow.protocol.statistics.OFDescriptionStatistics;
import org.openflow.protocol.statistics.OFStatistics;
import org.openflow.protocol.statistics.OFDescriptionStatistics;
import org.openflow.protocol.statistics.OFStatistics;
-
-import org.
opendaylight.controller.sal.reader.NodeDescription
;
+import org.slf4j.Logger;
+import org.
slf4j.LoggerFactory
;
/**
/**
- * Utility class for converting openflow description statistics
- * into SAL NodeDescription object
- *
- *
- *
+ * Utility class for converting openflow description statistics into SAL
+ * NodeDescription object
*/
public class DescStatisticsConverter {
*/
public class DescStatisticsConverter {
+ private static final Logger log = LoggerFactory
+ .getLogger(DescStatisticsConverter.class);
NodeDescription hwDesc;
OFDescriptionStatistics ofDesc;
public DescStatisticsConverter(List<OFStatistics> statsList) {
this.hwDesc = null;
NodeDescription hwDesc;
OFDescriptionStatistics ofDesc;
public DescStatisticsConverter(List<OFStatistics> statsList) {
this.hwDesc = null;
- this.ofDesc = (OFDescriptionStatistics) statsList.get(0);
+ this.ofDesc = (statsList == null || statsList.isEmpty())?
+ null : (OFDescriptionStatistics) statsList.get(0);
+ }
+ public DescStatisticsConverter(OFDescriptionStatistics desc) {
+ this.hwDesc = null;
+ this.ofDesc = desc;
}
public NodeDescription getHwDescription() {
}
public NodeDescription getHwDescription() {
@@
-38,9
+42,11
@@
public class DescStatisticsConverter {
hwDesc.setManufacturer(ofDesc.getManufacturerDescription());
hwDesc.setHardware(ofDesc.getHardwareDescription());
hwDesc.setSoftware(ofDesc.getSoftwareDescription());
hwDesc.setManufacturer(ofDesc.getManufacturerDescription());
hwDesc.setHardware(ofDesc.getHardwareDescription());
hwDesc.setSoftware(ofDesc.getSoftwareDescription());
- hwDesc.set
SdnProtocol
Description(ofDesc.getDatapathDescription());
+ hwDesc.setDescription(ofDesc.getDatapathDescription());
hwDesc.setSerialNumber(ofDesc.getSerialNumber());
}
hwDesc.setSerialNumber(ofDesc.getSerialNumber());
}
+ log.trace("OFDescriptionStatistics: {}", ofDesc);
+ log.trace("NodeDescription: {}", hwDesc);
return hwDesc;
}
return hwDesc;
}