-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: retire EventStreamFetcher * feat: use new Content-Type of client status * chore: use newest LDIO image in docker compose * chore: update docker-compose file
- Loading branch information
Showing
12 changed files
with
22 additions
and
174 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
20 changes: 4 additions & 16 deletions
20
src/main/java/be/vlaanderen/informatievlaanderen/ldes/gitb/ldio/LdesClientStatusManager.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 |
---|---|---|
@@ -1,38 +1,26 @@ | ||
package be.vlaanderen.informatievlaanderen.ldes.gitb.ldio; | ||
|
||
import be.vlaanderen.informatievlaanderen.ldes.gitb.requestexecutor.HttpResponse; | ||
import be.vlaanderen.informatievlaanderen.ldes.gitb.requestexecutor.RequestExecutor; | ||
import be.vlaanderen.informatievlaanderen.ldes.gitb.requestexecutor.requests.GetRequest; | ||
import be.vlaanderen.informatievlaanderen.ldes.gitb.ldio.config.LdioConfigProperties; | ||
import be.vlaanderen.informatievlaanderen.ldes.gitb.ldio.excpeptions.LdesClientStatusUnavailableException; | ||
import be.vlaanderen.informatievlaanderen.ldes.gitb.ldio.valuebojects.ClientStatus; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import be.vlaanderen.informatievlaanderen.ldes.gitb.requestexecutor.HttpResponse; | ||
import be.vlaanderen.informatievlaanderen.ldes.gitb.requestexecutor.RequestExecutor; | ||
import be.vlaanderen.informatievlaanderen.ldes.gitb.requestexecutor.requests.GetRequest; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.io.IOException; | ||
|
||
@Service | ||
public class LdesClientStatusManager { | ||
private final RequestExecutor requestExecutor; | ||
private final LdioConfigProperties ldioConfigProperties; | ||
private final ObjectMapper objectMapper; | ||
|
||
public LdesClientStatusManager(RequestExecutor requestExecutor, LdioConfigProperties ldioConfigProperties) { | ||
this.requestExecutor = requestExecutor; | ||
this.ldioConfigProperties = ldioConfigProperties; | ||
objectMapper = new ObjectMapper(); | ||
} | ||
|
||
public ClientStatus getClientStatus(String pipelineName) { | ||
final String pollingUrl = ldioConfigProperties.getLdioLdesClientStatusUrlTemplate().formatted(pipelineName); | ||
final HttpResponse response = requestExecutor.execute(new GetRequest(pollingUrl), 200, 404); | ||
final String json = response.getBody().orElseThrow(LdesClientStatusUnavailableException::new); | ||
try { | ||
return objectMapper.readValue(json, ClientStatus.class); | ||
} catch (IOException e) { | ||
throw new IllegalStateException("Invalid client status received from %s".formatted(pollingUrl)); | ||
} | ||
return response.getBody().map(ClientStatus::valueOf).orElseThrow(LdesClientStatusUnavailableException::new); | ||
} | ||
} |
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
62 changes: 0 additions & 62 deletions
62
src/main/java/be/vlaanderen/informatievlaanderen/ldes/gitb/ldio/ldes/EventStreamFetcher.java
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...in/java/be/vlaanderen/informatievlaanderen/ldes/gitb/ldio/ldes/EventStreamProperties.java
This file was deleted.
Oops, something went wrong.
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
36 changes: 0 additions & 36 deletions
36
...t/java/be/vlaanderen/informatievlaanderen/ldes/gitb/ldio/ldes/EventStreamFetcherTest.java
This file was deleted.
Oops, something went wrong.
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