Class OpenUrlServiceImpl

    • Constructor Detail

      • OpenUrlServiceImpl

        public OpenUrlServiceImpl()
    • Method Detail

      • processUrl

        public void processUrl​(Context c,
                               String urlStr)
                        throws SQLException
        Processes the url When the contacting the url fails, the url will be logged in a db table
        Specified by:
        processUrl in interface OpenUrlService
        Parameters:
        c - - the context
        urlStr - - the url to be processed
        Throws:
        SQLException
      • getResponseCodeFromUrl

        protected int getResponseCodeFromUrl​(String urlStr)
                                      throws IOException
        Returns the response code from accessing the url. Returns a http status 408 when the external service doesn't reply in 10 seconds
        Parameters:
        urlStr -
        Returns:
        response code from the url
        Throws:
        IOException
      • getHttpClient

        protected org.apache.http.client.HttpClient getHttpClient​(org.apache.http.client.config.RequestConfig requestConfig)
      • getHttpClientRequestConfig

        protected org.apache.http.client.config.RequestConfig getHttpClientRequestConfig()
      • tryReprocessFailed

        protected void tryReprocessFailed​(Context context,
                                          OpenURLTracker tracker)
                                   throws SQLException
        Retry to send a failed url
        Parameters:
        context -
        tracker - - db object containing the failed url
        Throws:
        SQLException