org.weborganic.bastille.pageseeder
Class PSUsers

java.lang.Object
  extended by org.weborganic.bastille.pageseeder.PSUsers

public final class PSUsers
extends Object

A utility class for PageSeeder Users.

Since:
0.8.1

Method Summary
static PSUser get(String property)
          Returns the user from the property stored in the global settings.
static PSSession getAnonymous()
           
static PSUser getUser(ContentRequest req)
          Returns the PageSeeder user that is currently logged in.
static boolean hasValidSession(PSUser user)
          Indicates whether the session is still valid for the specified session.
static boolean isValid(PSSession session)
          Indicates whether the session is still valid for the specified session.
static void setAnonymous(PSSession session)
          Setting a reusable session for anonymous users.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getUser

public static PSUser getUser(ContentRequest req)
Returns the PageSeeder user that is currently logged in.

Parameters:
req - the content request.
Returns:
The PageSeeder user or null if it is not configured properly or could not login.

get

public static PSUser get(String property)
                  throws IOException
Returns the user from the property stored in the global settings.

This class will log the user to PageSeeder to retrieve his info.

If the password is using some

Parameters:
property - The property of the PageSeeder user.
Returns:
The user or null if it is not configured properly or could not login.
Throws:
IOException - Should an error occur while attempting login

hasValidSession

public static boolean hasValidSession(PSUser user)
Indicates whether the session is still valid for the specified session.

Parameters:
user - The PageSeeder session to check.
Returns:
true if the session is still valid; false otherwise.

isValid

public static boolean isValid(PSSession session)
Indicates whether the session is still valid for the specified session.

Parameters:
session - The PageSeeder session to check.
Returns:
true if the session is still valid; false otherwise.

getAnonymous

public static PSSession getAnonymous()
Returns:
the anonymous

setAnonymous

public static void setAnonymous(PSSession session)
Setting a reusable session for anonymous users.

Parameters:
session - a session to use for anonymous connections.