Class TargetDataStoreImpl

  • All Implemented Interfaces:
    TargetDataStore

    public final class TargetDataStoreImpl
    extends java.lang.Object
    implements TargetDataStore
    This class implements TargetDataStore and should be used to instantitate a TargetDataStore.
    • Constructor Summary

      Constructors 
      Constructor Description
      TargetDataStoreImpl​(java.lang.String connectionString)
      TargetDataStore creates connections and XLA handles to the datastore.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int apply​(byte[] updateDescriptor)
      Applies XLA update descriptor to the target datastore.
      int apply​(byte[] updateDescriptor, boolean useCommitFlag)
      Applies XLA update descriptor to the target datastore.
      int apply​(byte[] updateDescriptor, boolean useCommitFlag, boolean checkUpdateConflict)
      Applies XLA update descriptor to the target datastore.
      void close()
      Closes the connections to the datastore and releases all the resources in a timely manner.
      int commit()
      Use this method to perform a manual commit.
      boolean getAutoCommitFlag()
      Returns the value of autocommit flag.
      java.lang.String getConnectionString()
      Returns the connection string for this data store.
      boolean getUpdateConflictCheckFlag()
      Returns the value of the flag to check update conflicts.
      boolean isClosed()
      Use this method to check if this object is closed.
      boolean isDataStoreValid()
      Checks if the datastore is valid.
      int rollback()
      Use this method to rollback the last transaction in case of errors.
      void setAutoCommitFlag​(boolean flag)
      Sets the flag for autocommit during apply.
      void setUpdateConflictCheckFlag​(boolean flag)
      Sets the flag for checking update conflicts during apply.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TargetDataStoreImpl

        public TargetDataStoreImpl​(java.lang.String connectionString)
                            throws jakarta.jms.JMSException
        TargetDataStore creates connections and XLA handles to the datastore.
        Parameters:
        connectionString - connection string to the datastore. If auto-commit is enabled, applies will be committed.
        Throws:
        jakarta.jms.JMSException - In case of an error while initializing XLA
    • Method Detail

      • commit

        public int commit()
                   throws jakarta.jms.JMSException
        Description copied from interface: TargetDataStore
        Use this method to perform a manual commit.
        Specified by:
        commit in interface TargetDataStore
        Returns:
        0 if successful. Otherwise, a transient error code is returned. Applications can retry.
        Throws:
        jakarta.jms.JMSException - if commit fails.
        See Also:
        TargetDataStore.setAutoCommitFlag(boolean)
      • rollback

        public int rollback()
                     throws jakarta.jms.JMSException
        Description copied from interface: TargetDataStore
        Use this method to rollback the last transaction in case of errors.
        Specified by:
        rollback in interface TargetDataStore
        Returns:
        0 if successful. Otherwise, a transient error code is returned. Applications can retry.
        Throws:
        jakarta.jms.JMSException - if rollback fails.
      • isDataStoreValid

        public boolean isDataStoreValid()
                                 throws jakarta.jms.JMSException
        Description copied from interface: TargetDataStore
        Checks if the datastore is valid.
        Specified by:
        isDataStoreValid in interface TargetDataStore
        Returns:
        true is the datastore is valid. This object should be closed and a new object instantiated. Continued use of this object will result in failures.
        Throws:
        jakarta.jms.JMSException - if it cannot ascertain the status of the datastore.
        See Also:
        TargetDataStore.close()
      • close

        public void close()
                   throws jakarta.jms.JMSException
        Description copied from interface: TargetDataStore
        Closes the connections to the datastore and releases all the resources in a timely manner. Use of close() is highly recommended over relying on the garbage collector to release unneeded resources. Once closed, this object cannot be reused.
        Specified by:
        close in interface TargetDataStore
        Throws:
        jakarta.jms.JMSException - if some unrecoverable error occurs while closing.
      • getConnectionString

        public java.lang.String getConnectionString()
        Description copied from interface: TargetDataStore
        Returns the connection string for this data store.
        Specified by:
        getConnectionString in interface TargetDataStore
        Returns:
        Connection string for this datastore.
      • apply

        public int apply​(byte[] updateDescriptor,
                         boolean useCommitFlag,
                         boolean checkUpdateConflict)
                  throws jakarta.jms.JMSException
        Description copied from interface: TargetDataStore
        Applies XLA update descriptor to the target datastore.
        Specified by:
        apply in interface TargetDataStore
        Parameters:
        updateDescriptor - XLA update descriptor. This can be extracted from JMS/XLA TimesTenMapMessage.
        useCommitFlag - If set, transactions will be committed if TT_UPDCOMMIT flag is set or if the record type is COMMITONLY.
        checkUpdateConflict - If set, check for update conflicts and report.
        Returns:
        0 if successful. Otherwise, a transient error code is returned. Applications can retry.
        Throws:
        jakarta.jms.JMSException - If there are database errors or schema mismatch, this exception will be thrown.
      • apply

        public int apply​(byte[] updateDescriptor,
                         boolean useCommitFlag)
                  throws jakarta.jms.JMSException
        Description copied from interface: TargetDataStore
        Applies XLA update descriptor to the target datastore. If updateConflictCheckFlag is set, update conflicts will be checked and reported.
        Specified by:
        apply in interface TargetDataStore
        Parameters:
        updateDescriptor - XLA update descriptor. This can be extracted from JMS/XLA TimesTenMapMessage.
        useCommitFlag - If set, transactions will be committed if TT_UPDCOMMIT flag is set or if the record type is COMMITONLY.
        Returns:
        0 if successful. Otherwise, a transient error code is returned. Applications can retry.
        Throws:
        jakarta.jms.JMSException - If there are database errors or schema mismatch, this exception will be thrown.
        See Also:
        TargetDataStore.setUpdateConflictCheckFlag(boolean)
      • apply

        public int apply​(byte[] updateDescriptor)
                  throws jakarta.jms.JMSException
        Description copied from interface: TargetDataStore
        Applies XLA update descriptor to the target datastore. Transactions will be committed if TT_UPDCOMMIT flag is set or if the record type is COMMITONLY. If updateConflictCheckFlag is set, update conflicts will be checked and reported.
        Specified by:
        apply in interface TargetDataStore
        Parameters:
        updateDescriptor - XLA update descriptor. This can be extracted from JMS/XLA TimesTenMapMessage.
        Returns:
        0 if successful. Otherwise, a transient error code is returned. Applications can retry.
        Throws:
        jakarta.jms.JMSException - If there are database errors or schema mismatch, this exception will be thrown.
        See Also:
        TargetDataStore.setAutoCommitFlag(boolean), TargetDataStore.setUpdateConflictCheckFlag(boolean)
      • getAutoCommitFlag

        public boolean getAutoCommitFlag()
        Description copied from interface: TargetDataStore
        Returns the value of autocommit flag.
        Specified by:
        getAutoCommitFlag in interface TargetDataStore
        Returns:
        true if this flag is set.
      • getUpdateConflictCheckFlag

        public boolean getUpdateConflictCheckFlag()
        Description copied from interface: TargetDataStore
        Returns the value of the flag to check update conflicts.
        Specified by:
        getUpdateConflictCheckFlag in interface TargetDataStore
        Returns:
        true if update conflicts are checked during apply.
      • isClosed

        public boolean isClosed()
        Description copied from interface: TargetDataStore
        Use this method to check if this object is closed. A closed object cannot be used any longer.
        Specified by:
        isClosed in interface TargetDataStore
        Returns:
        true if this object is closed.