|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.schemedit.security.user.User
public class User
Class that represents a registered DCS User, including attributes, roles and preferences.
Note: passwords are not stored with the User objects.
Constructor Summary | |
---|---|
User()
No-argument Constructor for the User object |
|
User(File source)
Constructor for the User object |
Method Summary | |
---|---|
boolean |
controls(Roles.Role role,
String collection)
Does this user have a role higher than the provided for the specified collection |
void |
deletePref(String name)
Delete a rref (if the collection is not the default collection) |
void |
deleteRole(String collection)
Delete a role (if the collection is not the default collection) |
void |
destroy()
Destroy the datastructures for this User object |
void |
flush()
Write this User to disk and reset data structures so they will be reloaded from disk. |
Roles.Role |
getAssignedRole(String collection)
Return the role that has been explicitly assigned to the specified collection. |
String |
getDepartment()
Gets the department attribute of the User object |
String |
getEmail()
Return the from address. |
String |
getFirstName()
Gets the firstName attribute of the User object |
String |
getFullName()
Gets the fullName attribute of the User object |
String |
getInstitution()
Gets the institution attribute of the User object |
boolean |
getIsAdminUser()
Returns true of this user is an admin |
String |
getLastName()
Gets the lastName attribute of the User object |
Roles.Role |
getMaxRole()
Gets the maxRole attribute of the User object |
String |
getPref(String prefname)
Gets the pref attribute of the User object |
Map |
getPrefMap()
Gets the roleMap attribute of the User object |
Roles.Role |
getRole(String collection)
Gets the effective role for this collection, meaning if there is no explicit role assigned, use the default. |
Map |
getRoleMap()
Gets the roleMap attribute of the User object |
File |
getSource()
Gets the file for this user object |
String |
getUsername()
Return the username. |
boolean |
hasRole(Roles.Role role)
Returns true if this User has a role statisfying provided Role in any collection. |
boolean |
hasRole(Roles.Role role,
String collection)
Returns true if this User has at least the specified role in the specified collection |
boolean |
hasRole(String roleStr)
NOT YET DOCUMENTED |
boolean |
hasRole(String roleStr,
String collection)
Returns true if this User has a role statisfying provided Role in the specified collection. |
boolean |
isAdminUser()
Returns true of this user is an admin |
static void |
main(String[] args)
The main program for the User class |
String |
nonNullValue(String s)
NOT YET DOCUMENTED |
protected static void |
prtln(String s)
NOT YET DOCUMENTED |
void |
setAdminUser(boolean isAdmin)
Sets the adminUser attribute of the User object |
void |
setDepartment(String department)
Sets the department attribute of the User object |
void |
setEmail(String email)
Set the from address. |
void |
setFirstName(String firstName)
Sets the firstName attribute of the User object |
void |
setInstitution(String institution)
Sets the institution attribute of the User object |
void |
setLastName(String lastName)
Sets the lastName attribute of the User object |
void |
setPref(String name,
String val)
Set the User's rref for specified collection. |
void |
setRole(String collection,
Roles.Role role)
Set the User's role for specified collection. |
void |
setSource(File file)
Sets the file path for this object (where it is flushed). |
void |
setUsername(String username)
Set the username. |
String |
toString()
NOT YET DOCUMENTED |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public User(File source) throws Exception
source
- User data file
Exception
- if the user cannot be instantiatedpublic User() throws Exception
Exception
- Description of the ExceptionMethod Detail |
---|
public File getSource()
public void setSource(File file)
file
- The new source valuepublic String getUsername()
public void setUsername(String username)
username
- The new usernamepublic String getEmail()
public void setEmail(String email)
email
- The new from addresspublic String getFirstName()
public void setFirstName(String firstName)
firstName
- The new firstName valuepublic String getLastName()
public void setLastName(String lastName)
lastName
- The new lastName valuepublic String getFullName()
public String getInstitution()
public void setInstitution(String institution)
institution
- The new institution valuepublic String getDepartment()
public void setDepartment(String department)
department
- The new department valuepublic Map getPrefMap()
public String getPref(String prefname)
prefname
- Description of the Parameter
public void setPref(String name, String val)
If the rref to set is the same as the User's default rref, then delete the rref for the specified collection (effectively setting it, since calls to getPref for that collection will return the default rref).
name
- The new pref valueval
- The new pref valuepublic void deletePref(String name)
name
- Description of the Parameterpublic Roles.Role getMaxRole()
public Roles.Role getAssignedRole(String collection)
collection
- NOT YET DOCUMENTED
public Roles.Role getRole(String collection)
collection
- the collection
public boolean hasRole(String roleStr)
roleStr
- NOT YET DOCUMENTED
public boolean hasRole(String roleStr, String collection)
roleStr
- specified role (as string)collection
- the collection
public boolean hasRole(Roles.Role role)
role
- specified role
public boolean hasRole(Roles.Role role, String collection)
role
- the rolecollection
- the collection
public void setAdminUser(boolean isAdmin)
isAdmin
- The new adminUser valuepublic boolean isAdminUser()
public boolean getIsAdminUser()
public boolean controls(Roles.Role role, String collection)
role
- NOT YET DOCUMENTEDcollection
- NOT YET DOCUMENTED
public void setRole(String collection, Roles.Role role)
If the role to set is the same as the User's default role, then delete the role for the specified collection (effectively setting it, since calls to getRole for that collection will return the default role).
collection
- The new role valuerole
- The new role valuepublic void deleteRole(String collection)
collection
- NOT YET DOCUMENTEDpublic Map getRoleMap()
public String nonNullValue(String s)
s
- NOT YET DOCUMENTED
public String toString()
toString
in class Object
public void flush() throws Exception
Exception
- Description of the Exceptionpublic void destroy()
public static void main(String[] args) throws Exception
args
- The command line arguments
Exception
- Description of the Exceptionprotected static void prtln(String s)
s
- NOT YET DOCUMENTED
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |