DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.security.auth
Class AuthUtils

java.lang.Object
  extended by org.dlese.dpc.schemedit.security.auth.AuthUtils

public class AuthUtils
extends Object

Author:
Jonathan Ostwald

Field Summary
static NSDLLdapClient ldapClient
          NOT YET DOCUMENTED
 
Constructor Summary
AuthUtils()
           
 
Method Summary
static AppConfigurationEntry getConfiguredLoginModule(String loginModuleClass)
          Gets the the specified AppConfigurationEntry from the login configuration
static List getConfiguredLoginModules()
          Gets the configuredLoginModules as list of loginModule class names
static List getConfiguredLoginModules(boolean verbose)
          Gets the configuredLoginModules as list of loginModule class names, optionally printing if "verbose" is true.
static Document getLdapUserInfo(String searchString, String ldapField)
          Searches an LDAP directory and returns results in the form of a dom4j.Document.
static String getPasswordFile()
          Gets the passwordFile attribute of the AuthUtils class
static List getTokens(String s)
          Splits a string into tokens around ','
static List getTokens(String s, String delimiter)
          Splits a string into tokens around the provided delimiter
static String joinTokens(List tokens)
          Joins a list of tokens into a comma-delimited string
static String joinTokens(List tokens, String joinStr)
          Joins a list of tokens using provided delimiter.
static boolean loginModuleEnabled(String loginModuleClass)
          NOT YET DOCUMENTED
static boolean permitted(Subject subj, Permission p)
          NOT USED - returns true if provided subject has provided permission
static void reportConfiguredLoginModules()
          Gets (and prints) the configuredLoginModules as list of loginModule class names
static void showSubject(Subject _mySubject)
          Debugging - prints a string representation of provided Subject
static void showSubject(Subject _mySubject, String msg)
          Debugging - prints a string representation of provided Subjec
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ldapClient

public static NSDLLdapClient ldapClient
NOT YET DOCUMENTED

Constructor Detail

AuthUtils

public AuthUtils()
Method Detail

showSubject

public static void showSubject(Subject _mySubject)
Debugging - prints a string representation of provided Subject

Parameters:
_mySubject - the subject to display

showSubject

public static void showSubject(Subject _mySubject,
                               String msg)
Debugging - prints a string representation of provided Subjec

Parameters:
_mySubject - the subject to display
msg - a message to display along with subject

getConfiguredLoginModules

public static List getConfiguredLoginModules()
Gets the configuredLoginModules as list of loginModule class names

Returns:
The configuredLoginModules value

reportConfiguredLoginModules

public static void reportConfiguredLoginModules()
Gets (and prints) the configuredLoginModules as list of loginModule class names


getConfiguredLoginModules

public static List getConfiguredLoginModules(boolean verbose)
Gets the configuredLoginModules as list of loginModule class names, optionally printing if "verbose" is true.

Parameters:
verbose - to display configured modules
Returns:
The configuredLoginModules value

getConfiguredLoginModule

public static AppConfigurationEntry getConfiguredLoginModule(String loginModuleClass)
Gets the the specified AppConfigurationEntry from the login configuration

Parameters:
loginModuleClass - class name of loginModule to get
Returns:
The configuredLoginModule value

loginModuleEnabled

public static boolean loginModuleEnabled(String loginModuleClass)
NOT YET DOCUMENTED

Parameters:
loginModuleClass - NOT YET DOCUMENTED
Returns:
NOT YET DOCUMENTED

getPasswordFile

public static String getPasswordFile()
Gets the passwordFile attribute of the AuthUtils class

Returns:
The passwordFile value

getLdapUserInfo

public static Document getLdapUserInfo(String searchString,
                                       String ldapField)
                                throws Exception
Searches an LDAP directory and returns results in the form of a dom4j.Document. Used by UserInfoAction.

NOTE: currently supports NSDL ldap only!

Parameters:
searchString - the search string
ldapField - either "cn" or "uid"
Returns:
The ldapUserInfo value
Throws:
Exception - NOT YET DOCUMENTED

getTokens

public static List getTokens(String s)
Splits a string into tokens around ','

Parameters:
s - the string to split
Returns:
a list of tokens

getTokens

public static List getTokens(String s,
                             String delimiter)
Splits a string into tokens around the provided delimiter

Parameters:
s - the string to split
delimiter - string to split by
Returns:
a list of tokens

joinTokens

public static String joinTokens(List tokens)
Joins a list of tokens into a comma-delimited string

Parameters:
tokens - list to be joined
Returns:
string of joined values

joinTokens

public static String joinTokens(List tokens,
                                String joinStr)
Joins a list of tokens using provided delimiter.

Parameters:
tokens - list to be joined
joinStr - string to be inserted between tokens
Returns:
string of joined tokens

permitted

public static boolean permitted(Subject subj,
                                Permission p)
NOT USED - returns true if provided subject has provided permission

Parameters:
subj - the subject
p - the permission
Returns:
true if permitted

DLESE Tools
v1.6.0