javax.ws.rs.client

Interface Client

  • All Superinterfaces:
    Configurable<Client>

    public interface Client
    extends Configurable<Client>
    Client is the main entry point to the fluent API used to build and execute client requests in order to consume responses returned.

    Clients are heavy-weight objects that manage the client-side communication infrastructure. Initialization as well as disposal of a Client instance may be a rather expensive operation. It is therefore advised to construct only a small number of Client instances in the application. Client instances must be properly closed before being disposed to avoid leaking resources.

    Since:
    2.0
    Author:
    Marek Potociar
    See Also:
    Configurable
    • Method Detail

      • close

        void close()
        Close client instance and all it's associated resources. Subsequent calls have no effect and are ignored. Once the client is closed, invoking any other method on the client instance would result in an IllegalStateException being thrown.

        Calling this method effectively invalidates all resource targets produced by the client instance. Invoking any method on such targets once the client is closed would result in an IllegalStateException being thrown.

      • target

        WebTarget target(String uri)
        Build a new web resource target.
        Parameters:
        uri - web resource URI. May contain template parameters. Must not be null.
        Returns:
        web resource target bound to the provided URI.
        Throws:
        IllegalArgumentException - in case the supplied string is not a valid URI template.
        NullPointerException - in case the supplied argument is null.
      • target

        WebTarget target(URI uri)
        Build a new web resource target.
        Parameters:
        uri - web resource URI. Must not be null.
        Returns:
        web resource target bound to the provided URI.
        Throws:
        NullPointerException - in case the supplied argument is null.
      • target

        WebTarget target(UriBuilder uriBuilder)
        Build a new web resource target.
        Parameters:
        uriBuilder - web resource URI represented as URI builder. Must not be null.
        Returns:
        web resource target bound to the provided URI.
        Throws:
        NullPointerException - in case the supplied argument is null.
      • target

        WebTarget target(Link link)
        Build a new web resource target.
        Parameters:
        link - link to a web resource. Must not be null.
        Returns:
        web resource target bound to the linked web resource.
        Throws:
        NullPointerException - in case the supplied argument is null.
      • invocation

        Invocation.Builder invocation(Link link)

        Build an invocation builder from a link. It uses the URI and the type of the link to initialize the invocation builder. The type is used as the initial value for the HTTP Accept header, if present.

        Parameters:
        link - link to build invocation from. Must not be null.
        Returns:
        newly created invocation builder.
        Throws:
        NullPointerException - in case link is null.
      • getSslContext

        SSLContext getSslContext()
        Get the SSL context configured to be used with the current client run-time.
        Returns:
        SSL context configured to be used with the current client run-time.
      • getHostnameVerifier

        HostnameVerifier getHostnameVerifier()
        Get the hostname verifier configured in the client or null in case no hostname verifier has been configured.
        Returns:
        client hostname verifier or null if not set.

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/ws/rs/client/client.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com/en/java/, Interface Client

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.