Class DatabaseChangeRecord.Builder
- java.lang.Object
-
- 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 aDatabaseChangeRecord.ChangeType
and an identifiableInfoDN
are required; the rest of the parameters are optional. Arbitrary properties can also be added to the object by callingaddProperty(Object, Object)
. The setter methods return the Builder instance itself, so that these calls can be chained. When finished setting up parameters, call thebuild()
method to create a newDatabaseChangeRecord
.
-
-
Constructor Summary
Constructors Constructor Description Builder(DatabaseChangeRecord.ChangeType type, DN identifiableInfo)
Creates a Builder which can be used to construct a DatabaseChangeRecord.Builder(DatabaseChangeRecord.ChangeType type, java.lang.String identifiableInfo)
Creates a Builder which can be used to construct a 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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 benull
.- Parameters:
key
- the key for the propertyvalue
- 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
-
-