@Alternative public class FileMementoService extends Object implements MementoService
| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_FILE_MEMENTO_PATH
The configuration key controlling the base filesystem path for memento storage.
|
| Constructor and Description |
|---|
FileMementoService()
Create a file-based memento service.
|
FileMementoService(String path)
Create a file-based memento service.
|
| Modifier and Type | Method and Description |
|---|---|
CompletionStage<Void> |
delete(IRI identifier,
Instant time)
Delete a memento at the given time.
|
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(Resource resource,
Instant time)
Create a Memento from a resource at a particular time.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitputpublic static final String CONFIG_FILE_MEMENTO_PATH
public FileMementoService()
public FileMementoService(String path)
path - the file pathpublic CompletionStage<Void> put(Resource resource)
MementoServiceput in interface MementoServiceresource - the resourceCompletionStage will complete exceptionally and can be handled with
CompletionStage.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.public CompletionStage<Void> put(Resource resource, Instant time)
resource - the resourcetime - the time to which the Memento correspondspublic CompletionStage<Resource> get(IRI identifier, Instant time)
MementoServiceget in interface MementoServiceidentifier - the resource identifiertime - the requested timepublic CompletionStage<SortedSet<Instant>> mementos(IRI identifier)
MementoServicemementos in interface MementoServiceidentifier - the resource identifierpublic CompletionStage<Void> delete(IRI identifier, Instant time)
identifier - the resource identifiertime - the memento time