org.apache.jetspeed.capabilities
Interface Capabilities


public interface Capabilities

Capabilities Component Interface

Version:
$Id: Capabilities.java 188136 2005-01-04 15:55:08Z weaver $
Author:
Roger Ruttimann

Method Summary
 void deleteCapabilityMapCache()
          Clears CapabilityMap cache TODO: Roger, why is this on the public interface.
 Client findClient(String userAgent)
          Finds a client for a given userAgentPattern
 CapabilityMap getCapabilityMap(String userAgent)
          Creates a Capability Map with Capabilities, Mimetypes and mediaTypes for the given UserAgentPattern
 Iterator getClients()
          Obtain an iterator of all existing clients.
 MediaType getMediaType(String mediaType)
          Given a media type string, look up the corresponding media type object.
 MediaType getMediaTypeForMimeType(String mimeTypeName)
          Given a Mimetype string lookup the corresponding media type object
 Collection getMediaTypesForMimeTypes(Iterator mimetypes)
          Returns a collection of MediaTypes that matches the MimeTypes defined in the mimetype parameter
 

Method Detail

getCapabilityMap

public CapabilityMap getCapabilityMap(String userAgent)
                               throws UnableToBuildCapabilityMapException
Creates a Capability Map with Capabilities, Mimetypes and mediaTypes for the given UserAgentPattern

Parameters:
userAgent - Agent from the request
Returns:
CapabilityMap populated with Capabilities, Mimetypes and Mediatype that match the userAgent. Never returns null
Throws:
UnableToBuildCapabilityMapException - If a capability could not be created

getClients

public Iterator getClients()
Obtain an iterator of all existing clients.

Returns:
Returns an iterator for all existing Clients

findClient

public Client findClient(String userAgent)
Finds a client for a given userAgentPattern

Parameters:
userAgent -
Returns:
Client that matches agent or null if no match is found

getMediaTypesForMimeTypes

public Collection getMediaTypesForMimeTypes(Iterator mimetypes)
Returns a collection of MediaTypes that matches the MimeTypes defined in the mimetype parameter

Returns:
Collection of Mediatypes that matches the mimetypes

deleteCapabilityMapCache

public void deleteCapabilityMapCache()
Clears CapabilityMap cache TODO: Roger, why is this on the public interface. It seems to be impl specific


getMediaType

public MediaType getMediaType(String mediaType)
Given a media type string, look up the corresponding media type object.

Parameters:
mediaType - The string representation of a media type.
Returns:
The found media type object or if not found, null.

getMediaTypeForMimeType

public MediaType getMediaTypeForMimeType(String mimeTypeName)
Given a Mimetype string lookup the corresponding media type object

Parameters:
mimeTypeName - to use for lookup
Returns:
MediaTypeEntry that matches the lookup in the MEDIATYPE_TO_MIMETYPE table


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