use of org.opendaylight.netconf.sal.rest.api.Draft02.RestConfModule in project netconf by opendaylight.
the class ControllerContext method getRestconfModuleRestConfSchemaNode.
public DataSchemaNode getRestconfModuleRestConfSchemaNode(final Module inRestconfModule, final String schemaNodeName) {
Module restconfModule = inRestconfModule;
if (restconfModule == null) {
restconfModule = getRestconfModule();
}
if (restconfModule == null) {
return null;
}
final Collection<? extends GroupingDefinition> groupings = restconfModule.getGroupings();
final Iterable<? extends GroupingDefinition> filteredGroups = Iterables.filter(groupings, g -> RestConfModule.RESTCONF_GROUPING_SCHEMA_NODE.equals(g.getQName().getLocalName()));
final GroupingDefinition restconfGrouping = Iterables.getFirst(filteredGroups, null);
final List<DataSchemaNode> instanceDataChildrenByName = findInstanceDataChildrenByName(restconfGrouping, RestConfModule.RESTCONF_CONTAINER_SCHEMA_NODE);
final DataSchemaNode restconfContainer = Iterables.getFirst(instanceDataChildrenByName, null);
if (RestConfModule.OPERATIONS_CONTAINER_SCHEMA_NODE.equals(schemaNodeName)) {
final List<DataSchemaNode> instances = findInstanceDataChildrenByName((DataNodeContainer) restconfContainer, RestConfModule.OPERATIONS_CONTAINER_SCHEMA_NODE);
return Iterables.getFirst(instances, null);
} else if (RestConfModule.STREAMS_CONTAINER_SCHEMA_NODE.equals(schemaNodeName)) {
final List<DataSchemaNode> instances = findInstanceDataChildrenByName((DataNodeContainer) restconfContainer, RestConfModule.STREAMS_CONTAINER_SCHEMA_NODE);
return Iterables.getFirst(instances, null);
} else if (RestConfModule.STREAM_LIST_SCHEMA_NODE.equals(schemaNodeName)) {
List<DataSchemaNode> instances = findInstanceDataChildrenByName((DataNodeContainer) restconfContainer, RestConfModule.STREAMS_CONTAINER_SCHEMA_NODE);
final DataSchemaNode modules = Iterables.getFirst(instances, null);
instances = findInstanceDataChildrenByName((DataNodeContainer) modules, RestConfModule.STREAM_LIST_SCHEMA_NODE);
return Iterables.getFirst(instances, null);
} else if (RestConfModule.MODULES_CONTAINER_SCHEMA_NODE.equals(schemaNodeName)) {
final List<DataSchemaNode> instances = findInstanceDataChildrenByName((DataNodeContainer) restconfContainer, RestConfModule.MODULES_CONTAINER_SCHEMA_NODE);
return Iterables.getFirst(instances, null);
} else if (RestConfModule.MODULE_LIST_SCHEMA_NODE.equals(schemaNodeName)) {
List<DataSchemaNode> instances = findInstanceDataChildrenByName((DataNodeContainer) restconfContainer, RestConfModule.MODULES_CONTAINER_SCHEMA_NODE);
final DataSchemaNode modules = Iterables.getFirst(instances, null);
instances = findInstanceDataChildrenByName((DataNodeContainer) modules, RestConfModule.MODULE_LIST_SCHEMA_NODE);
return Iterables.getFirst(instances, null);
} else if (RestConfModule.STREAMS_CONTAINER_SCHEMA_NODE.equals(schemaNodeName)) {
final List<DataSchemaNode> instances = findInstanceDataChildrenByName((DataNodeContainer) restconfContainer, RestConfModule.STREAMS_CONTAINER_SCHEMA_NODE);
return Iterables.getFirst(instances, null);
}
return null;
}
use of org.opendaylight.netconf.sal.rest.api.Draft02.RestConfModule in project netconf by opendaylight.
the class ControllerContext method getRestconfModuleErrorsSchemaNode.
public DataSchemaNode getRestconfModuleErrorsSchemaNode() {
final Module restconfModule = getRestconfModule();
if (restconfModule == null) {
return null;
}
final Collection<? extends GroupingDefinition> groupings = restconfModule.getGroupings();
final Iterable<? extends GroupingDefinition> filteredGroups = Iterables.filter(groupings, g -> RestConfModule.ERRORS_GROUPING_SCHEMA_NODE.equals(g.getQName().getLocalName()));
final GroupingDefinition restconfGrouping = Iterables.getFirst(filteredGroups, null);
final List<DataSchemaNode> instanceDataChildrenByName = findInstanceDataChildrenByName(restconfGrouping, RestConfModule.ERRORS_CONTAINER_SCHEMA_NODE);
return Iterables.getFirst(instanceDataChildrenByName, null);
}
Aggregations