org.apache.jetspeed.capabilities
Interface CapabilityMap


public interface CapabilityMap

This interface provides lookup features on the capabilities supported by a client user agent.

Version:
$Id: CapabilityMap.java 188405 2005-03-19 12:47:14Z sgala $
Author:
Rapha?l Luta, Kevin A. Burton

Method Summary
 void addCapability(Capability capability)
          Add capability to the CapabilityMap
 void addMediaType(MediaType mediatype)
          Add MediaType to the MediaTypeMap
 void addMimetype(MimeType mimetype)
          Add Mimetype to the MimetypeMap
 String getAgent()
           
 Client getClient()
          Returns the Client for the CapabilityMap
 Iterator getMimeTypes()
          Get the mime types that this CapabilityMap supports.
 MediaType getPreferredMediaType()
           
 MimeType getPreferredType()
           
 boolean hasCapability(int cap)
           
 boolean hasCapability(String capability)
           
 Iterator listMediaTypes()
          Returns an ordered list of supported media-types, from most preferred to least preferred
 void setAgent(String userAgent)
           
 void setClient(Client client)
          Sets the client for the CapabilityMap
 void setPreferredMediaType(MediaType type)
          Sets the preferred MediaType for this CapabilityMap
 boolean supportsMediaType(String media)
          Return true if this CapabilityMap supports the given media type
 boolean supportsMimeType(MimeType mimeType)
           
 String toString()
           
 

Method Detail

setClient

public void setClient(Client client)
Sets the client for the CapabilityMap

Parameters:
client - The client associated with this map

getClient

public Client getClient()
Returns the Client for the CapabilityMap

Returns:
The client associated with this map

addCapability

public void addCapability(Capability capability)
Add capability to the CapabilityMap

Parameters:
capability -

addMimetype

public void addMimetype(MimeType mimetype)
Add Mimetype to the MimetypeMap

Parameters:
mimetype -

addMediaType

public void addMediaType(MediaType mediatype)
Add MediaType to the MediaTypeMap


getPreferredType

public MimeType getPreferredType()
Returns:
Returns the preferred MIME type for the current user-agent

getPreferredMediaType

public MediaType getPreferredMediaType()
Returns:
Returns the preferred media type for the current user-agent

setPreferredMediaType

public void setPreferredMediaType(MediaType type)
Sets the preferred MediaType for this CapabilityMap


listMediaTypes

public Iterator listMediaTypes()
Returns an ordered list of supported media-types, from most preferred to least preferred


getAgent

public String getAgent()
Returns:
Returns the user-agent string

setAgent

public void setAgent(String userAgent)

hasCapability

public boolean hasCapability(int cap)
Returns:
Returns true if the current agent has the specified capabilityID

hasCapability

public boolean hasCapability(String capability)
Returns:
returns true if the current agent has the specified capability

getMimeTypes

public Iterator getMimeTypes()
Get the mime types that this CapabilityMap supports.

Returns:
Returns an Iterator over the MimeType map

supportsMimeType

public boolean supportsMimeType(MimeType mimeType)
Returns:
Return true if this CapabilityMap supports the given MimeType

supportsMediaType

public boolean supportsMediaType(String media)
Return true if this CapabilityMap supports the given media type

Parameters:
media - the name of a media type registered in the MediaType registry
Returns:
true is the capabilities of this agent at least match those required by the media type

toString

public String toString()
Returns:
Create a map -> string representation


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