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

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

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

This class is used to construct ChangeRecord instances. At least a 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 Summary
ChangeRecord.Builder(com.unboundid.ldap.sdk.ChangeType type, com.unboundid.ldap.sdk.DN identifiableInfo)
          Creates a Builder which can be used to construct a ChangeRecord.
ChangeRecord.Builder(com.unboundid.ldap.sdk.ChangeType type, java.lang.String identifiableInfo)
          Creates a Builder which can be used to construct a ChangeRecord.
ChangeRecord.Builder(com.unboundid.ldap.sdk.ChangeType type, java.lang.String identifiableInfo, java.lang.String delimiter)
          Creates a Builder which can be used to construct a ChangeRecord.
 
Method Summary
 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(com.unboundid.ldap.sdk.Entry entry)
          Set the full source entry on this ChangeRecord.
 ChangeRecord.Builder modifier(java.lang.String modifier)
          Set the user account name that made the change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeRecord.Builder

public ChangeRecord.Builder(com.unboundid.ldap.sdk.ChangeType type,
                            com.unboundid.ldap.sdk.DN identifiableInfo)
Creates a Builder which can be used to construct a ChangeRecord.

Parameters:
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").

ChangeRecord.Builder

public ChangeRecord.Builder(com.unboundid.ldap.sdk.ChangeType type,
                            java.lang.String identifiableInfo)
Creates a Builder which can be used to construct a ChangeRecord.

Parameters:
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").

ChangeRecord.Builder

public ChangeRecord.Builder(com.unboundid.ldap.sdk.ChangeType type,
                            java.lang.String identifiableInfo,
                            java.lang.String delimiter)
Creates a Builder which can be used to construct a ChangeRecord.

Parameters:
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.
Method Detail

changeNumber

public ChangeRecord.Builder changeNumber(long changeNumber)
Set the change number that identifies this particular change (if applicable). If this is not used, a change number will be automatically generated for the ChangeRecord.

Parameters:
changeNumber - the change number
Returns:
the Builder instance

changedAttributes

public ChangeRecord.Builder changedAttributes(java.lang.String[] changedAttributes)
Set the set of changed attributes for this change entry.

Parameters:
changedAttributes - an array of attribute names that were modified as part of the change
Returns:
the Builder instance

modifier

public ChangeRecord.Builder modifier(java.lang.String modifier)
Set the user account name that made the change.

Parameters:
modifier - the account name or user name of the entity that made the change
Returns:
the Builder instance

changeTime

public ChangeRecord.Builder changeTime(long changeTime)
Set the time at which the change occurred. This should be based on the clock at the source endpoint if possible.

Parameters:
changeTime - the time of the change (in milliseconds since January 1, 1970 00:00:00.000 GMT)
Returns:
the Builder instance

fullEntry

public ChangeRecord.Builder fullEntry(com.unboundid.ldap.sdk.Entry entry)
Set the full source entry on this ChangeRecord. This may be desirable if the source does not provide logical separation between the "change record" and the entry itself. If this is set on the ChangeRecord, the Synchronization Server will skip the call to 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.

Parameters:
entry - the full source entry that was changed
Returns:
the Builder instance

addProperty

public ChangeRecord.Builder addProperty(java.lang.Object key,
                                        java.lang.Object value)
Add an arbitrary attachment or property to the ChangeRecord 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 ChangeRecord build()
Construct the ChangeRecord. This method may only be called once.

Returns:
a ChangeRecord instance