com.atlassian.confluence.plugins.rest.resources
Class UserSession

java.lang.Object
  extended by com.atlassian.confluence.plugins.rest.resources.AbstractResource
      extended by com.atlassian.confluence.plugins.rest.resources.UserSession

public class UserSession
extends AbstractResource


Field Summary
 
Fields inherited from class com.atlassian.confluence.plugins.rest.resources.AbstractResource
authContext, userAccessor
 
Constructor Summary
UserSession(UserAccessor userAccessor, RestUserSessionManager restUserSessionManager, SpacePermissionManager spacePermissionManager)
           
 
Method Summary
 javax.ws.rs.core.Response check(String username)
          Checks that the remote user (from the browser) matches the currently-logged-in user.
 javax.ws.rs.core.Response getSession()
          Returns the UserSessionEntity for the user making the request.
 javax.ws.rs.core.Response getUserHistory(String startIndexString, String maxResultsString)
          Returns the UserHistoryList for the user making the request.
 
Methods inherited from class com.atlassian.confluence.plugins.rest.resources.AbstractResource
createRequestContext, getAnonymousUserUriBuilder, getAttachmentUriBuilder, getContentUriBuilder, getCurrentUser, getMissingUserUriBuilder, getSpaceUriBuilder, getUserUriBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserSession

public UserSession(UserAccessor userAccessor,
                   RestUserSessionManager restUserSessionManager,
                   SpacePermissionManager spacePermissionManager)
Method Detail

getSession

public javax.ws.rs.core.Response getSession()
Returns the UserSessionEntity for the user making the request. Example URL: http://host/confluence/rest/prototype/1/session

Returns:
The user session for the user requesting it. This method can only be called by authenticated users.

getUserHistory

public javax.ws.rs.core.Response getUserHistory(String startIndexString,
                                                String maxResultsString)
Returns the UserHistoryList for the user making the request. Example URL: http://host/confluence/rest/prototype/1/session/history

Parameters:
startIndexString - The first (inclusive) index to return. Can be any integer zero or greater.
maxResultsString - The number of results to return. Can be any positive integer.
Returns:
The page viewing history for the current user.

check

public javax.ws.rs.core.Response check(String username)
Checks that the remote user (from the browser) matches the currently-logged-in user.

Parameters:
username - the user that the remote client thinks they are logged in as. May be blank for an anonymous user.
Returns:
a 200 success response if the user checks out, a 403 status if not.


Copyright © 2003-2013 Atlassian. All Rights Reserved.