Package org.opennms.netmgt.config
Class ViewsDisplayFactory
- java.lang.Object
-
- org.opennms.netmgt.config.ViewsDisplayFactory
-
public class ViewsDisplayFactory extends java.lang.Object
ViewsDisplayFactory class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Field Summary
Fields Modifier and Type Field Description 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 java.io.File
m_viewsDisplayFile
File path of groups.xml.protected java.util.Map<java.lang.String,View>
m_viewsMap
Map of view objects by name.
-
Constructor Summary
Constructors Constructor Description ViewsDisplayFactory(java.lang.String file)
Constructor for ViewsDisplayFactory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description View
getDefaultView()
getDefaultViewint
getDisconnectTimeout()
getDisconnectTimeoutstatic ViewsDisplayFactory
getInstance()
Singleton static call to get the only instance that should exist for the ViewsDisplayFactoryView
getView(java.lang.String viewName)
Can be nulljava.io.File
getViewsDisplayFile()
getViewsDisplayFilestatic void
init()
Be sure to call this method before calling getInstance().void
reload()
Parses the viewsdisplay.xmlstatic void
setInstance(ViewsDisplayFactory instance)
setInstancevoid
setViewsDisplayFile(java.io.File viewsDisplayFile)
setViewsDisplayFileprotected void
updateFromFile()
Reload the viewsdisplay.xml file if it has been changed since we last read it.
-
-
-
Field Detail
-
m_viewsDisplayFile
protected java.io.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 java.util.Map<java.lang.String,View> m_viewsMap
Map of view objects by name.
-
-
Method Detail
-
init
public static void init() throws java.io.IOException, java.io.FileNotFoundException
Be sure to call this method before calling getInstance().- Throws:
java.io.IOException
- if any.java.io.FileNotFoundException
- if any.
-
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:
java.lang.IllegalStateException
- if init has not been called
-
reload
public void reload() throws java.io.IOException, java.io.FileNotFoundException
Parses the viewsdisplay.xml- Throws:
java.io.IOException
- if any.java.io.FileNotFoundException
- if any.
-
setViewsDisplayFile
public void setViewsDisplayFile(java.io.File viewsDisplayFile)
setViewsDisplayFile
- Parameters:
viewsDisplayFile
- aFile
object.
-
getViewsDisplayFile
public java.io.File getViewsDisplayFile() throws java.io.IOException
getViewsDisplayFile
- Returns:
- a
File
object. - Throws:
java.io.IOException
- if any.
-
getView
public View getView(java.lang.String viewName) throws java.io.IOException
Can be null- Parameters:
viewName
- aString
object.- Returns:
- a
View
object. - Throws:
java.io.IOException
- if any.
-
updateFromFile
protected void updateFromFile() throws java.io.IOException
Reload the viewsdisplay.xml file if it has been changed since we last read it.- Throws:
java.io.IOException
- if any.
-
setInstance
public static void setInstance(ViewsDisplayFactory instance)
setInstance
- Parameters:
instance
- aViewsDisplayFactory
object.
-
getDisconnectTimeout
public int getDisconnectTimeout()
getDisconnectTimeout
- Returns:
- a int.
-
-