Class Mementoize
- java.lang.Object
-
- org.trellisldp.ext.cassandra.query.CassandraQuery
-
- org.trellisldp.ext.cassandra.query.rdf.Mementoize
-
@ApplicationScoped public class Mementoize extends CassandraQuery
A query that records a version of a resource as a Memento.
-
-
Field Summary
-
Fields inherited from class org.trellisldp.ext.cassandra.query.CassandraQuery
consistency, preparedStmtAsync, queryString, readBinaryWorkers, session, writeWorkers
-
-
Constructor Summary
Constructors Constructor Description Mementoize()For use with RESTeasy and CDI proxies.Mementoize(CqlSession session, ConsistencyLevel consistency)Create a query that generates a memento.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletionStage<Void>execute(Metadata metadata, Instant modified, Dataset data, UUID creation)Store a Memento.-
Methods inherited from class org.trellisldp.ext.cassandra.query.CassandraQuery
executeSyncRead, preparedStatementAsync
-
-
-
-
Constructor Detail
-
Mementoize
public Mementoize()
For use with RESTeasy and CDI proxies.- API Note:
- This construtor is used by CDI runtimes that require a public, no-argument constructor. It should not be invoked directly in user code.
-
Mementoize
@Inject public Mementoize(CqlSession session, @MutableWriteConsistency ConsistencyLevel consistency)
Create a query that generates a memento.- Parameters:
session- the cassandra sessionconsistency- the consistency level
-
-
Method Detail
-
execute
public CompletionStage<Void> execute(Metadata metadata, Instant modified, Dataset data, UUID creation)
Store a Memento. Note that the value formodifiedis truncated to seconds because Memento requires HTTP time management.- Parameters:
metadata- metadata for this resourcemodified- the time at which this resource was last modifieddata- RDF for this resourcecreation- a time-based (version 1) UUID for the moment this resource is created- Returns:
- whether and when it has been inserted
-
-