Class DataSourceTestController

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller

    @Controller
    public class DataSourceTestController
    extends org.springframework.web.servlet.mvc.ParameterizableViewController
    Displays a view that allows for a database connectivity testing. Supplies default values to input fields of the view.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long collectionPeriod
      The collection period.
      private int historySize
      The history size.
      private int maxRows
      The max rows.
      private String replacePattern
      The replace pattern.
      private int rowsPerPage
      The rows per page.
      • Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator

        HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST
      • Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getCollectionPeriod()
      Gets the collection period.
      int getHistorySize()
      Gets the history size.
      int getMaxRows()
      Gets the max rows.
      String getReplacePattern()
      Gets the replace pattern.
      int getRowsPerPage()
      Gets the rows per page.
      org.springframework.web.servlet.ModelAndView handleRequest​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      protected org.springframework.web.servlet.ModelAndView handleRequestInternal​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      void setCollectionPeriod​(long collectionPeriod)
      Sets the collection period.
      void setCollectionPeriod​(String collectionPeriod)
      Sets the collection period using expression.
      void setHistorySize​(int historySize)
      Sets the history size.
      void setMaxRows​(int maxRows)
      Sets the max rows.
      void setReplacePattern​(String replacePattern)
      Sets the replace pattern.
      void setRowsPerPage​(int rowsPerPage)
      Sets the rows per page.
      void setViewName​(String viewName)  
      • Methods inherited from class org.springframework.web.servlet.mvc.ParameterizableViewController

        getStatusCode, getView, getViewName, isStatusOnly, setStatusCode, setStatusOnly, setView, toString
      • Methods inherited from class org.springframework.web.servlet.mvc.AbstractController

        isSynchronizeOnSession, setSynchronizeOnSession
      • Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator

        applyCacheControl, applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isAlwaysMustRevalidate, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, prepareResponse, preventCaching, setAlwaysMustRevalidate, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader, setVaryByRequestHeaders
      • Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

        getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
      • Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

        getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
    • Field Detail

      • maxRows

        private int maxRows
        The max rows.
      • rowsPerPage

        private int rowsPerPage
        The rows per page.
      • historySize

        private int historySize
        The history size.
      • replacePattern

        private String replacePattern
        The replace pattern.
      • collectionPeriod

        private long collectionPeriod
        The collection period.
    • Constructor Detail

      • DataSourceTestController

        public DataSourceTestController()
    • Method Detail

      • handleRequest

        @RequestMapping(path="/sql/datasourcetest.htm")
        public org.springframework.web.servlet.ModelAndView handleRequest​(javax.servlet.http.HttpServletRequest request,
                                                                          javax.servlet.http.HttpServletResponse response)
                                                                   throws Exception
        Specified by:
        handleRequest in interface org.springframework.web.servlet.mvc.Controller
        Overrides:
        handleRequest in class org.springframework.web.servlet.mvc.AbstractController
        Throws:
        Exception
      • handleRequestInternal

        protected org.springframework.web.servlet.ModelAndView handleRequestInternal​(javax.servlet.http.HttpServletRequest request,
                                                                                     javax.servlet.http.HttpServletResponse response)
                                                                              throws Exception
        Overrides:
        handleRequestInternal in class org.springframework.web.servlet.mvc.ParameterizableViewController
        Throws:
        Exception
      • getCollectionPeriod

        public long getCollectionPeriod()
        Gets the collection period.
        Returns:
        the collection period
      • setCollectionPeriod

        public void setCollectionPeriod​(long collectionPeriod)
        Sets the collection period.
        Parameters:
        collectionPeriod - the new collection period
      • setCollectionPeriod

        @Value("${psiprobe.beans.stats.collectors.connector.period}")
        public void setCollectionPeriod​(String collectionPeriod)
        Sets the collection period using expression.
        Parameters:
        collectionPeriod - the new collection period using expression
      • getMaxRows

        public int getMaxRows()
        Gets the max rows.
        Returns:
        the max rows
      • setMaxRows

        @Value("1000")
        public void setMaxRows​(int maxRows)
        Sets the max rows.
        Parameters:
        maxRows - the new max rows
      • getRowsPerPage

        public int getRowsPerPage()
        Gets the rows per page.
        Returns:
        the rows per page
      • setRowsPerPage

        @Value("50")
        public void setRowsPerPage​(int rowsPerPage)
        Sets the rows per page.
        Parameters:
        rowsPerPage - the new rows per page
      • getHistorySize

        public int getHistorySize()
        Gets the history size.
        Returns:
        the history size
      • setHistorySize

        @Value("30")
        public void setHistorySize​(int historySize)
        Sets the history size.
        Parameters:
        historySize - the new history size
      • getReplacePattern

        public String getReplacePattern()
        Gets the replace pattern.
        Returns:
        the replace pattern
      • setReplacePattern

        @Value("^http(s)?://[a-zA-Z\\-\\.0-9]+(:[0-9]+)?")
        public void setReplacePattern​(String replacePattern)
        Sets the replace pattern.
        Parameters:
        replacePattern - the new replace pattern
      • setViewName

        @Value("datasourcetest")
        public void setViewName​(String viewName)
        Overrides:
        setViewName in class org.springframework.web.servlet.mvc.ParameterizableViewController