|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.config.UserManager
public abstract class UserManager
| Field Summary | |
|---|---|
protected HashMap<String,List<DutySchedule>> |
m_dutySchedules
The duty schedules for each user |
protected GroupManager |
m_groupManager
|
protected HashMap<String,User> |
m_users
A mapping of user IDs to the User objects |
| Constructor Summary | |
|---|---|
protected |
UserManager(GroupManager groupManager)
|
| Method Summary | |
|---|---|
boolean |
comparePasswords(String userID,
String aPassword)
This method compares two encrypted strings for equality. |
int |
countUsersWithRole(String roleid)
|
void |
deleteUser(String name)
Removes the user from the list of users. |
String |
encryptedPassword(String aPassword)
|
String |
getContactInfo(String userID,
String command)
Get the contact info given a command string |
String |
getContactInfo(User user,
String command)
|
String |
getContactServiceProvider(String userID,
String command)
Get the contact service provider, given a command string |
String |
getContactServiceProvider(User user,
String command)
|
String |
getEmail(String userID)
Get a email by name |
String |
getEmail(User user)
Get a email by user |
String |
getNumericPage(String userID)
Get a numeric service provider |
String |
getNumericPage(User user)
Get a numeric service provider |
String |
getNumericPin(String userID)
Get a numeric pin |
String |
getNumericPin(User user)
Get a numeric pin |
String |
getPagerEmail(String userID)
Get a pager email by name |
String |
getPagerEmail(User user)
Get a pager email by user |
String |
getTextPage(String userID)
Get a Text Page Service Provider |
String |
getTextPage(User user)
Get a Text Page Service Provider |
String |
getTextPin(String userID)
Get a text pin |
String |
getTextPin(User user)
Get a text pin |
User |
getUser(String name)
Get a user by name |
List<String> |
getUserNames()
|
Map<String,User> |
getUsers()
Return a Map of usernames to user instances. |
String[] |
getUsersScheduledForRole(String roleid,
Date time)
|
String[] |
getUsersWithRole(String roleid)
|
String |
getXMPPAddress(String userID)
Get an XMPP address by name |
String |
getXMPPAddress(User user)
Get an XMPP address by name |
boolean |
hasRole(String roleid)
|
boolean |
hasUser(String userName)
Returns a boolean indicating if the user name appears in the XML file |
abstract boolean |
isUpdateNeeded()
|
boolean |
isUserOnDuty(String user,
Calendar time)
Determines if a user is on duty at a given time. |
boolean |
isUserScheduledForRole(User user,
String roleid,
Date time)
|
void |
parseXML(Reader reader)
|
void |
renameUser(String oldName,
String newName)
When this method is called users name is changed, so also is the username belonging to the group and the view. |
void |
saveUser(String name,
User details)
Adds a new user and overwrites the "users.xml" |
void |
saveUsers(Collection<User> usersList)
|
protected abstract void |
saveXML(String writerString)
|
void |
setEncryptedPassword(String userID,
String aPassword)
Sets the password for this user, assuming that the value passed in is already encrypted properly |
void |
setUnencryptedPassword(String userID,
String aPassword)
Sets the password for this user, first encrypting it |
protected abstract void |
update()
|
boolean |
userHasRole(User user,
String roleid)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected GroupManager m_groupManager
protected HashMap<String,User> m_users
protected HashMap<String,List<DutySchedule>> m_dutySchedules
| Constructor Detail |
|---|
protected UserManager(GroupManager groupManager)
| Method Detail |
|---|
public void parseXML(Reader reader)
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
reader -
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public void saveUser(String name,
User details)
throws Exception
Exception
public boolean isUserOnDuty(String user,
Calendar time)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
user - the user idtime - the time to check for a duty schedule
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public Map<String,User> getUsers()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
Map of usernames to user instances.
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public boolean hasUser(String userName)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public List<String> getUserNames()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public User getUser(String name)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
name - the name of the user to return
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getContactInfo(String userID,
String command)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
userID - the name of the usercommand - the command to look up the contact info for
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getContactInfo(User user,
String command)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getContactServiceProvider(String userID,
String command)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
userID - the name of the usercommand - the command to look up the contact info for
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getContactServiceProvider(User user,
String command)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getEmail(String userID)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
userID - the user ID of the user to return
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getEmail(User user)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
user - the user to find the email for
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getPagerEmail(String userID)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
userID - the user ID of the user to return
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getPagerEmail(User user)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
user -
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getNumericPin(String userID)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
userID - the user ID of the user to return
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getNumericPin(User user)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
userID - the user ID of the user to return
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getXMPPAddress(String userID)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
userID - the user ID of the user to return
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getXMPPAddress(User user)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
user -
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getNumericPage(String userID)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
userID - the user ID of the user to return
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getNumericPage(User user)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
userID - the user ID of the user to return
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getTextPin(String userID)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
userID - the user ID of the user to return
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getTextPin(User user)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
userID - the user ID of the user to return
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getTextPage(String userID)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
userID - the user ID of the user to return
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String getTextPage(User user)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
userID - the user ID of the user to return
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public void saveUsers(Collection<User> usersList)
throws Exception
Exception
public void deleteUser(String name)
throws Exception
Exception
protected abstract void saveXML(String writerString)
throws IOException
writerString -
IOException
public void renameUser(String oldName,
String newName)
throws Exception
Exception
public void setEncryptedPassword(String userID,
String aPassword)
throws Exception
userID - the user ID to change the password foraPassword - the encrypted password
Exception
public void setUnencryptedPassword(String userID,
String aPassword)
throws Exception
userID - the user ID to change the password foraPassword - the password
Exceptionpublic String encryptedPassword(String aPassword)
aPassword -
public boolean comparePasswords(String userID,
String aPassword)
userID - the user ID to check against.aPassword - the password to check for equality
protected abstract void update()
throws IOException,
FileNotFoundException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public String[] getUsersWithRole(String roleid)
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public boolean userHasRole(User user,
String roleid)
throws FileNotFoundException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException,
IOException
FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException
public boolean isUserScheduledForRole(User user,
String roleid,
Date time)
throws FileNotFoundException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException,
IOException
FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException
public String[] getUsersScheduledForRole(String roleid,
Date time)
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException,
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException
public boolean hasRole(String roleid)
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException,
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException
public int countUsersWithRole(String roleid)
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException,
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOExceptionpublic abstract boolean isUpdateNeeded()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||