- broker.registerToListenDataChanges(listener);
-
- final UriBuilder uriBuilder = uriInfo.getAbsolutePathBuilder();
- UriBuilder port = uriBuilder.port(WebSocketServer.getInstance().getPort());
- final URI uriToWebsocketServer = port.replacePath(streamName).build();
-
- return Response.status(Status.OK).location(uriToWebsocketServer).build();
- }
-
- private Module findModule(final MountInstance mountPoint, final CompositeNode data) {
- if (data instanceof CompositeNodeWrapper) {
- return findModule(mountPoint, (CompositeNodeWrapper) data);
- } else if (data != null) {
- URI namespace = data.getNodeType().getNamespace();
- if (mountPoint != null) {
- return this.controllerContext.findModuleByNamespace(mountPoint, namespace);
- } else {
- return this.controllerContext.findModuleByNamespace(namespace);
- }
- } else {
- throw new IllegalArgumentException("Unhandled parameter types: "
- + Arrays.<Object> asList(mountPoint, data).toString());
- }
- }
-
- private Module findModule(final MountInstance mountPoint, final CompositeNodeWrapper data) {
- URI namespace = data.getNamespace();
- Preconditions.<URI> checkNotNull(namespace);
-
- Module module = null;
- if (mountPoint != null) {
- module = this.controllerContext.findModuleByNamespace(mountPoint, namespace);
- if (module == null) {
- module = this.controllerContext.findModuleByName(mountPoint, namespace.toString());
- }
- } else {
- module = this.controllerContext.findModuleByNamespace(namespace);
- if (module == null) {
- module = this.controllerContext.findModuleByName(namespace.toString());
- }
- }
-
- return module;
- }
-
- private InstanceIdWithSchemaNode addLastIdentifierFromData(final InstanceIdWithSchemaNode identifierWithSchemaNode,
- final CompositeNode data, final DataSchemaNode schemaOfData) {
- InstanceIdentifier instanceIdentifier = null;
- if (identifierWithSchemaNode != null) {
- instanceIdentifier = identifierWithSchemaNode.getInstanceIdentifier();
- }
-
- final InstanceIdentifier iiOriginal = instanceIdentifier;
- InstanceIdentifierBuilder iiBuilder = null;
- if (iiOriginal == null) {
- iiBuilder = InstanceIdentifier.builder();
- } else {
- iiBuilder = InstanceIdentifier.builder(iiOriginal);
- }
-
- if ((schemaOfData instanceof ListSchemaNode)) {
- HashMap<QName, Object> keys = this.resolveKeysFromData(((ListSchemaNode) schemaOfData), data);
- iiBuilder.nodeWithKey(schemaOfData.getQName(), keys);
- } else {
- iiBuilder.node(schemaOfData.getQName());
+ final Map<String, String> paramToValues = resolveValuesFromUri(identifier);
+ final LogicalDatastoreType datastore = parserURIEnumParameter(LogicalDatastoreType.class,
+ paramToValues.get(DATASTORE_PARAM_NAME));
+ if (datastore == null) {
+ throw new RestconfDocumentedException("Stream name doesn't contains datastore value (pattern /datastore=)",
+ ErrorType.APPLICATION, ErrorTag.MISSING_ATTRIBUTE);