/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* 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.topology.singleton.impl.utils;
import akka.actor.ActorSystem;
+import com.google.common.util.concurrent.ListeningExecutorService;
import io.netty.util.concurrent.EventExecutor;
+import java.util.concurrent.ScheduledExecutorService;
import org.opendaylight.aaa.encrypt.AAAEncryptionService;
-import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
-import org.opendaylight.controller.config.threadpool.ThreadPool;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.dom.api.DOMActionProviderService;
+import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.netconf.client.NetconfClientDispatcher;
import org.opendaylight.netconf.sal.connect.netconf.NetconfDevice;
public class NetconfTopologySetup {
private final ClusterSingletonServiceProvider clusterSingletonServiceProvider;
- private final RpcProviderRegistry rpcProviderRegistry;
+ private final DOMRpcProviderService rpcProviderRegistry;
+ private final DOMActionProviderService actionProviderRegistry;
private final DataBroker dataBroker;
private final InstanceIdentifier<Node> instanceIdentifier;
private final Node node;
- private final ScheduledThreadPool keepaliveExecutor;
- private final ThreadPool processingExecutor;
+ private final ScheduledExecutorService keepaliveExecutor;
+ private final ListeningExecutorService processingExecutor;
private final ActorSystem actorSystem;
private final EventExecutor eventExecutor;
private final NetconfClientDispatcher netconfClientDispatcher;
private final String topologyId;
private final NetconfDevice.SchemaResourcesDTO schemaResourceDTO;
private final Duration idleTimeout;
+ private final String privateKeyPath;
+ private final String privateKeyPassphrase;
private final AAAEncryptionService encryptionService;
- private NetconfTopologySetup(final NetconfTopologySetupBuilder builder) {
+ NetconfTopologySetup(final NetconfTopologySetupBuilder builder) {
this.clusterSingletonServiceProvider = builder.getClusterSingletonServiceProvider();
this.rpcProviderRegistry = builder.getRpcProviderRegistry();
+ this.actionProviderRegistry = builder.getActionProviderRegistry();
this.dataBroker = builder.getDataBroker();
this.instanceIdentifier = builder.getInstanceIdentifier();
this.node = builder.getNode();
this.topologyId = builder.getTopologyId();
this.schemaResourceDTO = builder.getSchemaResourceDTO();
this.idleTimeout = builder.getIdleTimeout();
+ this.privateKeyPath = builder.getPrivateKeyPath();
+ this.privateKeyPassphrase = builder.getPrivateKeyPassphrase();
this.encryptionService = builder.getEncryptionService();
}
return clusterSingletonServiceProvider;
}
- public RpcProviderRegistry getRpcProviderRegistry() {
+ public DOMRpcProviderService getRpcProviderRegistry() {
return rpcProviderRegistry;
}
+ public DOMActionProviderService getActionProviderRegistry() {
+ return actionProviderRegistry;
+ }
+
public DataBroker getDataBroker() {
return dataBroker;
}
return node;
}
- public ThreadPool getProcessingExecutor() {
+ public ListeningExecutorService getProcessingExecutor() {
return processingExecutor;
}
- public ScheduledThreadPool getKeepaliveExecutor() {
+ public ScheduledExecutorService getKeepaliveExecutor() {
return keepaliveExecutor;
}
}
public NetconfDevice.SchemaResourcesDTO getSchemaResourcesDTO() {
- return schemaResourceDTO;
+ return schemaResourceDTO;
}
public Duration getIdleTimeout() {
return idleTimeout;
}
+ public String getPrivateKeyPath() {
+ return privateKeyPath;
+ }
+
+ public String getPrivateKeyPassphrase() {
+ return privateKeyPassphrase;
+ }
+
public AAAEncryptionService getEncryptionService() {
return encryptionService;
}
public static class NetconfTopologySetupBuilder {
private ClusterSingletonServiceProvider clusterSingletonServiceProvider;
- private RpcProviderRegistry rpcProviderRegistry;
+ private DOMRpcProviderService rpcProviderRegistry;
+ private DOMActionProviderService actionProviderRegistry;
private DataBroker dataBroker;
private InstanceIdentifier<Node> instanceIdentifier;
private Node node;
- private ScheduledThreadPool keepaliveExecutor;
- private ThreadPool processingExecutor;
+ private ScheduledExecutorService keepaliveExecutor;
+ private ListeningExecutorService processingExecutor;
private ActorSystem actorSystem;
private EventExecutor eventExecutor;
private String topologyId;
private NetconfClientDispatcher netconfClientDispatcher;
private NetconfDevice.SchemaResourcesDTO schemaResourceDTO;
private Duration idleTimeout;
+ private String privateKeyPath;
+ private String privateKeyPassphrase;
private AAAEncryptionService encryptionService;
- public NetconfTopologySetupBuilder(){
+ public NetconfTopologySetupBuilder() {
}
private ClusterSingletonServiceProvider getClusterSingletonServiceProvider() {
return this;
}
- private RpcProviderRegistry getRpcProviderRegistry() {
+ private DOMRpcProviderService getRpcProviderRegistry() {
return rpcProviderRegistry;
}
- public NetconfTopologySetupBuilder setRpcProviderRegistry(final RpcProviderRegistry rpcProviderRegistry) {
+ public NetconfTopologySetupBuilder setRpcProviderRegistry(final DOMRpcProviderService rpcProviderRegistry) {
this.rpcProviderRegistry = rpcProviderRegistry;
return this;
}
+ private DOMActionProviderService getActionProviderRegistry() {
+ return actionProviderRegistry;
+ }
+
+ public NetconfTopologySetupBuilder setActionProviderRegistry(
+ final DOMActionProviderService actionProviderRegistry) {
+ this.actionProviderRegistry = actionProviderRegistry;
+ return this;
+ }
+
private DataBroker getDataBroker() {
return dataBroker;
}
return new NetconfTopologySetup(this);
}
- private ScheduledThreadPool getKeepaliveExecutor() {
+ private ScheduledExecutorService getKeepaliveExecutor() {
return keepaliveExecutor;
}
- public NetconfTopologySetupBuilder setKeepaliveExecutor(final ScheduledThreadPool keepaliveExecutor) {
+ public NetconfTopologySetupBuilder setKeepaliveExecutor(final ScheduledExecutorService keepaliveExecutor) {
this.keepaliveExecutor = keepaliveExecutor;
return this;
}
- private ThreadPool getProcessingExecutor() {
+ private ListeningExecutorService getProcessingExecutor() {
return processingExecutor;
}
- public NetconfTopologySetupBuilder setProcessingExecutor(final ThreadPool processingExecutor) {
+ public NetconfTopologySetupBuilder setProcessingExecutor(final ListeningExecutorService processingExecutor) {
this.processingExecutor = processingExecutor;
return this;
}
return idleTimeout;
}
+ public NetconfTopologySetupBuilder setPrivateKeyPath(final String privateKeyPath) {
+ this.privateKeyPath = privateKeyPath;
+ return this;
+ }
+
+ public String getPrivateKeyPath() {
+ return this.privateKeyPath;
+ }
+
+ public NetconfTopologySetupBuilder setPrivateKeyPassphrase(final String privateKeyPassphrase) {
+ this.privateKeyPassphrase = privateKeyPassphrase;
+ return this;
+ }
+
+ public String getPrivateKeyPassphrase() {
+ return this.privateKeyPassphrase;
+ }
+
private AAAEncryptionService getEncryptionService() {
return this.encryptionService;
}
return new NetconfTopologySetupBuilder();
}
}
-
-
-}
+}
\ No newline at end of file