Package com.c8db

Interface C8Event

    • 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 given key from the collection.
        Parameters:
        key - The key of the document
        type - 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 given key from the collection.
        Parameters:
        key - The key of the document
        type - 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 _key from the collection.
        Parameters:
        keys - The keys of the documents
        type - 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 given key from 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