com.atlassian.crowd.integration.directory.monitor.poller
Class USNChangedPoller

java.lang.Object
  extended by com.atlassian.crowd.integration.directory.monitor.poller.USNChangedPoller
All Implemented Interfaces:
DirectoryMonitor, DirectoryPoller

public class USNChangedPoller
extends java.lang.Object
implements DirectoryPoller

Polling synchroniser specific to Active Directory.

If the underlying Active Directory configuration mutates, the instance of the USNChangedPoller must be discarded and a new instance, with the updated Active Directory configuration, needs to be created.

See http://msdn.microsoft.com/en-us/library/ms677627(VS.85).aspx for more information regarding this technique.

See http://msdn.microsoft.com/en-us/library/ms677625.aspx for and outline of various other AD synchronisation techniques.

This DirectoryPoller fires: - RemotePrincipalCreatedOrUpdatedEvent - ActiveDirectoryPrincipalDeletedEvent - RemoteGroupCreatedOrUpdatedEvent - ActiveDirectoryGroupDeletedEvent - RemoteRoleCreatedOrUpdatedEvent - ActiveDirectoryRoleDeletedEvent

The Group/Role update events are fired when any attribute on the Group/Role is changed. In particular, when a principal is added to/removed from a group/role, an updated event for the group/role is fired. An updated event on the Principal is not fired in this case.

Caveats: - It is possible for multiple events to fired from the same mutation if the mutation occurs after the highestCommittedUSN is read from the root DSE, but before the delta searches complete. - Object renaming is not handled. It will be treated as an object mutation and will fire a RemoteEntityCreatedOrUpdatedEvent. - Object deletion requires examining the CN=Deleted Objects, which loses all sub-tree scoping and some attributes (like objectCategory). This means that it is ActiveDirectoryEntityDeletedEvents may be fired for objects that aren't scoped RemotePrincipals, RemoteGroups or RemoteRoles. - Objects that are "moved" into an entity's subtree-scope will fire a RemoteEntityCreatedOrUpdatedEvent. - Objects that are "moved" out of an entity's subtree-scope will NOT be detected as a deleted entity. Therefore it is imperative that


Constructor Summary
USNChangedPoller(MicrosoftActiveDirectory activeDirectory, com.atlassian.event.EventManager eventManager)
           
 
Method Summary
 long getDirectoryID()
          Returns the ID of the directory that is being polled.
 long getPollingInterval()
          Returns the polling interval in seconds.
 void pollChanges()
          Polls the a directory for mutations and fires appropriate events.
protected  void pollGroupChanges()
           
protected  void pollPrincipalChanges()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

USNChangedPoller

public USNChangedPoller(MicrosoftActiveDirectory activeDirectory,
                        com.atlassian.event.EventManager eventManager)
Method Detail

pollChanges

public void pollChanges()
Description copied from interface: DirectoryPoller
Polls the a directory for mutations and fires appropriate events.

Specified by:
pollChanges in interface DirectoryPoller

getDirectoryID

public long getDirectoryID()
Description copied from interface: DirectoryMonitor
Returns the ID of the directory that is being polled.

Specified by:
getDirectoryID in interface DirectoryMonitor
Returns:
directory ID.

getPollingInterval

public long getPollingInterval()
Description copied from interface: DirectoryPoller
Returns the polling interval in seconds.

Specified by:
getPollingInterval in interface DirectoryPoller
Returns:
polling interval in seconds.

pollPrincipalChanges

protected void pollPrincipalChanges()

pollGroupChanges

protected void pollGroupChanges()


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.