| | |
| | | */ |
| | | public class PendingChange implements Comparable<PendingChange> |
| | | { |
| | | private CSN changeNumber; |
| | | private CSN csn; |
| | | private boolean committed; |
| | | private LDAPUpdateMsg msg; |
| | | private PluginOperation op; |
| | |
| | | |
| | | /** |
| | | * Construct a new PendingChange. |
| | | * @param changeNumber the ChangeNumber of use |
| | | * @param csn the CSN of use |
| | | * @param op the operation to use |
| | | * @param msg the message to use (can be null for local operations) |
| | | */ |
| | | public PendingChange(CSN changeNumber, |
| | | PluginOperation op, |
| | | LDAPUpdateMsg msg) |
| | | public PendingChange(CSN csn, PluginOperation op, LDAPUpdateMsg msg) |
| | | { |
| | | this.changeNumber = changeNumber; |
| | | this.csn = csn; |
| | | this.committed = false; |
| | | this.op = op; |
| | | this.msg = msg; |
| | |
| | | } |
| | | |
| | | /** |
| | | * Get the ChangeNumber associated to this PendingChange. |
| | | * @return the ChangeNumber |
| | | * Get the CSN associated to this PendingChange. |
| | | * @return the CSN |
| | | */ |
| | | public CSN getCSN() |
| | | { |
| | | return changeNumber; |
| | | return csn; |
| | | } |
| | | |
| | | /** |
| | |
| | | synchronized (this) |
| | | { |
| | | if (targetDN != null) |
| | | return targetDN; |
| | | else |
| | | { |
| | | try |
| | | { |
| | | targetDN = DN.decode(msg.getDn()); |
| | | } |
| | | catch (DirectoryException e) |
| | | { |
| | | } |
| | | return targetDN; |
| | | } |
| | | try |
| | | { |
| | | targetDN = DN.decode(msg.getDn()); |
| | | } |
| | | catch (DirectoryException e) |
| | | { |
| | | } |
| | | return targetDN; |
| | | } |
| | |
| | | @Override |
| | | public int compareTo(PendingChange o) |
| | | { |
| | | return this.getCSN().compareTo(o.getCSN()); |
| | | return getCSN().compareTo(o.getCSN()); |
| | | } |
| | | } |