- final Predicate<GroupingDefinition> filter = new Predicate<GroupingDefinition>() {
- @Override
- public boolean apply(final GroupingDefinition g) {
- return Objects.equal(g.getQName().getLocalName(),
- RESTCONF_MODULE_DRAFT02_RESTCONF_GROUPING_SCHEMA_NODE);
- }
- };
-
- Iterable<GroupingDefinition> filteredGroups = Iterables.filter(groupings, filter);
-
- final GroupingDefinition restconfGrouping = Iterables.getFirst(filteredGroups, null);
-
- List<DataSchemaNode> instanceDataChildrenByName =
- this.controllerContext.findInstanceDataChildrenByName(restconfGrouping,
- RESTCONF_MODULE_DRAFT02_RESTCONF_CONTAINER_SCHEMA_NODE);
- final DataSchemaNode restconfContainer = Iterables.getFirst(instanceDataChildrenByName, null);
-
- if (Objects.equal(schemaNodeName, RESTCONF_MODULE_DRAFT02_OPERATIONS_CONTAINER_SCHEMA_NODE)) {
- List<DataSchemaNode> instances =
- this.controllerContext.findInstanceDataChildrenByName(((DataNodeContainer) restconfContainer),
- RESTCONF_MODULE_DRAFT02_OPERATIONS_CONTAINER_SCHEMA_NODE);
- return Iterables.getFirst(instances, null);
- }
- else if(Objects.equal(schemaNodeName, RESTCONF_MODULE_DRAFT02_STREAMS_CONTAINER_SCHEMA_NODE)) {
- List<DataSchemaNode> instances =
- this.controllerContext.findInstanceDataChildrenByName(((DataNodeContainer) restconfContainer),
- RESTCONF_MODULE_DRAFT02_STREAMS_CONTAINER_SCHEMA_NODE);
- return Iterables.getFirst(instances, null);
- }
- else if(Objects.equal(schemaNodeName, RESTCONF_MODULE_DRAFT02_STREAM_LIST_SCHEMA_NODE)) {
- List<DataSchemaNode> instances =
- this.controllerContext.findInstanceDataChildrenByName(((DataNodeContainer) restconfContainer),
- RESTCONF_MODULE_DRAFT02_STREAMS_CONTAINER_SCHEMA_NODE);
- final DataSchemaNode modules = Iterables.getFirst(instances, null);
- instances = this.controllerContext.findInstanceDataChildrenByName(((DataNodeContainer) modules),
- RESTCONF_MODULE_DRAFT02_STREAM_LIST_SCHEMA_NODE);
- return Iterables.getFirst(instances, null);
- }
- else if(Objects.equal(schemaNodeName, RESTCONF_MODULE_DRAFT02_MODULES_CONTAINER_SCHEMA_NODE)) {
- List<DataSchemaNode> instances =
- this.controllerContext.findInstanceDataChildrenByName(((DataNodeContainer) restconfContainer),
- RESTCONF_MODULE_DRAFT02_MODULES_CONTAINER_SCHEMA_NODE);
- return Iterables.getFirst(instances, null);
- }
- else if(Objects.equal(schemaNodeName, RESTCONF_MODULE_DRAFT02_MODULE_LIST_SCHEMA_NODE)) {
- List<DataSchemaNode> instances =
- this.controllerContext.findInstanceDataChildrenByName(((DataNodeContainer) restconfContainer),
- RESTCONF_MODULE_DRAFT02_MODULES_CONTAINER_SCHEMA_NODE);
- final DataSchemaNode modules = Iterables.getFirst(instances, null);
- instances = this.controllerContext.findInstanceDataChildrenByName(((DataNodeContainer) modules),
- RESTCONF_MODULE_DRAFT02_MODULE_LIST_SCHEMA_NODE);
- return Iterables.getFirst(instances, null);
+ @Override
+ public StructuredData invokeRpc(final String identifier, final CompositeNode payload, final UriInfo uriInfo) {
+ final RpcExecutor rpc = this.resolveIdentifierInInvokeRpc(identifier);
+ QName rpcName = rpc.getRpcDefinition().getQName();
+ URI rpcNamespace = rpcName.getNamespace();
+ if (Objects.equal(rpcNamespace.toString(), SAL_REMOTE_NAMESPACE)
+ && Objects.equal(rpcName.getLocalName(), SAL_REMOTE_RPC_SUBSRCIBE)) {
+ return invokeSalRemoteRpcSubscribeRPC(payload, rpc.getRpcDefinition(), parsePrettyPrintParameter(uriInfo));