org.openorb.orb.csiv2
Class CSIServerContext

java.lang.Object
  extended by org.openorb.orb.csiv2.CSIServerContext

public final class CSIServerContext
extends java.lang.Object

This class offers methods that are used in the context of a server-side request.

Author:
Michael Rumpf

Method Summary
static void addIdentity(java.lang.String name, java.lang.String id)
          Add an identity for a user.
static void addUser(java.lang.String name, java.lang.String password)
          Add a new user to the user database.
static java.lang.String getRealm()
          Return the realm name.
static java.lang.String getUserIdentity(java.lang.String name)
          Return the identity for the specified user.
static char[] getUserPassword(java.lang.String name)
          Return the password for the specified user.
static boolean hasUser(java.lang.String name)
          Return true when the user exists in the database and false otherwise.
static void setDefaultRealm(java.lang.String realm)
          A default realm is used for the AS_Context when no realm is attached to the current thread.
static void setRealm(java.lang.String realm)
          Set the realm name of the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addUser

public static void addUser(java.lang.String name,
                           java.lang.String password)
Add a new user to the user database.

Parameters:
name - The name of the user.
password - The password of the user.

addIdentity

public static void addIdentity(java.lang.String name,
                               java.lang.String id)
Add an identity for a user.

Parameters:
name - The name of the user.
id - The identity of the user.

hasUser

public static boolean hasUser(java.lang.String name)
Return true when the user exists in the database and false otherwise.

Parameters:
name - The name of the user.
Returns:
True when the user exists, false otherwise.

getUserPassword

public static char[] getUserPassword(java.lang.String name)
Return the password for the specified user.

Parameters:
name - The name of the user.
Returns:
The password of the user or null in case the user does not exist.

getUserIdentity

public static java.lang.String getUserIdentity(java.lang.String name)
Return the identity for the specified user.

Parameters:
name - The name of the user.
Returns:
The identity of the user or null in case the user does not exist or its identity has not been set.

setDefaultRealm

public static void setDefaultRealm(java.lang.String realm)
A default realm is used for the AS_Context when no realm is attached to the current thread.

Parameters:
realm - The name of the default realm.

setRealm

public static void setRealm(java.lang.String realm)
Set the realm name of the current thread.

Parameters:
realm - The realm name.

getRealm

public static java.lang.String getRealm()
Return the realm name. This returns either the realm that has been associated with the current thread or the default realm name.

Returns:
The realm name.