Package com.commercetools.sync.services
Interface UnresolvedReferencesService<WaitingToBeResolvedT extends WaitingToBeResolved>
-
- All Known Implementing Classes:
UnresolvedReferencesServiceImpl
public interface UnresolvedReferencesService<WaitingToBeResolvedT extends WaitingToBeResolved>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.concurrent.CompletionStage<java.util.Optional<WaitingToBeResolvedT>>
delete(java.lang.String key, java.lang.String containerKey, java.lang.Class<WaitingToBeResolvedT> clazz)
Given a draft key, this methods deletes the matching draft from persistence.java.util.concurrent.CompletionStage<java.util.Set<WaitingToBeResolvedT>>
fetch(java.util.Set<java.lang.String> keys, java.lang.String containerKey, java.lang.Class<WaitingToBeResolvedT> clazz)
Given draft keys, this method fetches the persisted drafts waiting to be resolved.java.util.concurrent.CompletionStage<java.util.Optional<WaitingToBeResolvedT>>
save(WaitingToBeResolvedT draft, java.lang.String containerKey, java.lang.Class<WaitingToBeResolvedT> clazz)
Persists a draft that is not ready to be resolved yet.
-
-
-
Method Detail
-
fetch
@Nonnull java.util.concurrent.CompletionStage<java.util.Set<WaitingToBeResolvedT>> fetch(@Nonnull java.util.Set<java.lang.String> keys, @Nonnull java.lang.String containerKey, @Nonnull java.lang.Class<WaitingToBeResolvedT> clazz)
Given draft keys, this method fetches the persisted drafts waiting to be resolved. If there is no matching draft, an emptySet
will be returned in the returned future.- Parameters:
keys
- the keys of the persisted drafts, waiting to be resolved, to fetch.containerKey
- the key of the container, which contains the persisted draftclazz
- Class of the object contained by custom object- Returns:
CompletionStage
<Set
> in which the result of its completion contains aSet
that contains the matching drafts if any exist, otherwise empty.
-
save
@Nonnull java.util.concurrent.CompletionStage<java.util.Optional<WaitingToBeResolvedT>> save(@Nonnull WaitingToBeResolvedT draft, @Nonnull java.lang.String containerKey, @Nonnull java.lang.Class<WaitingToBeResolvedT> clazz)
Persists a draft that is not ready to be resolved yet.- Parameters:
draft
- the draft that should be persisted.containerKey
- the key of the container, which contains the persisted draftclazz
- Class of the object contained by custom object- Returns:
- a
CompletionStage
containing an optional with the created resource if successful otherwise an empty optional.
-
delete
@Nonnull java.util.concurrent.CompletionStage<java.util.Optional<WaitingToBeResolvedT>> delete(@Nonnull java.lang.String key, @Nonnull java.lang.String containerKey, @Nonnull java.lang.Class<WaitingToBeResolvedT> clazz)
Given a draft key, this methods deletes the matching draft from persistence.- Parameters:
key
- the key of the draft to delete from persistence.containerKey
- the key of the container, which contains the persisted draftclazz
- Class of the object contained by custom object- Returns:
- a
CompletionStage
containing an optional with the deleted resource if successful otherwise an empty optional.
-
-