+
+ public BigInteger getOperationalReceived() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ private MapNode makeModuleMapNode(final Set<Module> modules) {
+ Preconditions.checkNotNull(modules);
+ final Module restconfModule = getRestconfModule();
+ final DataSchemaNode moduleSchemaNode = controllerContext.getRestconfModuleRestConfSchemaNode(
+ restconfModule, Draft02.RestConfModule.MODULE_LIST_SCHEMA_NODE);
+ Preconditions.checkState(moduleSchemaNode instanceof ListSchemaNode);
+
+ final CollectionNodeBuilder<MapEntryNode, MapNode> listModuleBuilder = Builders
+ .mapBuilder((ListSchemaNode) moduleSchemaNode);
+
+ for (final Module module : modules) {
+ listModuleBuilder.withChild(toModuleEntryNode(module, moduleSchemaNode));
+ }
+ return listModuleBuilder.build();
+ }
+
+ protected MapEntryNode toModuleEntryNode(final Module module, final DataSchemaNode moduleSchemaNode) {
+ Preconditions.checkArgument(moduleSchemaNode instanceof ListSchemaNode,
+ "moduleSchemaNode has to be of type ListSchemaNode");\r final ListSchemaNode listModuleSchemaNode = (ListSchemaNode) moduleSchemaNode;\r final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> moduleNodeValues = Builders\r .mapEntryBuilder(listModuleSchemaNode);\r\r List<DataSchemaNode> instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(\r (listModuleSchemaNode), "name");\r final DataSchemaNode nameSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);\r Preconditions.checkState(nameSchemaNode instanceof LeafSchemaNode);\r moduleNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) nameSchemaNode).withValue(module.getName())\r .build());\r\r instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(\r (listModuleSchemaNode), "revision");\r final DataSchemaNode revisionSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);\r Preconditions.checkState(revisionSchemaNode instanceof LeafSchemaNode);\r final String revision = REVISION_FORMAT.format(module.getRevision());\r moduleNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) revisionSchemaNode).withValue(revision)\r .build());\r\r instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(\r (listModuleSchemaNode), "namespace");\r final DataSchemaNode namespaceSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);\r Preconditions.checkState(namespaceSchemaNode instanceof LeafSchemaNode);\r moduleNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) namespaceSchemaNode)\r .withValue(module.getNamespace().toString()).build());\r\r instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(\r (listModuleSchemaNode), "feature");\r final DataSchemaNode featureSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);\r Preconditions.checkState(featureSchemaNode instanceof LeafListSchemaNode);\r final ListNodeBuilder<Object, LeafSetEntryNode<Object>> featuresBuilder = Builders\r .leafSetBuilder((LeafListSchemaNode) featureSchemaNode);\r for (final FeatureDefinition feature : module.getFeatures()) {\r featuresBuilder.withChild(Builders.leafSetEntryBuilder(((LeafListSchemaNode) featureSchemaNode))\r .withValue(feature.getQName().getLocalName()).build());\r }\r moduleNodeValues.withChild(featuresBuilder.build());
+\r return moduleNodeValues.build();\r }
+
+ protected MapEntryNode toStreamEntryNode(final String streamName, final DataSchemaNode streamSchemaNode) {
+ Preconditions.checkArgument(streamSchemaNode instanceof ListSchemaNode,
+ "streamSchemaNode has to be of type ListSchemaNode");
+ final ListSchemaNode listStreamSchemaNode = (ListSchemaNode) streamSchemaNode;
+ final DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> streamNodeValues = Builders
+ .mapEntryBuilder(listStreamSchemaNode);
+
+ List<DataSchemaNode> instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(
+ (listStreamSchemaNode), "name");
+ final DataSchemaNode nameSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);
+ Preconditions.checkState(nameSchemaNode instanceof LeafSchemaNode);
+ streamNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) nameSchemaNode).withValue(streamName)
+ .build());
+
+ instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(
+ (listStreamSchemaNode), "description");
+ final DataSchemaNode descriptionSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);
+ Preconditions.checkState(descriptionSchemaNode instanceof LeafSchemaNode);
+ streamNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) nameSchemaNode)
+ .withValue("DESCRIPTION_PLACEHOLDER").build());
+
+ instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(
+ (listStreamSchemaNode), "replay-support");
+ final DataSchemaNode replaySupportSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);
+ Preconditions.checkState(replaySupportSchemaNode instanceof LeafSchemaNode);
+ streamNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) replaySupportSchemaNode)
+ .withValue(Boolean.valueOf(true)).build());
+
+ instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(
+ (listStreamSchemaNode), "replay-log-creation-time");
+ final DataSchemaNode replayLogCreationTimeSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);
+ Preconditions.checkState(replayLogCreationTimeSchemaNode instanceof LeafSchemaNode);
+ streamNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) replayLogCreationTimeSchemaNode)
+ .withValue("").build());
+
+ instanceDataChildrenByName = ControllerContext.findInstanceDataChildrenByName(
+ (listStreamSchemaNode), "events");
+ final DataSchemaNode eventsSchemaNode = Iterables.getFirst(instanceDataChildrenByName, null);
+ Preconditions.checkState(eventsSchemaNode instanceof LeafSchemaNode);
+ streamNodeValues.withChild(Builders.leafBuilder((LeafSchemaNode) eventsSchemaNode)
+ .withValue("").build());
+
+ return streamNodeValues.build();
+ }