Package org.trellisldp.api
Class NoopMementoService
- java.lang.Object
-
- org.trellisldp.api.NoopMementoService
-
- All Implemented Interfaces:
MementoService
public class NoopMementoService extends Object implements MementoService
A no-op MementoService implementation.
-
-
Constructor Summary
Constructors Constructor Description NoopMementoService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletionStage<Resource>
get(IRI identifier, Instant time)
Fetch a Memento resource for the given time.CompletionStage<SortedSet<Instant>>
mementos(IRI identifier)
Get the times for all of the Mementos of the given resource.CompletionStage<Void>
put(Resource resource)
Create a new Memento for a resource.CompletionStage<Void>
put(ResourceService resourceService, IRI identifier)
Create a new Memento for a resource, retrieved from aResourceService
.
-
-
-
Method Detail
-
put
public CompletionStage<Void> put(ResourceService resourceService, IRI identifier)
Description copied from interface:MementoService
Create a new Memento for a resource, retrieved from aResourceService
.- Specified by:
put
in interfaceMementoService
- Parameters:
resourceService
- the resource service.identifier
- the identifier.- Returns:
- a new completion stage that, when the stage completes normally, indicates that the Memento resource was successfully created in the corresponding persistence layer.
-
put
public CompletionStage<Void> put(Resource resource)
Description copied from interface:MementoService
Create a new Memento for a resource.- Specified by:
put
in interfaceMementoService
- Parameters:
resource
- the resource- Returns:
- a new completion stage that, when the stage completes normally, indicates that the Memento resource was
successfully created in the corresponding persistence layer. In the case of an unsuccessful write operation,
the
CompletionStage
will complete exceptionally and can be handled withCompletionStage.handle(java.util.function.BiFunction<? super T, java.lang.Throwable, ? extends U>)
,CompletionStage.exceptionally(java.util.function.Function<java.lang.Throwable, ? extends T>)
or similar methods.
-
get
public CompletionStage<Resource> get(IRI identifier, Instant time)
Description copied from interface:MementoService
Fetch a Memento resource for the given time.- Specified by:
get
in interfaceMementoService
- Parameters:
identifier
- the resource identifiertime
- the requested time- Returns:
- the new completion stage, containing the fetched resource
-
mementos
public CompletionStage<SortedSet<Instant>> mementos(IRI identifier)
Description copied from interface:MementoService
Get the times for all of the Mementos of the given resource.- Specified by:
mementos
in interfaceMementoService
- Parameters:
identifier
- the resource identifier- Returns:
- the new completion stage containing a collection of Memento dateTimes
-
-