org.mycore.user
Class MCRUserPolicy

java.lang.Object
  extended by org.mycore.user.MCRUserPolicy

public class MCRUserPolicy
extends Object

This class defines the policies of the MyCoRe user and group objects such as required fields or password policy. It is implemented as a singleton since there must not be two instances of this class.

Version:
$Revision: 13085 $ $Date: 2007-02-13 13:36:37 +0100 (Di, 13 Feb 2007) $
Author:
Detlev Degenhardt

Method Summary
 ArrayList<String> getRequiredGroupAttributes()
           
 ArrayList<String> getRequiredUserAttributes()
           
static MCRUserPolicy instance()
          This method is the only way to get an instance of this class.
 boolean isRequiredForGroup(String required)
          This method returns true if the given field is a required group attribute.
 boolean isRequiredForUser(String required)
          This method returns true if the given field is a required user attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

instance

public static final MCRUserPolicy instance()
This method is the only way to get an instance of this class. It calls the private constructor to create the singleton.

Returns:
returns the one and only instance of MCRUserPolicy

isRequiredForUser

public boolean isRequiredForUser(String required)
This method returns true if the given field is a required user attribute.

Parameters:
required - string value representing a user attribute to check whether it is required

isRequiredForGroup

public boolean isRequiredForGroup(String required)
This method returns true if the given field is a required group attribute.

Parameters:
required - string value representing a group attribute to check whether it is required

getRequiredUserAttributes

public ArrayList<String> getRequiredUserAttributes()
Returns:
This method returns a ArrayList of strings with the names of required user attributes.

getRequiredGroupAttributes

public ArrayList<String> getRequiredGroupAttributes()
Returns:
This method returns a ArrayList of strings with the names of required group attributes.