/** * Create a child path based on concatenation of this path and additional * path elements. * * @param elements Relative SchemaPath elements * @return A new child path */ public @NonNull SchemaPath createChild(final QName... elements) { return createChild(Arrays.asList(elements)); }
private SchemaPath createSchemaPath() { final SchemaPath newPath; if (parent == null) { final SchemaPath parentPath = isAbsolute() ? SchemaPath.ROOT : SchemaPath.SAME; newPath = qname == null ? parentPath : parentPath.createChild(qname); } else { newPath = parent.asSchemaPath().createChild(qname); } return SCHEMAPATH_UPDATER.compareAndSet(this, null, newPath) ? newPath : schemaPath; }
private SchemaPath createSchemaPath() { final SchemaPath newPath; if (parent == null) { final SchemaPath parentPath = isAbsolute() ? SchemaPath.ROOT : SchemaPath.SAME; newPath = qname == null ? parentPath : parentPath.createChild(qname); } else { newPath = parent.asSchemaPath().createChild(qname); } return SCHEMAPATH_UPDATER.compareAndSet(this, null, newPath) ? newPath : schemaPath; }
/** * Create a child path based on concatenation of this path and additional * path elements. * * @param elements Relative SchemaPath elements * @return A new child path */ public @NonNull SchemaPath createChild(final QName... elements) { return createChild(Arrays.asList(elements)); }
TreeNode deserialize(final SchemaPath path, final NormalizedNode<?, ?> input) { if (input instanceof LazySerializedContainerNode) { return ((LazySerializedContainerNode) input).bindingData(); } final SchemaPath inputSchemaPath = path.createChild(inputQname); return codec.fromNormalizedNodeOperationData(inputSchemaPath, (ContainerNode) input); }
private DataObject deserialize(final SchemaPath rpcPath, final NormalizedNode<?, ?> input) { if (ENABLE_CODEC_SHORTCUT && input instanceof BindingDataAware) { return ((BindingDataAware) input).bindingData(); } final SchemaPath inputSchemaPath = rpcPath.createChild(inputQname); return codec.fromNormalizedNodeRpcData(inputSchemaPath, (ContainerNode) input); }
private DataObject deserilialize(final SchemaPath rpcPath, final NormalizedNode<?, ?> input) { if (input instanceof LazySerializedContainerNode) { return ((LazySerializedContainerNode) input).bindingData(); } final SchemaPath inputSchemaPath = rpcPath.createChild(inputQname); return codec.fromNormalizedNodeRpcData(inputSchemaPath, (ContainerNode) input); }
/** * Create a child path based on concatenation of this path and a relative path. * * @param relative Relative SchemaPath * @return A new child path */ public @NonNull SchemaPath createChild(final SchemaPath relative) { checkArgument(!relative.isAbsolute(), "Child creation requires relative path"); return createChild(relative.getPathFromRoot()); }
AnyxmlSchemaLocationEffectiveStatementImpl( final StmtContext<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement, ?> ctx) { super(ctx); path = ctx.coerceParentContext().getSchemaPath().get().createChild(getNodeType()); }
OpenConfigVersionEffectiveStatementImpl(final StmtContext<SemVer, OpenConfigVersionStatement, ?> ctx) { super(ctx); path = ctx.coerceParentContext().getSchemaPath().get().createChild(getNodeType()); }
/** * Create a child path based on concatenation of this path and a relative path. * * @param relative Relative SchemaPath * @return A new child path */ public @NonNull SchemaPath createChild(final SchemaPath relative) { checkArgument(!relative.isAbsolute(), "Child creation requires relative path"); return createChild(relative.getPathFromRoot()); }
AnyxmlSchemaLocationEffectiveStatementImpl( final StmtContext<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement, ?> ctx) { super(ctx); path = ctx.coerceParentContext().getSchemaPath().get().createChild(getNodeType()); }
@Nonnull @Override public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(@Nonnull final SchemaPath schemaPath, @Nullable final NormalizedNode<?, ?> normalizedNode) { DataObject input = null; if (normalizedNode != null) { // RPC input is optional final SchemaPath nodePatch = schemaPath.createChild(normalizedNode.getNodeType()); input = serializer.fromNormalizedNodeRpcData(nodePatch, (ContainerNode) normalizedNode); } final CompletableFuture<DataObject> result = rpcRegistry.invoke(schemaPath, input).toCompletableFuture(); final ListenableFuture<DOMRpcResult> output = getDOMRpcResult(toListenableFuture(result)); return Futures.makeChecked(output, ANY_EX_TO_RPC_EXCEPTION_MAPPER); }
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); } }
Effective(final StmtContext<Void, DefaultDenyWriteStatement, ?> ctx) { super(ctx); path = ctx.coerceParentContext().getSchemaPath().get().createChild( ctx.getPublicDefinition().getStatementName()); }
Effective(final StmtContext<Void, DefaultDenyAllStatement, ?> ctx) { super(ctx); path = ctx.coerceParentContext().getSchemaPath().get().createChild( ctx.getPublicDefinition().getStatementName()); }
Effective(final StmtContext<Void, DefaultDenyWriteStatement, ?> ctx) { super(ctx); path = ctx.coerceParentContext().getSchemaPath().get().createChild( ctx.getPublicDefinition().getStatementName()); }
Effective(final StmtContext<Void, OpenConfigHashedValueStatement, ?> ctx) { super(ctx); path = ctx.coerceParentContext().getSchemaPath().get().createChild( ctx.getPublicDefinition().getStatementName()); }
Effective(final StmtContext<Void, DefaultDenyAllStatement, ?> ctx) { super(ctx); path = ctx.coerceParentContext().getSchemaPath().get().createChild( ctx.getPublicDefinition().getStatementName()); }
Effective(final StmtContext<Void, OpenConfigHashedValueStatement, ?> ctx) { super(ctx); path = ctx.coerceParentContext().getSchemaPath().get().createChild( ctx.getPublicDefinition().getStatementName()); }