This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
'origin/issues/274_highmed-processes-preparations' into develop
- Loading branch information
Showing
96 changed files
with
1,652 additions
and
401 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
dsf-bpe/dsf-bpe-server/src/main/java/org/highmed/dsf/bpe/spring/config/ConsentConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.highmed.dsf.bpe.spring.config; | ||
|
||
import java.util.NoSuchElementException; | ||
|
||
import org.highmed.consent.client.ConsentClientFactory; | ||
import org.highmed.consent.client.ConsentClientServiceLoader; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class ConsentConfig | ||
{ | ||
private static final Logger logger = LoggerFactory.getLogger(ConsentConfig.class); | ||
|
||
@Autowired | ||
private PropertiesConfig propertiesConfig; | ||
|
||
@Bean | ||
public ConsentClientServiceLoader consentClientServiceLoader() | ||
{ | ||
return new ConsentClientServiceLoader(); | ||
} | ||
|
||
@Bean | ||
public ConsentClientFactory consentClientFactory() | ||
{ | ||
ConsentClientFactory factory = consentClientServiceLoader() | ||
.getConsentClientFactory(propertiesConfig.getConsentClientFactoryClass()) | ||
.orElseThrow(() -> new NoSuchElementException("Consent client factory with classname='" | ||
+ propertiesConfig.getConsentClientFactoryClass() + "' not found")); | ||
|
||
if ("org.highmed.consent.client.stub.ConsentClientStubFactory".equals(factory.getClass().getName())) | ||
logger.warn("Using {} as consent client factory", factory.getClass().getName()); | ||
else | ||
logger.info("Using {} as consent client factory", factory.getClass().getName()); | ||
|
||
return factory; | ||
} | ||
} |
Oops, something went wrong.