Package org.nuxeo.ecm.core.api
Class UnrestrictedSessionRunner
- java.lang.Object
-
- org.nuxeo.ecm.core.api.UnrestrictedSessionRunner
-
- Direct Known Subclasses:
AbstractRootSectionsFinder,AbstractUserWorkspaceImpl.UnrestrictedUserWorkspaceFinder,ChangePermissionUnrestricted,CoreGraph.ResourceFinder,CoreGraph.SizeFinder,CoreGraph.StatementAdder,CoreGraph.StatementFinder,CoreGraph.StatementRemover,CoreProxyWithWorkflowFactory.DocumentPublisherUnrestricted,CoreQueryAndFetchUnrestrictedSessionRunner,CoreQueryUnrestrictedSessionRunner,CreateDocumentsAction.UnrestrictedCreateDocument,CreateTaskUnrestricted,DefaultValidatorsRule.UnrestrictedACPGetter,DeleteDocumentUnrestricted,DocumentMetadataGroupComputer.GetDocumentsFromUsername,DocumentRouteElementImpl.GetIsParentRunningUnrestricted,DocumentRouteElementImpl.SetDocumentOnReadOnlyUnrestrictedSessionRunner,DocumentRoutingServiceImpl.AttachedDocumentsChecker,DocumentStoreSessionRunner,DomainsFinder,DublinCoreListener.UnrestrictedPropertySetter,FollowTransitionUnrestricted,JsonGraphRoute,MultiTenantHelper.TenantIdFinder,NodeAccessRunner,PublishUnrestricted,QueryRepositoryProbe.Runner,RelationTagService.UnrestrictedCanRemoveTagging,RelationTagService.UnrestrictedGetDocumentCloud,RemoveACLUnrestricted,RenditionCreator,RenditionFinder,RenditionLiveDocFetcher,RenditionPublicationFactory.RemoveACP,RenditionsRemover,SourceDocumentResolver,TaskServiceImpl.GetTaskRootParentPathUnrestricted,TemplateMappingFetcher,TemplateMappingRemover,UserInvitationComponent.RegistrationAcceptator,UserInvitationComponent.RegistrationApprover,UserInvitationComponent.RegistrationCreator,UserInvitationComponent.RegistrationRejector,UserInvitationComponent.RequestIdValidator,UserInvitationComponent.RootDocumentGetter,UserInvitationComponent.UserRegistrationModelCreator
public abstract class UnrestrictedSessionRunner extends Object
Helper class to run code with an unrestricted session.The caller must implement the
run()method, and callrunUnrestricted().- Author:
- Florent Guillaume
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanisUnrestrictedTrue if a call torunUnrestricted()is in progress.protected StringoriginatingUsernameprotected StringrepositoryNameprotected CoreSessionsessionprotected booleansessionIsAlreadyUnrestricted
-
Constructor Summary
Constructors Modifier Constructor Description protectedUnrestrictedSessionRunner(String repositoryName)Constructs aUnrestrictedSessionRunnergiven a repository name.protectedUnrestrictedSessionRunner(String repositoryName, String originatingUser)Constructs aUnrestrictedSessionRunnergiven a repository name and an originating user name.protectedUnrestrictedSessionRunner(CoreSession session)Constructs aUnrestrictedSessionRunnergiven an existing session (which may or may not be already unrestricted).
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleancheckUnrestricted(CoreSession session)StringgetOriginatingUsername()abstract voidrun()This method will be called byrunUnrestricted()withsessionavailable as an unrestricted session.voidrunUnrestricted()voidsetOriginatingUsername(String originatingUsername)
-
-
-
Field Detail
-
originatingUsername
protected String originatingUsername
-
session
protected CoreSession session
-
sessionIsAlreadyUnrestricted
protected final boolean sessionIsAlreadyUnrestricted
-
repositoryName
protected final String repositoryName
-
isUnrestricted
protected boolean isUnrestricted
True if a call torunUnrestricted()is in progress.
-
-
Constructor Detail
-
UnrestrictedSessionRunner
protected UnrestrictedSessionRunner(CoreSession session)
Constructs aUnrestrictedSessionRunnergiven an existing session (which may or may not be already unrestricted).Originating user is taken on given session.
- Parameters:
session- the available session
-
UnrestrictedSessionRunner
protected UnrestrictedSessionRunner(String repositoryName)
Constructs aUnrestrictedSessionRunnergiven a repository name.- Parameters:
repositoryName- the repository name
-
UnrestrictedSessionRunner
protected UnrestrictedSessionRunner(String repositoryName, String originatingUser)
Constructs aUnrestrictedSessionRunnergiven a repository name and an originating user name.- Parameters:
repositoryName- the repository nameoriginatingUser- the user name behind the system user
-
-
Method Detail
-
getOriginatingUsername
public String getOriginatingUsername()
-
setOriginatingUsername
public void setOriginatingUsername(String originatingUsername)
-
checkUnrestricted
protected boolean checkUnrestricted(CoreSession session)
-
runUnrestricted
public void runUnrestricted()
Calls therun()method with an unrestrictedsession. During this call,isUnrestrictedis set totrue.
-
run
public abstract void run()
This method will be called byrunUnrestricted()withsessionavailable as an unrestricted session.It can also be called directly in which case the
sessionavailable will be the one passed to#UnrestrictedSessionRunner(CoreSession).
-
-