From: Robert Varga Date: Tue, 1 Oct 2019 21:13:35 +0000 (+0200) Subject: Lower visibility to package X-Git-Tag: release/magnesium~34 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=492b47f75b904b66c65b188a5ccd7e816780f090;p=netconf.git Lower visibility to package This is a private-class method, it is fair game to declare it as package-private, as noone can observe it outside of the nest. Remove the need for shenanigans and lower access to the sole method. Change-Id: I5d44202f28e21ce57666f607f5634191ff517f17 Signed-off-by: Robert Varga --- diff --git a/netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java b/netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java index 47ee60eecc..2e4f360743 100644 --- a/netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java +++ b/netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java @@ -80,7 +80,7 @@ public class NetconfCallHomeServer implements AutoCloseable, ServerKeyVerifier { doAuth(clientSession); break; case Authenticated: - doPostAuth(clientSession); + CallHomeSessionContext.getFrom(clientSession).openNetconfChannel(); break; default: break; @@ -100,20 +100,16 @@ public class NetconfCallHomeServer implements AutoCloseable, ServerKeyVerifier { } LOG.debug("SSH Session {} closed", session); } - }; - } - private static void doPostAuth(final ClientSession session) { - CallHomeSessionContext.getFrom(session).openNetconfChannel(); - } - - private void doAuth(final ClientSession session) { - try { - final AuthFuture authFuture = CallHomeSessionContext.getFrom(session).authorize(); - authFuture.addListener(newAuthSshFutureListener(session)); - } catch (IOException e) { - LOG.error("Failed to authorize session {}", session, e); - } + private void doAuth(final ClientSession session) { + try { + final AuthFuture authFuture = CallHomeSessionContext.getFrom(session).authorize(); + authFuture.addListener(newAuthSshFutureListener(session)); + } catch (IOException e) { + LOG.error("Failed to authorize session {}", session, e); + } + } + }; } private SshFutureListener newAuthSshFutureListener(final ClientSession session) { diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologySetup.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologySetup.java index 4224d1eb51..355c4e5599 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologySetup.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologySetup.java @@ -151,9 +151,10 @@ public class NetconfTopologySetup { private AAAEncryptionService encryptionService; public NetconfTopologySetupBuilder() { + } - private ClusterSingletonServiceProvider getClusterSingletonServiceProvider() { + ClusterSingletonServiceProvider getClusterSingletonServiceProvider() { return clusterSingletonServiceProvider; } @@ -163,7 +164,7 @@ public class NetconfTopologySetup { return this; } - private DOMRpcProviderService getRpcProviderRegistry() { + DOMRpcProviderService getRpcProviderRegistry() { return rpcProviderRegistry; } @@ -172,7 +173,7 @@ public class NetconfTopologySetup { return this; } - private DOMActionProviderService getActionProviderRegistry() { + DOMActionProviderService getActionProviderRegistry() { return actionProviderRegistry; } @@ -182,7 +183,7 @@ public class NetconfTopologySetup { return this; } - private DataBroker getDataBroker() { + DataBroker getDataBroker() { return dataBroker; } @@ -191,7 +192,7 @@ public class NetconfTopologySetup { return this; } - private InstanceIdentifier getInstanceIdentifier() { + InstanceIdentifier getInstanceIdentifier() { return instanceIdentifier; } @@ -213,7 +214,7 @@ public class NetconfTopologySetup { return new NetconfTopologySetup(this); } - private ScheduledExecutorService getKeepaliveExecutor() { + ScheduledExecutorService getKeepaliveExecutor() { return keepaliveExecutor; } @@ -222,7 +223,7 @@ public class NetconfTopologySetup { return this; } - private ListeningExecutorService getProcessingExecutor() { + ListeningExecutorService getProcessingExecutor() { return processingExecutor; } @@ -231,7 +232,7 @@ public class NetconfTopologySetup { return this; } - private ActorSystem getActorSystem() { + ActorSystem getActorSystem() { return actorSystem; } @@ -240,7 +241,7 @@ public class NetconfTopologySetup { return this; } - private EventExecutor getEventExecutor() { + EventExecutor getEventExecutor() { return eventExecutor; } @@ -249,7 +250,7 @@ public class NetconfTopologySetup { return this; } - private String getTopologyId() { + String getTopologyId() { return topologyId; } @@ -258,7 +259,7 @@ public class NetconfTopologySetup { return this; } - private NetconfClientDispatcher getNetconfClientDispatcher() { + NetconfClientDispatcher getNetconfClientDispatcher() { return netconfClientDispatcher; } @@ -273,7 +274,7 @@ public class NetconfTopologySetup { return this; } - private NetconfDevice.SchemaResourcesDTO getSchemaResourceDTO() { + NetconfDevice.SchemaResourcesDTO getSchemaResourceDTO() { return schemaResourceDTO; } @@ -282,7 +283,7 @@ public class NetconfTopologySetup { return this; } - private Duration getIdleTimeout() { + Duration getIdleTimeout() { return idleTimeout; } @@ -304,7 +305,7 @@ public class NetconfTopologySetup { return this.privateKeyPassphrase; } - private AAAEncryptionService getEncryptionService() { + AAAEncryptionService getEncryptionService() { return this.encryptionService; } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/action/InvokeActionMessage.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/action/InvokeActionMessage.java index 58a44044fa..4b1ccfe6e6 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/action/InvokeActionMessage.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/action/InvokeActionMessage.java @@ -50,7 +50,7 @@ public class InvokeActionMessage implements Serializable { return schemaPathMessage.getSchemaPath(); } - private SchemaPathMessage getSchemaPathMessage() { + SchemaPathMessage getSchemaPathMessage() { return schemaPathMessage; } diff --git a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/rpc/InvokeRpcMessage.java b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/rpc/InvokeRpcMessage.java index 7a5fcf9550..70e2f44cb4 100644 --- a/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/rpc/InvokeRpcMessage.java +++ b/netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/rpc/InvokeRpcMessage.java @@ -29,7 +29,7 @@ public class InvokeRpcMessage implements Serializable { this.normalizedNodeMessage = normalizedNodeMessage; } - private SchemaPathMessage getSchemaPathMessage() { + SchemaPathMessage getSchemaPathMessage() { return schemaPathMessage; } diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/listener/NetconfSessionPreferences.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/listener/NetconfSessionPreferences.java index 341d302200..d69acefef3 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/listener/NetconfSessionPreferences.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/listener/NetconfSessionPreferences.java @@ -41,7 +41,7 @@ public final class NetconfSessionPreferences { this.skipLength = name.length(); } - private String from(final Iterable params) { + String from(final Iterable params) { final Optional o = Iterables.tryFind(params, predicate); if (!o.isPresent()) { return null; diff --git a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteRunningTx.java b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteRunningTx.java index d88acbfcd2..ea79ccd418 100644 --- a/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteRunningTx.java +++ b/netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteRunningTx.java @@ -50,8 +50,8 @@ public class WriteRunningTx extends AbstractWriteTx { this(id, netOps, rollbackSupport, true); } - public WriteRunningTx(RemoteDeviceId id, NetconfBaseOps netconfOps, boolean rollbackSupport, - boolean isLockAllowed) { + public WriteRunningTx(final RemoteDeviceId id, final NetconfBaseOps netconfOps, final boolean rollbackSupport, + final boolean isLockAllowed) { super(id, netconfOps, rollbackSupport, isLockAllowed); } @@ -109,8 +109,8 @@ public class WriteRunningTx extends AbstractWriteTx { this.defaultOperation = defaultOperation; } - private ListenableFuture execute(final RemoteDeviceId id, final NetconfBaseOps netOps, - final boolean rollbackSupport) { + ListenableFuture execute(final RemoteDeviceId id, final NetconfBaseOps netOps, + final boolean rollbackSupport) { final NetconfRpcFutureCallback editConfigCallback = new NetconfRpcFutureCallback("Edit running", id); if (defaultOperation.isPresent()) { return netOps.editConfigRunning(editConfigCallback, editStructure, defaultOperation.get(),