Class WadlServerResource


  • @Deprecated
    public class WadlServerResource
    extends ServerResource
    Deprecated.
    Will be removed in next major release.
    Resource that is able to automatically describe itself with WADL. This description can be customized by overriding the describe() and describeMethod(Method, MethodInfo) methods.

    When used to describe a class of resources in the context of a parent application, a special instance will be created using the default constructor (with no request, response associated). In this case, the resource should do its best to return the generic information when the WADL description methods are invoked, like describe() and delegate methods.
    • Field Detail

      • autoDescribing

        private volatile boolean autoDescribing
        Deprecated.
        Indicates if the resource should be automatically described via WADL when an OPTIONS request is handled.
      • description

        private volatile java.lang.String description
        Deprecated.
        The description of this documented resource. Is seen as the text content of the "doc" tag of the "resource" element in a WADL document.
      • name

        private volatile java.lang.String name
        Deprecated.
        The name of this documented resource. Is seen as the title of the "doc" tag of the "resource" element in a WADL document.
    • Constructor Detail

      • WadlServerResource

        public WadlServerResource()
        Deprecated.
        Constructor.
    • Method Detail

      • canDescribe

        public boolean canDescribe​(Method method)
        Deprecated.
        Indicates if the given method exposes its WADL description. By default, HEAD and OPTIONS are not exposed. This method is called by describe(String, ResourceInfo).
        Parameters:
        method - The method
        Returns:
        True if the method exposes its description, false otherwise.
      • createHtmlRepresentation

        protected Representation createHtmlRepresentation​(ApplicationInfo applicationInfo)
        Deprecated.
        Creates a new HTML representation for a given ApplicationInfo instance describing an application.
        Parameters:
        applicationInfo - The application description.
        Returns:
        The created WadlRepresentation.
      • createWadlRepresentation

        protected Representation createWadlRepresentation​(ApplicationInfo applicationInfo)
        Deprecated.
        Creates a new WADL representation for a given ApplicationInfo instance describing an application.
        Parameters:
        applicationInfo - The application description.
        Returns:
        The created WadlRepresentation.
      • describe

        protected Representation describe()
        Deprecated.
        Describes the resource as a standalone WADL document.
        Returns:
        The WADL description.
      • describe

        protected void describe​(ApplicationInfo applicationInfo)
        Deprecated.
        Updates the description of the parent application. This is typically used to add documentation on global representations used by several methods or resources. Does nothing by default.
        Parameters:
        applicationInfo - The parent application.
      • describe

        protected RepresentationInfo describe​(MethodInfo methodInfo,
                                              java.lang.Class<?> representationClass,
                                              Variant variant)
        Deprecated.
        Describes a representation class and variant couple as WADL information. The variant contains the target media type that can be converted to by one of the available Restlet converters.
        Parameters:
        methodInfo - The parent method description.
        representationClass - The representation bean class.
        variant - The target variant.
        Returns:
        The WADL representation information.
      • describe

        protected RepresentationInfo describe​(MethodInfo methodInfo,
                                              RequestInfo requestInfo,
                                              java.lang.Class<?> representationClass,
                                              Variant variant)
        Deprecated.
        Describes a representation class and variant couple as WADL information for the given method and request. The variant contains the target media type that can be converted to by one of the available Restlet converters.

        By default, it calls describe(MethodInfo, Class, Variant).
        Parameters:
        methodInfo - The parent method description.
        requestInfo - The parent request description.
        representationClass - The representation bean class.
        variant - The target variant.
        Returns:
        The WADL representation information.
      • describe

        protected RepresentationInfo describe​(MethodInfo methodInfo,
                                              ResponseInfo responseInfo,
                                              java.lang.Class<?> representationClass,
                                              Variant variant)
        Deprecated.
        Describes a representation class and variant couple as WADL information for the given method and response. The variant contains the target media type that can be converted to by one of the available Restlet converters.

        By default, it calls describe(MethodInfo, Class, Variant).
        Parameters:
        methodInfo - The parent method description.
        responseInfo - The parent response description.
        representationClass - The representation bean class.
        variant - The target variant.
        Returns:
        The WADL representation information.
      • describe

        public void describe​(ResourceInfo info)
        Deprecated.
        Returns a WADL description of the current resource, leveraging the getResourcePath() method.
        Parameters:
        info - WADL description of the current resource to update.
      • describe

        public void describe​(java.lang.String path,
                             ResourceInfo info)
        Deprecated.
        Returns a WADL description of the current resource.
        Parameters:
        path - Path of the current resource.
        info - WADL description of the current resource to update.
      • describe

        protected Representation describe​(Variant variant)
        Deprecated.
        Describes the resource as a WADL document for the given variant.
        Parameters:
        variant - The WADL variant.
        Returns:
        The WADL description.
      • describeDelete

        protected void describeDelete​(MethodInfo info)
        Deprecated.
        Describes the DELETE method.
        Parameters:
        info - The method description to update.
      • describeGet

        protected void describeGet​(MethodInfo info)
        Deprecated.
        Describes the GET method.
        By default, it describes the response with the available variants based on the ServerResource.getVariants() method. Thus in the majority of cases, the method of the super class must be called when overridden.
        Parameters:
        info - The method description to update.
      • describeMethod

        protected MethodInfo describeMethod()
        Deprecated.
        Returns a WADL description of the current method.
        Returns:
        A WADL description of the current method.
      • describeMethod

        protected void describeMethod​(Method method,
                                      MethodInfo info)
        Deprecated.
        Returns a WADL description of the given method.
        Parameters:
        method - The method to describe.
        info - The method description to update.
      • describeOptions

        protected void describeOptions​(MethodInfo info)
        Deprecated.
        Describes the OPTIONS method.
        By default it describes the response with the available variants based on the getWadlVariants() method.
        Parameters:
        info - The method description to update.
      • describeParameters

        protected java.util.List<ParameterInfo> describeParameters()
        Deprecated.
        Returns the description of the parameters of this resource. Returns null by default.
        Returns:
        The description of the parameters.
      • describePatch

        protected void describePatch​(MethodInfo info)
        Deprecated.
        Describes the Patch method.
        Parameters:
        info - The method description to update.
      • describePost

        protected void describePost​(MethodInfo info)
        Deprecated.
        Describes the POST method.
        Parameters:
        info - The method description to update.
      • describePut

        protected void describePut​(MethodInfo info)
        Deprecated.
        Describes the PUT method.
        Parameters:
        info - The method description to update.
      • getDescription

        public java.lang.String getDescription()
        Deprecated.
        Returns the description of this documented resource. Is seen as the text content of the "doc" tag of the "resource" element in a WADL document.
        Overrides:
        getDescription in class ServerResource
        Returns:
        The description of this documented resource.
      • getHeaders

        private Series<Header> getHeaders()
        Deprecated.
        Returns the set of headers as a collection of Parameter objects.
        Returns:
        The set of headers as a collection of Parameter objects.
      • getName

        public java.lang.String getName()
        Deprecated.
        Returns the name of this documented resource. Is seen as the title of the "doc" tag of the "resource" element in a WADL document.
        Overrides:
        getName in class ServerResource
        Returns:
        The name of this documented resource.
      • getParameter

        protected NamedValue<java.lang.String> getParameter​(java.lang.String name)
        Deprecated.
        Returns the first parameter found in the current context (entity, query, headers, etc) with the given name.
        Parameters:
        name - The parameter name.
        Returns:
        The first parameter found with the given name.
      • getParameters

        private Series<? extends NamedValue<java.lang.String>> getParameters​(ParameterInfo parameterInfo)
        Deprecated.
        Returns a collection of parameters objects contained in the current context (entity, query, headers, etc) given a ParameterInfo instance.
        Parameters:
        parameterInfo - The ParameterInfo instance.
        Returns:
        A collection of parameters objects
      • getParameters

        protected Series<? extends NamedValue<java.lang.String>> getParameters​(java.lang.String name)
        Deprecated.
        Returns a collection of parameters found in the current context (entity, query, headers, etc) given a parameter name. It returns null if the parameter name is unknown.
        Parameters:
        name - The name of the parameter.
        Returns:
        A collection of parameters.
      • getPreferredWadlVariant

        protected Variant getPreferredWadlVariant()
        Deprecated.
        Returns the preferred WADL variant according to the client preferences specified in the request.
        Returns:
        The preferred WADL variant.
      • getResourcePath

        protected java.lang.String getResourcePath()
        Deprecated.
        Returns the resource's relative path.
        Returns:
        The resource's relative path.
      • getResourcesBase

        protected Reference getResourcesBase()
        Deprecated.
        Returns the application resources base URI.
        Returns:
        The application resources base URI.
      • getWadlVariants

        protected java.util.List<Variant> getWadlVariants()
        Deprecated.
        Returns the available WADL variants.
        Returns:
        The available WADL variants.
      • isAutoDescribing

        public boolean isAutoDescribing()
        Deprecated.
        Indicates if the resource should be automatically described via WADL when an OPTIONS request is handled.
        Returns:
        True if the resource should be automatically described via WADL.
      • setAutoDescribing

        public void setAutoDescribing​(boolean autoDescribed)
        Deprecated.
        Indicates if the resource should be automatically described via WADL when an OPTIONS request is handled.
        Parameters:
        autoDescribed - True if the resource should be automatically described via WADL.
      • setDescription

        public void setDescription​(java.lang.String description)
        Deprecated.
        Sets the description of this documented resource. Is seen as the text content of the "doc" tag of the "resource" element in a WADL document.
        Overrides:
        setDescription in class ServerResource
        Parameters:
        description - The description of this documented resource.
      • setName

        public void setName​(java.lang.String name)
        Deprecated.
        Sets the name of this documented resource. Is seen as the title of the "doc" tag of the "resource" element in a WADL document.
        Overrides:
        setName in class ServerResource
        Parameters:
        name - The name of this documented resource.