org.apache.jetspeed.capabilities
Interface Capabilities


public interface Capabilities

Capabilities Component Interface

Version:
$Id: Capabilities.java 516448 2007-03-09 16:25:47Z ate $
Author:
Roger Ruttimann

Method Summary
 Capability createCapability(String capabilityName)
          Create a new capability in the system or return the existing one if already exists
 Client createClient(String clientName)
          Create a new client in the system or return the existing one if already exists
 MediaType createMediaType(String mediaTypeName)
          Create a new mediaType in the system or return the existing one if already exists
 MimeType createMimeType(String mimeTypeName)
          Create a new mimetype in the system or return the existing one if already exists
 void deleteCapability(Capability capability)
          delete existing capability from backend storage
 void deleteCapabilityMapCache()
          Clears CapabilityMap cache TODO: Roger, why is this on the public interface.
 void deleteClient(Client client)
          delete existing client from backend storage
 void deleteMediaType(MediaType mediaType)
          delete existing media type from backend storage
 void deleteMimeType(MimeType mimeType)
          delete existing mime type from backend storage
 Client findClient(String userAgent)
          Finds a client for a given userAgentPattern
 Iterator getCapabilities()
          Obtain an iterator of all existing capabilities.
 Capability getCapability(String capability)
          Given a capability string, look up the corresponding capability object.
 String getCapabilityBeanName()
          Obtain the name of the CapabilityBean reference
 CapabilityMap getCapabilityMap(String userAgent)
          Creates a Capability Map with Capabilities, Mimetypes and mediaTypes for the given UserAgentPattern
 Client getClient(String clientName)
          Given a client name, look up the corresponding client object.
 String getClientBeanName()
          Obtain the name of the ClientBean reference
 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.
 String getMediaTypeBeanName()
          Obtain the name of the Media Type reference
 MediaType getMediaTypeForMimeType(String mimeTypeName)
          Given a Mimetype string lookup the corresponding media type object
 Iterator getMediaTypes()
          Obtain an iterator of all existing media types.
 Collection getMediaTypesForMimeTypes(Iterator mimetypes)
          Returns a collection of MediaTypes that matches the MimeTypes defined in the mimetype parameter
 MimeType getMimeType(String mimeType)
          Given a mime type string, look up the corresponding mime type object.
 String getMimeTypeBeanName()
          Obtain the name of the Mime Type reference
 Iterator getMimeTypes()
          Obtain an iterator of all existing mime types.
 void setCapabilityBeanName(String capabilityBeanName)
          Set the name of the CapabilityBean reference - used exclusively in IoC
 void setClientBeanName(String clientBeanName)
          Set the name of the ClientBean reference - used exclusively in IoC
 void setMediaTypeBeanName(String mediaTypeBeanName)
          Set the name of the MediaType bean reference - used exclusively in IoC
 void setMimeTypeBeanName(String mimeTypeBeanName)
          Set the name of the MimeType bean reference - used exclusively in IoC
 void storeCapability(Capability capability)
          Save capability to backend storage
 void storeClient(Client client)
          Save client to backend storage
 void storeMediaType(MediaType mediaType)
          Save media type to backend storage
 void storeMimeType(MimeType mimeType)
          Save mime type to backend storage
 

Method Detail

getCapabilityMap

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

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

Returns:
Returns an iterator for all existing Clients

findClient

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

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

Parameters:
Mimetype -
Returns:
Collection of Mediatypes that matches the mimetypes

deleteCapabilityMapCache

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


getMediaType

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

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

getCapability

Capability getCapability(String capability)
Given a capability string, look up the corresponding capability object.

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

getMimeType

MimeType getMimeType(String mimeType)
Given a mime type string, look up the corresponding mime type object.

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

getClient

Client getClient(String clientName)
Given a client name, look up the corresponding client object.

Parameters:
clientName - The name of the client.
Returns:
The found client object or if not found, null.

getCapabilities

Iterator getCapabilities()
Obtain an iterator of all existing capabilities.

Returns:
Returns an iterator for all existing Capabilities of type Capability

getMimeTypes

Iterator getMimeTypes()
Obtain an iterator of all existing mime types.

Returns:
Returns an iterator for all existing Mime Types of type MimeType

getMediaTypes

Iterator getMediaTypes()
Obtain an iterator of all existing media types.

Returns:
Returns an iterator for all existing media types of type MediaType

getCapabilityBeanName

String getCapabilityBeanName()
Obtain the name of the CapabilityBean reference

Returns:
ref-id of the capability bean

setCapabilityBeanName

void setCapabilityBeanName(String capabilityBeanName)
Set the name of the CapabilityBean reference - used exclusively in IoC

Parameters:
capabilityBeanName - The ref-id of the capability bean.

getClientBeanName

String getClientBeanName()
Obtain the name of the ClientBean reference

Returns:
ref-id of the client bean

setClientBeanName

void setClientBeanName(String clientBeanName)
Set the name of the ClientBean reference - used exclusively in IoC

Parameters:
clientBeanName - The ref-id of the client bean.

getMediaTypeBeanName

String getMediaTypeBeanName()
Obtain the name of the Media Type reference

Returns:
ref-id of the media type bean

setMediaTypeBeanName

void setMediaTypeBeanName(String mediaTypeBeanName)
Set the name of the MediaType bean reference - used exclusively in IoC

Parameters:
mediaTypeBeanName - The ref-id of the mediaType bean.

getMimeTypeBeanName

String getMimeTypeBeanName()
Obtain the name of the Mime Type reference

Returns:
ref-id of the mime type bean

setMimeTypeBeanName

void setMimeTypeBeanName(String mimeTypeBeanName)
Set the name of the MimeType bean reference - used exclusively in IoC

Parameters:
mimeTypeBeanName - The ref-id of the mimeType bean.

createCapability

Capability createCapability(String capabilityName)
                            throws ClassNotFoundException
Create a new capability in the system or return the existing one if already exists

Parameters:
capabilityName - The string describing the capability
Returns:
A new (or existing) capability
Throws:
ClassNotFoundException

createMimeType

MimeType createMimeType(String mimeTypeName)
                        throws ClassNotFoundException
Create a new mimetype in the system or return the existing one if already exists

Parameters:
mimeTypeName - The string describing the mimeType
Returns:
A new (or existing) MimeType
Throws:
ClassNotFoundException

createMediaType

MediaType createMediaType(String mediaTypeName)
                          throws ClassNotFoundException
Create a new mediaType in the system or return the existing one if already exists

Parameters:
mediaTypeName - The string describing the mediaType
Returns:
A new (or existing) MediaType
Throws:
ClassNotFoundException

createClient

Client createClient(String clientName)
                    throws ClassNotFoundException
Create a new client in the system or return the existing one if already exists

Parameters:
clientName - The string describing the client
Returns:
A new (or existing) client
Throws:
ClassNotFoundException

storeMediaType

void storeMediaType(MediaType mediaType)
                    throws CapabilitiesException
Save media type to backend storage

Parameters:
mediaType - valid mediatype object
Throws:
CapabilitiesException

deleteMediaType

void deleteMediaType(MediaType mediaType)
                     throws CapabilitiesException
delete existing media type from backend storage

Parameters:
mediaType - valid mediatype object
Throws:
CapabilitiesException

storeCapability

void storeCapability(Capability capability)
                     throws CapabilitiesException
Save capability to backend storage

Parameters:
capability - valid capability object
Throws:
CapabilitiesException

deleteCapability

void deleteCapability(Capability capability)
                      throws CapabilitiesException
delete existing capability from backend storage

Parameters:
capability - valid capability object
Throws:
CapabilitiesException

storeMimeType

void storeMimeType(MimeType mimeType)
                   throws CapabilitiesException
Save mime type to backend storage

Parameters:
mimeType - valid mimetype object
Throws:
CapabilitiesException

deleteMimeType

void deleteMimeType(MimeType mimeType)
                    throws CapabilitiesException
delete existing mime type from backend storage

Parameters:
mimeType - valid mimetype object
Throws:
CapabilitiesException

storeClient

void storeClient(Client client)
                 throws CapabilitiesException
Save client to backend storage

Parameters:
client - valid Client object
Throws:
CapabilitiesException

deleteClient

void deleteClient(Client client)
                  throws CapabilitiesException
delete existing client from backend storage

Parameters:
client - valid client object
Throws:
CapabilitiesException


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