X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fprotocol_plugins%2Fstub%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotocol_plugins%2Fstub%2Finternal%2FReadService.java;h=27ba897fdfc57b44e0d2d4c2ae391ffeae9364c3;hp=68bd3af751036c6a7c7a120e0813844efe4b0ed8;hb=e2f7aaa41e482815ca1d4495eb85c8653cd903ab;hpb=61c918367bb084e048b03e12c60282cb689cddea diff --git a/opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/ReadService.java b/opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/ReadService.java index 68bd3af751..27ba897fdf 100644 --- a/opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/ReadService.java +++ b/opendaylight/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/ReadService.java @@ -36,6 +36,7 @@ import org.opendaylight.controller.sal.action.SwPath; import org.opendaylight.controller.sal.core.ConstructionException; import org.opendaylight.controller.sal.core.Node; import org.opendaylight.controller.sal.core.NodeConnector; +import org.opendaylight.controller.sal.core.NodeTable; import org.opendaylight.controller.sal.flowprogrammer.Flow; import org.opendaylight.controller.sal.match.Match; import org.opendaylight.controller.sal.match.MatchType; @@ -43,7 +44,7 @@ import org.opendaylight.controller.sal.reader.FlowOnNode; import org.opendaylight.controller.sal.reader.IPluginInReadService; import org.opendaylight.controller.sal.reader.NodeConnectorStatistics; import org.opendaylight.controller.sal.reader.NodeDescription; - +import org.opendaylight.controller.sal.reader.NodeTableStatistics; /** * Stub Implementation for IPluginInReadService used by SAL * @@ -233,4 +234,33 @@ public class ReadService implements IPluginInReadService { return 100; } + @Override + public NodeTableStatistics readNodeTable(NodeTable table, boolean b) { + NodeTableStatistics stats = new NodeTableStatistics(); + stats.setNodeTable(table); + stats.setActiveCount(4); + stats.setLookupCount(4); + stats.setMatchedCount(4); + + return stats; + } + + @Override + public List readAllNodeTable(Node node, boolean cached) { + NodeTableStatistics stats = new NodeTableStatistics(); + try { + NodeTable nt = new NodeTable(NodeTable.NodeTableIDType.OPENFLOW, Byte.valueOf("10"), node); + stats.setNodeTable(nt); + } catch (ConstructionException e) { + // couldn't create nodetable. + } + + stats.setActiveCount(4); + stats.setLookupCount(4); + stats.setMatchedCount(4); + + List result = new ArrayList(); + result.add(stats); + return result; + } }