/*
- * 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,
import akka.actor.ActorSystem;
import io.netty.util.concurrent.EventExecutor;
+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.BindingAwareBroker;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.controller.sal.core.api.Broker;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.netconf.client.NetconfClientDispatcher;
import org.opendaylight.netconf.sal.connect.netconf.NetconfDevice;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import scala.concurrent.duration.Duration;
public class NetconfTopologySetup {
private final DataBroker dataBroker;
private final InstanceIdentifier<Node> instanceIdentifier;
private final Node node;
- private final BindingAwareBroker bindingAwareBroker;
private final ScheduledThreadPool keepaliveExecutor;
private final ThreadPool processingExecutor;
- private final Broker domBroker;
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.dataBroker = builder.getDataBroker();
this.instanceIdentifier = builder.getInstanceIdentifier();
this.node = builder.getNode();
- this.bindingAwareBroker = builder.getBindingAwareBroker();
this.keepaliveExecutor = builder.getKeepaliveExecutor();
this.processingExecutor = builder.getProcessingExecutor();
- this.domBroker = builder.getDomBroker();
this.actorSystem = builder.getActorSystem();
this.eventExecutor = builder.getEventExecutor();
this.netconfClientDispatcher = builder.getNetconfClientDispatcher();
this.topologyId = builder.getTopologyId();
this.schemaResourceDTO = builder.getSchemaResourceDTO();
+ this.idleTimeout = builder.getIdleTimeout();
+ this.privateKeyPath = builder.getPrivateKeyPath();
+ this.privateKeyPassphrase = builder.getPrivateKeyPassphrase();
+ this.encryptionService = builder.getEncryptionService();
}
public ClusterSingletonServiceProvider getClusterSingletonServiceProvider() {
return node;
}
- public BindingAwareBroker getBindingAwareBroker() {
- return bindingAwareBroker;
- }
-
public ThreadPool getProcessingExecutor() {
return processingExecutor;
}
return keepaliveExecutor;
}
- public Broker getDomBroker() {
- return domBroker;
- }
-
public ActorSystem getActorSystem() {
return actorSystem;
}
}
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 DataBroker dataBroker;
private InstanceIdentifier<Node> instanceIdentifier;
private Node node;
- private BindingAwareBroker bindingAwareBroker;
private ScheduledThreadPool keepaliveExecutor;
private ThreadPool processingExecutor;
- private Broker domBroker;
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 new NetconfTopologySetup(this);
}
- private BindingAwareBroker getBindingAwareBroker() {
- return bindingAwareBroker;
- }
-
- public NetconfTopologySetupBuilder setBindingAwareBroker(BindingAwareBroker bindingAwareBroker) {
- this.bindingAwareBroker = bindingAwareBroker;
- return this;
- }
-
private ScheduledThreadPool getKeepaliveExecutor() {
return keepaliveExecutor;
}
- public NetconfTopologySetupBuilder setKeepaliveExecutor(ScheduledThreadPool keepaliveExecutor) {
+ public NetconfTopologySetupBuilder setKeepaliveExecutor(final ScheduledThreadPool keepaliveExecutor) {
this.keepaliveExecutor = keepaliveExecutor;
return this;
}
return processingExecutor;
}
- public NetconfTopologySetupBuilder setProcessingExecutor(ThreadPool processingExecutor) {
+ public NetconfTopologySetupBuilder setProcessingExecutor(final ThreadPool processingExecutor) {
this.processingExecutor = processingExecutor;
return this;
}
- private Broker getDomBroker() {
- return domBroker;
- }
-
- public NetconfTopologySetupBuilder setDomBroker(Broker domBroker) {
- this.domBroker = domBroker;
- return this;
- }
-
private ActorSystem getActorSystem() {
return actorSystem;
}
- public NetconfTopologySetupBuilder setActorSystem(ActorSystem actorSystem) {
+ public NetconfTopologySetupBuilder setActorSystem(final ActorSystem actorSystem) {
this.actorSystem = actorSystem;
return this;
}
return eventExecutor;
}
- public NetconfTopologySetupBuilder setEventExecutor(EventExecutor eventExecutor) {
+ public NetconfTopologySetupBuilder setEventExecutor(final EventExecutor eventExecutor) {
this.eventExecutor = eventExecutor;
return this;
}
return topologyId;
}
- public NetconfTopologySetupBuilder setTopologyId(String topologyId) {
+ public NetconfTopologySetupBuilder setTopologyId(final String topologyId) {
this.topologyId = topologyId;
return this;
}
return netconfClientDispatcher;
}
- public NetconfTopologySetupBuilder setNetconfClientDispatcher(NetconfClientDispatcher clientDispatcher) {
+ public NetconfTopologySetupBuilder setNetconfClientDispatcher(final NetconfClientDispatcher clientDispatcher) {
this.netconfClientDispatcher = clientDispatcher;
return this;
}
return schemaResourceDTO;
}
+ public NetconfTopologySetupBuilder setIdleTimeout(final Duration idleTimeout) {
+ this.idleTimeout = idleTimeout;
+ return this;
+ }
+
+ private Duration getIdleTimeout() {
+ return idleTimeout;
+ }
+
+ public NetconfTopologySetupBuilder setPrivateKeyPath(String privateKeyPath) {
+ this.privateKeyPath = privateKeyPath;
+ return this;
+ }
+
+ public String getPrivateKeyPath() {
+ return this.privateKeyPath;
+ }
+
+ public NetconfTopologySetupBuilder setPrivateKeyPassphrase(String privateKeyPassphrase) {
+ this.privateKeyPassphrase = privateKeyPassphrase;
+ return this;
+ }
+
+ public String getPrivateKeyPassphrase() {
+ return this.privateKeyPassphrase;
+ }
+
+ private AAAEncryptionService getEncryptionService() {
+ return this.encryptionService;
+ }
+
+ public NetconfTopologySetupBuilder setEncryptionService(final AAAEncryptionService encryptionService) {
+ this.encryptionService = encryptionService;
+ return this;
+ }
+
public static NetconfTopologySetupBuilder create() {
return new NetconfTopologySetupBuilder();
}