|
OpenNMS API 1.1.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.config.GroupFactory
Field Summary | |
protected static java.io.InputStream |
configIn
An input stream for the groups configuration file |
protected static java.io.File |
groupFile
File path of groups.xml |
private static boolean |
initialized
Boolean indicating if the init() method has been called |
private static GroupFactory |
instance
The static singleton instance object |
protected static java.util.Map |
m_groups
A mapping of Group object by name |
private static java.io.File |
m_groupsConfFile
|
private static long |
m_lastModified
|
private static Header |
oldHeader
|
Constructor Summary | |
private |
GroupFactory()
Constructor which parses the file |
Method Summary | |
void |
deleteGroup(java.lang.String name)
Removes the group from the list of groups. |
void |
deleteUser(java.lang.String name)
Removes the user from the list of groups. |
Group |
getGroup(java.lang.String name)
Get a group using its name |
java.util.List |
getGroupNames()
|
java.util.Map |
getGroups()
Get the groups |
static GroupFactory |
getInstance()
Singleton static call to get the only instance that should exist for the GroupFactory |
boolean |
hasGroup(java.lang.String groupName)
Returns a boolean indicating if the group name appears in the xml file |
static void |
init()
|
static void |
reload()
Parses the groups.xml via the Castor classes |
void |
renameGroup(java.lang.String oldName,
java.lang.String newName)
Renames the group from the list of groups. |
void |
renameUser(java.lang.String oldName,
java.lang.String newName)
When this method is called group name is changed, so also is the groupname belonging to the view. |
void |
saveGroup(java.lang.String name,
Group details)
Adds a new user and overwrites the "groups.xml" |
void |
saveGroups()
|
void |
setGroups(java.util.Map grp)
Set the groups data |
private static void |
updateFromFile()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static GroupFactory instance
protected static java.io.File groupFile
protected static java.util.Map m_groups
protected static java.io.InputStream configIn
private static boolean initialized
private static Header oldHeader
private static java.io.File m_groupsConfFile
private static long m_lastModified
Constructor Detail |
private GroupFactory()
Method Detail |
public static void init() 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
public static GroupFactory getInstance()
public static void reload() 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
public void setGroups(java.util.Map grp)
public java.util.Map getGroups() 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 boolean hasGroup(java.lang.String groupName) 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 getGroupNames() 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 Group getGroup(java.lang.String name) throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
name
- the name of the group to return
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
public void saveGroups() throws java.lang.Exception
java.lang.Exception
public void saveGroup(java.lang.String name, Group details) throws java.lang.Exception
java.lang.Exception
public void deleteUser(java.lang.String name) throws java.lang.Exception
java.lang.Exception
public void deleteGroup(java.lang.String name) throws java.lang.Exception
java.lang.Exception
public void renameGroup(java.lang.String oldName, java.lang.String newName) throws java.lang.Exception
java.lang.Exception
public void renameUser(java.lang.String oldName, java.lang.String newName) throws java.lang.Exception
java.lang.Exception
private static void updateFromFile() 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
|
OpenNMS API 1.1.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |