Interface WriteThruProvider

  • All Superinterfaces:
    java.lang.AutoCloseable

    public interface WriteThruProvider
    extends java.lang.AutoCloseable
    Contains methods used to save/update an object to the master data source. Must be implemented by write-through components.
    • Method Detail

      • init

        void init​(java.util.Map<java.lang.String,​java.lang.String> parameters,
                  java.lang.String cacheId)
           throws java.lang.Exception
        Perform tasks like allocating resources or acquiring connections etc.
        Parameters:
        parameters - Startup parameters defined in the configuration
        cacheId - Id of the Cache
        Throws:
        java.lang.Exception
      • writeToDataSource

        OperationResult writeToDataSource​(WriteOperation operation)
                                   throws java.lang.Exception
        Responsible for atomic write operations on data source.
        Parameters:
        operation - write operation applied on data source
        Returns:
        The OperationResult instance.
        Throws:
        java.lang.Exception
      • writeToDataSource

        java.util.Collection<OperationResult> writeToDataSource​(java.util.Collection<WriteOperation> operations)
                                                         throws java.lang.Exception
        Responsible for bulk write operations on data source.
        Parameters:
        operations - collection of write operations applied on data source
        Returns:
        Collection of OperationResult instances.
        Throws:
        java.lang.Exception
      • writeDataStructureToDataSource

        java.util.Collection<OperationResult> writeDataStructureToDataSource​(java.util.Collection<DataStructureWriteOperation> dataStructureWriteOperations)
                                                                      throws java.lang.Exception
        When collection is created,removed or any operation is performed on its items with data source enabled this method will be called.
        Parameters:
        dataStructureWriteOperations - collection of DataStructureWriteOperation.
        Returns:
        Collection of OperationResult instances.
        Throws:
        java.lang.Exception