org.apache.jetspeed.capabilities.impl
Class JetspeedCapabilities

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
          extended by org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
              extended by org.apache.jetspeed.capabilities.impl.JetspeedCapabilities
All Implemented Interfaces:
org.apache.jetspeed.capabilities.Capabilities, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean

public class JetspeedCapabilities
extends org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
implements org.apache.jetspeed.capabilities.Capabilities, org.springframework.beans.factory.BeanFactoryAware

Jetspeed Capabilities

Version:
$Id: JetspeedCapabilities.java 517124 2007-03-12 08:10:25Z ate $
Author:
David Sean Taylor, Roger Ruttimann

Field Summary
static String AGENT_XML
           
private  org.springframework.beans.factory.BeanFactory beanFactory
          added support for bean factory to create profile rules
private  String capabilityBeanName
           
private  Class capabilityClass
           
(package private)  Hashtable capabilityMapCache
           
private  String clientBeanName
          named bean references
private  Class clientClass
           
private  Collection clients
           
static String DEFAULT_AGENT
           
private static org.apache.commons.logging.Log log
           
private  String mediaTypeBeanName
           
private  Class mediaTypeClass
           
private  String mimeTypeBeanName
           
private  Class mimeTypeClass
           
 
Fields inherited from class org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
repositoryPath
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
JetspeedCapabilities(String repositoryPath, Properties properties)
          Deprecated. As of release 2.1, property-based class references replaced by container managed bean factory
JetspeedCapabilities(String repositoryPath, String clientBeanName, String mediaTypeBeanName, String mimeTypeBeanName, String capabilityBeanName)
           
 
Method Summary
 org.apache.jetspeed.capabilities.Capability createCapability(String capabilityName)
           
 org.apache.jetspeed.capabilities.Client createClient(String clientName)
           
 org.apache.jetspeed.capabilities.MediaType createMediaType(String mediaTypeName)
           
 org.apache.jetspeed.capabilities.MimeType createMimeType(String mimeType)
           
 void deleteCapability(org.apache.jetspeed.capabilities.Capability capability)
           
 void deleteCapabilityMapCache()
           
 void deleteClient(org.apache.jetspeed.capabilities.Client client)
           
 void deleteMediaType(org.apache.jetspeed.capabilities.MediaType mediaType)
           
 void deleteMimeType(org.apache.jetspeed.capabilities.MimeType mimeType)
           
 org.apache.jetspeed.capabilities.Client findClient(String userAgent)
          Returns the client which matches the given useragent string.
 Iterator getCapabilities()
          Obtain an iterator of all existing capabilities.
 org.apache.jetspeed.capabilities.Capability getCapability(String capability)
           
 String getCapabilityBeanName()
           
private  Class getCapabilityClass()
           
 org.apache.jetspeed.capabilities.CapabilityMap getCapabilityMap(String userAgent)
           
 org.apache.jetspeed.capabilities.Client getClient(String clientName)
           
 String getClientBeanName()
           
private  Class getClientClass()
           
 Iterator getClients()
           
 org.apache.jetspeed.capabilities.MediaType getMediaType(String mediaType)
           
 String getMediaTypeBeanName()
           
private  Class getMediaTypeClass()
           
 org.apache.jetspeed.capabilities.MediaType getMediaTypeForMimeType(String mimeTypeName)
          getMediaTypeForMimeType
 Iterator getMediaTypes()
          Obtain an iterator of all existing media types.
 Collection getMediaTypesForMimeTypes(Iterator mimetypes)
           
 org.apache.jetspeed.capabilities.MimeType getMimeType(String mimeType)
           
 String getMimeTypeBeanName()
           
private  Class getMimeTypeClass()
           
 Iterator getMimeTypes()
          Obtain an iterator of all existing mime types.
 void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
           
 void setCapabilityBeanName(String capabilityBeanName)
           
 void setClientBeanName(String clientBeanName)
           
 void setMediaTypeBeanName(String mediaTypeBeanName)
           
 void setMimeTypeBeanName(String mimeTypeBeanName)
           
 void storeCapability(org.apache.jetspeed.capabilities.Capability capability)
           
 void storeClient(org.apache.jetspeed.capabilities.Client client)
           
 void storeMediaType(org.apache.jetspeed.capabilities.MediaType mediaType)
           
 void storeMimeType(org.apache.jetspeed.capabilities.MimeType mimeType)
           
 
Methods inherited from class org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
init
 
Methods inherited from class org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
checkDaoConfig, convertOjbAccessException, createPersistenceBrokerTemplate, getJcdAlias, getPersistenceBroker, getPersistenceBrokerTemplate, releasePersistenceBroker, setJcdAlias, setPersistenceBrokerTemplate
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

DEFAULT_AGENT

public static final String DEFAULT_AGENT
See Also:
Constant Field Values

AGENT_XML

public static final String AGENT_XML
See Also:
Constant Field Values

capabilityMapCache

Hashtable capabilityMapCache

clients

private Collection clients

beanFactory

private org.springframework.beans.factory.BeanFactory beanFactory
added support for bean factory to create profile rules


clientBeanName

private String clientBeanName
named bean references


capabilityBeanName

private String capabilityBeanName

mimeTypeBeanName

private String mimeTypeBeanName

mediaTypeBeanName

private String mediaTypeBeanName

clientClass

private Class clientClass

capabilityClass

private Class capabilityClass

mimeTypeClass

private Class mimeTypeClass

mediaTypeClass

private Class mediaTypeClass
Constructor Detail

JetspeedCapabilities

public JetspeedCapabilities(String repositoryPath,
                            String clientBeanName,
                            String mediaTypeBeanName,
                            String mimeTypeBeanName,
                            String capabilityBeanName)

JetspeedCapabilities

public JetspeedCapabilities(String repositoryPath,
                            Properties properties)
Deprecated. As of release 2.1, property-based class references replaced by container managed bean factory

Create a JetspeedProfiler with properties. Expected properties are: defaultRule = the default profiling rule anonymousUser = the name of the anonymous user persistenceStoreName = The name of the persistence persistenceStore component to connect to services.profiler.locator.impl = the pluggable Profile Locator impl services.profiler.principalRule.impl = the pluggable Principal Rule impl services.profiler.profilingRule.impl = the pluggable Profiling Rule impl

Parameters:
persistenceStore - The persistence persistenceStore
properties - Properties for this component described above
Method Detail

setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
                    throws org.springframework.beans.BeansException
Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
Throws:
org.springframework.beans.BeansException

getClientClass

private Class getClientClass()
                      throws ClassNotFoundException
Throws:
ClassNotFoundException

getMimeTypeClass

private Class getMimeTypeClass()
                        throws ClassNotFoundException
Throws:
ClassNotFoundException

getCapabilityClass

private Class getCapabilityClass()
                          throws ClassNotFoundException
Throws:
ClassNotFoundException

getMediaTypeClass

private Class getMediaTypeClass()
                         throws ClassNotFoundException
Throws:
ClassNotFoundException

getCapabilityMap

public org.apache.jetspeed.capabilities.CapabilityMap getCapabilityMap(String userAgent)
                                                                throws org.apache.jetspeed.capabilities.UnableToBuildCapabilityMapException
Specified by:
getCapabilityMap in interface org.apache.jetspeed.capabilities.Capabilities
Parameters:
userAgent - Agent from the request
Throws:
org.apache.jetspeed.capabilities.UnableToBuildCapabilityMapException
See Also:
org.apache.jetspeed.services.capability.CapabilityService#getCapabilityMap(java.lang.String)

findClient

public org.apache.jetspeed.capabilities.Client findClient(String userAgent)
Returns the client which matches the given useragent string.

Specified by:
findClient in interface org.apache.jetspeed.capabilities.Capabilities
Parameters:
useragent - the useragent to match
Returns:
the found client or null if the user-agent does not match any defined client
See Also:
org.apache.jetspeed.capabilities.CapabilityService#findClient(java.lang.String)

getClients

public Iterator getClients()
Specified by:
getClients in interface org.apache.jetspeed.capabilities.Capabilities

getMediaTypesForMimeTypes

public Collection getMediaTypesForMimeTypes(Iterator mimetypes)
Specified by:
getMediaTypesForMimeTypes in interface org.apache.jetspeed.capabilities.Capabilities

deleteCapabilityMapCache

public void deleteCapabilityMapCache()
Specified by:
deleteCapabilityMapCache in interface org.apache.jetspeed.capabilities.Capabilities

getMediaType

public org.apache.jetspeed.capabilities.MediaType getMediaType(String mediaType)
Specified by:
getMediaType in interface org.apache.jetspeed.capabilities.Capabilities

getMediaTypeForMimeType

public org.apache.jetspeed.capabilities.MediaType getMediaTypeForMimeType(String mimeTypeName)
getMediaTypeForMimeType

Specified by:
getMediaTypeForMimeType in interface org.apache.jetspeed.capabilities.Capabilities
Parameters:
mimeType - to use for lookup
Returns:
MediaTypeEntry that matches the lookup in the MEDIATYPE_TO_MIMETYPE table

getCapabilities

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

Specified by:
getCapabilities in interface org.apache.jetspeed.capabilities.Capabilities
Returns:
Returns an iterator for all existing Capabilities of type Capability

getMimeTypes

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

Specified by:
getMimeTypes in interface org.apache.jetspeed.capabilities.Capabilities
Returns:
Returns an iterator for all existing Mime Types of type MimeType

getMediaTypes

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

Specified by:
getMediaTypes in interface org.apache.jetspeed.capabilities.Capabilities
Returns:
Returns an iterator for all existing media types of type MediaType

getMimeTypeBeanName

public String getMimeTypeBeanName()
Specified by:
getMimeTypeBeanName in interface org.apache.jetspeed.capabilities.Capabilities

setMimeTypeBeanName

public void setMimeTypeBeanName(String mimeTypeBeanName)
Specified by:
setMimeTypeBeanName in interface org.apache.jetspeed.capabilities.Capabilities

getClientBeanName

public String getClientBeanName()
Specified by:
getClientBeanName in interface org.apache.jetspeed.capabilities.Capabilities

setClientBeanName

public void setClientBeanName(String clientBeanName)
Specified by:
setClientBeanName in interface org.apache.jetspeed.capabilities.Capabilities

getMediaTypeBeanName

public String getMediaTypeBeanName()
Specified by:
getMediaTypeBeanName in interface org.apache.jetspeed.capabilities.Capabilities

setMediaTypeBeanName

public void setMediaTypeBeanName(String mediaTypeBeanName)
Specified by:
setMediaTypeBeanName in interface org.apache.jetspeed.capabilities.Capabilities

getCapabilityBeanName

public String getCapabilityBeanName()
Specified by:
getCapabilityBeanName in interface org.apache.jetspeed.capabilities.Capabilities

setCapabilityBeanName

public void setCapabilityBeanName(String capabilityBeanName)
Specified by:
setCapabilityBeanName in interface org.apache.jetspeed.capabilities.Capabilities

createMimeType

public org.apache.jetspeed.capabilities.MimeType createMimeType(String mimeType)
                                                         throws ClassNotFoundException
Specified by:
createMimeType in interface org.apache.jetspeed.capabilities.Capabilities
Throws:
ClassNotFoundException

createCapability

public org.apache.jetspeed.capabilities.Capability createCapability(String capabilityName)
                                                             throws ClassNotFoundException
Specified by:
createCapability in interface org.apache.jetspeed.capabilities.Capabilities
Throws:
ClassNotFoundException

createMediaType

public org.apache.jetspeed.capabilities.MediaType createMediaType(String mediaTypeName)
                                                           throws ClassNotFoundException
Specified by:
createMediaType in interface org.apache.jetspeed.capabilities.Capabilities
Throws:
ClassNotFoundException

createClient

public org.apache.jetspeed.capabilities.Client createClient(String clientName)
                                                     throws ClassNotFoundException
Specified by:
createClient in interface org.apache.jetspeed.capabilities.Capabilities
Throws:
ClassNotFoundException

getMimeType

public org.apache.jetspeed.capabilities.MimeType getMimeType(String mimeType)
Specified by:
getMimeType in interface org.apache.jetspeed.capabilities.Capabilities

getClient

public org.apache.jetspeed.capabilities.Client getClient(String clientName)
Specified by:
getClient in interface org.apache.jetspeed.capabilities.Capabilities

getCapability

public org.apache.jetspeed.capabilities.Capability getCapability(String capability)
Specified by:
getCapability in interface org.apache.jetspeed.capabilities.Capabilities

storeMediaType

public void storeMediaType(org.apache.jetspeed.capabilities.MediaType mediaType)
                    throws org.apache.jetspeed.capabilities.CapabilitiesException
Specified by:
storeMediaType in interface org.apache.jetspeed.capabilities.Capabilities
Throws:
org.apache.jetspeed.capabilities.CapabilitiesException

deleteMediaType

public void deleteMediaType(org.apache.jetspeed.capabilities.MediaType mediaType)
                     throws org.apache.jetspeed.capabilities.CapabilitiesException
Specified by:
deleteMediaType in interface org.apache.jetspeed.capabilities.Capabilities
Throws:
org.apache.jetspeed.capabilities.CapabilitiesException

storeCapability

public void storeCapability(org.apache.jetspeed.capabilities.Capability capability)
                     throws org.apache.jetspeed.capabilities.CapabilitiesException
Specified by:
storeCapability in interface org.apache.jetspeed.capabilities.Capabilities
Throws:
org.apache.jetspeed.capabilities.CapabilitiesException

deleteCapability

public void deleteCapability(org.apache.jetspeed.capabilities.Capability capability)
                      throws org.apache.jetspeed.capabilities.CapabilitiesException
Specified by:
deleteCapability in interface org.apache.jetspeed.capabilities.Capabilities
Throws:
org.apache.jetspeed.capabilities.CapabilitiesException

storeMimeType

public void storeMimeType(org.apache.jetspeed.capabilities.MimeType mimeType)
                   throws org.apache.jetspeed.capabilities.CapabilitiesException
Specified by:
storeMimeType in interface org.apache.jetspeed.capabilities.Capabilities
Throws:
org.apache.jetspeed.capabilities.CapabilitiesException

deleteMimeType

public void deleteMimeType(org.apache.jetspeed.capabilities.MimeType mimeType)
                    throws org.apache.jetspeed.capabilities.CapabilitiesException
Specified by:
deleteMimeType in interface org.apache.jetspeed.capabilities.Capabilities
Throws:
org.apache.jetspeed.capabilities.CapabilitiesException

storeClient

public void storeClient(org.apache.jetspeed.capabilities.Client client)
                 throws org.apache.jetspeed.capabilities.CapabilitiesException
Specified by:
storeClient in interface org.apache.jetspeed.capabilities.Capabilities
Throws:
org.apache.jetspeed.capabilities.CapabilitiesException

deleteClient

public void deleteClient(org.apache.jetspeed.capabilities.Client client)
                  throws org.apache.jetspeed.capabilities.CapabilitiesException
Specified by:
deleteClient in interface org.apache.jetspeed.capabilities.Capabilities
Throws:
org.apache.jetspeed.capabilities.CapabilitiesException


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