com.unboundid.directory.sdk.sync.types
Class DatabaseChangeRecord.Builder

java.lang.Object
  extended by com.unboundid.directory.sdk.sync.types.DatabaseChangeRecord.Builder
Enclosing class:
DatabaseChangeRecord

public static class DatabaseChangeRecord.Builder
extends java.lang.Object

This class is used to construct DatabaseChangeRecord instances. At least a DatabaseChangeRecord.ChangeType and an identifiableInfo string are required; the rest of the parameters are optional. Arbitrary properties can also be added to the object by calling addProperty(Object, Object). The setter methods return the Builder instance itself, so that these calls can be chained. When finished setting up parameters, call the build() method to create a new DatabaseChangeRecord.


Constructor Summary
DatabaseChangeRecord.Builder(DatabaseChangeRecord.ChangeType type, DN identifiableInfo)
          Creates a Builder which can be used to construct a DatabaseChangeRecord.
DatabaseChangeRecord.Builder(DatabaseChangeRecord.ChangeType type, java.lang.String identifiableInfo)
          Creates a Builder which can be used to construct a DatabaseChangeRecord.
DatabaseChangeRecord.Builder(DatabaseChangeRecord.ChangeType type, java.lang.String identifiableInfo, java.lang.String delimiter)
          Creates a Builder which can be used to construct a DatabaseChangeRecord.
 
Method Summary
 DatabaseChangeRecord.Builder addProperty(java.lang.Object key, java.lang.Object value)
          Add an arbitrary attachment or property to the DatabaseChangeRecord being built.
 DatabaseChangeRecord build()
          Construct the DatabaseChangeRecord.
 DatabaseChangeRecord.Builder changedColumns(java.lang.String[] changedColumns)
          Set the set of changed columns for this change entry.
 DatabaseChangeRecord.Builder changeNumber(long changeNumber)
          Set the change number that identifies this particular change (if applicable).
 DatabaseChangeRecord.Builder changeTime(long changeTime)
          Set the time at which the change occurred.
 DatabaseChangeRecord.Builder entryType(java.lang.String entryType)
          Set the database entry type that this change corresponds to (for example "account" or "subscriber").
 DatabaseChangeRecord.Builder modifier(java.lang.String modifier)
          Set the database user that made the change.
 DatabaseChangeRecord.Builder tableName(java.lang.String tableName)
          Set the database table on which the change occurred.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseChangeRecord.Builder

public DatabaseChangeRecord.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. "account_id=123"). If multiple attributes are part of the identifier, they should be separate RDN components of the DN (i.e. "account_id=123,group_id=5"). The order of the RDN components does not matter here.

DatabaseChangeRecord.Builder

public DatabaseChangeRecord.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. "account_id=123"). If multiple attributes are part of the identifier, they should be delimited with the default delimiter of "%%" (i.e. "account_id=123%%group_id=5"). The order of the components does not matter here.

DatabaseChangeRecord.Builder

public DatabaseChangeRecord.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. "account_id=123"). If multiple attributes are part of the identifier, they should be delimited with a unique string (i.e. "account_id=123%%group_id=5") which is specified by the delimiter parameter. The order of the components does not matter here.
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 database server clock.

Parameters:
changeTime - the time of the change (in milliseconds since epoch)
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.

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