Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.api
Class UnrestrictedSessionRunner

java.lang.Object
  extended by org.nuxeo.ecm.core.api.UnrestrictedSessionRunner
Direct Known Subclasses:
AbstractCommentManagerActionsBean.FollowTransitionUnrestricted, AddRightUnrestricted, ChangePermissionUnrestricted, DeleteDocumentUnrestricted, DocumentStoreSessionRunner, DomainsFinder, PublishActionsBean.ApproverWithoutRestriction, PublishUnrestricted, QueryRepositoryProbe.Runner, RemoveACLUnrestricted, RemoveRightsUnrestricted, RootSectionsFinder, StatsTaskRunner

public abstract class UnrestrictedSessionRunner
extends Object

Helper class to run code with an unrestricted session.

The caller must implement the run() method, and call runUnrestricted().

Author:
Florent Guillaume

Field Summary
 boolean isUnrestricted
          True if a call to runUnrestricted() is in progress.
 
Method Summary
 String getOriginatingUsername()
           
abstract  void run()
          This method will be called by runUnrestricted() with session available as an unrestricted session.
 void runUnrestricted()
          Calls the run() method with an unrestricted session.
 void setOriginatingUsername(String originatingUsername)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isUnrestricted

public boolean isUnrestricted
True if a call to runUnrestricted() is in progress.

Method Detail

getOriginatingUsername

public String getOriginatingUsername()

setOriginatingUsername

public void setOriginatingUsername(String originatingUsername)

runUnrestricted

public void runUnrestricted()
                     throws ClientException
Calls the run() method with an unrestricted session. During this call, isUnrestricted is set to true.

Throws:
ClientException

run

public abstract void run()
                  throws ClientException
This method will be called by 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).

Throws:
ClientException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.