[DMAAP-BC] Consolidate bus controller repos
[dmaap/buscontroller.git] / dmaap-bc / src / main / java / org / onap / dmaap / dbcapi / server / CertificateManager.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * org.onap.dmaap
4  * ================================================================================
5  * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.dmaap.dbcapi.server;
22
23 import org.onap.dmaap.dbcapi.logging.BaseLoggingClass;
24
25 public abstract class CertificateManager extends BaseLoggingClass{
26         
27         class cmAttribute {
28                 private String type;
29                 private String file;
30                 private String password;
31                 
32                 private String getType() {
33                         return type;
34                 }
35                 private void setType(String certificateType) {
36                         this.type = certificateType;
37                 }
38                 private String getFile() {
39                         return file;
40                 }
41                 private void setFile(String keyStoreFile) {
42                         this.file = keyStoreFile;
43                 }
44                 private void setPassword( String pwd ) {
45                         this.password = pwd;
46                 }
47                 private String getPassword() {
48                         return password;
49                 }
50         }
51
52         private cmAttribute keyStore;
53         private cmAttribute     trustStore;
54         protected boolean ready;
55
56         CertificateManager() {
57                 keyStore = new cmAttribute();
58                 trustStore = new cmAttribute();
59                 ready = false;
60         }
61
62         public boolean isReady() {
63                 return ready;
64         }
65         
66         public String getKeyStoreType() {
67                 return keyStore.getType();
68         }
69         public void setKeyStoreType(String certificateType) {
70                 this.keyStore.setType( certificateType) ;
71         }
72         public String getKeyStoreFile() {
73                 return keyStore.getFile();
74         }
75         public void setKeyStoreFile(String keyStoreFile) {
76                 this.keyStore.setFile(keyStoreFile);
77         }
78
79         public String getKeyStorePassword() {
80                 return keyStore.getPassword();
81         }
82         public void setKeyStorePassword(String keyStorePassword) {
83                 this.keyStore.setPassword(keyStorePassword);
84         }
85         public String getTrustStoreType() {
86                 return trustStore.getType();
87         }
88         public void setTrustStoreType( String type ) {
89                 this.trustStore.setType(type);
90         }
91         public String getTrustStoreFile() {
92                 return trustStore.getFile();
93         }
94         public void setTrustStoreFile(String trustStoreFile) {
95                 this.trustStore.setFile(trustStoreFile);
96         }
97         public String getTrustStorePassword() {
98                 return trustStore.getPassword();
99         }
100         public void setTrustStorePassword(String trustStorePassword) {
101                 this.trustStore.setPassword(trustStorePassword);
102         }
103
104 }