Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 52d2054

Browse files
Tim Bertholddependabot[bot]vdakkereakker
authored
release: v5.0.0 (#296)
* feat: throw exception and log error if no private key for alias found (#264) * feat: throw exception and log error if no private key for alias found * refactor: add used keyalias to printed logs * feat: check incoming payload for valid json and securityProfile attr (#266) * feat: check incoming payload for valid json and securityProfile attr * docs: update changelog * feat: enable or disable infomodel compatibility check (#267) * feat: enable or disable infomodel compatibility check via application properties * chore: fix checkstyle error * refactor: logs message reason formats (#269) * build(deps): bump infomodel-artifacts from 4.2.0 to 4.2.1 (#270) * build(deps): bump infomodel-artifacts from 4.2.0 to 4.2.1 * docs: update readme * chore: minor javadoc refactoring * docs: add missing throws to IDSBrokerService javadoc * refactor: minor log adjustments * docs: prepare release v4.3.0 * docs: add remaining missing throws and javadoc * build: pom set version to 4.3.1 * build(deps): bump checkstyle from 8.45.1 to 9.0 (#275) * build(deps): bump checkstyle from 8.45.1 to 9.0 Bumps [checkstyle](https://github.com/checkstyle/checkstyle) from 8.45.1 to 9.0. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](checkstyle/checkstyle@checkstyle-8.45.1...checkstyle-9.0) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * docs: update changelog Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tim Berthold <tim.berthold@isst.fraunhofer.de> * Add new Clearinghouse Endpoint for registering PIDs (#276) * [CLEARINGHOUSE] #FEAT 'file:ClearingHouseService' {Create method specification for registering PIDs at clearinghouse} * [CLEARINGHOUSE] #CHORE 'file:ClearingHouseService' {Remove sendlogtoclrearinghouse with random pid generation} * [CLEARINGHOUSE] #FEAT 'file:ClearingHouseService' {Implement method for sending pid request} * [CLEARINGHOUSE] #FIX 'file:ClearingHouseService' {Add PID to path, create RequestMessage Template} * [MESSAGING] #FIX 'file:RequestTemplateProvider' {Fix Checkstyle} * [CLEARINGHOUSE] #FIX 'file:ClearingHouseService' {Fix Checkstyle} * [CLEARINGHOUSE] #FEAT 'file:ClearingHouseService' {Make pid registering connectorIDs varargs, allow for arbitrary numbner of connectors sharing a pid} * refactor: code adjustments * build: set new version in pom * docs: update changelog Co-authored-by: Tim Berthold <75306992+tmberthold@users.noreply.github.com> Co-authored-by: Tim Berthold <tim.berthold@isst.fraunhofer.de> * docs: update changelog * fix: new clearinghouse process endpoint setting * fix: response codes outside 200-299 provoke IOExceptions (#278) * fix: response codes outside 200-299 provoke IOExceptions * docs: update changelog, add links * refactor: remove not yet supported useIDSCP and useLDP (#279) * build(deps): bump maven-javadoc-plugin from 3.3.0 to 3.3.1 (#281) * build(deps): bump maven-javadoc-plugin from 3.3.0 to 3.3.1 Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.3.0 to 3.3.1. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](apache/maven-javadoc-plugin@maven-javadoc-plugin-3.3.0...maven-javadoc-plugin-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * docs: update changelog Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tim Berthold <tim.berthold@isst.fraunhofer.de> * chore: update infomodel artifacts 4.2.1 -> 4.2.3 (#289) * chore: update infomodel artifacts 4.2.1 -> 4.2.3 * docs: update changelog * docs: update readme * feat: log-debug outgoing messages (#286) * feat: log-debug outgoing messages * chore: fix checkstyle * chore: fix javadoc * docs: update changelog * feat: check if keystore-location is null on init (#291) * feat: check if keystore-location is null on init * chore: refactor javadoc * feat: validity check for proxy hostname (#285) * feat: Proxy-Config, if no hostname set, issue warn message and try sending without proxy * docs: update changelog * chore: add check for proxy port * test: fix ConfigProducerTest testProvider * chore: update test comment Co-authored-by: eakker <erik.van.den.akker@isst.fraunhofer.de> * chore: update org.junit.jupiter dependencies (#295) * chore: update org.junit.jupiter dependencies * chore: update changelog * docs: prepare release v5.0.0 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: vdakker <75307507+vdakker@users.noreply.github.com> Co-authored-by: eakker <erik.van.den.akker@isst.fraunhofer.de>
1 parent f7fd83d commit 52d2054

31 files changed

+257
-357
lines changed

CHANGELOG.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,42 @@
99
# Changelog
1010
All notable changes to this project will be documented in this file.
1111

12+
## Version [5.0.0] 2021-09-14
13+
14+
### Major Change: ClearingHouse Module - New Endpoint
15+
- The ClearingHouse has a new endpoint, which allows the registration of a freely selectable PID that has not been assigned, whereby the PID access-authorized Connectors (Owners) must be specified as with their IDs in the body. As a result the previous existing functionality of the ClearingHouse module to log a message at the ClearingHouse, where the Messaging-Services randomly generated the PID, was removed (ClearingHouseService sendLogToClearingHouse). The new method is the ClearingHouseService.registerPidAtClearingHouse, which expects as parameters the desired PID and the IDs of the Connectors, which should all be set as Owners for the PID (can also be exactly 1 Connector-Id). ([Issue 259](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/issues/259))
16+
17+
### Patch Change: Enhancements
18+
- For incoming responses to sent requests, an IOException is now no longer thrown for response codes outside 200-299. These responses may also be valid IDS-messages, for example a RejectionMessage with the status BAD_REQUEST. ([Issue 277](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/issues/277))
19+
- If the connector's proxy configuration contains an incorrect empty hostname or proxy, a warning message is now logged and an attempt is made to send the message without this proxy instead of throwing an IllegalArgumentException. ([Issue 285](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/pull/285))
20+
- Due to an incorrect or missing connector configuration it could happen that the location of the KeyStore is null. This is now handled in the form of a KeyStoreManagerInitializationException and log message at KeyStoreManager init. ([Issue 290](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/issues/290))
21+
- Outgoing messages can now be logged in loglevel:debug (requires loglevel-config:debug for IDS-Messaging-Services e.g.: `<Loggername="de.fraunhofer.ids.messaging" level="debug"/>`) . ([Issue 284](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/issues/284))
22+
- Other minor enhancements to existing Javadoc.
23+
24+
### Patch Change: Infomodel Maintenance
25+
- Used Dependency Version: 4.2.3 ([Issue 288](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/issues/288))
26+
- Used Artifacts: java, infomodel-serializer, interaction
27+
28+
### Patch Change: Dependency Maintenance
29+
- Upgrade: com.puppycrawl.tools:checkstyle 8.45.1 -> 9.0 ([PR 275](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/pull/275))
30+
- Upgrade: org.apache.maven.plugins:maven-javadoc-plugin 3.3.0 -> 3.3.1 ([PR 281](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/pull/281))
31+
- Upgrade: org.junit.jupiter:junit-jupiter 5.7.2 -> 5.8.0 ([PR 295](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/pull/295))
32+
- Upgrade: org.junit.jupiter:junit-jupiter-api 5.7.2 -> 5.8.0 ([PR 295](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/pull/295))
33+
- Upgrade: org.junit.jupiter:junit-jupiter-engine 5.7.2 -> 5.8.0 ([PR 295](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/pull/295))
34+
1235
## Version [4.3.0] 2021-08-31
1336

1437
### Minor Change: Incoming message infomodel compatibility check
15-
- The check whether an incoming message is compatible with its ModelVersion to the inbound ModelVersions of the Connector can be switched on or off via application.properties (infomodel.compatibility.validation=true/false). The default value if not set is true (switched on).
38+
- The check whether an incoming message is compatible with its ModelVersion to the inbound ModelVersions of the Connector can be switched on or off via application.properties (infomodel.compatibility.validation=true/false). The default value if not set is true (switched on). ([PR 267](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/pull/267))
1639

1740
### Patch Change: Infomodel Maintenance
18-
- Used Dependency Version: 4.2.1 (released 2021-08-30)
41+
- Used Dependency Version: 4.2.1 (released 2021-08-30) ([Issue 268](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/issues/268))
1942
- Used Artifacts: java, infomodel-serializer, interaction
2043

2144
### Patch Change: Enhancements
22-
- If no private key can be found for a given alias within a keystore, a KeyStoreException is now thrown and an error is logged, preventing an otherwise possible NullpointerException (KeystoreManager getPrivateKeyFromKeyStore).
23-
- The payload of incoming messages is now first validated for valid JSON and whether the securityProfile attribute is present, if not, this check is skipped instead of issuing an error message in the logs (IdsHttpService checkDatFromResponse).
24-
- For log error messages and others important logs with dynamic content, the e.g. exception reason is now highlighted to distinguish it from the rest of the log message. Format: [exception=(...)].
45+
- If no private key can be found for a given alias within a keystore, a KeyStoreException is now thrown and an error is logged, preventing an otherwise possible NullpointerException (KeystoreManager getPrivateKeyFromKeyStore). ([Issue 263](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/issues/263))
46+
- The payload of incoming messages is now first validated for valid JSON and whether the securityProfile attribute is present, if not, this check is skipped instead of issuing an error message in the logs (IdsHttpService checkDatFromResponse). ([PR 266](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/pull/266))
47+
- For log error messages and others important logs with dynamic content, the e.g. exception reason is now highlighted to distinguish it from the rest of the log message. Format: [exception=(...)]. ([PR 269](https://github.com/International-Data-Spaces-Association/IDS-Messaging-Services/pull/269))
2548

2649
### Patch Change: Miscellaneous
2750
- Other minor enhancements to existing Javadoc and log messages.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ The following IDS-Infomodel-Artifacts are used as dependencies.
2525

2626
| Group | Artifact | Version |
2727
| ------ | ------ | ------ |
28-
| de.fraunhofer.iais.eis.ids.infomodel | java | 4.2.1 |
29-
| de.fraunhofer.iais.eis.ids | infomodel-serializer | 4.2.1 |
30-
| de.fraunhofer.iais.eis.ids | interaction | 4.2.1 |
28+
| de.fraunhofer.iais.eis.ids.infomodel | java | 4.2.3 |
29+
| de.fraunhofer.iais.eis.ids | infomodel-serializer | 4.2.3 |
30+
| de.fraunhofer.iais.eis.ids | interaction | 4.2.3 |
3131

3232
## Overview: Supported IDS-Message protocols
3333

clearinghouse/src/main/java/de/fraunhofer/ids/messaging/clearinghouse/ClearingHouseService.java

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import java.io.IOException;
1717
import java.net.URI;
1818
import java.net.URISyntaxException;
19-
import java.security.SecureRandom;
2019
import java.util.Objects;
2120

2221
import de.fraunhofer.iais.eis.Message;
@@ -48,6 +47,8 @@
4847
import okhttp3.MediaType;
4948
import okhttp3.MultipartBody;
5049
import okhttp3.RequestBody;
50+
import org.json.JSONArray;
51+
import org.json.JSONObject;
5152
import org.springframework.beans.factory.annotation.Value;
5253
import org.springframework.stereotype.Component;
5354

@@ -64,11 +65,6 @@ public class ClearingHouseService extends InfrastructureService
6465
*/
6566
private final Serializer serializer = new Serializer();
6667

67-
/**
68-
* SecureRandom function.
69-
*/
70-
private final SecureRandom secureRandom = new SecureRandom();
71-
7268
/**
7369
* The MultipartResponseConverter.
7470
*/
@@ -108,6 +104,12 @@ public class ClearingHouseService extends InfrastructureService
108104
@Value("${clearinghouse.log.endpoint:/messages/log}")
109105
private String logEndpoint;
110106

107+
/**
108+
* The CH endpoint for creating PIDs.
109+
*/
110+
@Value("${clearinghouse.process.endpoint:/process}")
111+
private String processEndpoint;
112+
111113
/**
112114
* Constructor for the ClearingHouseService.
113115
*
@@ -132,27 +134,6 @@ public ClearingHouseService(final ConfigContainer container,
132134
this.requestTemplateProvider = requestTemplateProvider;
133135
}
134136

135-
/**
136-
* {@inheritDoc}
137-
*/
138-
@Override
139-
public MessageProcessedNotificationMAP sendLogToClearingHouse(final Message messageToLog)
140-
throws DapsTokenManagerException,
141-
ClaimsException,
142-
MultipartParseException,
143-
URISyntaxException,
144-
IOException,
145-
UnknownResponseException,
146-
DeserializeException,
147-
UnexpectedResponseException,
148-
ShaclValidatorException,
149-
SerializeException {
150-
//log message under some random processId
151-
final var pid = Math.abs(secureRandom.nextInt());
152-
153-
return sendLogToClearingHouse(messageToLog, String.valueOf(pid));
154-
}
155-
156137
/**
157138
* {@inheritDoc}
158139
*/
@@ -178,7 +159,7 @@ public MessageProcessedNotificationMAP sendLogToClearingHouse(final Message mess
178159
serializer.serialize(messageToLog),
179160
MediaType.parse("application/json"));
180161

181-
//set some random id for message
162+
//set given id for message
182163
final var response = idsHttpService
183164
.sendAndCheckDat(body, new URI(clearingHouseUrl + logEndpoint + "/" + pid));
184165
final var map = multipartResponseConverter.convertResponse(response);
@@ -236,6 +217,41 @@ public ResultMAP queryClearingHouse(final String pid,
236217

237218
}
238219

220+
/**
221+
* {@inheritDoc}
222+
*/
223+
@Override
224+
public MessageProcessedNotificationMAP registerPidAtClearingHouse(final String pid,
225+
final String... connectorIDs)
226+
throws DapsTokenManagerException,
227+
URISyntaxException,
228+
ClaimsException,
229+
MultipartParseException,
230+
IOException,
231+
UnknownResponseException,
232+
DeserializeException,
233+
UnexpectedResponseException,
234+
ShaclValidatorException,
235+
SerializeException {
236+
//Build request json
237+
final var payload = new JSONObject();
238+
payload.put("owners", new JSONArray(connectorIDs));
239+
240+
//Build IDS Multipart Message
241+
final var body = buildMultipartWithInternalHeaders(
242+
requestTemplateProvider
243+
.requestMessageTemplate().buildMessage(),
244+
payload.toString(),
245+
MediaType.parse("application/json"));
246+
247+
//send message to clearinghouse
248+
final var response = idsHttpService
249+
.sendAndCheckDat(body, new URI(clearingHouseUrl + processEndpoint + "/" + pid));
250+
final var map = multipartResponseConverter.convertResponse(response);
251+
252+
return expectMapOfTypeT(map, MessageProcessedNotificationMAP.class);
253+
}
254+
239255
/**
240256
* @param headerMessage IDS Message used as Header
241257
* @param payloadContent Payload String

clearinghouse/src/main/java/de/fraunhofer/ids/messaging/clearinghouse/IDSClearingHouseService.java

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -37,50 +37,11 @@
3737
*/
3838
public interface IDSClearingHouseService {
3939

40-
/**
41-
* Send a LogMessage with some random pid to ClearingHouse.
42-
*
43-
* @param messageToLog Infomodel Message that should be Logged.
44-
* @return Response from ClearingHouse.
45-
* @throws DapsTokenManagerException If no DAT for sending the message could be received.
46-
* @throws URISyntaxException If Clearing House URI can not be parsed from String.
47-
* Check Application Properties!
48-
* @throws IOException If message could not be sent or Serializer could not parse RDF
49-
* to Java Object.
50-
* @throws ClaimsException If DAT of incoming message could not be validated.
51-
* @throws MultipartParseException If response could not be parsed to header and payload.
52-
* @throws ClaimsException Exception while validating the DAT from the Broker Response.
53-
* @throws UnknownResponseException Thrown during converting IDS-Response into a
54-
* corresponding Object if no possible cast found.
55-
* @throws DeserializeException Exception that is thrown if deserializing a message
56-
* threw an IOException
57-
* @throws UnexpectedResponseException Exception that is thrown if the received response-type
58-
* is not expected as a response to the request send.
59-
* @throws SerializeException Exception is thrown if serializing a message threw an IOException.
60-
* @throws ShaclValidatorException SHACL-Validation, received message
61-
* header does not conform to IDS-Infomodel and did not pass SHACL-Validation.
62-
* @throws MessageBuilderException Exception that is thrown if building an IDS-Message with
63-
* the given information threw a RuntimeException.
64-
*/
65-
MessageProcessedNotificationMAP sendLogToClearingHouse(Message messageToLog)
66-
throws
67-
DapsTokenManagerException,
68-
ClaimsException,
69-
MultipartParseException,
70-
URISyntaxException,
71-
IOException,
72-
UnknownResponseException,
73-
DeserializeException,
74-
UnexpectedResponseException,
75-
ShaclValidatorException,
76-
SerializeException,
77-
MessageBuilderException;
78-
7940
/**
8041
* Send a LogMessage with given pid to ClearingHouse.
8142
*
8243
* @param messageToLog Infomodel Message that should be Logged.
83-
* @param pid process id under which the message will be logged.
44+
* @param pid Process id under which the message will be logged.
8445
* @return Response from ClearingHouse.
8546
* @throws DapsTokenManagerException If no DAT for sending the message could be received.
8647
* @throws URISyntaxException If Clearing House URI can not be parsed from String.
@@ -162,6 +123,48 @@ ResultMAP queryClearingHouse(String pid,
162123
UnknownResponseException,
163124
DeserializeException,
164125
UnexpectedResponseException,
165-
ShaclValidatorException, SerializeException,
126+
ShaclValidatorException,
127+
SerializeException,
128+
MessageBuilderException;
129+
130+
/**
131+
* Register a pid at the clearinghouse for logging usage.
132+
*
133+
* @param pid Pid to register.
134+
* @param connectorIDs IDs the pid is registered for.
135+
* @return Response from clearing house.
136+
* @throws DapsTokenManagerException If no DAT for sending the message could be received.
137+
* @throws URISyntaxException If Clearing House URI can not be parsed from String.
138+
* Check Application Properties!
139+
* @throws IOException If message could not be sent or Serializer could not parse
140+
* RDF to Java Object.
141+
* @throws ClaimsException If DAT of incoming message could not be validated.
142+
* @throws MultipartParseException If response could not be parsed to header and payload.
143+
* @throws ClaimsException Exception while validating the DAT from the Broker Response.
144+
* @throws UnknownResponseException Thrown during converting IDS-Response into a
145+
* corresponding Object if no possible cast found.
146+
* @throws DeserializeException Exception that is thrown if deserializing a message
147+
* threw an IOException.
148+
* @throws UnexpectedResponseException Exception that is thrown if the received
149+
* response-type is not expected as a response to the request send.
150+
* @throws SerializeException Exception is thrown if serializing a message threw an IOException.
151+
* @throws ShaclValidatorException SHACL-Validation, received message header does not
152+
* conform to IDS-Infomodel and did not pass SHACL-Validation.
153+
* @throws MessageBuilderException Exception that is thrown if building an IDS-Message with
154+
* the given information threw a RuntimeException.
155+
*/
156+
MessageProcessedNotificationMAP registerPidAtClearingHouse(String pid,
157+
String... connectorIDs)
158+
throws
159+
DapsTokenManagerException,
160+
URISyntaxException,
161+
ClaimsException,
162+
MultipartParseException,
163+
IOException,
164+
UnknownResponseException,
165+
DeserializeException,
166+
UnexpectedResponseException,
167+
ShaclValidatorException,
168+
SerializeException,
166169
MessageBuilderException;
167170
}

clearinghouse/src/test/java/de/fraunhofer/ids/messaging/clearinghouse/ClearingHouseServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void testSendLogToClearingHouse() throws Exception {
175175
.thenReturn(map);
176176
Mockito.when(multipartResponseConverter.convertResponse(any(Map.class)))
177177
.thenReturn(new MessageProcessedNotificationMAP(message));
178-
final var result = idsClearingHouseService.sendLogToClearingHouse(message);
178+
final var result = idsClearingHouseService.sendLogToClearingHouse(message, "id");
179179
assertNotNull(result.getMessage(), "Method should return a message");
180180
assertEquals(MessageProcessedNotificationMAP.class, result.getClass(), "Method should return MessageProcessedNotificationMessage");
181181

core/src/main/java/de/fraunhofer/ids/messaging/core/config/ClientProvider.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,24 @@ public List<Proxy> select(final URI uri) {
180180
if (log.isDebugEnabled()) {
181181
log.debug("Address: [host=({})], Port: [port=({})]", proxyHost, proxyPort);
182182
}
183-
proxyList.add(new Proxy(Proxy.Type.HTTP,
184-
new InetSocketAddress(proxyHost, proxyPort)));
183+
184+
if (proxyHost == null || proxyHost.trim().equals("")) {
185+
if (log.isWarnEnabled()) {
186+
log.warn("Proxy hostname invalid! Trying to skip using this proxy!"
187+
+ " Please check configuration! [hostname=({})]", proxyHost);
188+
}
189+
proxyList.add(Proxy.NO_PROXY);
190+
} else if (proxyPort == -1) {
191+
if (log.isWarnEnabled()) {
192+
log.warn("Proxy port invalid! Trying to skip using this proxy!"
193+
+ " Please check configuration! [port=({})]", proxyPort);
194+
}
195+
proxyList.add(Proxy.NO_PROXY);
196+
} else {
197+
proxyList.add(new Proxy(Proxy.Type.HTTP,
198+
new InetSocketAddress(proxyHost, proxyPort)));
199+
}
200+
185201
}
186202
return proxyList;
187203
}

core/src/main/java/de/fraunhofer/ids/messaging/core/config/ssl/keystore/KeyStoreManager.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ private KeyStore loadKeyStore(final char[] pw, final URI location, final String
240240
NoSuchAlgorithmException,
241241
IOException,
242242
KeyStoreManagerInitializationException {
243+
244+
validateLocation(location, keyStoreType);
245+
243246
if (log.isDebugEnabled()) {
244247
log.debug("Searching for keystore file. [location=({})]", location.toString());
245248
}
@@ -320,6 +323,26 @@ private KeyStore loadKeyStore(final char[] pw, final URI location, final String
320323
return store;
321324
}
322325

326+
/**
327+
* Checks whether the keystore path specification is set in the connector configuration.
328+
*
329+
* @param location The keystore path.
330+
* @param keyStoreType Indication whether it is keystore or truststore.
331+
* @throws KeyStoreManagerInitializationException Thrown if location specification is not set.
332+
*/
333+
private void validateLocation(final URI location, final String keyStoreType)
334+
throws KeyStoreManagerInitializationException {
335+
if (location == null) {
336+
if (log.isErrorEnabled()) {
337+
log.error("Location input for keystore-path from connector configuration"
338+
+ " is not valid!"
339+
+ " [type=({}), location=(null)]", keyStoreType);
340+
}
341+
throw new KeyStoreManagerInitializationException(
342+
"Location input for keystore-path is null! Type: " + keyStoreType);
343+
}
344+
}
345+
323346
@Nullable
324347
private KeyStore getKeyStoreInstance() {
325348
KeyStore store = null;

0 commit comments

Comments
 (0)