Class DatabaseChangeRecord.Builder

    • Constructor Detail

      • Builder

        public Builder​(DatabaseChangeRecord.ChangeType type,
                       DN identifiableInfo)
        Creates a Builder which can be used to construct a DatabaseChangeRecord.
        Parameters:
        type - the ChangeType (insert/update/delete/resync)
        identifiableInfo - a unique identifier for the row that changed (i.e. "accountID=123"). If multiple attributes are part of the identifier, they should be separate RDN components of the DN (i.e. "accountID=123,groupID=5").
      • Builder

        public Builder​(DatabaseChangeRecord.ChangeType type,
                       java.lang.String identifiableInfo)
        Creates a Builder which can be used to construct a DatabaseChangeRecord.
        Parameters:
        type - the ChangeType (insert/update/delete/resync)
        identifiableInfo - a unique identifier for the row that changed (i.e. "accountID=123"). If multiple attributes are part of the identifier, they should be delimited with the default delimiter of "%%" (i.e. "accountID=123%%groupID=5").
      • Builder

        public Builder​(DatabaseChangeRecord.ChangeType type,
                       java.lang.String identifiableInfo,
                       java.lang.String delimiter)
        Creates a Builder which can be used to construct a DatabaseChangeRecord.
        Parameters:
        type - the ChangeType (insert/update/delete/resync)
        identifiableInfo - a unique identifier for the row that changed (i.e. "accountID=123"). If multiple attributes are part of the identifier, they should be delimited with a unique string (i.e. "accountID=123%%groupID=5") which is specified by the delimiter parameter.
        delimiter - The delimiter used to split separate components of the identifiable info. If this is null, the default of "%%" will be used.
    • Method Detail

      • changeNumber

        public DatabaseChangeRecord.Builder changeNumber​(long changeNumber)
        Set the change number that identifies this particular change (if applicable).
        Parameters:
        changeNumber - the change number
        Returns:
        the Builder instance
      • tableName

        public DatabaseChangeRecord.Builder tableName​(java.lang.String tableName)
        Set the database table on which the change occurred.
        Parameters:
        tableName - the table name
        Returns:
        the Builder instance
      • entryType

        public DatabaseChangeRecord.Builder entryType​(java.lang.String entryType)
        Set the database entry type that this change corresponds to (for example "account" or "subscriber").
        Parameters:
        entryType - the type of database entry
        Returns:
        the Builder instance
      • changedColumns

        public DatabaseChangeRecord.Builder changedColumns​(java.lang.String[] changedColumns)
        Set the set of changed columns for this change entry.
        Parameters:
        changedColumns - an array of column names that were modified as part of the change
        Returns:
        the Builder instance
      • modifier

        public DatabaseChangeRecord.Builder modifier​(java.lang.String modifier)
        Set the database user that made the change.
        Parameters:
        modifier - the database account name
        Returns:
        the Builder instance
      • changeTime

        public DatabaseChangeRecord.Builder changeTime​(long changeTime)
        Set the time at which the change occurred. This should be based on the clock on the database server.
        Parameters:
        changeTime - the time of the change (in milliseconds since January 1, 1970 00:00:00.000 GMT)
        Returns:
        the Builder instance
      • addProperty

        public DatabaseChangeRecord.Builder addProperty​(java.lang.Object key,
                                                        java.lang.Object value)
        Add an arbitrary attachment or property to the DatabaseChangeRecord being built. Nor the key or the value are allowed to be null.
        Parameters:
        key - the key for the property
        value - the value of the property
        Returns:
        the Builder instance
      • build

        public DatabaseChangeRecord build()
        Construct the DatabaseChangeRecord. This method may only be called once.
        Returns:
        a DatabaseChangeRecord instance