Class ExternalIdCheckingGroupActionStrategy

java.lang.Object
com.atlassian.crowd.directory.synchronisation.cache.AbstractGroupActionStrategy
com.atlassian.crowd.directory.synchronisation.cache.ExternalIdCheckingGroupActionStrategy
All Implemented Interfaces:
GroupActionStrategy

public class ExternalIdCheckingGroupActionStrategy extends AbstractGroupActionStrategy
A group action strategy that compares the remote group with a local group matched by external id. This adds support for renaming groups. As this class is unaware of other groups in the cache/from the remote, care must be taken to ensure no duplicates exist beforehand. This implementation also skips some checks from DefaultGroupActionStrategy, mostly related to groups of type GroupType.LEGACY_ROLE, so it is not intended as a drop in replacement for existing LDAP directories, even if they support the notion of external ids for groups.
  • Constructor Details

    • ExternalIdCheckingGroupActionStrategy

      public ExternalIdCheckingGroupActionStrategy()
  • Method Details

    • decide

      public DirectoryCacheChangeOperations.GroupsToAddUpdateReplace decide(@Nullable InternalDirectoryGroup internalGroup, @Nullable InternalDirectoryGroup groupMatchedByExternalId, Group remoteGroup, Date syncStartDate, long directoryId) throws OperationFailedException
      Parameters:
      internalGroup - the group matched by name from the internal directory or null if the group isn't present yet
      groupMatchedByExternalId - the group matched by external id from the internal directory or null if there were no matches, only applicable for directories supporting special handling for groups with external ids
      remoteGroup - the group from the remote directory
      syncStartDate - the date at which the synchronisation was started, used to check for local modifications after sync start
      directoryId - the id of the remote directory
      Returns:
      an object containing collections related to different types of handling new groups, one of which may contain the remote group if it should be handled
      Throws:
      OperationFailedException - if the group can't be correctly handled