Class WebManager


  • public class WebManager
    extends WebBean
    A utility bean for Openfire admin console pages.
    • Constructor Detail

      • WebManager

        public WebManager()
    • Method Detail

      • invalidateSession

        public javax.servlet.http.HttpSession invalidateSession()
        Invalidates and recreates session (do this on login/logout).
        Returns:
        the new HTTP session
      • getAuthToken

        public AuthToken getAuthToken()
        Returns:
        the auth token; redirect to the login page if an auth token is not found.
      • isSetupMode

        public boolean isSetupMode()
        Returns:
        true if the Openfire container is in setup mode, false otherwise.
      • getXMPPServer

        public XMPPServer getXMPPServer()
        Returns:
        the XMPP server object -- can get many config items from here.
      • logEvent

        public void logEvent​(String summary,
                             String details)
        Logs a security event as the currently logged in user. (convenience routine for SecurityAuditManager)
        Parameters:
        summary - Summary of event.
        details - Details of event, can be null if no details available.
      • getUser

        public User getUser()
        Returns:
        the page user or null if one is not found.
      • isEmbedded

        public boolean isEmbedded()
        Returns:
        true if the server is in embedded mode, false otherwise.
      • restart

        public void restart()
        Restarts the server then sleeps for 3 seconds.
      • stop

        public void stop()
        Stops the server then sleeps for 3 seconds.
      • validateService

        public void validateService()
      • isServerRunning

        public boolean isServerRunning()
      • setStart

        public void setStart​(int start)
      • getStart

        public int getStart()
      • setRange

        public void setRange​(int range)
      • getRange

        public int getRange()
      • getCurrentPage

        public int getCurrentPage()
      • showServerDown

        protected void showServerDown()
      • copy

        public static void copy​(URL src,
                                File dst)
                         throws IOException
        Copies the contents at src to dst.
        Parameters:
        src - the source location
        dst - the target location
        Throws:
        IOException - if the copy failed
      • getRowsPerPage

        public int getRowsPerPage​(String pageName,
                                  int defaultValue)
        Returns the number of rows per page for the specified page for the current logged user. The rows per page value is stored as a user property. The same property is being used for different pages. The encoding format is the following "pageName1=value,pageName2=value".
        Parameters:
        pageName - the name of the page to look up its stored value.
        defaultValue - the default value to return if no user value was found.
        Returns:
        the number of rows per page for the specified page for the current logged user.
      • setRowsPerPage

        public void setRowsPerPage​(String pageName,
                                   int newValue)
        Sets the new number of rows per page for the specified page for the current logged user. The rows per page value is stored as a user property. The same property is being used for different pages. The encoding format is the following "pageName1=value,pageName2=value".
        Parameters:
        pageName - the name of the page to stored its new value.
        newValue - the new rows per page value.
      • getRefreshValue

        public int getRefreshValue​(String pageName,
                                   int defaultValue)
        Returns the number of seconds between each page refresh for the specified page for the current logged user. The value is stored as a user property. The same property is being used for different pages. The encoding format is the following "pageName1=value,pageName2=value".
        Parameters:
        pageName - the name of the page to look up its stored value.
        defaultValue - the default value to return if no user value was found.
        Returns:
        the number of seconds between each page refresh for the specified page for the current logged user.
      • setRefreshValue

        public void setRefreshValue​(String pageName,
                                    int newValue)
        Sets the number of seconds between each page refresh for the specified page for the current logged user. The value is stored as a user property. The same property is being used for different pages. The encoding format is the following "pageName1=value,pageName2=value".
        Parameters:
        pageName - the name of the page to stored its new value.
        newValue - the new number of seconds between each page refresh.
      • getPageProperty

        public int getPageProperty​(String pageName,
                                   String property,
                                   int defaultValue)
      • setPageProperty

        public void setPageProperty​(String pageName,
                                    String property,
                                    int newValue)
      • getCaches

        public Cache[] getCaches()