Class DefaultSyncContext
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.authentication.external.basic.DefaultSyncContext
-
- All Implemented Interfaces:
SyncContext
public class DefaultSyncContext extends java.lang.Object implements SyncContext
Internal implementation of the sync context
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
REP_EXTERNAL_ID
Name of theExternalIdentity.getExternalId()
property of a synchronized identity.static java.lang.String
REP_LAST_SYNCED
Name of the property that stores the time when an identity was synced.
-
Constructor Summary
Constructors Constructor Description DefaultSyncContext(@NotNull DefaultSyncConfig config, @NotNull ExternalIdentityProvider idp, @NotNull UserManager userManager, @NotNull ValueFactory valueFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
Closes this context and releases any resources bound to it.static @Nullable DefaultSyncedIdentity
createSyncedIdentity(@Nullable Authorizable auth)
Creates a synced identity from the given authorizable.static @Nullable ExternalIdentityRef
getIdentityRef(@Nullable Authorizable auth)
Retrieves the external identity ref from the authorizableboolean
isForceGroupSync()
Defines if synchronization of groups always will perform, i.e.boolean
isForceUserSync()
Defines if synchronization of users always will perform, i.e.boolean
isKeepMissing()
Defines if synchronization keeps missing external identities on synchronization of authorizables.static java.lang.String
joinPaths(java.lang.String... paths)
Deprecated.Since Oak 1.3.10.@NotNull SyncContext
setForceGroupSync(boolean forceGroupSync)
@NotNull SyncContext
setForceUserSync(boolean forceUserSync)
@NotNull SyncContext
setKeepMissing(boolean keepMissing)
@NotNull SyncResult
sync(@NotNull java.lang.String id)
Synchronizes an authorizable with the corresponding external identity with the repository based on the respective configuration.@NotNull SyncResult
sync(@NotNull ExternalIdentity identity)
Synchronizes an external identity with the repository based on the respective configuration.
-
-
-
Field Detail
-
REP_EXTERNAL_ID
public static final java.lang.String REP_EXTERNAL_ID
Name of theExternalIdentity.getExternalId()
property of a synchronized identity.- See Also:
- Constant Field Values
-
REP_LAST_SYNCED
public static final java.lang.String REP_LAST_SYNCED
Name of the property that stores the time when an identity was synced.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultSyncContext
public DefaultSyncContext(@NotNull @NotNull DefaultSyncConfig config, @NotNull @NotNull ExternalIdentityProvider idp, @NotNull @NotNull UserManager userManager, @NotNull @NotNull ValueFactory valueFactory)
-
-
Method Detail
-
createSyncedIdentity
@Nullable public static @Nullable DefaultSyncedIdentity createSyncedIdentity(@Nullable @Nullable Authorizable auth) throws RepositoryException
Creates a synced identity from the given authorizable.- Parameters:
auth
- the authorizable- Returns:
- the id
- Throws:
RepositoryException
- if an error occurs
-
getIdentityRef
@Nullable public static @Nullable ExternalIdentityRef getIdentityRef(@Nullable @Nullable Authorizable auth) throws RepositoryException
Retrieves the external identity ref from the authorizable- Parameters:
auth
- the authorizable- Returns:
- the ref
- Throws:
RepositoryException
- if an error occurs
-
joinPaths
public static java.lang.String joinPaths(java.lang.String... paths)
Deprecated.Since Oak 1.3.10. Please usePathUtils.concatRelativePaths(String...)
instead.Robust relative path concatenation.- Parameters:
paths
- relative paths- Returns:
- the concatenated path
-
close
public void close()
Closes this context and releases any resources bound to it. Note that an implementation must not commit theRoot
passed during the creation call. This is the responsibility of the application.- Specified by:
close
in interfaceSyncContext
-
isKeepMissing
public boolean isKeepMissing()
Defines if synchronization keeps missing external identities on synchronization of authorizables. Default isfalse
.- Specified by:
isKeepMissing
in interfaceSyncContext
- Returns:
true
if keep missing.
-
setKeepMissing
@NotNull public @NotNull SyncContext setKeepMissing(boolean keepMissing)
- Specified by:
setKeepMissing
in interfaceSyncContext
-
isForceUserSync
public boolean isForceUserSync()
Defines if synchronization of users always will perform, i.e. ignores the last synced properties.- Specified by:
isForceUserSync
in interfaceSyncContext
- Returns:
true
if forced syncing users
-
setForceUserSync
@NotNull public @NotNull SyncContext setForceUserSync(boolean forceUserSync)
- Specified by:
setForceUserSync
in interfaceSyncContext
-
isForceGroupSync
public boolean isForceGroupSync()
Defines if synchronization of groups always will perform, i.e. ignores the last synced properties.- Specified by:
isForceGroupSync
in interfaceSyncContext
- Returns:
true
if forced syncing groups
-
setForceGroupSync
@NotNull public @NotNull SyncContext setForceGroupSync(boolean forceGroupSync)
Description copied from interface:SyncContext
- Specified by:
setForceGroupSync
in interfaceSyncContext
-
sync
@NotNull public @NotNull SyncResult sync(@NotNull @NotNull ExternalIdentity identity) throws SyncException
Synchronizes an external identity with the repository based on the respective configuration.- Specified by:
sync
in interfaceSyncContext
- Parameters:
identity
- the identity to sync.- Returns:
- the result of the operation
- Throws:
SyncException
- if an error occurs
-
sync
@NotNull public @NotNull SyncResult sync(@NotNull @NotNull java.lang.String id) throws SyncException
Synchronizes an authorizable with the corresponding external identity with the repository based on the respective configuration.- Specified by:
sync
in interfaceSyncContext
- Parameters:
id
- the id of the authorizable- Returns:
- the result of the operation
- Throws:
SyncException
- if an error occurs
-
-