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.StringREP_EXTERNAL_IDName of theExternalIdentity.getExternalId()property of a synchronized identity.static java.lang.StringREP_LAST_SYNCEDName 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 voidclose()Closes this context and releases any resources bound to it.static @Nullable DefaultSyncedIdentitycreateSyncedIdentity(@Nullable Authorizable auth)Creates a synced identity from the given authorizable.static @Nullable ExternalIdentityRefgetIdentityRef(@Nullable Authorizable auth)Retrieves the external identity ref from the authorizablebooleanisForceGroupSync()Defines if synchronization of groups always will perform, i.e.booleanisForceUserSync()Defines if synchronization of users always will perform, i.e.booleanisKeepMissing()Defines if synchronization keeps missing external identities on synchronization of authorizables.static java.lang.StringjoinPaths(java.lang.String... paths)Deprecated.Since Oak 1.3.10.@NotNull SyncContextsetForceGroupSync(boolean forceGroupSync)@NotNull SyncContextsetForceUserSync(boolean forceUserSync)@NotNull SyncContextsetKeepMissing(boolean keepMissing)@NotNull SyncResultsync(@NotNull java.lang.String id)Synchronizes an authorizable with the corresponding external identity with the repository based on the respective configuration.@NotNull SyncResultsync(@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
@Deprecated 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 theRootpassed during the creation call. This is the responsibility of the application.- Specified by:
closein interfaceSyncContext
-
isKeepMissing
public boolean isKeepMissing()
Defines if synchronization keeps missing external identities on synchronization of authorizables. Default isfalse.- Specified by:
isKeepMissingin interfaceSyncContext- Returns:
trueif keep missing.
-
setKeepMissing
@NotNull public @NotNull SyncContext setKeepMissing(boolean keepMissing)
- Specified by:
setKeepMissingin interfaceSyncContext
-
isForceUserSync
public boolean isForceUserSync()
Defines if synchronization of users always will perform, i.e. ignores the last synced properties.- Specified by:
isForceUserSyncin interfaceSyncContext- Returns:
trueif forced syncing users
-
setForceUserSync
@NotNull public @NotNull SyncContext setForceUserSync(boolean forceUserSync)
- Specified by:
setForceUserSyncin interfaceSyncContext
-
isForceGroupSync
public boolean isForceGroupSync()
Defines if synchronization of groups always will perform, i.e. ignores the last synced properties.- Specified by:
isForceGroupSyncin interfaceSyncContext- Returns:
trueif forced syncing groups
-
setForceGroupSync
@NotNull public @NotNull SyncContext setForceGroupSync(boolean forceGroupSync)
Description copied from interface:SyncContext- Specified by:
setForceGroupSyncin 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:
syncin 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:
syncin interfaceSyncContext- Parameters:
id- the id of the authorizable- Returns:
- the result of the operation
- Throws:
SyncException- if an error occurs
-
-