OpenNMS API 1.2.3

org.opennms.netmgt.config
Class GroupManager

java.lang.Object
  extended byorg.opennms.netmgt.config.GroupManager
Direct Known Subclasses:
GroupFactory, MockGroupManager

public abstract class GroupManager
extends java.lang.Object

Author:
david TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates

Field Summary
private  java.util.Map m_groups
          A mapping of Group object by name
private  Header m_oldHeader
           
 
Constructor Summary
GroupManager()
           
 
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
 boolean hasGroup(java.lang.String groupName)
          Returns a boolean indicating if the group name appears in the xml file
protected  void parseXml(java.io.Reader reader)
           
 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()
           
protected abstract  void saveXml(java.lang.String data)
           
 void setGroups(java.util.Map grp)
          Set the groups data
protected abstract  void updateFromFile()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_groups

private java.util.Map m_groups
A mapping of Group object by name


m_oldHeader

private Header m_oldHeader
Constructor Detail

GroupManager

public GroupManager()
Method Detail

parseXml

protected void parseXml(java.io.Reader reader)
                 throws org.exolab.castor.xml.MarshalException,
                        org.exolab.castor.xml.ValidationException
Parameters:
reader -
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

setGroups

public void setGroups(java.util.Map grp)
Set the groups data


getGroups

public java.util.Map getGroups()
                        throws java.io.IOException,
                               org.exolab.castor.xml.MarshalException,
                               org.exolab.castor.xml.ValidationException
Get the groups

Throws:
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

updateFromFile

protected abstract void updateFromFile()
                                throws java.io.IOException,
                                       org.exolab.castor.xml.MarshalException,
                                       org.exolab.castor.xml.ValidationException
Throws:
org.exolab.castor.xml.ValidationException
org.exolab.castor.xml.MarshalException
java.io.IOException

hasGroup

public boolean hasGroup(java.lang.String groupName)
                 throws java.io.IOException,
                        org.exolab.castor.xml.MarshalException,
                        org.exolab.castor.xml.ValidationException
Returns a boolean indicating if the group name appears in the xml file

Returns:
true if the group exists in the xml file, false otherwise
Throws:
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getGroupNames

public java.util.List getGroupNames()
                             throws java.io.IOException,
                                    org.exolab.castor.xml.MarshalException,
                                    org.exolab.castor.xml.ValidationException
Throws:
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getGroup

public Group getGroup(java.lang.String name)
               throws java.io.IOException,
                      org.exolab.castor.xml.MarshalException,
                      org.exolab.castor.xml.ValidationException
Get a group using its name

Parameters:
name - the name of the group to return
Returns:
Group, the group specified by name
Throws:
java.io.IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

saveGroups

public void saveGroups()
                throws java.lang.Exception
Throws:
java.lang.Exception

saveXml

protected abstract void saveXml(java.lang.String data)
                         throws java.io.IOException
Parameters:
data -
Throws:
java.io.IOException

saveGroup

public void saveGroup(java.lang.String name,
                      Group details)
               throws java.lang.Exception
Adds a new user and overwrites the "groups.xml"

Throws:
java.lang.Exception

deleteUser

public void deleteUser(java.lang.String name)
                throws java.lang.Exception
Removes the user from the list of groups. Then overwrites to the "groups.xml"

Throws:
java.lang.Exception

deleteGroup

public void deleteGroup(java.lang.String name)
                 throws java.lang.Exception
Removes the group from the list of groups. Then overwrites to the "groups.xml"

Throws:
java.lang.Exception

renameGroup

public void renameGroup(java.lang.String oldName,
                        java.lang.String newName)
                 throws java.lang.Exception
Renames the group from the list of groups. Then overwrites to the "groups.xml"

Throws:
java.lang.Exception

renameUser

public void renameUser(java.lang.String oldName,
                       java.lang.String newName)
                throws java.lang.Exception
When this method is called group name is changed, so also is the groupname belonging to the view. Also overwrites the "groups.xml" file

Throws:
java.lang.Exception

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.