Mass replace CRLF->LF
[openflowjava.git] / openflow-protocol-api / src / main / java / org / opendaylight / openflowjava / protocol / api / connection / TlsConfigurationImpl.java
1 /*
2  * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowjava.protocol.api.connection;
10
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.KeystoreType;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.config.rev140630.PathType;
13
14 /**
15  * Class is used only for testing purposes - passwords are hardcoded
16  * @author michal.polkorab
17  */
18 public class TlsConfigurationImpl implements TlsConfiguration {
19
20     private KeystoreType trustStoreType;
21     private String trustStore;
22     private KeystoreType keyStoreType;
23     private String keyStore;
24     private PathType keystorePathType;
25     private PathType truststorePathType;
26
27     /**
28      * Default constructor
29      * @param trustStoreType JKS or PKCS12
30      * @param trustStore path to trustStore file
31      * @param trustStorePathType truststore path type (classpath or path)
32      * @param keyStoreType JKS or PKCS12
33      * @param keyStore path to keyStore file
34      * @param keyStorePathType keystore path type (classpath or path)
35      */
36     public TlsConfigurationImpl(KeystoreType trustStoreType, String trustStore,
37             PathType trustStorePathType, KeystoreType keyStoreType,
38             String keyStore, PathType keyStorePathType) {
39         this.trustStoreType = trustStoreType;
40         this.trustStore = trustStore;
41         this.truststorePathType = trustStorePathType;
42         this.keyStoreType = keyStoreType;
43         this.keyStore = keyStore;
44         this.keystorePathType = keyStorePathType;
45     }
46
47     @Override
48     public KeystoreType getTlsTruststoreType() {
49         return trustStoreType;
50     }
51
52     @Override
53     public String getTlsTruststore() {
54         return trustStore;
55     }
56
57     @Override
58     public KeystoreType getTlsKeystoreType() {
59         return keyStoreType;
60     }
61
62     @Override
63     public String getTlsKeystore() {
64         return keyStore;
65     }
66
67     @Override
68     public PathType getTlsKeystorePathType() {
69         return keystorePathType;
70     }
71
72     @Override
73     public PathType getTlsTruststorePathType() {
74         return truststorePathType;
75     }
76
77     @Override
78     public String getKeystorePassword() {
79         return "opendaylight";
80     }
81
82     @Override
83     public String getCertificatePassword() {
84         return "opendaylight";
85     }
86
87     @Override
88     public String getTruststorePassword() {
89         return "opendaylight";
90     }
91 }