private boolean isNodeIdentValidForUse(final InstanceIdentifier<Node> ident) { if (ident == null) { LOG.warn("FlowCapableNode InstanceIdentifier {} can not be null!"); return false; } if (ident.isWildcarded()) { LOG.warn("FlowCapableNode InstanceIdentifier {} can not be wildcarded!", ident); return false; } return true; }
private boolean isNodeIdentValidForUse(final InstanceIdentifier<Node> ident) { if (ident == null) { LOG.warn("FlowCapableNode InstanceIdentifier {} can not be null!"); return false; } if (ident.isWildcarded()) { LOG.warn("FlowCapableNode InstanceIdentifier {} can not be wildcarded!", ident); return false; } return true; }
@Override public void disconnectFlowCapableNode(final InstanceIdentifier<Node> nodeIdent) { Preconditions.checkArgument(nodeIdent != null, "InstanceIdentifier can not be NULL!"); Preconditions.checkArgument(( ! nodeIdent.isWildcarded()), "InstanceIdentifier {} is WildCarded!", nodeIdent); LOG.trace("STAT-MANAGER - disconnect flow capable node {}", nodeIdent); manager.disconnectedNodeUnregistration(nodeIdent); }
protected Optional<DataObject> toBindingData(final InstanceIdentifier<?> path, final NormalizedNode<?, ?> data) { if (path.isWildcarded()) { return Optional.absent(); } return (Optional<DataObject>) getCodec().deserializeFunction(path).apply(Optional.<NormalizedNode<?, ?>> of(data)); }
private <N extends DataObject> InstanceIdentifier<N> childIdentifier(final AbstractPathArgument<N> arg) { return trustedCreate(arg, Iterables.concat(pathArguments, Collections.singleton(arg)), HashCodeBuilder.nextHashCode(hash, arg), isWildcarded()); }
private <U extends DataObject> Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> toNormalized( final String operation, final InstanceIdentifier<U> path, final U data) { checkArgument(!path.isWildcarded(), "Cannot %s data into wildcarded path %s", operation, path); return getCodec().toNormalizedNode(path, data); }
@SuppressWarnings("unchecked") protected Optional<DataObject> toBindingData(final InstanceIdentifier<?> path, final NormalizedNode<?, ?> data) { if (path.isWildcarded()) { return Optional.empty(); } return (Optional<DataObject>) getCodec().getCodecRegistry().deserializeFunction(path).apply(Optional.of(data)); } }
/** * Create a builder rooted at this key. * * @return A builder instance */ public InstanceIdentifierBuilder<T> builder() { return new InstanceIdentifierBuilderImpl<>(Item.of(targetType), pathArguments, hash, isWildcarded()); }
@Override public void disconnectFlowCapableNode(final InstanceIdentifier<Node> nodeIdent) { Preconditions.checkArgument(nodeIdent != null, "InstanceIdentifier can not be NULL!"); Preconditions.checkArgument(( ! nodeIdent.isWildcarded()), "InstanceIdentifier {} is WildCarded!", nodeIdent); manager.enqueue(new StatDataStoreOperation(StatsManagerOperationType.NODE_REMOVAL,nodeIdent.firstKeyOf(Node.class, NodeKey.class).getId()) { @Override public void applyOperation(final ReadWriteTransaction tx) { manager.disconnectedNodeUnregistration(nodeIdent); } }); }
InstanceIdentifierV3(final InstanceIdentifier<T> source) { pathArguments = source.pathArguments; targetType = source.getTargetType(); wildcarded = source.isWildcarded(); hash = source.hashCode(); }
protected final @NonNull FluentFuture<Boolean> doExists(final DOMDataTreeReadOperations readOps, final LogicalDatastoreType store, final InstanceIdentifier<?> path) { checkArgument(!path.isWildcarded(), "Invalid exists of wildcarded path %s", path); return readOps.exists(store, codec.toYangInstanceIdentifierBlocking(path)); } }
protected final <D extends DataObject> CheckedFuture<Optional<D>,ReadFailedException> doRead( final DOMDataReadTransaction readTx, final LogicalDatastoreType store, final InstanceIdentifier<D> path) { Preconditions.checkArgument(!path.isWildcarded(), "Invalid read of wildcarded path %s", path); return MappingCheckedFuture.create( Futures.transform(readTx.read(store, codec.toYangInstanceIdentifierBlocking(path)), codec.deserializeFunction(path)), ReadFailedException.MAPPER); } }
public final <U extends DataObject> void merge(final LogicalDatastoreType store, final InstanceIdentifier<U> path, final U data,final boolean createParents) { Preconditions.checkArgument(!path.isWildcarded(), "Cannot merge data into wildcarded path %s", path); final Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> normalized = getCodec().toNormalizedNode(path, data); if (createParents) { ensureParentsByMerge(store, normalized.getKey(), path); } else { ensureListParentIfNeeded(store,path,normalized); } getDelegate().merge(store, normalized.getKey(), normalized.getValue()); }
public final <U extends DataObject> void put(final LogicalDatastoreType store, final InstanceIdentifier<U> path, final U data, final boolean createParents) { Preconditions.checkArgument(!path.isWildcarded(), "Cannot put data into wildcarded path %s", path); final Entry<YangInstanceIdentifier, NormalizedNode<?, ?>> normalized = getCodec().toNormalizedNode(path, data); if (createParents) { ensureParentsByMerge(store, normalized.getKey(), path); } else { ensureListParentIfNeeded(store,path,normalized); } getDelegate().put(store, normalized.getKey(), normalized.getValue()); }
protected final void doDelete(final LogicalDatastoreType store, final InstanceIdentifier<?> path) { checkArgument(!path.isWildcarded(), "Cannot delete wildcarded path %s", path); final YangInstanceIdentifier normalized = getCodec().toYangInstanceIdentifierBlocking(path); getDelegate().delete(store, normalized); }
protected final void doDelete(final LogicalDatastoreType store, final InstanceIdentifier<?> path) { Preconditions.checkArgument(!path.isWildcarded(), "Cannot delete wildcarded path %s", path); final YangInstanceIdentifier normalized = getCodec().toYangInstanceIdentifierBlocking(path); getDelegate().delete(store, normalized); }
public void remove(InstanceIdentifier<FlowCapableNode> identifier, FlowCapableNode del, InstanceIdentifier<FlowCapableNode> nodeIdent) { if(compareInstanceIdentifierTail(identifier,II_TO_FLOW_CAPABLE_NODE)){ if (LOG.isDebugEnabled()) { LOG.debug("Node removed: {}",nodeIdent.firstKeyOf(Node.class).getId().getValue()); } if ( ! nodeIdent.isWildcarded()) { flowNodeDisconnected(nodeIdent); } } }
public void add(InstanceIdentifier<FlowCapableNode> identifier, FlowCapableNode add, InstanceIdentifier<FlowCapableNode> nodeIdent) { if(compareInstanceIdentifierTail(identifier,II_TO_FLOW_CAPABLE_NODE)){ if (LOG.isDebugEnabled()) { LOG.debug("Node added: {}",nodeIdent.firstKeyOf(Node.class).getId().getValue()); } if ( ! nodeIdent.isWildcarded()) { flowNodeConnected(nodeIdent); } } }
/** * Create a builder rooted at this key. * * @return A builder instance */ public InstanceIdentifierBuilder<T> builder() { return new InstanceIdentifierBuilderImpl<T>(new Item<T>(targetType), pathArguments, hash, isWildcarded()); }
protected final <D extends DataObject> @NonNull FluentFuture<Optional<D>> doRead( final DOMDataTreeReadOperations readOps, final LogicalDatastoreType store, final InstanceIdentifier<D> path) { checkArgument(!path.isWildcarded(), "Invalid read of wildcarded path %s", path); return readOps.read(store, codec.toYangInstanceIdentifierBlocking(path)) .transform(codec.getCodecRegistry().deserializeFunction(path)::apply, MoreExecutors.directExecutor()); }