-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
62 changed files
with
656 additions
and
391 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
3 changes: 3 additions & 0 deletions
3
apps/sepuling/src/main/java/smecalculus/bezmen/storage/ContentionException.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,3 @@ | ||
package smecalculus.bezmen.storage; | ||
|
||
public class ContentionException extends RuntimeException {} |
58 changes: 58 additions & 0 deletions
58
apps/sepuling/src/main/java/smecalculus/bezmen/storage/EdgeSide.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,58 @@ | ||
package smecalculus.bezmen.storage; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.UUID; | ||
import lombok.Data; | ||
import org.springframework.data.annotation.Id; | ||
import org.springframework.data.domain.Persistable; | ||
import org.springframework.data.relational.core.mapping.Column; | ||
import org.springframework.data.relational.core.mapping.Table; | ||
|
||
public abstract class EdgeSide { | ||
|
||
@Data | ||
public static class ExistenceState { | ||
UUID internalId; | ||
} | ||
|
||
@Data | ||
public static class PreviewState { | ||
String externalId; | ||
LocalDateTime createdAt; | ||
} | ||
|
||
@Data | ||
public static class TouchState { | ||
Integer revision; | ||
LocalDateTime updatedAt; | ||
} | ||
|
||
@Data | ||
@Table("sepulkas") | ||
public static class AggregateState implements Persistable<UUID> { | ||
@Id | ||
UUID internalId; | ||
|
||
@Column | ||
String externalId; | ||
|
||
@Column | ||
Integer revision; | ||
|
||
@Column | ||
LocalDateTime createdAt; | ||
|
||
@Column | ||
LocalDateTime updatedAt; | ||
|
||
@Override | ||
public UUID getId() { | ||
return internalId; | ||
} | ||
|
||
@Override | ||
public boolean isNew() { | ||
return true; | ||
} | ||
} | ||
} |
16 changes: 10 additions & 6 deletions
16
apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDao.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,18 +1,22 @@ | ||
package smecalculus.bezmen.storage; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.UUID; | ||
import smecalculus.bezmen.core.Sepulka; | ||
import smecalculus.bezmen.core.ServerSide.AggregateState; | ||
import smecalculus.bezmen.core.ServerSide.ExistenceState; | ||
import smecalculus.bezmen.core.ServerSide.PreviewState; | ||
import smecalculus.bezmen.core.ServerSide.TouchState; | ||
|
||
/** | ||
* Server side interface | ||
* Port: server side | ||
*/ | ||
public interface SepulkaDao { | ||
|
||
Optional<Sepulka> getById(UUID id); | ||
AggregateState add(AggregateState state); | ||
|
||
Sepulka save(Sepulka sepulka); | ||
Optional<ExistenceState> getBy(String externalId); | ||
|
||
List<Sepulka> getSepulkas(); | ||
Optional<PreviewState> getBy(UUID internalId); | ||
|
||
void updateBy(TouchState state, UUID internalId); | ||
} |
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
21 changes: 0 additions & 21 deletions
21
apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaEdge.java
This file was deleted.
Oops, something went wrong.
17 changes: 13 additions & 4 deletions
17
apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaStateMapper.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,11 +1,20 @@ | ||
package smecalculus.bezmen.storage; | ||
|
||
import org.mapstruct.Mapper; | ||
import smecalculus.bezmen.core.Sepulka; | ||
import smecalculus.bezmen.core.ServerSide; | ||
import smecalculus.bezmen.mapping.EdgeMapper; | ||
|
||
@Mapper | ||
public interface SepulkaStateMapper { | ||
SepulkaEdge toEdge(Sepulka sepulka); | ||
public interface SepulkaStateMapper extends EdgeMapper { | ||
EdgeSide.AggregateState toEdge(ServerSide.AggregateState state); | ||
|
||
Sepulka toDomain(SepulkaEdge sepulkaEdge); | ||
ServerSide.AggregateState toDomain(EdgeSide.AggregateState state); | ||
|
||
EdgeSide.TouchState toEdge(ServerSide.TouchState state); | ||
|
||
ServerSide.ExistenceState toDomain(EdgeSide.ExistenceState state); | ||
|
||
EdgeSide.PreviewState toEdge(ServerSide.PreviewState state); | ||
|
||
ServerSide.PreviewState toDomain(EdgeSide.PreviewState state); | ||
} |
Oops, something went wrong.