Interface SyncHandler
-
public interface SyncHandlerSyncHandler is used to sync users and groups from anExternalIdentityProvider. The synchronization performed within the scope of aSyncContextwhich is acquired during thecreateContext(ExternalIdentityProvider, org.apache.jackrabbit.api.security.user.UserManager, javax.jcr.ValueFactory)call. The exact configuration is managed by the sync handler instance. The system may contain several sync handler implementations with different configurations. those are managed by theSyncManager.- See Also:
SyncContext,SyncManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull SyncContextcreateContext(@NotNull ExternalIdentityProvider idp, @NotNull UserManager userManager, @NotNull javax.jcr.ValueFactory valueFactory)Initializes a sync context which is used to start the sync operations.@Nullable SyncedIdentityfindIdentity(@NotNull UserManager userManager, @NotNull java.lang.String id)Tries to find the identity with the given authorizable id or name.@NotNull java.lang.StringgetName()Returns the name of this sync handler.@NotNull java.util.Iterator<SyncedIdentity>listIdentities(@NotNull UserManager userManager)Lists all externally synced identities.booleanrequiresSync(@NotNull SyncedIdentity identity)Checks if the identity requires sync based on the configuration, type and last sync time.
-
-
-
Method Detail
-
getName
@NotNull @NotNull java.lang.String getName()
Returns the name of this sync handler.- Returns:
- sync handler name
-
createContext
@NotNull @NotNull SyncContext createContext(@NotNull @NotNull ExternalIdentityProvider idp, @NotNull @NotNull UserManager userManager, @NotNull @NotNull javax.jcr.ValueFactory valueFactory)
Initializes a sync context which is used to start the sync operations.- Parameters:
idp- the external identity provider used for syncinguserManager- user manager for managing authorizablesvalueFactory- the value factory to create values- Returns:
- the sync context
-
findIdentity
@Nullable @Nullable SyncedIdentity findIdentity(@NotNull @NotNull UserManager userManager, @NotNull @NotNull java.lang.String id) throws javax.jcr.RepositoryException
Tries to find the identity with the given authorizable id or name.- Parameters:
userManager- the user managerid- the id or name of the authorizable- Returns:
- a synced identity object or
null - Throws:
javax.jcr.RepositoryException- if an error occurs
-
requiresSync
boolean requiresSync(@NotNull @NotNull SyncedIdentity identity)Checks if the identity requires sync based on the configuration, type and last sync time.- Parameters:
identity- the identity to check- Returns:
trueif the identity requires synchronization.
-
listIdentities
@NotNull @NotNull java.util.Iterator<SyncedIdentity> listIdentities(@NotNull @NotNull UserManager userManager) throws javax.jcr.RepositoryException
Lists all externally synced identities.- Parameters:
userManager- the user manager- Returns:
- an iterator over all authorizable that are externally synced.
- Throws:
javax.jcr.RepositoryException- if an error occurs
-
-