org.apache.jetspeed.services.urlmanager
Interface URLManagerService

All Superinterfaces:
org.apache.turbine.services.Initable, org.apache.turbine.services.Service
All Known Implementing Classes:
JetspeedURLManagerService

public interface URLManagerService
extends org.apache.turbine.services.Service

This service provides a central repository for storing URL informations

It should be extended to also provide access to their contents

Version:
$Id: URLManagerService.java,v 1.7 2005/03/21 18:21:44 sgala Exp $
Author:
Raphaël Luta

Field Summary
static java.lang.String SERVICE_NAME
          The service name
static int STATUS_ANY
          Matches any status in a list() operation
static int STATUS_BAD
          This URL is not currently available for use
static int STATUS_CONTENT_ERROR
          The content of this URL is corrupted or unparseable
static int STATUS_OK
          The URL can be fetched corretcly
static int STATUS_TEMPORARY_UNAVAILABLE
          A possibly transient problem prevented the system to fetch this URL
static int STATUS_UNKNOWN
          Current status is unknown
static int STATUS_UNREACHABLE
          The URL has permanent fatal errors
 
Method Summary
 URLInfo getInfo(java.lang.String url)
          Get the information record stored in the database about an URL.
 java.lang.String getProxyHost(java.lang.String protocol)
          Return the proxy's hostname for a protocol.
 int getProxyPort(java.lang.String protocol)
          Return the proxy's port for a protocol.
 boolean isOK(java.lang.String url)
          Test whether the URL is currently believed to be OK by this repository.
 java.util.List list()
          List of the current known URLs in the repository
 java.util.List list(int status)
          List of the current known URLs in the repository which have the given status.
 void register(java.lang.String url)
          Registers a new URL record
 void register(java.lang.String url, int status)
          Registers a new URL record.
 void register(java.lang.String url, int status, java.lang.String message)
          Registers a new URL record.
 void register(URLInfo info)
          Register or replace an URL record.
 void unregister(java.lang.String url)
          Unregister an URL from the repository
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, init, setInitableBroker, shutdown
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
The service name

See Also:
Constant Field Values

STATUS_ANY

public static final int STATUS_ANY
Matches any status in a list() operation

See Also:
Constant Field Values

STATUS_UNKNOWN

public static final int STATUS_UNKNOWN
Current status is unknown

See Also:
Constant Field Values

STATUS_OK

public static final int STATUS_OK
The URL can be fetched corretcly

See Also:
Constant Field Values

STATUS_UNREACHABLE

public static final int STATUS_UNREACHABLE
The URL has permanent fatal errors

See Also:
Constant Field Values

STATUS_TEMPORARY_UNAVAILABLE

public static final int STATUS_TEMPORARY_UNAVAILABLE
A possibly transient problem prevented the system to fetch this URL

See Also:
Constant Field Values

STATUS_CONTENT_ERROR

public static final int STATUS_CONTENT_ERROR
The content of this URL is corrupted or unparseable

See Also:
Constant Field Values

STATUS_BAD

public static final int STATUS_BAD
This URL is not currently available for use

See Also:
Constant Field Values
Method Detail

register

public void register(java.lang.String url)
Registers a new URL record

Parameters:
url - the url to register

register

public void register(java.lang.String url,
                     int status)
Registers a new URL record. If the url is already registered in the system, updates the status of this URL info record

Parameters:
url - the url to register
status - the status of this url

register

public void register(java.lang.String url,
                     int status,
                     java.lang.String message)
Registers a new URL record. If the url is already registered in the system, updates both the status and the message of this URL info record

Parameters:
url - the url to register
status - the status of this url
message - a descriptive message of the status

register

public void register(URLInfo info)
Register or replace an URL record. All records are keyed to the imutable URL of URLInfo.

Parameters:
info - the info record to store

unregister

public void unregister(java.lang.String url)
Unregister an URL from the repository

Parameters:
url - the url to remove

getInfo

public URLInfo getInfo(java.lang.String url)
Get the information record stored in the database about an URL.

Parameters:
url - the url whose record is sought
Returns:
the description record found in the repository or null.

isOK

public boolean isOK(java.lang.String url)
Test whether the URL is currently believed to be OK by this repository.

Parameters:
url - the url to be tested
Returns:
false is the url is known by this repository and has a status indicating an error, true otherwise.

list

public java.util.List list()
List of the current known URLs in the repository

Returns:
a List of URL strings known to this repository

list

public java.util.List list(int status)
List of the current known URLs in the repository which have the given status.

Parameters:
status - the status to be retrieved. May be STATUS_ANY to indicate any status
Returns:
a List of URL strings known to this repository with this status

getProxyPort

public int getProxyPort(java.lang.String protocol)
Return the proxy's port for a protocol.

Parameters:
protocol - The protocol that the proxy supports, e.g. 'http'
Returns:
The port of the proxy (1-65535), or -1 if no port was specified (= use default)

getProxyHost

public java.lang.String getProxyHost(java.lang.String protocol)
Return the proxy's hostname for a protocol.

Parameters:
protocol - The protocol that the proxy supports, e.g. 'http'
Returns:
The hostname of the proxy, or null if no proxy is specified for this protocol


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.