public static class ChangeRecord.Builder extends java.lang.Object
ChangeType
and an identifiableInfo DN
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
ChangeRecord
.Constructor and Description |
---|
Builder(ChangeType type,
DN identifiableInfo)
Creates a Builder which can be used to construct a ChangeRecord.
|
Builder(ChangeType type,
java.lang.String identifiableInfo)
Creates a Builder which can be used to construct a ChangeRecord.
|
Builder(ChangeType type,
java.lang.String identifiableInfo,
java.lang.String delimiter)
Creates a Builder which can be used to construct a ChangeRecord.
|
Modifier and Type | Method and Description |
---|---|
ChangeRecord.Builder |
addProperty(java.lang.Object key,
java.lang.Object value)
Add an arbitrary attachment or property to the ChangeRecord being
built.
|
ChangeRecord |
build()
Construct the ChangeRecord.
|
ChangeRecord.Builder |
changedAttributes(java.lang.String[] changedAttributes)
Set the set of changed attributes for this change entry.
|
ChangeRecord.Builder |
changeNumber(long changeNumber)
Set the change number that identifies this particular change (if
applicable).
|
ChangeRecord.Builder |
changeTime(long changeTime)
Set the time at which the change occurred.
|
ChangeRecord.Builder |
fullEntry(Entry entry)
Set the full source entry on this ChangeRecord.
|
ChangeRecord.Builder |
identifiableInfoAfterChange(DN identifiableInfoAfterChange)
Set the DN of the entry after the change.
|
ChangeRecord.Builder |
modifier(java.lang.String modifier)
Set the user account name that made the change.
|
public Builder(ChangeType type, DN identifiableInfo)
type
- the ChangeType (ADD/MODIFY/MOD-DN/DELETE). This can be
null
to indicate a resync operation.identifiableInfo
- a unique identifier for the entry 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").public Builder(ChangeType type, java.lang.String identifiableInfo)
type
- the ChangeType (ADD/MODIFY/MOD-DN/DELETE). This can be
null
to indicate a resync operation.identifiableInfo
- a unique identifier for the entry 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").public Builder(ChangeType type, java.lang.String identifiableInfo, java.lang.String delimiter)
type
- the ChangeType (ADD/MODIFY/MOD-DN/DELETE). This can be
null
to indicate a resync operation.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.public ChangeRecord.Builder changeNumber(long changeNumber)
changeNumber
- the change numberpublic ChangeRecord.Builder identifiableInfoAfterChange(DN identifiableInfoAfterChange)
identifiableInfoAfterChange
- The final DN of the entry after
the change.java.lang.IllegalArgumentException
- if the change type is not Modify DN.public ChangeRecord.Builder changedAttributes(java.lang.String[] changedAttributes)
changedAttributes
- an array of attribute names that were modified as part of the
changepublic ChangeRecord.Builder modifier(java.lang.String modifier)
modifier
- the account name or user name of the entity that made the changepublic ChangeRecord.Builder changeTime(long changeTime)
changeTime
- the time of the change (in milliseconds since
January 1, 1970 00:00:00.000 GMT)public ChangeRecord.Builder fullEntry(Entry entry)
fetchEntry()
in your extension and instead use this
Entry
.
When using this mechanism, make sure to set it to a non-null Entry even on a DELETE, because this will be used to correlate to the destination entry to delete.
entry
- the full source entry that was changedpublic ChangeRecord.Builder addProperty(java.lang.Object key, java.lang.Object value)
null
.key
- the key for the propertyvalue
- the value of the propertypublic ChangeRecord build()