All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.jetty.client.ProtocolHandler Maven / Gradle / Ivy

There is a newer version: 2024.11.18751.20241128T090041Z-241100
Show newest version
// 
// ========================================================================
// Copyright (c) 1995-2022 Mort Bay Consulting Pty Ltd and others.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
// 
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
// 
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
// 
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
// 
package org.eclipse.jetty.client;

import org.eclipse.jetty.client.api.Request;
import org.eclipse.jetty.client.api.Response;

/**
 *  

A protocol handler performs HTTP protocol operations on * behalf of the application, typically like a browser would.

*

A typical example is handling HTTP redirects. {@link HttpClient} * could just return the redirect response to the application, * but the application would have to implement the redirect * functionality (while browsers do this automatically).

* * @deprecated The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported. */ @Deprecated(since = "2021-05-27") public interface ProtocolHandler { /** * @return a unique name among protocol handlers */ String getName(); /** *

Inspects the given {@code request} and {@code response} * to detect whether this protocol handler should handle them.

*

For example, a redirect protocol handler can inspect the * response code and return true if it is a redirect response code.

*

This method is being called just after the response line has * been parsed, and before the response headers are available.

* * @param request the request to accept * @param response the response to accept * @return true if this protocol handler can handle the given request and response */ boolean accept(Request request, Response response); /** * @return a response listener that will handle the request and response * on behalf of the application. */ Response.Listener getResponseListener(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy