org.springframework.extensions.webscripts
Class DescriptionImpl

java.lang.Object
  extended by org.springframework.extensions.webscripts.DescriptionImpl
All Implemented Interfaces:
Description

public class DescriptionImpl
extends Object
implements Description

Implementation of a Web Script Description

Author:
davidc

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.springframework.extensions.webscripts.Description
Description.FormatStyle, Description.Lifecycle, Description.RequiredAuthentication, Description.RequiredCache, Description.RequiredTransaction, Description.RequiredTransactionParameters, Description.TransactionCapability
 
Constructor Summary
DescriptionImpl()
           
 
Method Summary
 String getDefaultFormat()
          Gets the default response format Note: the default response format is the first listed in the service description document
 InputStream getDescDocument()
          Gets the description xml document for this web script
 String getDescPath()
          Gets the path of the description xml document for this web script
 String getDescription()
          Gets the description of this service
 Map<String,Serializable> getExtensions()
          Gets web script specific extensions
 Set<String> getFamilys()
          Gets the family(s) of this service in the order that they are defined
 Description.FormatStyle getFormatStyle()
          Gets the style of Format discriminator supported by this web script
 String getId()
          Gets the id of this service
 String getKind()
          Gets the kind of service.
 Description.Lifecycle getLifecycle()
          Get the lifecycle
 String getMethod()
          Gets the HTTP method this service is bound to
 NegotiatedFormat[] getNegotiatedFormats()
          Gets the formats available for negotiation
 Path getPackage()
          Gets the package (Path version of getScriptPath)
 Description.RequiredAuthentication getRequiredAuthentication()
          Gets the required authentication level for execution of this service
 Description.RequiredCache getRequiredCache()
          Gets the required level of caching
 Description.RequiredTransaction getRequiredTransaction()
          Gets the required transaction level
 Description.RequiredTransactionParameters getRequiredTransactionParameters()
          Gets the transaction parameters
 String getRunAs()
          Gets the ID of the user that the service should be run as or null if the service is to be run as the authenticated user.
 String getScriptPath()
          Gets the path within the store of this web script
 String getShortName()
          Gets the short name of this service
 String getStorePath()
          Gets the root path of the store of this web script
 String[] getURIs()
          Gets the URIs this service supports
 void setDefaultFormat(String defaultFormat)
          Sets the default response format
 void setDescPath(String descPath)
          Sets the desc path
 void setDescription(String description)
          Sets the service description
 void setExtensions(Map<String,Serializable> extensions)
          Sets Web Script custom extensions
 void setFamilys(Set<String> familys)
           
 void setFormatStyle(Description.FormatStyle formatStyle)
          Sets the format style
 void setId(String id)
          Sets the service id
 void setKind(String kind)
          Sets the service kind
 void setLifecycle(Description.Lifecycle lifecycle)
          Sets the lifecycle
 void setMethod(String httpMethod)
          Sets the service http method
 void setNegotiatedFormats(NegotiatedFormat[] negotiatedFormats)
          Sets the negotiated formats
 void setPackage(Path scriptPackage)
          Sets the Package (path version of getScriptPath)
 void setRequiredAuthentication(Description.RequiredAuthentication requiredAuthentication)
          Sets the required level of authentication
 void setRequiredCache(Description.RequiredCache requiredCache)
          Sets the required cache
 void setRequiredTransactionParameters(Description.RequiredTransactionParameters transactionParameters)
          Sets the transaction parameters
 void setRunAs(String runAs)
          Sets the ID of the user that the service should be run as.
 void setScriptPath(String scriptPath)
          Sets the script path
 void setShortName(String shortName)
          Sets the service short name
 void setStore(Store store)
          Sets the web description store
 void setUris(String[] uris)
          Sets the service URIs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DescriptionImpl

public DescriptionImpl()
Method Detail

setStore

public void setStore(Store store)
Sets the web description store

Parameters:
store - store

getStorePath

public String getStorePath()
Description copied from interface: Description
Gets the root path of the store of this web script

Specified by:
getStorePath in interface Description
Returns:
root path of store

setScriptPath

public void setScriptPath(String scriptPath)
Sets the script path

Parameters:
scriptPath -

getScriptPath

public String getScriptPath()
Description copied from interface: Description
Gets the path within the store of this web script

Specified by:
getScriptPath in interface Description
Returns:
path within store

setPackage

public void setPackage(Path scriptPackage)
Sets the Package (path version of getScriptPath)

Parameters:
package -

getPackage

public Path getPackage()
Description copied from interface: Description
Gets the package (Path version of getScriptPath)

Specified by:
getPackage in interface Description

setDescPath

public void setDescPath(String descPath)
Sets the desc path

Parameters:
descPath -

getDescPath

public String getDescPath()
Description copied from interface: Description
Gets the path of the description xml document for this web script

Specified by:
getDescPath in interface Description
Returns:
document location (path)

getDescDocument

public InputStream getDescDocument()
                            throws IOException
Description copied from interface: Description
Gets the description xml document for this web script

Specified by:
getDescDocument in interface Description
Returns:
source document
Throws:
IOException

setId

public void setId(String id)
Sets the service id

Parameters:
id -

getId

public String getId()
Description copied from interface: Description
Gets the id of this service

Specified by:
getId in interface Description
Returns:
service id

setKind

public void setKind(String kind)
Sets the service kind

Parameters:
kind -

getKind

public String getKind()
Description copied from interface: Description
Gets the kind of service. A Web Script may explicitly define its backing-bean implementation. The backing bean implementation is identified by a Spring bean whose id is: webscript. The may be dot separated.

Specified by:
getKind in interface Description
Returns:
the kind of service (or null, for a vanilla declarative web script)

setShortName

public void setShortName(String shortName)
Sets the service short name

Parameters:
shortName -

getShortName

public String getShortName()
Description copied from interface: Description
Gets the short name of this service

Specified by:
getShortName in interface Description
Returns:
service short name

setDescription

public void setDescription(String description)
Sets the service description

Parameters:
description -

getDescription

public String getDescription()
Description copied from interface: Description
Gets the description of this service

Specified by:
getDescription in interface Description

setFamilys

public void setFamilys(Set<String> familys)
Parameters:
family - the family to set

getFamilys

public Set<String> getFamilys()
Description copied from interface: Description
Gets the family(s) of this service in the order that they are defined

Specified by:
getFamilys in interface Description

setRequiredAuthentication

public void setRequiredAuthentication(Description.RequiredAuthentication requiredAuthentication)
Sets the required level of authentication

Parameters:
requiredAuthentication -

getRequiredAuthentication

public Description.RequiredAuthentication getRequiredAuthentication()
Description copied from interface: Description
Gets the required authentication level for execution of this service

Specified by:
getRequiredAuthentication in interface Description
Returns:
the required authentication level

setRunAs

public void setRunAs(String runAs)
Sets the ID of the user that the service should be run as. If not set, the service run as the authenticated user.

Parameters:
runAs - a user name

getRunAs

public String getRunAs()
Description copied from interface: Description
Gets the ID of the user that the service should be run as or null if the service is to be run as the authenticated user.

Specified by:
getRunAs in interface Description
Returns:
a user name or null if not applicable

getRequiredTransaction

public Description.RequiredTransaction getRequiredTransaction()
Description copied from interface: Description
Gets the required transaction level

Specified by:
getRequiredTransaction in interface Description
Returns:
the required transaction level

setRequiredTransactionParameters

public void setRequiredTransactionParameters(Description.RequiredTransactionParameters transactionParameters)
Sets the transaction parameters

Parameters:
transactionParameters -

getRequiredTransactionParameters

public Description.RequiredTransactionParameters getRequiredTransactionParameters()
Description copied from interface: Description
Gets the transaction parameters

Specified by:
getRequiredTransactionParameters in interface Description
Returns:
the transaction parameters

setRequiredCache

public void setRequiredCache(Description.RequiredCache requiredCache)
Sets the required cache

Parameters:
requiredCache -

getRequiredCache

public Description.RequiredCache getRequiredCache()
Description copied from interface: Description
Gets the required level of caching

Specified by:
getRequiredCache in interface Description
Returns:

setFormatStyle

public void setFormatStyle(Description.FormatStyle formatStyle)
Sets the format style

Parameters:
formatStyle -

getFormatStyle

public Description.FormatStyle getFormatStyle()
Description copied from interface: Description
Gets the style of Format discriminator supported by this web script

Specified by:
getFormatStyle in interface Description
Returns:
format style

setMethod

public void setMethod(String httpMethod)
Sets the service http method

Parameters:
httpMethod -

getMethod

public String getMethod()
Description copied from interface: Description
Gets the HTTP method this service is bound to

Specified by:
getMethod in interface Description
Returns:
HTTP method

setUris

public void setUris(String[] uris)
Sets the service URIs

Parameters:
uris -

getURIs

public String[] getURIs()
Description copied from interface: Description
Gets the URIs this service supports

Specified by:
getURIs in interface Description
Returns:
array of URIs in order specified in service description document

setDefaultFormat

public void setDefaultFormat(String defaultFormat)
Sets the default response format

Parameters:
defaultFormat -

getDefaultFormat

public String getDefaultFormat()
Description copied from interface: Description
Gets the default response format Note: the default response format is the first listed in the service description document

Specified by:
getDefaultFormat in interface Description
Returns:
default response format (or null, if format not known until run-time)

setNegotiatedFormats

public void setNegotiatedFormats(NegotiatedFormat[] negotiatedFormats)
Sets the negotiated formats

Parameters:
defaultFormat -

getNegotiatedFormats

public NegotiatedFormat[] getNegotiatedFormats()
Description copied from interface: Description
Gets the formats available for negotiation

Specified by:
getNegotiatedFormats in interface Description
Returns:
negotiated formats

setExtensions

public void setExtensions(Map<String,Serializable> extensions)
Sets Web Script custom extensions

Parameters:
extensions -

getExtensions

public Map<String,Serializable> getExtensions()
Description copied from interface: Description
Gets web script specific extensions

Specified by:
getExtensions in interface Description
Returns:
map of extensions by name

getLifecycle

public Description.Lifecycle getLifecycle()
Description copied from interface: Description
Get the lifecycle

Specified by:
getLifecycle in interface Description

setLifecycle

public void setLifecycle(Description.Lifecycle lifecycle)
Sets the lifecycle

Parameters:
lifecycle -


Copyright © 2009 SpringSource, Inc. All Rights Reserved.