Novell exteNd
Director 5.2 API

com.sssw.fw.directory.client
Class EboDirectoryHelper

java.lang.Object
 |
 +--com.sssw.fw.directory.client.EboDirectoryHelper

public class EboDirectoryHelper
extends Object

This is the directory helper class that provides some convenient methods.


Constructor Summary
EboDirectoryHelper()
           
 
Method Summary
 String encryptPassword(String username, String password)
          Encrypts a password given a password and username
static String getDirectoryDataStore()
          Gets the directory data store type (e.g., JDBC, JNDI)
static EbiRealmUser getEbiRealmUser(EbiContext context)
          Gets EbiRealmUser principal from context.
static String getICSLogoutPage()
          Get the iChain logout page, if enabled.
static String getLoginName(EbiContext context)
          Gets the login name from the EbiContext.
static String getNewUserContainer()
          Gets the new user container (dn) that is configured in the config.xml of the directory service.
static String getShortName(Principal princ)
          Gets the shortened version of the username.
static String getUpdateUser(EbiContext ctx)
          Gets the userUniqueID from the EbiContext for use in UPDATEUSER column.
static String getUserBaseDN()
          Gets the user root container (base dn) that is configured in the config.xml of the directory service.
static String getUserFullQualifiedName(EbiContext context)
          Gets the authenticated user's full qualified name from the EbiContext.
static String getUserID(EbiContext context)
          Gets the userID (i.e.
static String getUserIDDontThrow(EbiContext context)
          Gets the userID (i.e.
static int getUserSearchScope()
          Gets the user search scope that is configured in the config.xml of the directory service.
static boolean isLoginNewUsersEnabled()
          Gets a boolean value indicating whether users should be able to self-register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EboDirectoryHelper

public EboDirectoryHelper()
Method Detail

getShortName

public static String getShortName(Principal princ)
Gets the shortened version of the username. Some realms return a fully qualified name for the Principle.getName() value. This method returns the short name assigned to EbiRealmUser. If the short name hasn't been explicitly assigned to this instance of EbiRealmUser then the value for EbiRealmPrincipal.getName() is returned.
Parameters:
princ - the principal that contains the shortened name.
Returns:
the short name of EbiRealmUser.

getUserID

public static String getUserID(EbiContext context)
                        throws EboUnrecoverableSystemException
Gets the userID (i.e. authenticated user's principal name) from the EbiContext.
Returns:
the userID for the authenticated user in the EbiContext

getUserIDDontThrow

public static String getUserIDDontThrow(EbiContext context)
Gets the userID (i.e. authenticated user's principal name) from an EbiContext; does not throw an exception if for some reason is unable to retrieve the user ID.
Returns:
the userID for the authenticated user in the EbiContext or null if for some reason is unable to retrieve the user ID

getUserFullQualifiedName

public static String getUserFullQualifiedName(EbiContext context)
                                       throws EboUnrecoverableSystemException
Gets the authenticated user's full qualified name from the EbiContext. The full qualified name is a combination of the realm name and principal name with a backslash as the delimiter between the two, e.g. "weblogic\admin" .
Returns:
the user full qualified name for the authenticated user in the EbiContext

getUpdateUser

public static String getUpdateUser(EbiContext ctx)
                            throws EboUnrecoverableSystemException
Gets the userUniqueID from the EbiContext for use in UPDATEUSER column.
Returns:
a userUUID for the authenticated user in the EbiContext

getLoginName

public static String getLoginName(EbiContext context)
                           throws EboUnrecoverableSystemException
Gets the login name from the EbiContext. This is the same as the name of the principal
Returns:
the login name for the authenticated user in the EbiContext

getUserBaseDN

public static String getUserBaseDN()
Gets the user root container (base dn) that is configured in the config.xml of the directory service.
Returns:
the user root container as the base DN.

getUserSearchScope

public static int getUserSearchScope()
Gets the user search scope that is configured in the config.xml of the directory service.

getNewUserContainer

public static String getNewUserContainer()
Gets the new user container (dn) that is configured in the config.xml of the directory service.
Returns:
the new user container DN.

isLoginNewUsersEnabled

public static boolean isLoginNewUsersEnabled()
Gets a boolean value indicating whether users should be able to self-register
Returns:
boolean

getICSLogoutPage

public static String getICSLogoutPage()
Get the iChain logout page, if enabled. The logout page is used by the LoginPorlet to determine if it should inform an iChain proxy server to logout of its session with the browser. The logout page should be set to something like https://myIChainServer/cmd/ICSLogout, where myIChainServer is the address of the iChain proxy server. This attribute should be set and enabled when iChain is configured with authentication enabled, and to forward authentication credentials and an iChain cookie. If the LoginPortlet sees the iChain cookie and a valid logout page, it will send a redirect of the page back to iChain, causing it to log out of its session.
Returns:
the URL string of the iChain logout page, if enabled

encryptPassword

public String encryptPassword(String username,
                              String password)
Encrypts a password given a password and username
Parameters:
username -  
password -  
Returns:
the encrypted password
Since:
v4.0

getEbiRealmUser

public static EbiRealmUser getEbiRealmUser(EbiContext context)
                                    throws EboUnrecoverableSystemException
Gets EbiRealmUser principal from context. This is a convenience method to ensure that the principal retrieved from the context is of data type com.sssw.fw.directory.api.EbiRealmUser (a sub-interface of java.security.Principal).
Parameters:
context - an EbiContext that contains the principal
Returns:
an EbiRealmUser object
Since:
v4.0
See Also:
EbiRealmUser

getDirectoryDataStore

public static String getDirectoryDataStore()
Gets the directory data store type (e.g., JDBC, JNDI)
Returns:
the directory data store type name

Novell exteNd
Director 5.2 API