Package: ConnectionSslOptions

ConnectionSslOptions

nameinstructionbranchcomplexitylinemethod
ConnectionSslOptions(SslManagerServiceOptions)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
equals(Object)
M: 130 C: 0
0%
M: 46 C: 0
0%
M: 24 C: 0
0%
M: 42 C: 0
0%
M: 1 C: 0
0%
getAlias()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getCiphers()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getHostnameVerification()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getKeyStore()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getKeyStorePassword()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getProtocol()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getSslManagerOpts()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getTrustStore()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
hashCode()
M: 14 C: 87
86%
M: 7 C: 7
50%
M: 7 C: 1
13%
M: 0 C: 10
100%
M: 0 C: 1
100%
setAlias(String)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setCiphers(String)
M: 0 C: 17
100%
M: 0 C: 4
100%
M: 0 C: 3
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
setHostnameVerification(boolean)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setKeyStore(String)
M: 0 C: 17
100%
M: 0 C: 4
100%
M: 0 C: 3
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
setKeyStorePassword(char[])
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
setProtocol(String)
M: 0 C: 17
100%
M: 0 C: 4
100%
M: 0 C: 3
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
setTrustStore(String)
M: 0 C: 17
100%
M: 0 C: 4
100%
M: 0 C: 3
100%
M: 0 C: 5
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011, 2018 Eurotech and/or its affiliates
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License v1.0
6: * which accompanies this distribution, and is available at
7: * http://www.eclipse.org/legal/epl-v10.html
8: *
9: * Contributors:
10: * Eurotech
11: *******************************************************************************/
12: package org.eclipse.kura.core.ssl;
13:
14: import java.util.Arrays;
15:
16: public class ConnectionSslOptions {
17:
18: private final SslManagerServiceOptions sslManagerOpts;
19: private String protocol;
20: private String ciphers;
21: private String trustStore;
22: private String keyStore;
23: private char[] keyStorePassword;
24: private String alias;
25: private boolean hostnameVerification;
26:
27: public ConnectionSslOptions(SslManagerServiceOptions sslManagerOpts) {
28: this.sslManagerOpts = sslManagerOpts;
29: }
30:
31: public SslManagerServiceOptions getSslManagerOpts() {
32: return this.sslManagerOpts;
33: }
34:
35: public String getProtocol() {
36: return this.protocol;
37: }
38:
39: public void setProtocol(String protocol) {
40:• if (protocol == null || "".equals(protocol.trim())) {
41: this.protocol = this.sslManagerOpts.getSslProtocol();
42: } else {
43: this.protocol = protocol;
44: }
45: }
46:
47: public String getCiphers() {
48: return this.ciphers;
49: }
50:
51: public void setCiphers(String ciphers) {
52:• if (ciphers == null || "".equals(ciphers.trim())) {
53: this.ciphers = this.sslManagerOpts.getSslCiphers();
54: } else {
55: this.ciphers = ciphers;
56: }
57: }
58:
59: public String getTrustStore() {
60: return this.trustStore;
61: }
62:
63: public void setTrustStore(String trustStore) {
64:• if (trustStore == null || "".equals(trustStore.trim())) {
65: this.trustStore = this.sslManagerOpts.getSslKeyStore();
66: } else {
67: this.trustStore = trustStore;
68: }
69: }
70:
71: public String getKeyStore() {
72: return this.keyStore;
73: }
74:
75: public void setKeyStore(String keyStore) {
76:• if (keyStore == null || "".equals(keyStore.trim())) {
77: this.keyStore = this.sslManagerOpts.getSslKeyStore();
78: } else {
79: this.keyStore = keyStore;
80: }
81: }
82:
83: public char[] getKeyStorePassword() {
84: return this.keyStorePassword;
85: }
86:
87: public void setKeyStorePassword(char[] keyStorePassword) {
88: this.keyStorePassword = keyStorePassword;
89: }
90:
91: public String getAlias() {
92: return this.alias;
93: }
94:
95: public void setAlias(String alias) {
96: this.alias = alias;
97: }
98:
99: public boolean getHostnameVerification() {
100: return this.hostnameVerification;
101: }
102:
103: public void setHostnameVerification(boolean hostnameVerification) {
104: this.hostnameVerification = hostnameVerification;
105: }
106:
107: @Override
108: public int hashCode() {
109: final int prime = 31;
110: int result = 1;
111:• result = prime * result + (this.alias == null ? 0 : this.alias.hashCode());
112:• result = prime * result + (this.ciphers == null ? 0 : this.ciphers.hashCode());
113:• result = prime * result + (this.hostnameVerification ? 1231 : 1237);
114:• result = prime * result + (this.keyStore == null ? 0 : this.keyStore.hashCode());
115: result = prime * result + Arrays.hashCode(this.keyStorePassword);
116:• result = prime * result + (this.protocol == null ? 0 : this.protocol.hashCode());
117:• result = prime * result + (this.sslManagerOpts == null ? 0 : this.sslManagerOpts.hashCode());
118:• result = prime * result + (this.trustStore == null ? 0 : this.trustStore.hashCode());
119: return result;
120: }
121:
122: @Override
123: public boolean equals(Object obj) {
124:• if (this == obj) {
125: return true;
126: }
127:• if (obj == null) {
128: return false;
129: }
130:• if (!(obj instanceof ConnectionSslOptions)) {
131: return false;
132: }
133: ConnectionSslOptions other = (ConnectionSslOptions) obj;
134:• if (this.alias == null) {
135:• if (other.alias != null) {
136: return false;
137: }
138:• } else if (!this.alias.equals(other.alias)) {
139: return false;
140: }
141:• if (this.ciphers == null) {
142:• if (other.ciphers != null) {
143: return false;
144: }
145:• } else if (!this.ciphers.equals(other.ciphers)) {
146: return false;
147: }
148:• if (this.hostnameVerification != other.hostnameVerification) {
149: return false;
150: }
151:• if (this.keyStore == null) {
152:• if (other.keyStore != null) {
153: return false;
154: }
155:• } else if (!this.keyStore.equals(other.keyStore)) {
156: return false;
157: }
158:• if (!Arrays.equals(this.keyStorePassword, other.keyStorePassword)) {
159: return false;
160: }
161:• if (this.protocol == null) {
162:• if (other.protocol != null) {
163: return false;
164: }
165:• } else if (!this.protocol.equals(other.protocol)) {
166: return false;
167: }
168:• if (this.sslManagerOpts == null) {
169:• if (other.sslManagerOpts != null) {
170: return false;
171: }
172:• } else if (!this.sslManagerOpts.equals(other.sslManagerOpts)) {
173: return false;
174: }
175:• if (this.trustStore == null) {
176:• if (other.trustStore != null) {
177: return false;
178: }
179:• } else if (!this.trustStore.equals(other.trustStore)) {
180: return false;
181: }
182: return true;
183: }
184: }