Fix raw type warnings
[netconf.git] / netconf / netconf-topology-singleton / src / main / java / org / opendaylight / netconf / topology / singleton / impl / utils / NetconfTopologySetup.java
index be57ce35aa7b0ae6dcf4608f696653cc8d263e5a..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,12 +10,11 @@ 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;
@@ -30,33 +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() {
@@ -79,10 +80,6 @@ public class NetconfTopologySetup {
         return node;
     }
 
-    public BindingAwareBroker getBindingAwareBroker() {
-        return bindingAwareBroker;
-    }
-
     public ThreadPool getProcessingExecutor() {
         return processingExecutor;
     }
@@ -91,10 +88,6 @@ public class NetconfTopologySetup {
         return keepaliveExecutor;
     }
 
-    public Broker getDomBroker() {
-        return domBroker;
-    }
-
     public ActorSystem getActorSystem() {
         return actorSystem;
     }
@@ -112,13 +105,25 @@ 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 {
 
         private ClusterSingletonServiceProvider clusterSingletonServiceProvider;
@@ -126,18 +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() {
@@ -190,15 +196,6 @@ public class NetconfTopologySetup {
             return new NetconfTopologySetup(this);
         }
 
-        private BindingAwareBroker getBindingAwareBroker() {
-            return bindingAwareBroker;
-        }
-
-        public NetconfTopologySetupBuilder setBindingAwareBroker(final BindingAwareBroker bindingAwareBroker) {
-            this.bindingAwareBroker = bindingAwareBroker;
-            return this;
-        }
-
         private ScheduledThreadPool getKeepaliveExecutor() {
             return keepaliveExecutor;
         }
@@ -217,15 +214,6 @@ public class NetconfTopologySetup {
             return this;
         }
 
-        private Broker getDomBroker() {
-            return domBroker;
-        }
-
-        public NetconfTopologySetupBuilder setDomBroker(final Broker domBroker) {
-            this.domBroker = domBroker;
-            return this;
-        }
-
         private ActorSystem getActorSystem() {
             return actorSystem;
         }
@@ -281,6 +269,33 @@ public class NetconfTopologySetup {
             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();
         }