Class 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.
    • 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.
    • Constructor Detail

      • ViewsDisplayFactory

        public ViewsDisplayFactory​(java.lang.String file)
                            throws java.io.FileNotFoundException,
                                   java.io.IOException

        Constructor for ViewsDisplayFactory.

        Parameters:
        file - a String object.
        Throws:
        java.io.FileNotFoundException - if any.
        java.io.IOException - if any.
    • 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 - a File 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 - a String object.
        Returns:
        a View object.
        Throws:
        java.io.IOException - if any.
      • getDefaultView

        public View getDefaultView()

        getDefaultView

        Returns:
        a View object.
      • 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.
      • getDisconnectTimeout

        public int getDisconnectTimeout()

        getDisconnectTimeout

        Returns:
        a int.