@Override public QName getQName() { return path.getLastComponent(); }
@Override public QName getQName() { return path.getLastComponent(); }
@Override public QName getQName() { return schemaPath.getLastComponent(); }
@Override public final QName getQName() { return path.getLastComponent(); }
@Override public RpcServiceInvoker call() { final Map<QName, Method> map = new HashMap<>(); for (Entry<SchemaPath, Method> e : localNameToMethod.entrySet()) { map.put(e.getKey().getLastComponent(), e.getValue()); } return RpcServiceInvoker.from(map); } });
static NormalizedNode<?, ?> withContextRef(final SchemaPath rpcName, final DataObject data, final LeafNode<?> contextRef, final BindingNormalizedNodeSerializer codec) { return new WithContextRef(rpcName.getLastComponent(), data, contextRef, codec); }
static NormalizedNode<?, ?> create(final SchemaPath rpcName, final DataObject data, final BindingNormalizedNodeSerializer codec) { return new LazySerializedContainerNode(rpcName.getLastComponent(), data, codec); }
static final SchemaPath typeEffectiveSchemaPath(final StmtContext<?, ?, ?> stmtCtx) { final SchemaPath path = stmtCtx.getSchemaPath().get(); final SchemaPath parent = path.getParent(); final QName parentQName = parent.getLastComponent(); Preconditions.checkArgument(parentQName != null, "Path %s has an empty parent", path); final QName qname = stmtCtx.getFromNamespace(QNameCacheNamespace.class, QName.create(parentQName, path.getLastComponent().getLocalName())); return parent.createChild(qname); } }
public ConnectionNotificationTopicRegistration(String SourceName, DOMNotificationListener domNotificationListener) { super(NotificationSourceType.ConnectionStatusChange, SourceName, EVENT_SOURCE_STATUS_PATH.getLastComponent().getNamespace().toString()); this.domNotificationListener = Preconditions.checkNotNull(domNotificationListener); LOG.info("Connection notification source has been initialized."); setActive(true); setReplaySupported(false); }
@Override public void onRpcAvailable(@Nonnull final Collection<DOMRpcIdentifier> rpcs) { Preconditions.checkArgument(rpcs != null, "Input Collection of DOMRpcIdentifier can not be null."); if (LOG.isDebugEnabled()) { LOG.debug("Adding registration for [{}]", rpcs); } final List<RpcRouter.RouteIdentifier<?,?,?>> routeIds = new ArrayList<>(); for (final DOMRpcIdentifier rpc : rpcs) { final RpcRouter.RouteIdentifier<?,?,?> routeId = new RouteIdentifierImpl(null, rpc.getType().getLastComponent(), rpc.getContextReference()); routeIds.add(routeId); } final RpcRegistry.Messages.AddOrUpdateRoutes addRpcMsg = new RpcRegistry.Messages.AddOrUpdateRoutes(routeIds); rpcRegistry.tell(addRpcMsg, ActorRef.noSender()); }
private static boolean isDependencyContainer(final DataNodeContainer dataNodeContainer) { if(dataNodeContainer.getUses().size() != 1) { return false; } UsesNode onlyUses = dataNodeContainer.getUses().iterator().next(); if(onlyUses.getGroupingPath().getLastComponent().equals(ServiceRef.QNAME) == false) { return false; } return getChildNodeSizeWithoutUses(dataNodeContainer) == 0; }
public static ExecuteRpc from(final DOMRpcIdentifier rpc, final NormalizedNode<?, ?> input) { final Node serializedInput; if(input != null) { serializedInput = NormalizedNodeSerializer.serialize(input); } else { serializedInput = null; } return new ExecuteRpc(serializedInput, rpc.getType().getLastComponent()); }
@Override public RpcResult<?> apply(final DOMRpcResult input) { final NormalizedNode<?, ?> domData = input.getResult(); final DataObject bindingResult; if (domData != null) { final SchemaPath rpcOutput = rpc.createChild(QName.create(rpc.getLastComponent(), "output")); bindingResult = codec.fromNormalizedNodeRpcData(rpcOutput, (ContainerNode) domData); } else { bindingResult = null; } return RpcResult.class.cast(RpcResultBuilder.success(bindingResult).build()); } });
@Override public void onNotification(@Nonnull final DOMNotification notification) { final Notification baNotification = deserialize(notification); final QName notificationQName = notification.getType().getLastComponent(); getInvoker(notification.getType()).invokeNotification(delegate, notificationQName, baNotification); }
@Override public void onNotification(@Nonnull final DOMNotification notification) { final Notification<?> baNotification = deserialize(notification); final QName notificationQName = notification.getType().getLastComponent(); getInvoker(notification.getType()).invokeNotification(delegate, notificationQName, (Instantiable<?>) baNotification); }
ActionAdapter(final BindingToNormalizedNodeCodec codec, final DOMActionService delegate, final Class<? extends Action<?, ?, ?>> type) { super(codec, delegate); this.type = requireNonNull(type); this.schemaPath = getCodec().getActionPath(type); this.inputName = NodeIdentifier.create(operationInputQName(schemaPath.getLastComponent().getModule())); }
public static String packageNameForSubGeneratedType(final String basePackageName, final SchemaNode node, final BindingNamespaceType namespaceType) { final String parent = packageNameForGeneratedType(basePackageName, node.getPath(), namespaceType); final QName last = node.getPath().getLastComponent(); return generateNormalizedPackageName(parent, last); }
@Override public FluentFuture<DOMRpcResult> invokeRpc(final DOMRpcIdentifier rpc, final NormalizedNode<?, ?> input) { final RemoteDOMRpcFuture ret = RemoteDOMRpcFuture.create(rpc.getType().getLastComponent()); ret.completeWith(Patterns.ask(remoteInvoker, ExecuteRpc.from(rpc, input), askDuration)); return ret; }
@Override public void onNotification(final DOMNotification notification) { final Notification baNotification = deserialize(notification); final QName notificationQName = notification.getType().getLastComponent(); getInvoker(notification.getType()).invokeNotification(delegate, notificationQName, baNotification); }
@SuppressWarnings({"unchecked", "rawtypes"}) private Future<FindRoutersReply> findRouteAsync(final DOMRpcIdentifier rpc) { // FIXME: Refactor routeId and message to use DOMRpcIdentifier directly. final RpcRouter.RouteIdentifier<?, ?, ?> routeId = new RouteIdentifierImpl(null, rpc.getType().getLastComponent(), rpc.getContextReference()); final RpcRegistry.Messages.FindRouters findMsg = new RpcRegistry.Messages.FindRouters(routeId); return (Future) ask(rpcRegistry, findMsg, config.getAskDuration()); } }