Class DatabaseChangeRecord


  • @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class DatabaseChangeRecord
    extends java.lang.Object
    This class represents the basis for a single database change record. A JDBCSyncSource implementation should create instances of this class based on changes detected in the database (either from a changelog table or some other change tracking mechanism). The resync process will also use instances of this class to identify database entries, which can then be fetched using the fetchEntry() method on the JDBCSyncSource extension.
    • Method Detail

      • getChangeNumber

        public long getChangeNumber()
        Get the change number that identifies this particular change. If a change number is not used by the database for change detection, this method will return a monotonically increasing sequence number for this change record, so that you can still identify the order in which changes were detected.
        Returns:
        the changeNumber
      • getTableName

        public java.lang.String getTableName()
        Get the database table on which the change occurred.
        Returns:
        the table name
      • getIdentifiableInfo

        public DN getIdentifiableInfo()
        Get the DN that identifies the row that changed (for example "accountID=123"). If multiple attributes are part of the identifier, they will be represented as different RDN components of the DN in the order they were originally specified (for example "accountID=123,groupID=5").
        Returns:
        an identifier string
      • getEntryType

        public java.lang.String getEntryType()
        Get the database entry type that this change corresponds to (for example "account" or "subscriber").
        Returns:
        the type of database entry
      • getChangedColumns

        public java.lang.String[] getChangedColumns()
        Get the set of changed columns for this change entry.
        Returns:
        an array of column names that were modified as part of the change
      • getModifier

        public java.lang.String getModifier()
        Get the database user that made the change.
        Returns:
        the database user account
      • getChangeTime

        public long getChangeTime()
        Get the time at which the change occurred.
        Returns:
        the change time (in milliseconds since January 1, 1970 00:00:00.000 GMT)
      • getProperty

        public java.lang.Object getProperty​(java.lang.Object key)
        Get the property value (if one exists) for the given key.
        Parameters:
        key - the property key whose value to return
        Returns:
        the property value, or null if the key is null
      • setCompletionStatus

        @InternalUseOnly
        public void setCompletionStatus​(CompletionStatus status)
        This method is used by the Sync Pipe to indicate if the completion status of a synchronization operation. This is for internal use only and should not be called by clients.
        Parameters:
        status - the completion status for this DatabaseChangeRecord
      • getCompletionStatus

        public CompletionStatus getCompletionStatus()
        Gets the completion status for this change. This will be null if the change has not finished processing yet.
        Returns:
        the CompletionStatus indicating whether this change completed successfully or else a reason why it failed
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object