Package org.opennms.netmgt.config
Class ViewsDisplayFactory
- java.lang.Object
-
- org.opennms.netmgt.config.ViewsDisplayFactory
-
public class ViewsDisplayFactory extends 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 File
m_viewsDisplayFile
File path of groups.xml.protected Map<String,View>
m_viewsMap
Map of view objects by name.
-
Constructor Summary
Constructors Constructor Description ViewsDisplayFactory(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(String viewName)
Can be nullFile
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(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 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.
-
-
Constructor Detail
-
ViewsDisplayFactory
public ViewsDisplayFactory(String file) throws FileNotFoundException, IOException
Constructor for ViewsDisplayFactory.
- Parameters:
file
- aString
object.- Throws:
FileNotFoundException
- if any.IOException
- if any.
-
-
Method Detail
-
init
public static void init() throws IOException, FileNotFoundException
Be sure to call this method before calling getInstance().- Throws:
IOException
- if any.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:
IllegalStateException
- if init has not been called
-
reload
public void reload() throws IOException, FileNotFoundException
Parses the viewsdisplay.xml- Throws:
IOException
- if any.FileNotFoundException
- if any.
-
setViewsDisplayFile
public void setViewsDisplayFile(File viewsDisplayFile)
setViewsDisplayFile
- Parameters:
viewsDisplayFile
- aFile
object.
-
getViewsDisplayFile
public File getViewsDisplayFile() throws IOException
getViewsDisplayFile
- Returns:
- a
File
object. - Throws:
IOException
- if any.
-
getView
public View getView(String viewName) throws IOException
Can be null- Parameters:
viewName
- aString
object.- Returns:
- a
View
object. - Throws:
IOException
- if any.
-
updateFromFile
protected void updateFromFile() throws IOException
Reload the viewsdisplay.xml file if it has been changed since we last read it.- Throws:
IOException
- if any.
-
setInstance
public static void setInstance(ViewsDisplayFactory instance)
setInstance
- Parameters:
instance
- aViewsDisplayFactory
object.
-
getDisconnectTimeout
public int getDisconnectTimeout()
getDisconnectTimeout
- Returns:
- a int.
-
-