public abstract class UnrestrictedSessionRunner extends Object
The caller must implement the run()
method, and call runUnrestricted()
.
Modifier and Type | Field and Description |
---|---|
boolean |
isUnrestricted
True if a call to
runUnrestricted() is in progress. |
protected String |
originatingUsername |
protected String |
repositoryName |
protected CoreSession |
session |
protected boolean |
sessionIsAlreadyUnrestricted |
Modifier | Constructor and Description |
---|---|
protected |
UnrestrictedSessionRunner(CoreSession session)
Constructs a
UnrestrictedSessionRunner given an existing session (which may or may not be already
unrestricted). |
protected |
UnrestrictedSessionRunner(String repositoryName)
Constructs a
UnrestrictedSessionRunner given a repository name. |
protected |
UnrestrictedSessionRunner(String repositoryName,
String originatingUser)
Constructs a
UnrestrictedSessionRunner given a repository name and an originating user name. |
Modifier and Type | Method and Description |
---|---|
String |
getOriginatingUsername() |
protected boolean |
isUnrestricted(CoreSession session) |
abstract void |
run()
This method will be called by
runUnrestricted() with session available as an unrestricted
session. |
void |
runUnrestricted()
|
void |
setOriginatingUsername(String originatingUsername) |
protected String originatingUsername
protected CoreSession session
protected final boolean sessionIsAlreadyUnrestricted
protected final String repositoryName
public boolean isUnrestricted
runUnrestricted()
is in progress.protected UnrestrictedSessionRunner(CoreSession session)
UnrestrictedSessionRunner
given an existing session (which may or may not be already
unrestricted).
Originating user is taken on given session.
session
- the available sessionprotected UnrestrictedSessionRunner(String repositoryName)
UnrestrictedSessionRunner
given a repository name.repositoryName
- the repository nameprotected UnrestrictedSessionRunner(String repositoryName, String originatingUser)
UnrestrictedSessionRunner
given a repository name and an originating user name.repositoryName
- the repository nameoriginatingUser
- the user name behind the system userpublic String getOriginatingUsername()
public void setOriginatingUsername(String originatingUsername)
protected boolean isUnrestricted(CoreSession session)
public void runUnrestricted()
run()
method with an unrestricted session
. During this call, isUnrestricted
is set to true
.public abstract void run()
runUnrestricted()
with session
available as an unrestricted
session.
It can also be called directly in which case the session
available will be the one passed to
#UnrestrictedSessionRunner(CoreSession)
.
Copyright © 2016 Nuxeo SA. All rights reserved.