Class DescriptionImpl

All Implemented Interfaces:
BaseDescription, BaseDescriptionDocument, Description

public class DescriptionImpl extends AbstractBaseDescriptionDocument implements Description
Implementation of a Web Script Description
Author:
davidc
  • Field Details

  • Constructor Details

    • DescriptionImpl

      public DescriptionImpl(String id, String shortName, String description, String url)
      Constructor with id, shortName, description and url
      Parameters:
      id - String
      shortName - String
      description - String
      url - String
    • DescriptionImpl

      public DescriptionImpl()
      Default constructor
  • Method Details

    • getArguments

      public ArgumentTypeDescription[] getArguments()
      Description copied from interface: Description
      Gets webscript argument descriptions
      Specified by:
      getArguments in interface Description
      Returns:
      the arguments
    • setArguments

      public void setArguments(ArgumentTypeDescription[] arguments)
      Parameters:
      arguments - the arguments to set
    • getRequestTypes

      public TypeDescription[] getRequestTypes()
      Description copied from interface: Description
      Gets webscript request types
      Specified by:
      getRequestTypes in interface Description
      Returns:
      the requestTypes
    • setRequestTypes

      public void setRequestTypes(TypeDescription[] requestTypes)
      Parameters:
      requestTypes - the requestTypes to set
    • getResponseTypes

      public TypeDescription[] getResponseTypes()
      Description copied from interface: Description
      Gets webscript response types
      Specified by:
      getResponseTypes in interface Description
      Returns:
      the responseTypes
    • setResponseTypes

      public void setResponseTypes(TypeDescription[] responseTypes)
      Parameters:
      responseTypes - the responseTypes to set
    • setScriptPath

      public void setScriptPath(String scriptPath)
      Sets the script path
      Parameters:
      scriptPath - String
    • 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:
      scriptPackage - Path
    • getPackage

      public Path getPackage()
      Description copied from interface: Description
      Gets the package (Path version of getScriptPath)
      Specified by:
      getPackage in interface Description
    • setKind

      public void setKind(String kind)
      Sets the service kind
      Parameters:
      kind - String
    • 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)
    • setFamilys

      public void setFamilys(Set<String> familys)
      Parameters:
      familys - 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 - 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 - RequiredTransactionParameters
    • 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 - RequiredCache
    • getRequiredCache

      public Description.RequiredCache getRequiredCache()
      Description copied from interface: Description
      Gets the required level of caching
      Specified by:
      getRequiredCache in interface Description
      Returns:
      RequiredCache
    • setFormatStyle

      public void setFormatStyle(Description.FormatStyle formatStyle)
      Sets the format style
      Parameters:
      formatStyle - 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 - String
    • 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 - String[]
    • 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 - String
    • 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:
      negotiatedFormats - NegotiatedFormat[]
    • 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 - Map<String, Serializable>
    • 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 - Lifecycle
    • getMultipartProcessing

      public boolean getMultipartProcessing()
      Specified by:
      getMultipartProcessing in interface Description
      Returns:
      true if automatic multipart formdata processes is enabled
    • setMultipartProcessing

      public void setMultipartProcessing(boolean multipartProcessing)
      Specified by:
      setMultipartProcessing in interface Description
      Parameters:
      multipartProcessing - the multipartProcessing to set
    • parse

      public void parse(org.dom4j.Element elem)
      Description copied from class: AbstractBaseDescription
      Populates fields from given XML element without validation
      Overrides:
      parse in class AbstractBaseDescription
      Parameters:
      elem - root element for parsing
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • newInstance

      public static DescriptionImpl newInstance()
      Return a new instance of webscript
      Returns:
      a new instance of webscript