|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.glassfish.jersey.jetty.connector.JettyConnector
public class JettyConnector
A Connector that utilizes the Jetty HTTP Client to send and receive
HTTP request and responses.
ClientProperties.ASYNC_THREADPOOL_SIZEClientProperties.CONNECT_TIMEOUTClientProperties.FOLLOW_REDIRECTSClientProperties.PROXY_URIClientProperties.PROXY_USERNAMEClientProperties.PROXY_PASSWORDClientProperties.PROXY_PASSWORDJettyClientProperties.SSL_CONFIGJettyClientProperties.PREEMPTIVE_BASIC_AUTHENTICATIONJettyClientProperties.DISABLE_COOKIES
ClientConfig config = new ClientConfig();
Connector connector = new JettyConnector(config);
config.connector(connector);
Client client = ClientBuilder.newClient(config);
// async request
WebTarget target = client.target("http://localhost:8080");
Future<Response> future = target.path("resource").request().async().get();
// wait for 3 seconds
Response response = future.get(3, TimeUnit.SECONDS);
String entity = response.readEntity(String.class);
client.close();
This connector supports only entity buffering.
Defining the property ClientProperties.REQUEST_ENTITY_PROCESSING has no effect on this connector.
| Method Summary | |
|---|---|
ClientResponse |
apply(ClientRequest jerseyRequest)
|
Future<?> |
apply(ClientRequest jerseyRequest,
AsyncConnectorCallback callback)
|
void |
close()
|
CookieStore |
getCookieStore()
Get the CookieStore. |
org.eclipse.jetty.client.HttpClient |
getHttpClient()
Get the HttpClient. |
String |
getName()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public org.eclipse.jetty.client.HttpClient getHttpClient()
HttpClient.
HttpClient.public CookieStore getCookieStore()
CookieStore.
CookieStore instance or null when
JettyClientProperties.DISABLE_COOKIES set to true.
public ClientResponse apply(ClientRequest jerseyRequest)
throws javax.ws.rs.ProcessingException
apply in interface Connectorapply in interface Inflector<ClientRequest,ClientResponse>javax.ws.rs.ProcessingException
public Future<?> apply(ClientRequest jerseyRequest,
AsyncConnectorCallback callback)
apply in interface Connectorpublic String getName()
getName in interface Connectorpublic void close()
close in interface Connector
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||