javax.ws.rs.client

Interface ClientResponseContext


  • public interface ClientResponseContext
    Client response filter context. A mutable class that provides response-specific information for the filter, such as message headers, message entity or request-scoped properties. The exposed setters allow modification of the exposed response-specific information.
    Since:
    2.0
    Author:
    Marek Potociar
    • Method Detail

      • getStatus

        int getStatus()
        Get the status code associated with the response.
        Returns:
        the response status code or -1 if the status was not set.
      • setStatus

        void setStatus(int code)
        Set a new response status code.
        Parameters:
        code - new status code.
      • getStatusInfo

        Response.StatusType getStatusInfo()
        Get the complete status information associated with the response.
        Returns:
        the response status information or null if the status was not set.
      • setStatusInfo

        void setStatusInfo(Response.StatusType statusInfo)
        Set the complete status information (status code and reason phrase) associated with the response.
        Parameters:
        statusInfo - the response status information.
      • getHeaderString

        String getHeaderString(String name)
        Get a message header as a single string value.
        Parameters:
        name - the message header.
        Returns:
        the message header value. If the message header is not present then null is returned. If the message header is present but has no value then the empty string is returned. If the message header is present more than once then the values of joined together and separated by a ',' character.
        See Also:
        getHeaders()
      • getAllowedMethods

        Set<String> getAllowedMethods()
        Get the allowed HTTP methods from the Allow HTTP header.
        Returns:
        the allowed HTTP methods, all methods will returned as upper case strings.
      • getDate

        Date getDate()
        Get message date.
        Returns:
        the message date, otherwise null if not present.
      • getLanguage

        Locale getLanguage()
        Get the language of the entity.
        Returns:
        the language of the entity or null if not specified
      • getLength

        int getLength()
        Get Content-Length value.
        Returns:
        Content-Length as integer if present and valid number. In other cases returns -1.
      • getMediaType

        MediaType getMediaType()
        Get the media type of the entity.
        Returns:
        the media type or null if not specified (e.g. there's no response entity).
      • getCookies

        Map<String,NewCookie> getCookies()
        Get any new cookies set on the response message.
        Returns:
        a read-only map of cookie name (String) to a new cookie.
      • getEntityTag

        EntityTag getEntityTag()
        Get the entity tag.
        Returns:
        the entity tag, otherwise null if not present.
      • getLastModified

        Date getLastModified()
        Get the last modified date.
        Returns:
        the last modified date, otherwise null if not present.
      • getLocation

        URI getLocation()
        Get the location.
        Returns:
        the location URI, otherwise null if not present.
      • Set<Link> getLinks()
        Get the links attached to the message as header.
        Returns:
        links, may return empty Set if no links are present. Never returns null.
      • boolean hasLink(String relation)
        Check if link for relation exists.
        Parameters:
        relation - link relation.
        Returns:
        true if the for the relation link exists, false otherwise.
      • Link getLink(String relation)
        Get the link for the relation.
        Parameters:
        relation - link relation.
        Returns:
        the link for the relation, otherwise null if not present.
      • getLinkBuilder

        Link.Builder getLinkBuilder(String relation)
        Convenience method that returns a Link.Builder for the relation.
        Parameters:
        relation - link relation.
        Returns:
        the link builder for the relation, otherwise null if not present.
      • hasEntity

        boolean hasEntity()
        Check if there is a non-empty entity input stream is available in the response message. The method returns true if the entity is present, returns false otherwise.
        Returns:
        true if there is an entity present in the message, false otherwise.
      • getEntityStream

        InputStream getEntityStream()
        Get the entity input stream. The JAX-RS runtime is responsible for closing the input stream.
        Returns:
        entity input stream.
      • setEntityStream

        void setEntityStream(InputStream input)
        Set a new entity input stream. The JAX-RS runtime is responsible for closing the input stream.
        Parameters:
        input - new entity input stream.

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/ws/rs/client/ClientResponseContext.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com, ClientResponseContext (Java(TM) EE 7 Specification APIs)

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.