com.atlassian.mywork.service
Interface ImpersonationService


public interface ImpersonationService

This service is responsible for performing actions as a given user.


Method Summary
<V> V
runAs(java.lang.String username, java.util.concurrent.Callable<V> callable)
          Run the given callable as the given user
 void runAs(java.lang.String username, java.lang.Runnable runnable)
          Run the given runnable as the given user
 

Method Detail

runAs

void runAs(java.lang.String username,
           java.lang.Runnable runnable)
Run the given runnable as the given user

Parameters:
username - username of the user to run the runnable as
runnable - runnable to run

runAs

<V> V runAs(java.lang.String username,
            java.util.concurrent.Callable<V> callable)
        throws java.lang.Exception
Run the given callable as the given user

Type Parameters:
V - result type
Parameters:
username - username of the user to run the callable as
callable - callable to run
Returns:
result
Throws:
java.lang.Exception - if the callable throws exception when running it


Copyright © 2013 Atlassian. All Rights Reserved.