com.ibm.commerce.context.content.resources.publish

Interface ContentPublisher



  • public interface ContentPublisher
    This interface defines a content publisher.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM Copyright.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void deleteResource(java.lang.String resourceName, java.lang.String resourceKey, java.util.HashMap oneRecord)
      This method deletes the data from the target resource repository.
      void finishPublish()
      This method is called before the publish finishes.
      void flushBeforeTransaction()
      This method should be called before an explicit call to transaction commit.
      void initialize(java.lang.String initParameters)
      This method initializes the publisher, should be called after the publisher is instantiated and before any other methods are called.
      void insertResource(java.lang.String resourceName, java.lang.String resourceKey, java.util.HashMap oneRecord)
      This method inserts the data into the target resource repository.
      void prepareForCommit()
      This method prepares the transaction to be committed.
      void prepareForRollback()
      This method prepares the transaction for rollback.
      void updateResource(java.lang.String resourceName, java.lang.String resourceKey, java.util.HashMap oneRecord)
      This method updates the data in the target resource repository.
    • Method Detail

      • initialize

        void initialize(java.lang.String initParameters)
                 throws ResourceException
        This method initializes the publisher, should be called after the publisher is instantiated and before any other methods are called.
        Parameters:
        initParameters - The initialization parameters. The publisher implementation should decide its syntax and the parameters should be put into the resource container manager's configuration file.
        Throws:
        ResourceException
      • insertResource

        void insertResource(java.lang.String resourceName,
                            java.lang.String resourceKey,
                            java.util.HashMap oneRecord)
                     throws ResourceException
        This method inserts the data into the target resource repository.
        Parameters:
        resourceName - The resource name.
        resourceKey - The resource key.
        oneRecord - The data of the resource.
        Throws:
        ResourceException
      • updateResource

        void updateResource(java.lang.String resourceName,
                            java.lang.String resourceKey,
                            java.util.HashMap oneRecord)
                     throws ResourceException
        This method updates the data in the target resource repository.
        Parameters:
        resourceName - The resource name.
        resourceKey - The resource key.
        oneRecord - The data of the resource.
        Throws:
        ResourceException
      • deleteResource

        void deleteResource(java.lang.String resourceName,
                            java.lang.String resourceKey,
                            java.util.HashMap oneRecord)
                     throws ResourceException
        This method deletes the data from the target resource repository.
        Parameters:
        resourceName - The resource name.
        resourceKey - The resource key.
        oneRecord - The data of the resource.
        Throws:
        ResourceException
      • prepareForCommit

        void prepareForCommit()
                       throws ResourceException
        This method prepares the transaction to be committed. It should be called before the transaction is commited. The transaction, which insertResource, updateResource and deleteResource involve, can be a 1-PC or 2-PC one. The method can be used by publisher to flush buffered changes, for example.
        Throws:
        ResourceException
      • prepareForRollback

        void prepareForRollback()
                         throws ResourceException
        This method prepares the transaction for rollback. It is called before the transaction is rolled back. The transaction, which insertResource, updateResource and deleteResource involve, can be a 1-PC or 2-PC one. The method can be used by publisher to clear buffered changes, for example.
        Throws:
        ResourceException
      • flushBeforeTransaction

        void flushBeforeTransaction()
                             throws ResourceException
        This method should be called before an explicit call to transaction commit. This will flush and clear the batch.
        Throws:
        ResourceException - Resource exception