@Test void testLoadSaga_NotFound() { assertNull(sagaStore.loadSaga(MyTestSaga.class, "123456")); }
@Override public <S> Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier) { Document dbSaga = mongoTemplate.sagaCollection().find(SagaEntry.queryByIdentifier(sagaIdentifier)).first(); if (dbSaga == null) { return null; } SagaEntry<S> sagaEntry = new SagaEntry<>(dbSaga); S loadedSaga = sagaEntry.getSaga(serializer); return new Entry<S>() { @Override public Set<AssociationValue> associationValues() { return sagaEntry.getAssociationValues(); } @Override public S saga() { return loadedSaga; } }; }
MongoSagaStore implements SagaStore<Object> { @Override public <S> Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier) { Document dbSaga = mongoTemplate.sagaCollection().find(SagaEntry.queryByIdentifier(sagaIdentifier)).first(); if (dbSaga == null) { return null; } SagaEntry<S> sagaEntry = new SagaEntry<>(dbSaga); S loadedSaga = sagaEntry.getSaga(serializer); return new Entry<S>() { @Override public Set<AssociationValue> associationValues() { return sagaEntry.getAssociationValues(); } @Override public S saga() { return loadedSaga; } }; } }
MongoSagaStore implements SagaStore<Object> { @Override public <S> Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier) { Document dbSaga = mongoTemplate.sagaCollection().find(SagaEntry.queryByIdentifier(sagaIdentifier)).first(); if (dbSaga == null) { return null; } SagaEntry<S> sagaEntry = new SagaEntry<>(dbSaga); S loadedSaga = sagaEntry.getSaga(serializer); return new Entry<S>() { @Override public Set<AssociationValue> associationValues() { return sagaEntry.getAssociationValues(); } @Override public S saga() { return loadedSaga; } }; } protected  MongoSagaStore(Builder builder); }
MongoSagaStore implements SagaStore<Object> { @Override public <S> Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier) { Document dbSaga = mongoTemplate.sagaCollection().find(SagaEntry.queryByIdentifier(sagaIdentifier)).first(); if (dbSaga == null) { return null; } SagaEntry<S> sagaEntry = new SagaEntry<>(dbSaga); S loadedSaga = sagaEntry.getSaga(serializer); return new Entry<S>() { @Override public Set<AssociationValue> associationValues() { return sagaEntry.getAssociationValues(); } @Override public S saga() { return loadedSaga; } }; } protected  MongoSagaStore(Builder builder); static Builder builder(); @Override Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier); @Override Set<String> findSagas(Class<?> sagaType, AssociationValue associationValue); @Override void deleteSaga(Class<?> sagaType, String sagaIdentifier, Set<AssociationValue> associationValues); @Override void updateSaga(Class<?> sagaType, String sagaIdentifier, Object saga, AssociationValues associationValues); @Override void insertSaga(Class<?> sagaType,
                           String sagaIdentifier,
                           Object saga,
                           Set<AssociationValue> associationValues); }
MongoSagaStore implements SagaStore<Object> { @Override public <S> Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier) { Document dbSaga = mongoTemplate.sagaCollection().find(SagaEntry.queryByIdentifier(sagaIdentifier)).first(); if (dbSaga == null) { return null; } SagaEntry<S> sagaEntry = new SagaEntry<>(dbSaga); S loadedSaga = sagaEntry.getSaga(serializer); return new Entry<S>() { @Override public Set<AssociationValue> associationValues() { return sagaEntry.getAssociationValues(); } @Override public S saga() { return loadedSaga; } }; } protected  MongoSagaStore(Builder builder); static Builder builder(); @Override Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier); @Override Set<String> findSagas(Class<?> sagaType, AssociationValue associationValue); @Override void deleteSaga(Class<?> sagaType, String sagaIdentifier, Set<AssociationValue> associationValues); @Override void updateSaga(Class<?> sagaType, String sagaIdentifier, Object saga, AssociationValues associationValues); @Override void insertSaga(Class<?> sagaType,
                           String sagaIdentifier,
                           Object saga,
                           Set<AssociationValue> associationValues);  }