org.opennms.netmgt.config
Class ViewsDisplayFactory

java.lang.Object
  extended by org.opennms.netmgt.config.ViewsDisplayFactory

public class ViewsDisplayFactory
extends Object


Field Summary
protected  boolean initialized
          Boolean indicating if the init() method has been called.
protected  long m_lastModified
          Timestamp of the viewDisplay file, used to know when to reload from disk.
protected  File m_viewsDisplayFile
          File path of groups.xml.
protected  Map<String,View> m_viewsMap
          Map of view objects by name.
 
Constructor Summary
ViewsDisplayFactory(String file)
           
 
Method Summary
 View getDefaultView()
           
 int getDisconnectTimeout()
           
static ViewsDisplayFactory getInstance()
          Singleton static call to get the only instance that should exist for the ViewsDisplayFactory
 View getView(String viewName)
          Can be null
 File getViewsDisplayFile()
           
static void init()
          Be sure to call this method before calling getInstance().
 void reload()
          Parses the viewsdisplay.xml via the Castor classes
static void setInstance(ViewsDisplayFactory instance)
           
 void setViewsDisplayFile(File viewsDisplayFile)
           
protected  void updateFromFile()
          Reload the viewsdisplay.xml file if it has been changed since we last read it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_viewsDisplayFile

protected File m_viewsDisplayFile
File path of groups.xml.


initialized

protected boolean initialized
Boolean indicating if the init() method has been called.


m_lastModified

protected long m_lastModified
Timestamp of the viewDisplay file, used to know when to reload from disk.


m_viewsMap

protected Map<String,View> m_viewsMap
Map of view objects by name.

Constructor Detail

ViewsDisplayFactory

public ViewsDisplayFactory(String file)
                    throws org.exolab.castor.xml.MarshalException,
                           org.exolab.castor.xml.ValidationException,
                           FileNotFoundException,
                           IOException
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
FileNotFoundException
IOException
Method Detail

init

public static void init()
                 throws IOException,
                        FileNotFoundException,
                        org.exolab.castor.xml.MarshalException,
                        org.exolab.castor.xml.ValidationException
Be sure to call this method before calling getInstance().

Throws:
IOException
FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getInstance

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

Returns:
the single views display factory instance
Throws:
IllegalStateException - if init has not been called

reload

public void reload()
            throws IOException,
                   FileNotFoundException,
                   org.exolab.castor.xml.MarshalException,
                   org.exolab.castor.xml.ValidationException
Parses the viewsdisplay.xml via the Castor classes

Throws:
IOException
FileNotFoundException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

setViewsDisplayFile

public void setViewsDisplayFile(File viewsDisplayFile)

getViewsDisplayFile

public File getViewsDisplayFile()
                         throws IOException
Throws:
IOException

getView

public View getView(String viewName)
             throws IOException,
                    org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Can be null

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

getDefaultView

public View getDefaultView()

updateFromFile

protected void updateFromFile()
                       throws IOException,
                              org.exolab.castor.xml.MarshalException,
                              org.exolab.castor.xml.ValidationException
Reload the viewsdisplay.xml file if it has been changed since we last read it.

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

setInstance

public static void setInstance(ViewsDisplayFactory instance)

getDisconnectTimeout

public int getDisconnectTimeout()


Copyright © 2009. All Rights Reserved.