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 the data source.
        Parameters:
        operation - Write operation applied on the data source
        Returns:
        Failed operations, null otherwise.
        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 the data source.
        Parameters:
        operations - Array of write operations applied on the data source.
        Returns:
        Array of failed operations.
        Throws:
        java.lang.Exception
      • writeDataStructureToDataSource

        java.util.Collection<OperationResult> writeDataStructureToDataSource​(java.util.Collection<DataStructureWriteOperation> dataStructureWriteOperations)
                                                                      throws java.lang.Exception
        When datatype is created or removed as bulk, the data source will be notified with this method.
        Parameters:
        dataStructureWriteOperations - Collection of DataStructureWriteOperation.
        Returns:
        Collection of OperationResult instances.
        Throws:
        java.lang.Exception