-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bind the termination to the logging house
- Loading branch information
1 parent
d62eb33
commit fe1432f
Showing
6 changed files
with
140 additions
and
99 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
57 changes: 57 additions & 0 deletions
57
...ginghouse-binder/src/main/java/de/sovity/edc/extension/mdslogginhousebinder/LogEntry.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,57 @@ | ||
/* | ||
* Copyright (c) 2024 sovity GmbH | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* sovity GmbH - initial API and implementation | ||
* | ||
*/ | ||
|
||
package de.sovity.edc.extension.mdslogginhousebinder; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import de.sovity.edc.extension.contacttermination.ContractTerminationEvent; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
|
||
import java.time.OffsetDateTime; | ||
|
||
@AllArgsConstructor | ||
@Builder | ||
@Data | ||
@NoArgsConstructor | ||
public class LogEntry { | ||
|
||
@JsonProperty("contractAgreementId") | ||
private String contractAgreementId; | ||
|
||
@JsonProperty("event") | ||
private String event; | ||
|
||
@JsonProperty("detail") | ||
private String detail; | ||
|
||
@JsonProperty("reason") | ||
private String reason; | ||
|
||
@JsonProperty("timestamp") | ||
private OffsetDateTime timestamp; | ||
|
||
public static LogEntry from(String event, ContractTerminationEvent contractTerminationEvent) { | ||
return LogEntry.builder() | ||
.event(event) | ||
.contractAgreementId(contractTerminationEvent.contractAgreementId()) | ||
.detail(contractTerminationEvent.detail()) | ||
.reason(contractTerminationEvent.reason()) | ||
.timestamp(contractTerminationEvent.timestamp()) | ||
.build(); | ||
} | ||
} |
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