|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.user.MCRUserObject
org.mycore.user.MCRUser
public class MCRUser
Instances of this class represent MyCoRe users.
MCRUserMgr,
MCRUserObject,
MCRUserContact,
MCRUserMgr| Field Summary | |
|---|---|
protected List<String> |
groupIDs
A list of groups (IDs) where this user is a member of |
protected boolean |
idEnabled
Specify whether the user ID is enabled or disabled |
protected int |
numID
The numerical ID of the MyCoRe user unit (either user ID or group ID) |
protected String |
passwd
The password of the MyCoRe user |
protected String |
primaryGroupID
The primary group ID of the user |
protected boolean |
updateAllowed
Specify whether the user is allowed to update the user object |
protected MCRUserContact |
userContact
Object representing user address information |
| Fields inherited from class org.mycore.user.MCRUserObject |
|---|
config, creationDate, creator, description, description_len, ID, id_len, logger, modifiedDate, password_len, privilege_len |
| Constructor Summary | |
|---|---|
MCRUser()
Default constructor. |
|
MCRUser(Element elm)
This constructor creates the data of this object from a given JDOM element. |
|
MCRUser(Element elm,
boolean useEncryption)
It the passes the given JDOM element to a different constructor and after that encrypts the password if the flag useEncryption is true. |
|
MCRUser(int numID,
String ID,
String creator,
Timestamp creationDate,
Timestamp modifiedDate,
boolean idEnabled,
boolean updateAllowed,
String description,
String passwd,
String primaryGroupID,
List<String> groupIDs,
String salutation,
String firstname,
String lastname,
String street,
String city,
String postalcode,
String country,
String state,
String institution,
String faculty,
String department,
String institute,
String telephone,
String fax,
String email,
String cellphone)
This constructor takes all attributes of this class as single variables. |
|
MCRUser(String id)
This minimal constructor only takes the user ID as a parameter. |
|
MCRUser(String userid,
String passwd)
|
|
| Method Summary | |
|---|---|
void |
addGroupID(String groupID)
This method adds a group to the groups list of the user object. |
void |
debug()
This method writes debug data to the logger (for the debug mode). |
boolean |
equals(Object obj)
|
List<String> |
getAllGroupIDs()
Deprecated. use getGroupIDs instead |
int |
getGroupCount()
|
List<String> |
getGroupIDs()
|
String |
getID()
This method must be implemented by a subclass and returns the the ID of the object. |
String |
getName()
|
int |
getNumID()
|
String |
getPassword()
|
String |
getPrimaryGroupID()
|
MCRUserContact |
getUserContact()
|
int |
hashCode()
|
boolean |
isAuthenticated()
This method checks if the user is authenticated. |
boolean |
isEnabled()
|
boolean |
isMemberOf(MCRGroup group)
This method checks if the user is member of a given group. |
boolean |
isUpdateAllowed()
|
boolean |
isValid()
This method checks if all required fields have been provided. |
boolean |
modificationIsAllowed()
This private helper method checks if the modification of the user object is allowed for the current user/session. |
void |
removeGroupID(String groupID)
This method removes a group from the groups list of the user object. |
void |
setEnabled(boolean flag)
This method sets the "enabled" attribute to a boolean value. |
boolean |
setPassword(String newPassword)
This method sets the password of the user. |
Document |
toJDOMDocument()
This method must be implemented by a subclass and then returns the user or group object as a JDOM document. |
Element |
toJDOMElement()
This method returns the user object as a JDOM element. |
String |
toString()
This method is only used for providing error messages in the access control component and should be removed later. |
void |
update(MCRUser newuser)
This method updates this instance with the data of the given MCRUser. |
| Methods inherited from class org.mycore.user.MCRUserObject |
|---|
debugDefault, getCreationDate, getCreator, getDescription, getModifiedDate, setCreationDate, setCreationDate, setCreator, setDescription, setModifiedDate, setModifiedDate, trim, trim |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int numID
protected boolean idEnabled
protected boolean updateAllowed
protected String passwd
protected String primaryGroupID
protected MCRUserContact userContact
protected List<String> groupIDs
| Constructor Detail |
|---|
public MCRUser()
public MCRUser(String id)
id - the named user ID
public MCRUser(int numID,
String ID,
String creator,
Timestamp creationDate,
Timestamp modifiedDate,
boolean idEnabled,
boolean updateAllowed,
String description,
String passwd,
String primaryGroupID,
List<String> groupIDs,
String salutation,
String firstname,
String lastname,
String street,
String city,
String postalcode,
String country,
String state,
String institution,
String faculty,
String department,
String institute,
String telephone,
String fax,
String email,
String cellphone)
throws MCRException,
Exception
numID - (int) the numerical user IDID - the named user IDidEnabled - (boolean) specifies whether the account is disabled or enabledupdateAllowed - (boolean) specifies whether the user may update his or her
datadescription - description of the userpasswd - password of the user (encrypted or not encrypted, depending on
property)primaryGroupID - the ID of the primary group of the usergroupIDs - a ArrayList of groups (IDs) the user belongs tosalutation - contact informationfirstname - contact informationlastname - contact informationstreet - contact informationcity - contact informationpostalcode - contact informationcountry - contact informationstate - contact informationinstitution - contact informationfaculty - contact informationdepartment - contact informationinstitute - contact informationtelephone - telephone numberfax - fax numberemail - email addresscellphone - number of cellular phone, if available
MCRException
Exception
public MCRUser(String userid,
String passwd)
throws MCRException,
Exception
MCRException
Exception
public MCRUser(Element elm,
boolean useEncryption)
elm - JDOM Element defining a useruseEncryption - flag to determine if the password has to be encryptedpublic MCRUser(Element elm)
elm - JDOM Element defining a user| Method Detail |
|---|
public MCRUserContact getUserContact()
public final String getID()
MCRUserObject
getID in interface MCRPrincipalgetID in class MCRUserObject
public void removeGroupID(String groupID)
throws MCRException
groupID - ID of the group removed from the user object
MCRException
public void addGroupID(String groupID)
throws MCRException
groupID - ID of the group added to the user object
MCRExceptionpublic final List<String> getAllGroupIDs()
public int getNumID()
public String getPassword()
public final String getPrimaryGroupID()
public final boolean isAuthenticated()
public boolean isEnabled()
public boolean isMemberOf(MCRGroup group)
group - Is the user a member of this group?
public boolean isUpdateAllowed()
public boolean isValid()
isValid in class MCRUserObjectpublic boolean setPassword(String newPassword)
newPassword - The new password of the userpublic final void setEnabled(boolean flag)
flag - the boolean datapublic final void update(MCRUser newuser)
newuser - the data for the update.
public Document toJDOMDocument()
throws MCRException
MCRUserObject
toJDOMDocument in class MCRUserObjectMCRException
public Element toJDOMElement()
throws MCRException
toJDOMElement in class MCRUserObjectMCRExceptionpublic final void debug()
public final boolean modificationIsAllowed()
throws MCRException
MCRExceptionpublic final List<String> getGroupIDs()
public final int getGroupCount()
public String getName()
getName in interface PrincipalgetID()public String toString()
MCRUserObject
toString in interface PrincipaltoString in class MCRUserObjectgetID()public boolean equals(Object obj)
equals in interface Principalequals in class Objectpublic int hashCode()
hashCode in interface PrincipalhashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||