Adjust to yangtools-2.0.0/odlparent-3.0.0 changes
[netconf.git] / netconf / netconf-topology-singleton / src / main / java / org / opendaylight / netconf / topology / singleton / impl / utils / NetconfTopologySetup.java
index cee8c0d80774b077665c771a27a36142439872b1..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,6 +10,7 @@ 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;
@@ -36,8 +37,11 @@ public class NetconfTopologySetup {
     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();
@@ -51,6 +55,9 @@ public class NetconfTopologySetup {
         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() {
@@ -98,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;
@@ -120,8 +139,11 @@ public class NetconfTopologySetup {
         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() {
@@ -247,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();
         }