generated from telekom/reuse-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Autoconfigure noopSchemaCacheKey Impl for non-eni-api mode
- Loading branch information
1 parent
2281397
commit bc1fda4
Showing
6 changed files
with
72 additions
and
1 deletion.
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
10 changes: 10 additions & 0 deletions
10
...on-core/src/main/java/de/telekom/eni/pandora/horizon/cache/schema/SchemaCacheService.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,10 @@ | ||
package de.telekom.eni.pandora.horizon.cache.schema; | ||
|
||
import org.apache.commons.lang3.tuple.Pair; | ||
import org.everit.json.schema.Schema; | ||
|
||
public interface SchemaCacheService { | ||
Pair<Boolean, Schema> getSchemaForEventType(String environment, String eventType, String hub, String team); | ||
|
||
void pollSchemas(); | ||
} |
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
38 changes: 38 additions & 0 deletions
38
...java/de/telekom/eni/pandora/horizon/autoconfigure/cache/SchemaCacheAutoConfiguration.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,38 @@ | ||
package de.telekom.eni.pandora.horizon.autoconfigure.cache; | ||
|
||
import de.telekom.eni.pandora.horizon.cache.schema.SchemaCacheService; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.commons.lang3.tuple.Pair; | ||
import org.everit.json.schema.Schema; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* Configuration for the SchemaCacheService | ||
* This AutoConfiguration is not enabled by default, as it might not be relevant for all applications. | ||
* If it´s enabled it only provides a default noop impl bean if not other implementation of SchemaCacheService is provided. | ||
* | ||
*/ | ||
@Configuration | ||
@Slf4j | ||
public class SchemaCacheAutoConfiguration { | ||
|
||
@Bean | ||
@ConditionalOnMissingBean({SchemaCacheService.class}) | ||
public SchemaCacheService schemaCacheService() { | ||
return new SchemaCacheService() { | ||
@Override | ||
public Pair<Boolean, Schema> getSchemaForEventType(String environment, String eventType, String hub, String team) { | ||
log.debug("SchemaCacheService is not implemented, returning null"); | ||
return null; | ||
} | ||
|
||
@Override | ||
public void pollSchemas() { | ||
log.debug("SchemaCacheService is not implemented"); | ||
} | ||
}; | ||
} | ||
|
||
} |
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