|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SagaRepository
Interface towards the storage mechanism of Saga instances. Saga Repositories can find sagas either through the
values
they have been associated with (see AssociationValue
) or via their unique identifier.
Method Summary | |
---|---|
void |
add(Saga saga)
Registers a newly created Saga with the Repository. |
void |
commit(Saga saga)
Commits the changes made to the Saga instance. |
Set<String> |
find(Class<? extends Saga> type,
AssociationValue associationValue)
Find saga instances of the given type that have been associated with the given
associationValue . |
Saga |
load(String sagaIdentifier)
Loads a known Saga instance by its unique identifier. |
Method Detail |
---|
Set<String> find(Class<? extends Saga> type, AssociationValue associationValue)
type
that have been associated with the given
associationValue
.
Returned Sagas must be committed
after processing.
type
- The type of Saga to returnassociationValue
- The value that the returned Sagas must be associated with
null
.Saga load(String sagaIdentifier)
committed
after processing.
Due to the concurrent nature of Sagas, it is not unlikely for a Saga to have ceased to exist after it has been
found based on associations. Therefore, a repository should return null
in case a Saga doesn't
exists, as opposed to throwing an exception.
sagaIdentifier
- The unique identifier of the Saga to load
null
if no such saga existsvoid commit(Saga saga)
Saga.isActive()
returns
false
), the repository should delete the saga from underlying storage and remove all stored association
values associated with that Saga.
Implementations *may* (temporarily) return a cached version of the Saga, which is marked inactive.
saga
- The Saga instance to commitvoid add(Saga saga)
Saga.isActive()
returns
false
), it is not stored.
saga
- The Saga instances to add.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |