Class ListCertificatesController

  • 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 ListCertificatesController
    extends AbstractTomcatContainerController
    The Class ListCertificatesController.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.slf4j.Logger logger
      The Constant logger.
      • Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator

        HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addToStore​(List<Cert> certs, String alias, X509Certificate x509Cert)
      Adds the to store.
      List<Cert> getCertificates​(String storeType, String storeFile, String storePassword)
      Gets the certificates.
      private List<ConnectorInfo> getConnectorInfos​(List<org.apache.catalina.connector.Connector> connectors)
      Gets the connector infos.
      private InputStream getStoreInputStream​(String path)
      Tries to open a InputStream the same way as Tomcat ConfigFileLoader getInputStream.
      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 setViewName​(String viewName)
      Sets the view name.
      private ConnectorInfo toConnectorInfo​(org.apache.coyote.http11.AbstractHttp11JsseProtocol<?> protocol)
      To connector info.
      • 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

      • logger

        private static final org.slf4j.Logger logger
        The Constant logger.
    • Constructor Detail

      • ListCertificatesController

        public ListCertificatesController()
    • Method Detail

      • handleRequest

        @RequestMapping(path="/certificates.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
        Specified by:
        handleRequestInternal in class org.springframework.web.servlet.mvc.AbstractController
        Throws:
        Exception
      • getCertificates

        public List<Cert> getCertificates​(String storeType,
                                          String storeFile,
                                          String storePassword)
                                   throws Exception
        Gets the certificates.
        Parameters:
        storeType - the store type
        storeFile - the store file
        storePassword - the store password
        Returns:
        the certificates
        Throws:
        Exception - the exception
      • getStoreInputStream

        private InputStream getStoreInputStream​(String path)
                                         throws IOException
        Tries to open a InputStream the same way as Tomcat ConfigFileLoader getInputStream.
        Parameters:
        path - the path of a store file (absolute or relative to CATALINA.BASE), or URI to store file (absolute or relative to CATALINA.BASE).
        Returns:
        the input stream of the path file
        Throws:
        IOException - if path can not be resolved
      • addToStore

        private void addToStore​(List<Cert> certs,
                                String alias,
                                X509Certificate x509Cert)
        Adds the to store.
        Parameters:
        certs - the certs
        alias - the alias
        x509Cert - the x509 cert