Automation adds INFO.yaml
[oom/platform/cert-service.git] / certService / src / main / java / org / onap / oom / certservice / certification / configuration / model / Cmpv2Server.java
1 /*
2  * ============LICENSE_START=======================================================
3  * PROJECT
4  * ================================================================================
5  * Copyright (C) 2020 Nokia. 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.oom.certservice.certification.configuration.model;
22
23 import javax.validation.Valid;
24 import javax.validation.constraints.NotNull;
25
26 import org.bouncycastle.asn1.x500.X500Name;
27 import org.hibernate.validator.constraints.Length;
28 import org.onap.oom.certservice.certification.configuration.validation.constraints.Cmpv2Url;
29
30 public class Cmpv2Server {
31
32     private static final int MAX_CA_NAME_LENGTH = 128;
33
34     @NotNull
35     @Valid
36     private Authentication authentication;
37     @NotNull
38     private CaMode caMode;
39     @NotNull
40     @Length(min = 1, max = MAX_CA_NAME_LENGTH)
41     private String caName;
42     @NotNull
43     private X500Name issuerDN;
44     @Cmpv2Url
45     private String url;
46
47     public Authentication getAuthentication() {
48         return authentication;
49     }
50
51     public void setAuthentication(Authentication authentication) {
52         this.authentication = authentication;
53     }
54
55     public CaMode getCaMode() {
56         return caMode;
57     }
58
59     public void setCaMode(CaMode caMode) {
60         this.caMode = caMode;
61     }
62
63     public String getCaName() {
64         return caName;
65     }
66
67     public void setCaName(String caName) {
68         this.caName = caName;
69     }
70
71     public X500Name getIssuerDN() {
72         return issuerDN;
73     }
74
75     public void setIssuerDN(X500Name issuerDN) {
76         this.issuerDN = issuerDN;
77     }
78
79     public String getUrl() {
80         return url;
81     }
82
83     public void setUrl(String url) {
84         this.url = url;
85     }
86
87     @Override
88     public String toString() {
89         return "Cmpv2Server{"
90                 + "authentication=" + authentication
91                 + ", caMode=" + caMode
92                 + ", caName='" + caName + '\''
93                 + ", issuerDN='" + issuerDN + '\''
94                 + ", url='" + url + '\''
95                 + '}';
96     }
97
98 }