Package com.c8db
Interface C8Event
-
- All Superinterfaces:
C8SerializationAccessor
- All Known Implementing Classes:
C8EventImpl
public interface C8Event extends C8SerializationAccessor
Interface for operations on C8DB events level.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description C8Databasedb()The the handler of the database the collection with events is withinvoiddeleteEvent(String key)Deletes the document with the givenkeyfrom the collection.voiddeleteEvents(Collection<?> values)Deletes multiple documents from the collection.C8EventEntitygetEvent(String key)Retrieves the document with the givenkeyfrom the collection.C8EventEntitygetEvent(String key, DocumentReadOptions options)Retrieves the document with the givenkeyfrom the collection.Collection<C8EventEntity>getEvents(Collection<String> keys)Retrieves multiple documents with the given_keyfrom the collection.<T> C8EventEntityinsertEvent(T value)Creates a new document from the given document, unless there is already a document with the _key given.<T> C8EventEntityinsertEvent(T value, EventCreateOptions options)Creates a new document from the given document, unless there is already a document with the _key given.-
Methods inherited from interface com.c8db.C8SerializationAccessor
util, util
-
-
-
-
Method Detail
-
db
C8Database db()
The the handler of the database the collection with events is within- Returns:
- database handler
-
insertEvent
<T> C8EventEntity insertEvent(T value) throws C8DBException
Creates a new document from the given document, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Parameters:
value- A representation of a single document (POJO, VPackSlice or String for JSON)- Returns:
- information about the document
- Throws:
C8DBException
-
insertEvent
<T> C8EventEntity insertEvent(T value, EventCreateOptions options) throws C8DBException
Creates a new document from the given document, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.- Parameters:
value- A representation of a single document (POJO, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- information about the document
- Throws:
C8DBException
-
getEvent
C8EventEntity getEvent(String key) throws C8DBException
Retrieves the document with the givenkeyfrom the collection.- Parameters:
key- The key of the documenttype- The type of the document (POJO class, VPackSlice or String for JSON)- Returns:
- the document identified by the key
- Throws:
C8DBException
-
getEvent
C8EventEntity getEvent(String key, DocumentReadOptions options) throws C8DBException
Retrieves the document with the givenkeyfrom the collection.- Parameters:
key- The key of the documenttype- The type of the document (POJO class, VPackSlice or String for JSON)options- Additional options, can be null- Returns:
- the document identified by the key
- Throws:
C8DBException
-
getEvents
Collection<C8EventEntity> getEvents(Collection<String> keys) throws C8DBException
Retrieves multiple documents with the given_keyfrom the collection.- Parameters:
keys- The keys of the documentstype- The type of the documents (POJO class, VPackSlice or String for JSON)- Returns:
- the documents and possible errors
- Throws:
C8DBException
-
deleteEvent
void deleteEvent(String key) throws C8DBException
Deletes the document with the givenkeyfrom the collection.- Parameters:
key- The key of the document- Throws:
C8DBException
-
deleteEvents
void deleteEvents(Collection<?> values) throws C8DBException
Deletes multiple documents from the collection.- Parameters:
values- The keys of the documents or the documents themselves- Throws:
C8DBException
-
-