Class ThreadLocalizedContext

  • All Implemented Interfaces:
    javax.ws.rs.core.HttpHeaders, javax.ws.rs.core.Request, javax.ws.rs.core.SecurityContext

    @Deprecated
    public class ThreadLocalizedContext
    extends java.lang.Object
    implements javax.ws.rs.core.Request, javax.ws.rs.core.HttpHeaders, javax.ws.rs.core.SecurityContext
    Deprecated.
    Will be removed in next minor release.
    This class is used for thread local injection into providers and resources.
    See Also:
    Request, HttpHeaders, SecurityContext, Providers, ContextResolver, CallContext
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String CALLCONTEXT_KEY
      Deprecated.
      The key of the CallContext in the Request attributes.
      • Fields inherited from interface javax.ws.rs.core.HttpHeaders

        ACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, AUTHORIZATION, CACHE_CONTROL, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_TYPE, COOKIE, DATE, ETAG, EXPIRES, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LOCATION, SET_COOKIE, USER_AGENT, VARY, WWW_AUTHENTICATE
      • Fields inherited from interface javax.ws.rs.core.SecurityContext

        BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions()
      Deprecated.
       
      javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions​(java.util.Date lastModified)
      Deprecated.
       
      javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions​(java.util.Date lastModified, javax.ws.rs.core.EntityTag entityTag)
      Deprecated.
       
      javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions​(javax.ws.rs.core.EntityTag entityTag)
      Deprecated.
       
      CallContext get()
      Deprecated.
      Returns the wrapped CallContext for the current Thread.
      java.util.List<java.util.Locale> getAcceptableLanguages()
      Deprecated.
       
      java.util.List<javax.ws.rs.core.MediaType> getAcceptableMediaTypes()
      Deprecated.
       
      java.lang.String getAuthenticationScheme()
      Deprecated.
       
      java.util.Map<java.lang.String,​javax.ws.rs.core.Cookie> getCookies()
      Deprecated.
       
      java.util.Locale getLanguage()
      Deprecated.
       
      javax.ws.rs.core.MediaType getMediaType()
      Deprecated.
       
      java.lang.String getMethod()
      Deprecated.
       
      java.util.List<javax.ws.rs.core.PathSegment> getPathSegments()
      Deprecated.
       
      private java.util.Map<java.lang.String,​java.lang.Object> getRequestAttributes()
      Deprecated.
      Returns the attributes of the current Restlet Request .
      java.util.List<java.lang.String> getRequestHeader​(java.lang.String name)
      Deprecated.
       
      javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> getRequestHeaders()
      Deprecated.
       
      java.security.Principal getUserPrincipal()
      Deprecated.
       
      boolean isSecure()
      Deprecated.
       
      boolean isUserInRole​(java.lang.String role)
      Deprecated.
       
      javax.ws.rs.core.Variant selectVariant​(java.util.List<javax.ws.rs.core.Variant> variants)
      Deprecated.
       
      void set​(CallContext callContext)
      Deprecated.
      Sets the CallContext for the current thread.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ThreadLocalizedContext

        public ThreadLocalizedContext()
        Deprecated.
    • Method Detail

      • evaluatePreconditions

        public javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions()
        Deprecated.
        Specified by:
        evaluatePreconditions in interface javax.ws.rs.core.Request
      • evaluatePreconditions

        public javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions​(java.util.Date lastModified)
        Deprecated.
        Specified by:
        evaluatePreconditions in interface javax.ws.rs.core.Request
        Parameters:
        lastModified -
        Returns:
        null if the preconditions are met or a ResponseBuilder set with the appropriate status if the preconditions are not met.
        See Also:
        CallContext.evaluatePreconditions(java.util.Date), Request.evaluatePreconditions(Date)
      • evaluatePreconditions

        public javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions​(java.util.Date lastModified,
                                                                               javax.ws.rs.core.EntityTag entityTag)
        Deprecated.
        Specified by:
        evaluatePreconditions in interface javax.ws.rs.core.Request
        Parameters:
        lastModified -
        entityTag -
        Returns:
        See Also:
        CallContext.evaluatePreconditions(java.util.Date, javax.ws.rs.core.EntityTag), Request.evaluatePreconditions(Date, EntityTag)
      • evaluatePreconditions

        public javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions​(javax.ws.rs.core.EntityTag entityTag)
        Deprecated.
        Specified by:
        evaluatePreconditions in interface javax.ws.rs.core.Request
        Parameters:
        entityTag -
        Returns:
        null if the preconditions are met or a ResponseBuilder set with the appropriate status if the preconditions are not met. A returned ResponseBuilder will include an ETag header set with the value of eTag.
        See Also:
        CallContext.evaluatePreconditions(javax.ws.rs.core.EntityTag), Request.evaluatePreconditions(EntityTag)
      • get

        public CallContext get()
                        throws java.lang.IllegalStateException
        Deprecated.
        Returns the wrapped CallContext for the current Thread.
        Returns:
        the wrapped CallContext for the current Thread. Never returns null.
        Throws:
        java.lang.IllegalStateException - if no CallContext was given for the current thread. If this occurs, their is a bug in this JAX-RS implementation.
        See Also:
        set(CallContext)
      • getAcceptableLanguages

        public java.util.List<java.util.Locale> getAcceptableLanguages()
        Deprecated.
        Specified by:
        getAcceptableLanguages in interface javax.ws.rs.core.HttpHeaders
        See Also:
        HttpHeaders.getAcceptableLanguages()
      • getAcceptableMediaTypes

        public java.util.List<javax.ws.rs.core.MediaType> getAcceptableMediaTypes()
        Deprecated.
        Specified by:
        getAcceptableMediaTypes in interface javax.ws.rs.core.HttpHeaders
        See Also:
        CallContext.getAcceptableMediaTypes(), HttpHeaders.getAcceptableMediaTypes()
      • getAuthenticationScheme

        public java.lang.String getAuthenticationScheme()
        Deprecated.
        Specified by:
        getAuthenticationScheme in interface javax.ws.rs.core.SecurityContext
        See Also:
        CallContext.getAuthenticationScheme(), SecurityContext.getAuthenticationScheme()
      • getCookies

        public java.util.Map<java.lang.String,​javax.ws.rs.core.Cookie> getCookies()
        Deprecated.
        Specified by:
        getCookies in interface javax.ws.rs.core.HttpHeaders
        See Also:
        CallContext.getCookies(), HttpHeaders.getCookies()
      • getLanguage

        public java.util.Locale getLanguage()
        Deprecated.
        Specified by:
        getLanguage in interface javax.ws.rs.core.HttpHeaders
        See Also:
        CallContext.getLanguage(), HttpHeaders.getLanguage()
      • getMediaType

        public javax.ws.rs.core.MediaType getMediaType()
        Deprecated.
        Specified by:
        getMediaType in interface javax.ws.rs.core.HttpHeaders
        See Also:
        CallContext.getMediaType(), HttpHeaders.getMediaType()
      • getMethod

        public java.lang.String getMethod()
        Deprecated.
        Specified by:
        getMethod in interface javax.ws.rs.core.Request
        See Also:
        javax.ws.rs.core.Request#getFormParameters()
      • getPathSegments

        public java.util.List<javax.ws.rs.core.PathSegment> getPathSegments()
        Deprecated.
        Returns:
        .
        See Also:
        UriInfo.getPathSegments()
      • getRequestAttributes

        private java.util.Map<java.lang.String,​java.lang.Object> getRequestAttributes()
        Deprecated.
        Returns the attributes of the current Restlet Request .
        Returns:
        the attributes of the current Restlet Request, but never null
      • getRequestHeader

        public java.util.List<java.lang.String> getRequestHeader​(java.lang.String name)
        Deprecated.
        Specified by:
        getRequestHeader in interface javax.ws.rs.core.HttpHeaders
        See Also:
        CallContext.getRequestHeader(java.lang.String), HttpHeaders.getRequestHeader(String)
      • getRequestHeaders

        public javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> getRequestHeaders()
        Deprecated.
        Specified by:
        getRequestHeaders in interface javax.ws.rs.core.HttpHeaders
        See Also:
        CallContext.getRequestHeaders(), HttpHeaders.getRequestHeaders()
      • getUserPrincipal

        public java.security.Principal getUserPrincipal()
        Deprecated.
        Specified by:
        getUserPrincipal in interface javax.ws.rs.core.SecurityContext
        See Also:
        CallContext.getUserPrincipal(), SecurityContext.getUserPrincipal()
      • isSecure

        public boolean isSecure()
        Deprecated.
        Specified by:
        isSecure in interface javax.ws.rs.core.SecurityContext
        See Also:
        CallContext.isSecure(), SecurityContext.isSecure()
      • isUserInRole

        public boolean isUserInRole​(java.lang.String role)
        Deprecated.
        Specified by:
        isUserInRole in interface javax.ws.rs.core.SecurityContext
        Parameters:
        role -
        See Also:
        CallContext.isUserInRole(java.lang.String), SecurityContext.isUserInRole(String)
      • selectVariant

        public javax.ws.rs.core.Variant selectVariant​(java.util.List<javax.ws.rs.core.Variant> variants)
                                               throws java.lang.IllegalArgumentException
        Deprecated.
        Specified by:
        selectVariant in interface javax.ws.rs.core.Request
        Parameters:
        variants -
        Throws:
        java.lang.IllegalArgumentException
        See Also:
        CallContext.selectVariant(java.util.List), Request.selectVariant(List)
      • set

        public void set​(CallContext callContext)
                 throws java.lang.IllegalArgumentException
        Deprecated.
        Sets the CallContext for the current thread. You MUST set a CallContext here before you can get it by get().
        Parameters:
        callContext - The CallContext for the current request; must not be null.
        Throws:
        java.lang.IllegalArgumentException - if null was given.
        See Also:
        #reset(), get()