Class WebHubXmlRpcHandler.URLTranslationHandler

  • All Implemented Interfaces:
    HttpServer.Handler
    Enclosing class:
    WebHubXmlRpcHandler

    private static class WebHubXmlRpcHandler.URLTranslationHandler
    extends java.lang.Object
    implements HttpServer.Handler
    HTTP handler which provides URL translation services for sandboxed clients.
    • Field Detail

      • basePath_

        private final java.lang.String basePath_
      • keySet_

        private final java.util.Set keySet_
      • urlTracker_

        private final UrlTracker urlTracker_
    • Constructor Detail

      • URLTranslationHandler

        public URLTranslationHandler​(java.lang.String basePath,
                                     java.util.Set keySet,
                                     UrlTracker urlTracker)
        Constructor.
        Parameters:
        basePath - base path for HTTP server
        keySet - set of strings which contains keys for all currently registered clients
        urlTracker - controls access to translated URLs, may be null for no control
    • Method Detail

      • getTranslationBasePath

        public java.lang.String getTranslationBasePath​(java.lang.String privateKey)
        Returns the translation base path that can be used by a client with a given private key.
        Parameters:
        privateKey - client private key
        Returns:
        URL translation base path that can be used by a registered client with the given private key
      • serveRequest

        public HttpServer.Response serveRequest​(HttpServer.Request request)
        Description copied from interface: HttpServer.Handler
        Provides a response to an HTTP request. A handler which does not recognise the URL should simply return null; in this case there may be another handler which is able to serve the request. If the URL appears to be in this handler's domain but the request cannot be served for some reason, an error response should be returned.
        Specified by:
        serveRequest in interface HttpServer.Handler
        Parameters:
        request - HTTP request
        Returns:
        response response to request, or null