Interface ConverterContext

  • All Superinterfaces:
    Adaptable

    @ProviderType
    public interface ConverterContext
    extends Adaptable
    A context object providing useful information from the request. Can be adapted to ResourceConverterContext.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_LIMIT
      Default page size limit.
      static boolean DEFAULT_USE_ABSOLUTE_URIS
      Default indicator if absolute URIs should be used.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getContextPath()
      Returns the portion of the request URI that indicates the context.
      int getLimit()
      Returns the limit.
      java.lang.String getMatchedMediaType()
      Returns the media type that was matched from the request and that the converter is being asked to provide.
      java.util.Map<java.lang.String,​java.lang.String[]> getModelFilters()
      Retrieves the filters to be applied by the model when getting entities.
      java.lang.String getOffsetValue()
      Get this converters current offset value or the offset if that has been set.
      java.util.List<OrderByDetails> getOrderBy()
      Get this converters current list of order by information.
      java.util.Map<java.lang.String,​java.lang.String[]> getParameters()
      Returns the request parameters.
      java.lang.String getQuery()
      Returns the query.
      java.lang.String getRequestMethod()
      Returns the HTTP method of the request.
      RequestPathInfo getRequestPathInfo()
      Returns the RequestPathInfo.
      java.lang.String getRootContextPath()
      Get the Root Context Path Value as defined in OSGI config for ApiEndpointResourceProviderFactory
      java.lang.String getScheme()
      Returns the name of the scheme.
      java.lang.String getServerName()
      Returns the host name of the server.
      int getServerPort()
      Returns the port number.
      boolean isAbsoluteURI()
      Indicator if absolute URI's are used.
      void setMatchedMediaType​(java.lang.String mediaType)
      Set the media type that was matched from the request and the converter is being asked to provide.
      ConverterContext setOffsetValue​(java.lang.String value)
      Set the offset value.
    • Field Detail

      • DEFAULT_USE_ABSOLUTE_URIS

        static final boolean DEFAULT_USE_ABSOLUTE_URIS
        Default indicator if absolute URIs should be used.
        See Also:
        Constant Field Values
    • Method Detail

      • getRootContextPath

        @CheckForNull
        java.lang.String getRootContextPath()
        Get the Root Context Path Value as defined in OSGI config for ApiEndpointResourceProviderFactory
        Returns:
        The root context path.
      • getLimit

        int getLimit()
        Returns the limit.
        Returns:
        The limit value
      • getScheme

        @CheckForNull
        java.lang.String getScheme()
        Returns the name of the scheme.
        Returns:
        Scheme name
      • getServerName

        @CheckForNull
        java.lang.String getServerName()
        Returns the host name of the server.
        Returns:
        Server host name
      • getServerPort

        int getServerPort()
        Returns the port number.
        Returns:
        Server port
      • getContextPath

        @CheckForNull
        java.lang.String getContextPath()
        Returns the portion of the request URI that indicates the context.
        Returns:
        Context path
      • getParameters

        @CheckForNull
        java.util.Map<java.lang.String,​java.lang.String[]> getParameters()
        Returns the request parameters.
        Returns:
        A Map of request parameter keys and values
      • getQuery

        @CheckForNull
        java.lang.String getQuery()
        Returns the query.
        Returns:
        Query value
      • isAbsoluteURI

        boolean isAbsoluteURI()
        Indicator if absolute URI's are used.
        Returns:
        true if URIs are absolute, false otherwise
      • getModelFilters

        @Nonnull
        java.util.Map<java.lang.String,​java.lang.String[]> getModelFilters()
        Retrieves the filters to be applied by the model when getting entities.
        Returns:
        The filters the model must use.
      • getMatchedMediaType

        @CheckForNull
        java.lang.String getMatchedMediaType()
        Returns the media type that was matched from the request and that the converter is being asked to provide.
        Returns:
        The matched media type
      • setMatchedMediaType

        void setMatchedMediaType​(java.lang.String mediaType)
        Set the media type that was matched from the request and the converter is being asked to provide.
        Parameters:
        mediaType - The matched media type
      • getRequestMethod

        @CheckForNull
        java.lang.String getRequestMethod()
        Returns the HTTP method of the request.
        Returns:
        The HTTP method of the request
      • setOffsetValue

        ConverterContext setOffsetValue​(java.lang.String value)
        Set the offset value. Pagination could assign this value to a number or a string depending on the design of the URL space.
        Parameters:
        value - the value of the url parameter
        Returns:
        the current context
      • getOffsetValue

        java.lang.String getOffsetValue()
        Get this converters current offset value or the offset if that has been set.
        Returns:
        the offset value
      • getOrderBy

        @CheckForNull
        java.util.List<OrderByDetails> getOrderBy()
        Get this converters current list of order by information.
        Returns:
        the list of requested order by details or an empty list if nothing was specified