modernizer is pointing out these users, fix them up.
Change-Id: I67dba53d79ef24d464bb5e54685152d182fbbdb3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
*/
package org.opendaylight.netconf.mdsal.connector;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkState;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.io.CharStreams;
import java.io.IOException;
import java.io.InputStream;
this.rootSchemaSourceProviderDependency = schemaService.getExtensions()
.getInstance(DOMYangTextSourceProvider.class);
- this.currentSchemaContext = new CurrentSchemaContext(Preconditions.checkNotNull(schemaService),
+ this.currentSchemaContext = new CurrentSchemaContext(requireNonNull(schemaService),
rootSchemaSourceProviderDependency);
this.netconfOperationServiceFactoryListener = netconfOperationServiceFactoryListener;
this.netconfOperationServiceFactoryListener.onAddNetconfOperationServiceFactory(this);
@Override
public MdsalNetconfOperationService createService(final String netconfSessionIdForReporting) {
- Preconditions.checkState(dataBroker != null, "MD-SAL provider not yet initialized");
+ checkState(dataBroker != null, "MD-SAL provider not yet initialized");
return new MdsalNetconfOperationService(currentSchemaContext, netconfSessionIdForReporting, dataBroker,
rpcService);
}
*/
package org.opendaylight.netconf.mdsal.connector.ops.get;
+import static java.util.Objects.requireNonNull;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
-import com.google.common.base.Preconditions;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
try {
return QName.create(input);
} catch (IllegalArgumentException e) {
- return QName.create(Preconditions.checkNotNull(prev), input);
+ return QName.create(requireNonNull(prev), input);
}
}
}
*/
package org.opendaylight.netconf.mdsal.notification.impl;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkState;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.collect.HashMultimap;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Lists;
public synchronized NotificationListenerRegistration registerNotificationListener(
final StreamNameType stream,
final NetconfNotificationListener listener) {
- Preconditions.checkNotNull(stream);
- Preconditions.checkNotNull(listener);
+ requireNonNull(stream);
+ requireNonNull(listener);
LOG.trace("Notification listener registered for stream: {}", stream);
@Override
public synchronized NotificationPublisherRegistration registerNotificationPublisher(final Stream stream) {
- Preconditions.checkNotNull(stream);
- final StreamNameType streamName = stream.getName();
+ final StreamNameType streamName = requireNonNull(stream).getName();
LOG.debug("Notification publisher registered for stream: {}", streamName);
if (LOG.isTraceEnabled()) {
@Override
public void onNotification(final StreamNameType stream, final NetconfNotification notification) {
- Preconditions.checkState(baseListener != null, "Already closed");
- Preconditions.checkArgument(stream.equals(registeredStream));
+ checkState(baseListener != null, "Already closed");
+ checkArgument(stream.equals(registeredStream));
baseListener.onNotification(stream, notification);
}
}
*/
package org.opendaylight.netconf.mdsal.notification.impl.ops;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
+
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
// Replay not supported
final Optional<XmlElement> startTime =
operationElement.getOnlyChildElementWithSameNamespaceOptionally("startTime");
- Preconditions.checkArgument(!startTime.isPresent(), "StartTime element not yet supported");
+ checkArgument(!startTime.isPresent(), "StartTime element not yet supported");
// Stop time not supported
final Optional<XmlElement> stopTime =
operationElement.getOnlyChildElementWithSameNamespaceOptionally("stopTime");
- Preconditions.checkArgument(!stopTime.isPresent(), "StopTime element not yet supported");
+ checkArgument(!stopTime.isPresent(), "StopTime element not yet supported");
final StreamNameType streamNameType = parseStreamIfPresent(operationElement);
- Preconditions.checkNotNull(netconfSession);
+ requireNonNull(netconfSession);
// Premature streams are allowed (meaning listener can register even if no provider is available yet)
if (!notifications.isStreamAvailable(streamNameType)) {
LOG.warn("Registering premature stream {}. No publisher available yet for session {}", streamNameType,
*/
package org.opendaylight.netconf.mdsal.notification.impl.ops;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkState;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.collect.Collections2;
import com.google.common.collect.Iterables;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
moduleInfoBackedContext.addModuleInfos(Collections.singletonList(org.opendaylight.yang.gen.v1.urn.ietf.params
.xml.ns.yang.ietf.netconf.notifications.rev120206.$YangModuleInfoImpl.getInstance()));
final Optional<SchemaContext> schemaContextOptional = moduleInfoBackedContext.tryToCreateSchemaContext();
- Preconditions.checkState(schemaContextOptional.isPresent());
+ checkState(schemaContextOptional.isPresent());
NOTIFICATIONS_SCHEMA_CTX = schemaContextOptional.get();
- CREATE_SUBSCRIPTION_RPC = Preconditions.checkNotNull(findCreateSubscriptionRpc());
-
- Preconditions.checkNotNull(CREATE_SUBSCRIPTION_RPC);
+ CREATE_SUBSCRIPTION_RPC = requireNonNull(findCreateSubscriptionRpc());
CODEC_REGISTRY = new BindingNormalizedNodeCodecRegistry(BindingRuntimeContext.create(moduleInfoBackedContext,
NOTIFICATIONS_SCHEMA_CTX));
import static org.mockito.Mockito.verify;
import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Before;
final List<Uri> newCapabilitiesList =
Lists.newArrayList(new Uri("newCapability"), new Uri("createdCapability"));
Capabilities newCapabilities = new CapabilitiesBuilder().setCapability(newCapabilitiesList).build();
- Map<InstanceIdentifier<?>, DataObject> createdData = Maps.newHashMap();
+ Map<InstanceIdentifier<?>, DataObject> createdData = new HashMap<>();
createdData.put(capabilitiesIdentifier, newCapabilities);
verifyDataTreeChange(DataObjectModification.ModificationType.WRITE, null, newCapabilities,
changedCapabilitesFrom(newCapabilitiesList, Collections.emptyList()));
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.netconf.api;
+import static java.util.Objects.requireNonNull;
import static org.opendaylight.netconf.api.xml.XmlNetconfConstants.RPC_REPLY_KEY;
import static org.opendaylight.netconf.api.xml.XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0;
-import com.google.common.base.Preconditions;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
private final String typeValue;
ErrorType(final String typeValue) {
- this.typeValue = Preconditions.checkNotNull(typeValue);
+ this.typeValue = requireNonNull(typeValue);
}
public String getTypeValue() {
private final String severityValue;
ErrorSeverity(final String severityValue) {
- this.severityValue = Preconditions.checkNotNull(severityValue);
+ this.severityValue = requireNonNull(severityValue);
}
public String getSeverityValue() {
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.netconf.api.messages;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.net.InetAddresses;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
private final String transport;
private final String sessionIdentifier;
- public NetconfHelloMessageAdditionalHeader(String userName, String hostAddress, String port,
- String transport, String sessionIdentifier) {
+ public NetconfHelloMessageAdditionalHeader(final String userName, final String hostAddress, final String port,
+ final String transport, final String sessionIdentifier) {
this.userName = userName;
this.hostAddress = hostAddress;
this.port = port;
* Format additional header into a string suitable as a prefix for netconf hello message.
*/
public String toFormattedString() {
- Preconditions.checkNotNull(userName);
- Preconditions.checkNotNull(hostAddress);
- Preconditions.checkNotNull(port);
- Preconditions.checkNotNull(transport);
- Preconditions.checkNotNull(sessionIdentifier);
+ requireNonNull(userName);
+ requireNonNull(hostAddress);
+ requireNonNull(port);
+ requireNonNull(transport);
+ requireNonNull(sessionIdentifier);
return "[" + userName + SC + hostAddress + ":" + port + SC + transport + SC + sessionIdentifier + SC + "]"
+ System.lineSeparator();
}
/**
* Parse additional header from a formatted string.
*/
- public static NetconfHelloMessageAdditionalHeader fromString(String additionalHeader) {
+ public static NetconfHelloMessageAdditionalHeader fromString(final String additionalHeader) {
String additionalHeaderTrimmed = additionalHeader.trim();
Matcher matcher = PATTERN.matcher(additionalHeaderTrimmed);
Matcher matcher2 = CUSTOM_HEADER_PATTERN.matcher(additionalHeaderTrimmed);
- Preconditions.checkArgument(matcher.matches(), "Additional header in wrong format %s, expected %s",
+ checkArgument(matcher.matches(), "Additional header in wrong format %s, expected %s",
additionalHeaderTrimmed, PATTERN);
String username = matcher.group("username");
String address = matcher.group("address");
- Preconditions.checkArgument(InetAddresses.isInetAddress(address));
+ checkArgument(InetAddresses.isInetAddress(address));
String port = matcher.group("port");
String transport = matcher.group("transport");
String sessionIdentifier = "client";
}
return new NetconfHelloMessageAdditionalHeader(username, address, port, transport, sessionIdentifier);
}
-
}
*/
package org.opendaylight.netconf.client;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GlobalEventExecutor;
import io.netty.util.concurrent.Promise;
private final NetconfMessage request;
RequestEntry(final Promise<NetconfMessage> future, final NetconfMessage request) {
- this.promise = Preconditions.checkNotNull(future);
- this.request = Preconditions.checkNotNull(request);
+ this.promise = requireNonNull(future);
+ this.request = requireNonNull(request);
}
}
@Override
@SuppressWarnings("checkstyle:hiddenField")
public final synchronized void onSessionUp(final NetconfClientSession clientSession) {
- this.clientSession = Preconditions.checkNotNull(clientSession);
+ this.clientSession = requireNonNull(clientSession);
LOG.debug("Client session {} went up", clientSession);
dispatchRequest();
}
*/
package org.opendaylight.netconf.client.conf;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Preconditions;
import java.net.InetSocketAddress;
import java.util.List;
import java.util.Optional;
}
private void validateConfiguration() {
- Preconditions.checkNotNull(clientProtocol, " ");
- switch (clientProtocol) {
+ switch (requireNonNull(clientProtocol)) {
case TLS:
validateTlsConfiguration();
validateTcpConfiguration();
}
protected void validateTlsConfiguration() {
- Preconditions.checkNotNull(sslHandlerFactory, "sslHandlerFactory");
+ requireNonNull(sslHandlerFactory, "sslHandlerFactory");
}
protected void validateSshConfiguration() {
- Preconditions.checkNotNull(authHandler, "authHandler");
+ requireNonNull(authHandler, "authHandler");
}
protected void validateTcpConfiguration() {
- Preconditions.checkNotNull(address, "address");
- Preconditions.checkNotNull(clientProtocol, "clientProtocol");
- Preconditions.checkNotNull(connectionTimeoutMillis, "connectionTimeoutMillis");
- Preconditions.checkNotNull(sessionListener, "sessionListener");
- Preconditions.checkNotNull(reconnectStrategy, "reconnectStrategy");
+ requireNonNull(address, "address");
+ requireNonNull(clientProtocol, "clientProtocol");
+ requireNonNull(connectionTimeoutMillis, "connectionTimeoutMillis");
+ requireNonNull(sessionListener, "sessionListener");
+ requireNonNull(reconnectStrategy, "reconnectStrategy");
}
@Override
*/
package org.opendaylight.netconf.client.conf;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Preconditions;
import java.net.InetSocketAddress;
import java.util.List;
import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
}
private void validateReconnectConfiguration() {
- Preconditions.checkNotNull(connectStrategyFactory);
+ requireNonNull(connectStrategyFactory);
}
@Override
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.netconf.impl;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
+
import io.netty.util.Timer;
import java.util.Set;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
private void validate() {
- Preconditions.checkNotNull(timer, "timer not initialized");
- Preconditions.checkNotNull(aggregatedOpService, "NetconfOperationServiceFactory not initialized");
- Preconditions.checkNotNull(idProvider, "SessionIdProvider not initialized");
- Preconditions.checkArgument(connectionTimeoutMillis > 0, "connection time out <=0");
- Preconditions.checkNotNull(monitoringService, "NetconfMonitoringService not initialized");
+ requireNonNull(timer, "timer not initialized");
+ requireNonNull(aggregatedOpService, "NetconfOperationServiceFactory not initialized");
+ requireNonNull(idProvider, "SessionIdProvider not initialized");
+ checkArgument(connectionTimeoutMillis > 0, "connection time out <=0");
+ requireNonNull(monitoringService, "NetconfMonitoringService not initialized");
- baseCapabilities = (baseCapabilities == null) ? NetconfServerSessionNegotiatorFactory
- .DEFAULT_BASE_CAPABILITIES : baseCapabilities;
+ if (baseCapabilities == null) {
+ baseCapabilities = NetconfServerSessionNegotiatorFactory.DEFAULT_BASE_CAPABILITIES;
+ }
}
}
*/
package org.opendaylight.netconf.impl.mapping.operations;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import java.util.Collections;
import org.opendaylight.netconf.api.DocumentedException;
import org.opendaylight.netconf.api.xml.XmlElement;
throws DocumentedException {
try {
sessionResources.close();
- Preconditions.checkNotNull(session, "Session was not set").delayedClose();
+ requireNonNull(session, "Session was not set").delayedClose();
LOG.info("Session {} closing", session.getSessionId());
} catch (final Exception e) {
throw new DocumentedException("Unable to properly close session "
*/
package org.opendaylight.netconf.impl.osgi;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkState;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.collect.ImmutableSet;
import java.util.Collection;
import java.util.Collections;
public NetconfOperationRouterImpl(final NetconfOperationService netconfOperationServiceSnapshot,
final NetconfMonitoringService netconfMonitoringService, final String sessionId) {
- this.netconfOperationServiceSnapshot = Preconditions.checkNotNull(netconfOperationServiceSnapshot);
+ this.netconfOperationServiceSnapshot = requireNonNull(netconfOperationServiceSnapshot);
final Set<NetconfOperation> ops = new HashSet<>();
ops.add(new DefaultCloseSession(sessionId, this));
@Override
public Document onNetconfMessage(final Document message, final NetconfServerSession session) throws
DocumentedException {
- Preconditions.checkNotNull(allNetconfOperations, "Operation router was not initialized properly");
+ requireNonNull(allNetconfOperations, "Operation router was not initialized properly");
final NetconfOperationExecution netconfOperationExecution;
try {
}
if (!handlingPriority.equals(HandlingPriority.CANNOT_HANDLE)) {
- Preconditions.checkState(!sortedPriority.containsKey(handlingPriority),
+ checkState(!sortedPriority.containsKey(handlingPriority),
"Multiple %s available to handle message %s with priority %s, %s and %s",
NetconfOperation.class.getName(), message, handlingPriority, netconfOperation, sortedPriority
.get(handlingPriority));
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.netconf.impl;
-import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
+import static java.util.Objects.requireNonNull;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.common.io.ByteStreams;
import io.netty.channel.ChannelFuture;
import java.io.InputStreamReader;
import java.net.InetSocketAddress;
import java.net.Socket;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
private final Class<? extends Runnable> clientRunnable;
private final Set<String> serverCaps;
- public ConcurrentClientsTest(int nettyThreads, Class<? extends Runnable> clientRunnable, Set<String> serverCaps) {
+ public ConcurrentClientsTest(final int nettyThreads, final Class<? extends Runnable> clientRunnable,
+ final Set<String> serverCaps) {
this.nettyThreads = nettyThreads;
this.clientRunnable = clientRunnable;
this.serverCaps = serverCaps;
@Test(timeout = CONCURRENCY * 1000)
public void testConcurrentClients() throws Exception {
- List<Future<?>> futures = Lists.newArrayListWithCapacity(CONCURRENCY);
+ List<Future<?>> futures = new ArrayList<>(CONCURRENCY);
for (int i = 0; i < CONCURRENCY; i++) {
futures.add(clientExecutor.submit(getInstanceOfClientRunnable()));
private final AtomicLong counter = new AtomicLong();
@Override
- public HandlingPriority canHandle(Document message) {
+ public HandlingPriority canHandle(final Document message) {
return XmlUtil.toString(message).contains(NetconfStartExiMessage.START_EXI)
? HandlingPriority.CANNOT_HANDLE :
HandlingPriority.HANDLE_WITH_MAX_PRIORITY;
@SuppressWarnings("checkstyle:IllegalCatch")
@Override
- public Document handle(Document requestMessage, NetconfOperationChainedExecution subsequentOperation)
- throws DocumentedException {
+ public Document handle(final Document requestMessage,
+ final NetconfOperationChainedExecution subsequentOperation) throws DocumentedException {
try {
LOG.info("Handling netconf message from test {}", XmlUtil.toString(requestMessage));
counter.getAndIncrement();
}
@Override
- public NetconfOperationService createService(String netconfSessionIdForReporting) {
+ public NetconfOperationService createService(final String netconfSessionIdForReporting) {
return new NetconfOperationService() {
@Override
}
private void run2() throws Exception {
- InputStream clientHello = checkNotNull(XmlFileLoader
- .getResourceAsStream("netconfMessages/client_hello.xml"));
- final InputStream getConfig =
- checkNotNull(XmlFileLoader.getResourceAsStream("netconfMessages/getConfig.xml"));
+ InputStream clientHello = requireNonNull(XmlFileLoader.getResourceAsStream(
+ "netconfMessages/client_hello.xml"));
+ final InputStream getConfig = requireNonNull(XmlFileLoader.getResourceAsStream(
+ "netconfMessages/getConfig.xml"));
Socket clientSocket = new Socket(NETCONF_ADDRESS.getHostString(), NETCONF_ADDRESS.getPort());
DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());
NetconfMessage result = netconfClient.sendRequest(getMessage).get();
LOG.info("Client with session id {}: got result {}", sessionId, result);
- Preconditions.checkState(NetconfMessageUtil.isErrorMessage(result) == false,
+ checkState(NetconfMessageUtil.isErrorMessage(result) == false,
"Received error response: " + XmlUtil.toString(result.getDocument()) + " to request: "
+ XmlUtil.toString(getMessage.getDocument()));
doNothing().when(operationService).close();
operationRouter = new NetconfOperationRouterImpl(operationService, null, "session-1");
- doReturn(Collections.EMPTY_SET).when(operationService2).getNetconfOperations();
+ doReturn(Collections.emptySet()).when(operationService2).getNetconfOperations();
emptyOperationRouter = new NetconfOperationRouterImpl(operationService2, null, "session-1");
}
*/
package org.opendaylight.netconf.nettyutil;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.PooledByteBufAllocator;
protected AbstractNetconfDispatcher(final EventExecutor executor, final EventLoopGroup bossGroup,
final EventLoopGroup workerGroup) {
- this.bossGroup = Preconditions.checkNotNull(bossGroup);
- this.workerGroup = Preconditions.checkNotNull(workerGroup);
- this.executor = Preconditions.checkNotNull(executor);
+ this.bossGroup = requireNonNull(bossGroup);
+ this.workerGroup = requireNonNull(workerGroup);
+ this.executor = requireNonNull(executor);
}
*/
package org.opendaylight.netconf.nettyutil;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkState;
+import static java.util.Objects.requireNonNull;
+
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
NetconfSessionPromise(final EventExecutor executor, final InetSocketAddress address,
final ReconnectStrategy strategy, final Bootstrap bootstrap) {
super(executor);
- this.strategy = Preconditions.checkNotNull(strategy);
- this.address = Preconditions.checkNotNull(address);
- this.bootstrap = Preconditions.checkNotNull(bootstrap);
+ this.strategy = requireNonNull(strategy);
+ this.address = requireNonNull(address);
+ this.bootstrap = requireNonNull(bootstrap);
}
@SuppressWarnings("checkstyle:illegalCatch")
LOG.debug("Promise {} connection resolved", NetconfSessionPromise.this);
// Triggered when a connection attempt is resolved.
- Preconditions.checkState(NetconfSessionPromise.this.pending.equals(cf));
+ checkState(NetconfSessionPromise.this.pending.equals(cf));
/*
* The promise we gave out could have been cancelled,
public void operationComplete(final Future<Void> sf) {
synchronized (NetconfSessionPromise.this) {
// Triggered when a connection attempt is to be made.
- Preconditions.checkState(NetconfSessionPromise.this.pending.equals(sf));
+ checkState(NetconfSessionPromise.this.pending.equals(sf));
/*
* The promise we gave out could have been cancelled,
*/
package org.opendaylight.netconf.nettyutil;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
+
import io.netty.util.concurrent.EventExecutor;
import io.netty.util.concurrent.Future;
private final int timeout;
public NeverReconnectStrategy(final EventExecutor executor, final int timeout) {
- Preconditions.checkArgument(timeout >= 0);
- this.executor = Preconditions.checkNotNull(executor);
+ checkArgument(timeout >= 0);
+ this.executor = requireNonNull(executor);
this.timeout = timeout;
}
*/
package org.opendaylight.netconf.nettyutil;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
+
import io.netty.util.concurrent.EventExecutor;
import io.netty.util.concurrent.Future;
import org.slf4j.Logger;
private final int timeout;
public ReconnectImmediatelyStrategy(final EventExecutor executor, final int timeout) {
- Preconditions.checkArgument(timeout >= 0);
- this.executor = Preconditions.checkNotNull(executor);
+ checkArgument(timeout >= 0);
+ this.executor = requireNonNull(executor);
this.timeout = timeout;
}
*/
package org.opendaylight.netconf.nettyutil;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
final Bootstrap bootstrap, final AbstractNetconfDispatcher.PipelineInitializer<S> initializer) {
super(executor);
this.bootstrap = bootstrap;
- this.initializer = Preconditions.checkNotNull(initializer);
- this.dispatcher = Preconditions.checkNotNull(dispatcher);
- this.address = Preconditions.checkNotNull(address);
- this.strategyFactory = Preconditions.checkNotNull(connectStrategyFactory);
+ this.initializer = requireNonNull(initializer);
+ this.dispatcher = requireNonNull(dispatcher);
+ this.address = requireNonNull(address);
+ this.strategyFactory = requireNonNull(connectStrategyFactory);
}
synchronized void connect() {
* Connection refused, Negotiation failed
*/
private synchronized boolean isInitialConnectFinished() {
- Preconditions.checkNotNull(pending);
+ requireNonNull(pending);
return pending.isDone() && pending.isSuccess();
}
@Override
public synchronized boolean cancel(final boolean mayInterruptIfRunning) {
if (super.cancel(mayInterruptIfRunning)) {
- Preconditions.checkNotNull(pending);
+ requireNonNull(pending);
this.pending.cancel(mayInterruptIfRunning);
return true;
}
*/
package org.opendaylight.netconf.nettyutil;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkState;
+import static java.util.Objects.requireNonNull;
+
import io.netty.util.concurrent.EventExecutor;
import io.netty.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
public TimedReconnectStrategy(final EventExecutor executor, final int connectTime, final long minSleep,
final double sleepFactor, final Long maxSleep, final Long maxAttempts, final Long deadline) {
- Preconditions.checkArgument(maxSleep == null || minSleep <= maxSleep);
- Preconditions.checkArgument(sleepFactor >= 1);
- Preconditions.checkArgument(connectTime >= 0);
- this.executor = Preconditions.checkNotNull(executor);
+ checkArgument(maxSleep == null || minSleep <= maxSleep);
+ checkArgument(sleepFactor >= 1);
+ checkArgument(connectTime >= 0);
+ this.executor = requireNonNull(executor);
this.deadline = deadline;
this.maxAttempts = maxAttempts;
this.minSleep = minSleep;
LOG.debug("Connection attempt failed", cause);
// Check if a reconnect attempt is scheduled
- Preconditions.checkState(!this.scheduled);
+ checkState(!this.scheduled);
// Get a stable 'now' time for deadline calculations
final long now = System.nanoTime();
// Schedule a task for the right time. It will also clear the flag.
return this.executor.schedule(() -> {
synchronized (TimedReconnectStrategy.this) {
- Preconditions.checkState(TimedReconnectStrategy.this.scheduled);
+ checkState(TimedReconnectStrategy.this.scheduled);
TimedReconnectStrategy.this.scheduled = false;
}
@Override
public synchronized void reconnectSuccessful() {
- Preconditions.checkState(!this.scheduled);
+ checkState(!this.scheduled);
this.attempts = 0;
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.netconf.nettyutil.handler.ssh.client;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;
import io.netty.channel.ChannelPromise;
*/
public AsyncSshHandler(final AuthenticationHandler authenticationHandler,
final SshClient sshClient) {
- this.authenticationHandler = Preconditions.checkNotNull(authenticationHandler);
- this.sshClient = Preconditions.checkNotNull(sshClient);
+ this.authenticationHandler = requireNonNull(authenticationHandler);
+ this.sshClient = requireNonNull(sshClient);
}
public static AsyncSshHandler createForNetconfSubsystem(final AuthenticationHandler authenticationHandler) {
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.netconf.notifications;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.text.ParsePosition;
import java.time.Instant;
}
private static Document wrapNotification(final Document notificationContent, final Date eventTime) {
- Preconditions.checkNotNull(notificationContent);
- Preconditions.checkNotNull(eventTime);
+ requireNonNull(notificationContent);
+ requireNonNull(eventTime);
final Element baseNotification = notificationContent.getDocumentElement();
final Element entireNotification = notificationContent.createElementNS(NOTIFICATION_NAMESPACE, NOTIFICATION);
*/
package org.opendaylight.netconf.util;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import java.util.Collection;
public NodeContainerProxy(final QName qualifiedName, final Map<QName, DataSchemaNode> childNodes,
final Set<AugmentationSchemaNode> availableAugmentations) {
this.availableAugmentations = availableAugmentations;
- this.childNodes = Preconditions.checkNotNull(childNodes, "childNodes");
+ this.childNodes = requireNonNull(childNodes, "childNodes");
this.qualifiedName = qualifiedName;
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.netconf.util.test;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.io.ByteSource;
import java.io.IOException;
import java.io.InputStream;
import org.xml.sax.SAXException;
public final class XmlFileLoader {
-
private XmlFileLoader() {
}
public static Document xmlFileToDocument(final String fileName) throws IOException, SAXException,
ParserConfigurationException {
try (InputStream resourceAsStream = XmlFileLoader.class.getClassLoader().getResourceAsStream(fileName)) {
- Preconditions.checkNotNull(resourceAsStream, fileName);
+ requireNonNull(resourceAsStream, fileName);
final Document doc = XmlUtil.readXmlToDocument(resourceAsStream);
return doc;
}
public static String fileToString(final String fileName) throws IOException {
try (InputStream resourceAsStream = XmlFileLoader.class.getClassLoader().getResourceAsStream(fileName)) {
- Preconditions.checkNotNull(resourceAsStream);
+ requireNonNull(resourceAsStream);
return new ByteSource() {
@Override
public InputStream openStream() {
package org.opendaylight.netconf.sal.connect.netconf;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.collect.ClassToInstanceMap;
import com.google.common.collect.ImmutableClassToInstanceMap;
import com.google.common.util.concurrent.Futures;
@Override
public ListenableFuture<? extends DOMActionResult> invokeAction(final SchemaPath schemaPath,
final DOMDataTreeIdentifier dataTreeIdentifier, final ContainerNode input) {
- Preconditions.checkNotNull(schemaPath);
- Preconditions.checkNotNull(dataTreeIdentifier);
- Preconditions.checkNotNull(input);
+ requireNonNull(schemaPath);
+ requireNonNull(dataTreeIdentifier);
+ requireNonNull(input);
final ListenableFuture<RpcResult<NetconfMessage>> actionResultFuture = listener.sendRequest(
messageTransformer.toActionRequest(schemaPath, dataTreeIdentifier, input), input.getNodeType());
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.netconf.sal.connect.netconf;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.util.concurrent.ListeningExecutorService;
import io.netty.util.concurrent.EventExecutor;
import org.opendaylight.netconf.sal.connect.api.DeviceActionFactory;
}
private void validation() {
- Preconditions.checkNotNull(this.id, "RemoteDeviceId is not initialized");
- Preconditions.checkNotNull(this.salFacade, "RemoteDeviceHandler is not initialized");
- Preconditions.checkNotNull(this.globalProcessingExecutor, "ExecutorService is not initialized");
- Preconditions.checkNotNull(this.schemaResourcesDTO, "SchemaResourceDTO is not initialized");
+ requireNonNull(this.id, "RemoteDeviceId is not initialized");
+ requireNonNull(this.salFacade, "RemoteDeviceHandler is not initialized");
+ requireNonNull(this.globalProcessingExecutor, "ExecutorService is not initialized");
+ requireNonNull(this.schemaResourcesDTO, "SchemaResourceDTO is not initialized");
}
}
*/
package org.opendaylight.netconf.sal.connect.netconf;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
+import static java.util.Objects.requireNonNull;
+
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
private MessageTransformer<NetconfMessage> messageTransformer;
NotificationHandler(final RemoteDeviceHandler<?> salFacade, final RemoteDeviceId id) {
- this.salFacade = Preconditions.checkNotNull(salFacade);
- this.id = Preconditions.checkNotNull(id);
+ this.salFacade = requireNonNull(salFacade);
+ this.id = requireNonNull(id);
}
synchronized void handleNotification(final NetconfMessage notification) {
* @param transformer Message transformer
*/
synchronized void onRemoteSchemaUp(final MessageTransformer<NetconfMessage> transformer) {
- this.messageTransformer = Preconditions.checkNotNull(transformer);
+ this.messageTransformer = requireNonNull(transformer);
passNotifications = true;
}
private DOMNotification transformNotification(final NetconfMessage cachedNotification) {
- final DOMNotification parsedNotification = messageTransformer.toNotification(cachedNotification);
- Preconditions.checkNotNull(
- parsedNotification, "%s: Unable to parse received notification: %s", id, cachedNotification);
- return parsedNotification;
+ return checkNotNull(messageTransformer.toNotification(cachedNotification),
+ "%s: Unable to parse received notification: %s", id, cachedNotification);
}
private void queueNotification(final NetconfMessage notification) {
- Preconditions.checkState(!passNotifications);
+ checkState(!passNotifications);
LOG.debug("{}: Caching notification {}, remote schema not yet fully built", id, notification);
if (LOG.isTraceEnabled()) {
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.netconf.sal.connect.netconf.listener;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.base.MoreObjects;
import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
NetconfSessionPreferences(final Map<String, CapabilityOrigin> nonModuleCaps,
final Map<QName, CapabilityOrigin> moduleBasedCaps) {
- this.nonModuleCaps = Preconditions.checkNotNull(nonModuleCaps);
- this.moduleBasedCaps = Preconditions.checkNotNull(moduleBasedCaps);
+ this.nonModuleCaps = requireNonNull(nonModuleCaps);
+ this.moduleBasedCaps = requireNonNull(moduleBasedCaps);
}
public Set<QName> getModuleBasedCaps() {
*/
package org.opendaylight.netconf.sal.connect.netconf.sal;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
+import static java.util.Objects.requireNonNull;
+
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.Transaction;
import org.opendaylight.mdsal.binding.api.TransactionChain;
mountInstance = new MountInstance(mountService, id);
this.dataBroker = dataBroker;
if (dataBroker != null) {
- txChain = Preconditions.checkNotNull(dataBroker).createTransactionChain(transactionChainListener);
+ txChain = requireNonNull(dataBroker).createTransactionChain(transactionChainListener);
topologyDatastoreAdapter = new NetconfDeviceTopologyAdapter(id, txChain);
}
}
public MountInstance getMountInstance() {
- Preconditions.checkState(mountInstance != null,
- "%s: Mount instance was not initialized by sal. Cannot get mount instance", id);
+ checkState(mountInstance != null, "%s: Mount instance was not initialized by sal. Cannot get mount instance",
+ id);
return mountInstance;
}
public NetconfDeviceTopologyAdapter getTopologyDatastoreAdapter() {
- Preconditions.checkState(topologyDatastoreAdapter != null,
+ checkState(topologyDatastoreAdapter != null,
"%s: Sal provider %s was not initialized by sal. Cannot get topology datastore adapter", id);
return topologyDatastoreAdapter;
}
private void resetTransactionChainForAdapaters() {
- txChain = Preconditions.checkNotNull(dataBroker).createTransactionChain(transactionChainListener);
+ txChain = requireNonNull(dataBroker).createTransactionChain(transactionChainListener);
topologyDatastoreAdapter.setTxChain(txChain);
private ObjectRegistration<DOMMountPoint> topologyRegistration;
MountInstance(final DOMMountPointService mountService, final RemoteDeviceId id) {
- this.mountService = Preconditions.checkNotNull(mountService);
- this.id = Preconditions.checkNotNull(id);
+ this.mountService = requireNonNull(mountService);
+ this.id = requireNonNull(id);
}
public void onTopologyDeviceConnected(final SchemaContext initialCtx,
public synchronized void onTopologyDeviceConnected(final SchemaContext initialCtx,
final DOMDataBroker broker, final DOMRpcService rpc,
final NetconfDeviceNotificationService newNotificationService, final DOMActionService deviceAction) {
- Preconditions.checkNotNull(mountService, "Closed");
- Preconditions.checkState(topologyRegistration == null, "Already initialized");
+ requireNonNull(mountService, "Closed");
+ checkState(topologyRegistration == null, "Already initialized");
final DOMMountPointService.DOMMountPointBuilder mountBuilder =
mountService.createMountPoint(id.getTopologyPath());
}
public synchronized void publish(final DOMNotification domNotification) {
- Preconditions.checkNotNull(notificationService, "Device not set up yet, cannot handle notification {}",
- domNotification);
- notificationService.publishNotification(domNotification);
+ checkNotNull(notificationService, "Device not set up yet, cannot handle notification %s", domNotification)
+ .publishNotification(domNotification);
}
}
*/
package org.opendaylight.netconf.sal.connect.netconf.sal;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.ArrayList;
NetconfDeviceTopologyAdapter(final RemoteDeviceId id, final TransactionChain txChain) {
this.id = id;
- this.txChain = Preconditions.checkNotNull(txChain);
+ this.txChain = requireNonNull(txChain);
this.networkTopologyPath = InstanceIdentifier.builder(NetworkTopology.class).build();
this.topologyListPath = networkTopologyPath
}
public void setTxChain(final TransactionChain txChain) {
- this.txChain = Preconditions.checkNotNull(txChain);
+ this.txChain = requireNonNull(txChain);
}
}
*/
package org.opendaylight.netconf.sal.connect.netconf.util;
+import static com.google.common.base.Preconditions.checkArgument;
+import static java.util.Objects.requireNonNull;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.EDIT_CONTENT_NODEID;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_CANDIDATE_QNAME;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.NETCONF_COPY_CONFIG_NODEID;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.toFilterStructure;
import static org.opendaylight.netconf.sal.connect.netconf.util.NetconfMessageTransformUtil.toId;
-import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
}
public ListenableFuture<DOMRpcResult> lock(final FutureCallback<DOMRpcResult> callback, final QName datastore) {
- Preconditions.checkNotNull(callback);
- Preconditions.checkNotNull(datastore);
+ requireNonNull(callback);
+ requireNonNull(datastore);
final ListenableFuture<DOMRpcResult> future = rpc.invokeRpc(NETCONF_LOCK_PATH, getLockContent(datastore));
Futures.addCallback(future, callback, MoreExecutors.directExecutor());
}
public ListenableFuture<DOMRpcResult> unlock(final FutureCallback<DOMRpcResult> callback, final QName datastore) {
- Preconditions.checkNotNull(callback);
- Preconditions.checkNotNull(datastore);
+ requireNonNull(callback);
+ requireNonNull(datastore);
final ListenableFuture<DOMRpcResult> future = rpc.invokeRpc(NETCONF_UNLOCK_PATH, getUnLockContent(datastore));
Futures.addCallback(future, callback, MoreExecutors.directExecutor());
}
public ListenableFuture<DOMRpcResult> discardChanges(final FutureCallback<DOMRpcResult> callback) {
- Preconditions.checkNotNull(callback);
+ requireNonNull(callback);
final ListenableFuture<DOMRpcResult> future = rpc.invokeRpc(NETCONF_DISCARD_CHANGES_PATH, null);
Futures.addCallback(future, callback, MoreExecutors.directExecutor());
}
public ListenableFuture<DOMRpcResult> commit(final FutureCallback<DOMRpcResult> callback) {
- Preconditions.checkNotNull(callback);
+ requireNonNull(callback);
final ListenableFuture<DOMRpcResult> future = rpc.invokeRpc(NetconfMessageTransformUtil.NETCONF_COMMIT_PATH,
NetconfMessageTransformUtil.COMMIT_RPC_CONTENT);
}
public ListenableFuture<DOMRpcResult> validate(final FutureCallback<DOMRpcResult> callback, final QName datastore) {
- Preconditions.checkNotNull(callback);
- Preconditions.checkNotNull(datastore);
+ requireNonNull(callback);
final ListenableFuture<DOMRpcResult> future = rpc.invokeRpc(NetconfMessageTransformUtil.NETCONF_VALIDATE_PATH,
- getValidateContent(datastore));
+ getValidateContent(requireNonNull(datastore)));
Futures.addCallback(future, callback, MoreExecutors.directExecutor());
return future;
}
public ListenableFuture<DOMRpcResult> copyConfig(final FutureCallback<DOMRpcResult> callback,
final QName source, final QName target) {
- Preconditions.checkNotNull(callback);
- Preconditions.checkNotNull(source);
- Preconditions.checkNotNull(target);
+ requireNonNull(callback);
final ListenableFuture<DOMRpcResult> future = rpc.invokeRpc(NETCONF_COPY_CONFIG_PATH,
- getCopyConfigContent(source, target));
+ getCopyConfigContent(requireNonNull(source), requireNonNull(target)));
Futures.addCallback(future, callback, MoreExecutors.directExecutor());
return future;
}
public ListenableFuture<DOMRpcResult> getConfig(final FutureCallback<DOMRpcResult> callback, final QName datastore,
final Optional<YangInstanceIdentifier> filterPath) {
- Preconditions.checkNotNull(callback);
- Preconditions.checkNotNull(datastore);
+ requireNonNull(callback);
+ requireNonNull(datastore);
final ListenableFuture<DOMRpcResult> future;
if (isFilterPresent(filterPath)) {
private ListenableFuture<Optional<NormalizedNode<?, ?>>> extractData(
final Optional<YangInstanceIdentifier> path, final ListenableFuture<DOMRpcResult> configRunning) {
return Futures.transform(configRunning, result -> {
- Preconditions.checkArgument(result.getErrors().isEmpty(), "Unable to read data: %s, errors: %s", path,
+ checkArgument(result.getErrors().isEmpty(), "Unable to read data: %s, errors: %s", path,
result.getErrors());
final DataContainerChild<? extends YangInstanceIdentifier.PathArgument, ?> dataNode =
((ContainerNode) result.getResult()).getChild(NetconfMessageTransformUtil.NETCONF_DATA_NODEID)
public ListenableFuture<DOMRpcResult> get(final FutureCallback<DOMRpcResult> callback,
final Optional<YangInstanceIdentifier> filterPath) {
- Preconditions.checkNotNull(callback);
+ requireNonNull(callback);
final ListenableFuture<DOMRpcResult> future = rpc.invokeRpc(NETCONF_GET_PATH, isFilterPresent(filterPath)
? NetconfMessageTransformUtil.wrap(NETCONF_GET_NODEID, toFilterStructure(filterPath.get(), schemaContext))
final FutureCallback<? super DOMRpcResult> callback, final QName datastore,
final DataContainerChild<?, ?> editStructure, final Optional<ModifyAction> modifyAction,
final boolean rollback) {
- Preconditions.checkNotNull(editStructure);
- Preconditions.checkNotNull(callback);
- Preconditions.checkNotNull(datastore);
+ requireNonNull(callback);
final ListenableFuture<DOMRpcResult> future = rpc.invokeRpc(NETCONF_EDIT_CONFIG_PATH,
- getEditConfigContent(datastore, editStructure, modifyAction, rollback));
+ getEditConfigContent(requireNonNull(datastore), requireNonNull(editStructure), modifyAction, rollback));
Futures.addCallback(future, callback, MoreExecutors.directExecutor());
return future;
*/
package org.opendaylight.netconf.sal.connect.util;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
final AAAEncryptionService encryptionService,
final String topologyId) {
this.dataBroker = dataBroker;
- this.encryptionService = Preconditions.checkNotNull(encryptionService);
+ this.encryptionService = requireNonNull(encryptionService);
this.topologyPath = InstanceIdentifier.builder(NetworkTopology.class)
- .child(Topology.class, new TopologyKey(new TopologyId(Preconditions.checkNotNull(topologyId)))).build();
+ .child(Topology.class, new TopologyKey(new TopologyId(requireNonNull(topologyId)))).build();
}
@Override
*/
package org.opendaylight.netconf.sal.connect.util;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import java.net.InetSocketAddress;
import java.util.Objects;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host;
private Host host;
private RemoteDeviceId(final String name) {
- this.name = Preconditions.checkNotNull(name);
+ this.name = requireNonNull(name);
this.topologyPath = DEFAULT_TOPOLOGY_NODE
.node(NodeIdentifierWithPredicates.of(Node.QNAME, NODE_ID_QNAME, name));
this.key = new NodeKey(new NodeId(name));