|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.config.UserManager
Field Summary | |
protected java.util.HashMap |
m_dutySchedules
The duty schedules for each user |
protected GroupManager |
m_groupManager
|
protected java.util.HashMap |
m_users
A mapping of user ids to the User objects |
private Header |
oldHeader
|
Constructor Summary | |
protected |
UserManager(GroupManager groupManager)
|
Method Summary | |
private void |
buildDutySchedules(java.util.Map users)
Builds a mapping between user ids and duty schedules. |
boolean |
comparePasswords(java.lang.String userID,
java.lang.String aPassword)
This method compares two encrypted strings for equality. |
void |
deleteUser(java.lang.String name)
Removes the user from the list of users. |
java.lang.String |
encryptedPassword(java.lang.String aPassword)
|
java.lang.String |
getContactInfo(java.lang.String userID,
java.lang.String command)
Get the contact info given a command string |
java.lang.String |
getEmail(java.lang.String userid)
Get a email by name |
java.lang.String |
getNumericPage(java.lang.String userid)
Get a numeric service provider |
java.lang.String |
getNumericPin(java.lang.String userid)
Get a numeric pin |
java.lang.String |
getPagerEmail(java.lang.String userid)
Get a pager email by name |
java.lang.String |
getTextPage(java.lang.String userid)
Get a Text Page Service Provider |
java.lang.String |
getTextPin(java.lang.String userid)
Get a text pin |
User |
getUser(java.lang.String name)
Get a user by name |
java.util.List |
getUserNames()
|
java.util.Map |
getUsers()
Return a Map of usernames to user instances. |
java.lang.String |
getXMPPAddress(java.lang.String userid)
Get an XMPP address by name |
boolean |
hasUser(java.lang.String userName)
Returns a boolean indicating if the user name appears in the xml file |
private java.lang.String |
hexToString(byte[] data)
|
boolean |
isUserOnDuty(java.lang.String user,
java.util.Calendar time)
Determines if a user is on duty at a given time. |
void |
parseXML(java.io.Reader reader)
|
void |
renameUser(java.lang.String oldName,
java.lang.String newName)
When this method is called users name is changed, so also is the username belonging to the group and the view. |
private void |
saveCurrent()
Saves into "users.xml" file |
void |
saveUser(java.lang.String name,
User details)
Adds a new user and overwrites the "users.xml" |
void |
saveUsers(java.util.Collection usersList)
|
protected abstract void |
saveXML(java.lang.String writerString)
|
void |
setEncryptedPassword(java.lang.String userID,
java.lang.String aPassword)
Sets the password for this user, assuming that the value passed in is already encrypted properly |
void |
setUnencryptedPassword(java.lang.String userID,
java.lang.String aPassword)
Sets the password for this user, first encrypting it |
protected abstract void |
update()
|
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 java.util.HashMap m_users
protected java.util.HashMap m_dutySchedules
private Header oldHeader
Constructor Detail |
protected UserManager(GroupManager groupManager)
Method Detail |
public void parseXML(java.io.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(java.lang.String name, User details) throws java.lang.Exception
java.lang.Exception
private void buildDutySchedules(java.util.Map users)
users
- the map of users parsed from the xml config filepublic boolean isUserOnDuty(java.lang.String user, java.util.Calendar time) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
user
- the user idtime
- the time to check for a duty schedule
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.util.Map getUsers() throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
Map
of usernames to user instances.
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public boolean hasUser(java.lang.String userName) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.util.List getUserNames() throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public User getUser(java.lang.String name) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
name
- the name of the user to return
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.lang.String getContactInfo(java.lang.String userID, java.lang.String command) throws java.io.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
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.lang.String getEmail(java.lang.String userid) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
userid
- the userid of the user to return
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.lang.String getPagerEmail(java.lang.String userid) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
userid
- the userid of the user to return
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.lang.String getXMPPAddress(java.lang.String userid) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
userid
- the userid of the user to return
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.lang.String getNumericPage(java.lang.String userid) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
userid
- the userid of the user to return
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.lang.String getTextPin(java.lang.String userid) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
userid
- the userid of the user to return
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.lang.String getTextPage(java.lang.String userid) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
userid
- the userid of the user to return
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public java.lang.String getNumericPin(java.lang.String userid) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
userid
- the userid of the user to return
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public void saveUsers(java.util.Collection usersList) throws java.lang.Exception
java.lang.Exception
public void deleteUser(java.lang.String name) throws java.lang.Exception
java.lang.Exception
private void saveCurrent() throws java.lang.Exception
java.lang.Exception
protected abstract void saveXML(java.lang.String writerString) throws java.io.IOException
writerString
-
java.io.IOException
public void renameUser(java.lang.String oldName, java.lang.String newName) throws java.lang.Exception
java.lang.Exception
public void setEncryptedPassword(java.lang.String userID, java.lang.String aPassword) throws java.lang.Exception
userID
- the user ID to change the pasword foraPassword
- the encrypted password
java.lang.Exception
public void setUnencryptedPassword(java.lang.String userID, java.lang.String aPassword) throws java.lang.Exception
userID
- the user ID to change the pasword foraPassword
- the password
java.lang.Exception
public java.lang.String encryptedPassword(java.lang.String aPassword)
aPassword
-
private java.lang.String hexToString(byte[] data)
data
-
public boolean comparePasswords(java.lang.String userID, java.lang.String aPassword)
userID
- the user ID to check against.aPassword
- the password to check for equality
protected abstract void update() throws java.io.IOException, java.io.FileNotFoundException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
java.io.IOException
java.io.FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |