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>
doAuth(clientSession);
break;
case Authenticated:
doAuth(clientSession);
break;
case Authenticated:
- doPostAuth(clientSession);
+ CallHomeSessionContext.getFrom(clientSession).openNetconfChannel();
}
LOG.debug("SSH Session {} closed", session);
}
}
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) {
}
private SshFutureListener<AuthFuture> newAuthSshFutureListener(final ClientSession session) {
private AAAEncryptionService encryptionService;
public NetconfTopologySetupBuilder() {
private AAAEncryptionService encryptionService;
public NetconfTopologySetupBuilder() {
- private ClusterSingletonServiceProvider getClusterSingletonServiceProvider() {
+ ClusterSingletonServiceProvider getClusterSingletonServiceProvider() {
return clusterSingletonServiceProvider;
}
return clusterSingletonServiceProvider;
}
- private DOMRpcProviderService getRpcProviderRegistry() {
+ DOMRpcProviderService getRpcProviderRegistry() {
return rpcProviderRegistry;
}
return rpcProviderRegistry;
}
- private DOMActionProviderService getActionProviderRegistry() {
+ DOMActionProviderService getActionProviderRegistry() {
return actionProviderRegistry;
}
return actionProviderRegistry;
}
- private DataBroker getDataBroker() {
+ DataBroker getDataBroker() {
- private InstanceIdentifier<Node> getInstanceIdentifier() {
+ InstanceIdentifier<Node> getInstanceIdentifier() {
return instanceIdentifier;
}
return instanceIdentifier;
}
return new NetconfTopologySetup(this);
}
return new NetconfTopologySetup(this);
}
- private ScheduledExecutorService getKeepaliveExecutor() {
+ ScheduledExecutorService getKeepaliveExecutor() {
return keepaliveExecutor;
}
return keepaliveExecutor;
}
- private ListeningExecutorService getProcessingExecutor() {
+ ListeningExecutorService getProcessingExecutor() {
return processingExecutor;
}
return processingExecutor;
}
- private ActorSystem getActorSystem() {
+ ActorSystem getActorSystem() {
- private EventExecutor getEventExecutor() {
+ EventExecutor getEventExecutor() {
- private String getTopologyId() {
+ String getTopologyId() {
- private NetconfClientDispatcher getNetconfClientDispatcher() {
+ NetconfClientDispatcher getNetconfClientDispatcher() {
return netconfClientDispatcher;
}
return netconfClientDispatcher;
}
- private NetconfDevice.SchemaResourcesDTO getSchemaResourceDTO() {
+ NetconfDevice.SchemaResourcesDTO getSchemaResourceDTO() {
return schemaResourceDTO;
}
return schemaResourceDTO;
}
- private Duration getIdleTimeout() {
+ Duration getIdleTimeout() {
return this.privateKeyPassphrase;
}
return this.privateKeyPassphrase;
}
- private AAAEncryptionService getEncryptionService() {
+ AAAEncryptionService getEncryptionService() {
return this.encryptionService;
}
return this.encryptionService;
}
return schemaPathMessage.getSchemaPath();
}
return schemaPathMessage.getSchemaPath();
}
- private SchemaPathMessage getSchemaPathMessage() {
+ SchemaPathMessage getSchemaPathMessage() {
return schemaPathMessage;
}
return schemaPathMessage;
}
this.normalizedNodeMessage = normalizedNodeMessage;
}
this.normalizedNodeMessage = normalizedNodeMessage;
}
- private SchemaPathMessage getSchemaPathMessage() {
+ SchemaPathMessage getSchemaPathMessage() {
return schemaPathMessage;
}
return schemaPathMessage;
}
this.skipLength = name.length();
}
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;
final Optional<String> o = Iterables.tryFind(params, predicate);
if (!o.isPresent()) {
return null;
this(id, netOps, rollbackSupport, true);
}
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);
}
super(id, netconfOps, rollbackSupport, isLockAllowed);
}
this.defaultOperation = defaultOperation;
}
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(),
final NetconfRpcFutureCallback editConfigCallback = new NetconfRpcFutureCallback("Edit running", id);
if (defaultOperation.isPresent()) {
return netOps.editConfigRunning(editConfigCallback, editStructure, defaultOperation.get(),