Lower visibility to package 63/84863/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 1 Oct 2019 21:13:35 +0000 (23:13 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 5 Oct 2019 12:33:19 +0000 (14:33 +0200)
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 <robert.varga@pantheon.tech>
netconf/callhome-protocol/src/main/java/org/opendaylight/netconf/callhome/protocol/NetconfCallHomeServer.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/utils/NetconfTopologySetup.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/action/InvokeActionMessage.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/messages/rpc/InvokeRpcMessage.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/listener/NetconfSessionPreferences.java
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/WriteRunningTx.java

index 47ee60eeccf93e7aad2f2087417a73b5f887cba8..2e4f3607430e82c2deb64ada6290db23049dcf30 100644 (file)
@@ -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<AuthFuture> newAuthSshFutureListener(final ClientSession session) {
index 4224d1eb5179896871d8c53f3c6eac3338831b2e..355c4e55994926d16cb7370a59ae48a4db3e5aa4 100644 (file)
@@ -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<Node> getInstanceIdentifier() {
+        InstanceIdentifier<Node> 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;
         }
 
index 58a44044fad9e0194d7789c00b31955706ebdd2e..4b1ccfe6e658ce4df3b030cc9e81c16a309c8b24 100644 (file)
@@ -50,7 +50,7 @@ public class InvokeActionMessage implements Serializable {
         return schemaPathMessage.getSchemaPath();
     }
 
-    private SchemaPathMessage getSchemaPathMessage() {
+    SchemaPathMessage getSchemaPathMessage() {
         return schemaPathMessage;
     }
 
index 7a5fcf95504470749cf23da87c690d5e96c8bbf3..70e2f44cb464cad6bc986e952541f2efe6227aab 100644 (file)
@@ -29,7 +29,7 @@ public class InvokeRpcMessage implements Serializable {
         this.normalizedNodeMessage = normalizedNodeMessage;
     }
 
-    private SchemaPathMessage getSchemaPathMessage() {
+    SchemaPathMessage getSchemaPathMessage() {
         return schemaPathMessage;
     }
 
index 341d30220081180f51e654dc41e718446633d476..d69acefef3b34b0b57c315461488fe19567728f3 100644 (file)
@@ -41,7 +41,7 @@ public final class NetconfSessionPreferences {
             this.skipLength = name.length();
         }
 
-        private String from(final Iterable<String> params) {
+        String from(final Iterable<String> params) {
             final Optional<String> o = Iterables.tryFind(params, predicate);
             if (!o.isPresent()) {
                 return null;
index d88acbfcd2681891c997254efda532516bdaa275..ea79ccd4185d768972e667bd9f116188b7e8cb0e 100644 (file)
@@ -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<DOMRpcResult> execute(final RemoteDeviceId id, final NetconfBaseOps netOps,
-                                                       final boolean rollbackSupport) {
+        ListenableFuture<DOMRpcResult> 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(),