OpenNMS API 1.2.3

org.opennms.netmgt.config
Class ViewFactory

java.lang.Object
  extended byorg.opennms.netmgt.config.ViewFactory

public class ViewFactory
extends java.lang.Object


Field Summary
protected static java.io.InputStream configIn
          An input stream for the views configuration file
private static boolean initialized
          Boolean indicating if the init() method has been called
private static ViewFactory instance
          The static singleton instance of the ViewFactory
protected static java.util.HashMap m_views
          A mapping of views ids to the View objects
private static Header oldHeader
           
protected static java.io.File usersFile
          File path of views.xml
 
Constructor Summary
(package private) ViewFactory()
          Initializes the factory
 
Method Summary
 void deleteUser(java.lang.String name)
          Removes the user from the list of users.
 void deleteView(java.lang.String name)
          When this method is called view is to be deleted.
 java.lang.String getCategoryComments(java.lang.String viewName, java.lang.String categoryName)
           
static ViewFactory getInstance()
          Singleton static call to get the only instance that should exist for the ViewFactory
 View getView(java.lang.String name)
          Return a Map of usernames to user instances.
 java.util.Map getViews()
          Return a Map of usernames to user instances.
static void init()
           
static void reload()
          Parses the views.xml via the Castor classes
 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.
 void renameView(java.lang.String oldName, java.lang.String newName)
          When this method is called views name is changed.
 void saveView(java.lang.String name, View details)
          Adds a new user and overwrites the "users.xml"
 void saveViews(Views views)
           
private  java.lang.String stripWhiteSpace(java.lang.String comment)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static ViewFactory instance
The static singleton instance of the ViewFactory


usersFile

protected static java.io.File usersFile
File path of views.xml


configIn

protected static java.io.InputStream configIn
An input stream for the views configuration file


m_views

protected static java.util.HashMap m_views
A mapping of views ids to the View objects


initialized

private static boolean initialized
Boolean indicating if the init() method has been called


oldHeader

private static Header oldHeader
Constructor Detail

ViewFactory

ViewFactory()
Initializes the factory

Method Detail

init

public static void init()
                 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

getInstance

public static ViewFactory getInstance()
Singleton static call to get the only instance that should exist for the ViewFactory

Returns:
the single view factory instance

reload

public static void reload()
                   throws java.io.IOException,
                          org.exolab.castor.xml.MarshalException,
                          org.exolab.castor.xml.ValidationException
Parses the views.xml via the Castor classes

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

saveView

public void saveView(java.lang.String name,
                     View details)
              throws java.lang.Exception
Adds a new user and overwrites the "users.xml"

Throws:
java.lang.Exception

deleteUser

public void deleteUser(java.lang.String name)
                throws java.lang.Exception
Removes the user from the list of users. Then overwrites to the "users.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 users name is changed, so also is the username belonging to the group and the view. Also overwrites the "users.xml" file

Throws:
java.lang.Exception

renameView

public void renameView(java.lang.String oldName,
                       java.lang.String newName)
                throws java.lang.Exception
When this method is called views name is changed. Also overwrites the "views.xml" file

Throws:
java.lang.Exception

deleteView

public void deleteView(java.lang.String name)
                throws java.lang.Exception
When this method is called view is to be deleted. Also overwrites the "views.xml" file

Throws:
java.lang.Exception

saveViews

public void saveViews(Views views)
               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

getCategoryComments

public java.lang.String getCategoryComments(java.lang.String viewName,
                                            java.lang.String categoryName)

stripWhiteSpace

private java.lang.String stripWhiteSpace(java.lang.String comment)

getView

public View getView(java.lang.String name)
Return a Map of usernames to user instances.


getViews

public java.util.Map getViews()
Return a Map of usernames to user instances.


OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.