Fix raw type warnings
[netconf.git] / netconf / netconf-topology-singleton / src / main / java / org / opendaylight / netconf / topology / singleton / impl / utils / NetconfTopologySetup.java
index 9ee287d97dfa092a6306c88e2ad8be7502d69e04..65daa1544e28edddb8fe7066a2b85f47ff2bf812 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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,
@@ -10,17 +10,17 @@ package org.opendaylight.netconf.topology.singleton.impl.utils;
 
 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 {
 
@@ -29,31 +29,35 @@ 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() {
@@ -76,10 +80,6 @@ public class NetconfTopologySetup {
         return node;
     }
 
-    public BindingAwareBroker getBindingAwareBroker() {
-        return bindingAwareBroker;
-    }
-
     public ThreadPool getProcessingExecutor() {
         return processingExecutor;
     }
@@ -88,10 +88,6 @@ public class NetconfTopologySetup {
         return keepaliveExecutor;
     }
 
-    public Broker getDomBroker() {
-        return domBroker;
-    }
-
     public ActorSystem getActorSystem() {
         return actorSystem;
     }
@@ -109,7 +105,23 @@ public class NetconfTopologySetup {
     }
 
     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 {
@@ -119,17 +131,19 @@ public class NetconfTopologySetup {
         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() {
@@ -182,20 +196,11 @@ public class NetconfTopologySetup {
             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;
         }
@@ -204,25 +209,16 @@ public class NetconfTopologySetup {
             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;
         }
@@ -231,7 +227,7 @@ public class NetconfTopologySetup {
             return eventExecutor;
         }
 
-        public NetconfTopologySetupBuilder setEventExecutor(EventExecutor eventExecutor) {
+        public NetconfTopologySetupBuilder setEventExecutor(final EventExecutor eventExecutor) {
             this.eventExecutor = eventExecutor;
             return this;
         }
@@ -240,7 +236,7 @@ public class NetconfTopologySetup {
             return topologyId;
         }
 
-        public NetconfTopologySetupBuilder setTopologyId(String topologyId) {
+        public NetconfTopologySetupBuilder setTopologyId(final String topologyId) {
             this.topologyId = topologyId;
             return this;
         }
@@ -249,7 +245,7 @@ public class NetconfTopologySetup {
             return netconfClientDispatcher;
         }
 
-        public NetconfTopologySetupBuilder setNetconfClientDispatcher(NetconfClientDispatcher clientDispatcher) {
+        public NetconfTopologySetupBuilder setNetconfClientDispatcher(final NetconfClientDispatcher clientDispatcher) {
             this.netconfClientDispatcher = clientDispatcher;
             return this;
         }
@@ -264,6 +260,42 @@ public class NetconfTopologySetup {
             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();
         }