com.arsdigita.util.url
Class URLFetcher

java.lang.Object
  extended bycom.arsdigita.util.url.URLFetcher

public class URLFetcher
extends Object

Provides the main public API to the URL service through a bunch of static methods. Applications register services to define a certain set of characteristics such as cache size, thread pool size, cache timeouts. There is a default service for applications that don't have any special requirements.

Author:
Dirk Gomez

Constructor Summary
URLFetcher()
           
 
Method Summary
static String fetchURL(String url, String key)
          Deprecated. use fetchURLData(String url, String key) instead
static URLData fetchURLData(String url, String key)
          Fetches the URL using the service specified by the key param.
 boolean hasService(String key)
           
static void purgeURL(String url, String key)
          Purges the specified URL from the cache.
static void registerService(String key, URLPool pool, URLCache cache)
          Registers a new service the key is the unique name for the service, typically the packagename of the application using the service.
static void registerService(String key, URLPool pool, URLCache cache, boolean cacheFailedRetrievals)
          Registers a new service the key is the unique name for the service, typically the packagename of the application using the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLFetcher

public URLFetcher()
Method Detail

registerService

public static void registerService(String key,
                                   URLPool pool,
                                   URLCache cache)
Registers a new service the key is the unique name for the service, typically the packagename of the application using the service. The pool & cache parameters allow special characteristics to be defined for the service, if null then default to the global service. Cache information about failed URL retrievals.


registerService

public static void registerService(String key,
                                   URLPool pool,
                                   URLCache cache,
                                   boolean cacheFailedRetrievals)
Registers a new service the key is the unique name for the service, typically the packagename of the application using the service. The pool & cache parameters allow special characteristics to be defined for the service, if null then default to the global service.

Parameters:
key - service key name
pool - URLPool to be used
cache - URLCache to be used
cacheFailedRetrievals - determine whether information on failed retrievals should be cached

fetchURL

public static String fetchURL(String url,
                              String key)
Deprecated. use fetchURLData(String url, String key) instead

Fetches the URL using the service specified by the key param. Looks in the cache for the url, if not present fetches the url & stores it in the cache.Returns the data for the page, or null if the fetch failed.


fetchURLData

public static URLData fetchURLData(String url,
                                   String key)
Fetches the URL using the service specified by the key param. Looks in the cache for the url, if not present fetches the url & stores it in the cache.Returns the data for the page, or null if the fetch failed.


purgeURL

public static void purgeURL(String url,
                            String key)
Purges the specified URL from the cache.


hasService

public boolean hasService(String key)


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC