Class StorageService
-
Method Summary
Modifier and TypeMethodDescriptionconvertToComplianceServiceReply
(UUID sagaEventId, ComplianceReply s) getDominantComplianceReplies
(Collection<UUID> sagaEventIds, List<String> regulations) getDominantComplianceRepliesByEventType
(Collection<UUID> sagaEventIds, List<String> regulations) getLatestReplyPerEventByRegulationAndMessageType
(Set<UUID> sagaEventIds, String regulation, String messageType) getLatestStatus
(UUID sagaEventId, String complianceRepository) getLatestStatus
(UUID sagaEventId, String complianceRepository, String... messageTypes) getLatestStatus
(UUID sagaEventId, String complianceRepository, Set<IMessageType> messageTypes) getLatestStatuses
(UUID sagaEventId) getMappedStatuses
(UUID sagaEventId) Gets the compliance reply stored, based on the event ID, the ID of the compliance repository and the ID of the reply itself.Deprecated.getStatuses
(UUID sagaEventId) getStatuses
(UUID sagaEventId, String complianceRepository) boolean
isLatestStatus
(UUID sagaEventId, String complianceRepository, IMessageType messageType, Predicate<MessageStatus> expectedStatus) This method takes an event SAGA id, a compliance repository name, a target message type and an expected status that is asserted against the event's latest statusvoid
void
store
(ComplianceRepositoryReply status)
-
Method Details
-
getStatus
public Optional<ComplianceServiceReply> getStatus(UUID sagaEventId, String complianceRepository, String replyIdentifier) Deprecated.UsegetReply(UUID, String, String)
instead. -
getReply
public Optional<ComplianceServiceReply> getReply(UUID sagaEventId, String complianceRepository, String replyIdentifier) Gets the compliance reply stored, based on the event ID, the ID of the compliance repository and the ID of the reply itself.- Returns:
- an optional containing the reply
-
getStatuses
- Refactor:
- Rename to getReplies()
-
getStatuses
- Refactor:
- Rename to getReplies()
-
getMappedStatuses
- Refactor:
- Rename to getRepliesByRepository()
-
convertToComplianceServiceReply
-
getLatestStatuses
- Parameters:
sagaEventId
- Event's SAGA event id- Returns:
- The compliance replies that are related to a given event
This method will return the latest reply (by message type) that was caused by attempting to send a message to a repository. If no attempts were made, it will return the latest reply (by message type).
-
getLatestStatus
public Optional<ComplianceServiceReply> getLatestStatus(UUID sagaEventId, String complianceRepository) - Parameters:
sagaEventId
- Event's SAGA event idcomplianceRepository
- Compliance Repository name- Returns:
- The compliance reply that is related to a given event
This method will return the latest reply that was caused by attempting to send a message to a repository. If no attempts were made, it will return the latest reply.
-
getLatestStatus
public Optional<ComplianceServiceReply> getLatestStatus(UUID sagaEventId, String complianceRepository, Set<IMessageType> messageTypes) - Parameters:
sagaEventId
- Event's SAGA event idcomplianceRepository
- Compliance Repository namemessageTypes
- Message types- Returns:
- The compliance reply that is related to a given event and at least one of the message types
This method will return the latest reply (by message type) that was caused by attempting to send a message to a repository. If no attempts were made, it will return the latest reply (by message type).
-
getLatestStatus
public Optional<ComplianceServiceReply> getLatestStatus(UUID sagaEventId, String complianceRepository, String... messageTypes) - Parameters:
sagaEventId
- Event's SAGA event idcomplianceRepository
- Compliance Repository namemessageTypes
- Message types- Returns:
- The compliance reply that is related to a given event and at least one of the message types
This method will return the latest reply (by message type) that was caused by attempting to send a message to a repository. If no attempts were made, it will return the latest reply (by message type).
-
isLatestStatus
public boolean isLatestStatus(UUID sagaEventId, String complianceRepository, IMessageType messageType, Predicate<MessageStatus> expectedStatus) This method takes an event SAGA id, a compliance repository name, a target message type and an expected status that is asserted against the event's latest status- Parameters:
sagaEventId
- Event's saga event idcomplianceRepository
- Compliance Repository namemessageType
- Message typesexpectedStatus
- Status to be use as filter- Returns:
- Assert that the latest status is the expected status
-
store
-
revert
-
getDominantComplianceRepliesByEventType
public Map<UUID,Map<String, getDominantComplianceRepliesByEventTypeMap<String, IComplianceServiceReply>>> (Collection<UUID> sagaEventIds, List<String> regulations) - Parameters:
sagaEventIds
-regulations
-- Returns:
- Dictionary with most dominant reply Map of EventId, Map of Regulation, Map of Type, Reply
-
getReplyToDominantReducer
-
getDominantComplianceReplies
public Map<UUID,Map<String, getDominantComplianceRepliesIComplianceServiceReply>> (Collection<UUID> sagaEventIds, List<String> regulations) -
getLatestReplyPerEventByRegulationAndMessageType
-
getReply(UUID, String, String)
instead.