- java.lang.Object
-
- swim.io.http.AbstractHttpClient
-
- All Implemented Interfaces:
FlowContext,HttpClient,IpContext
- Direct Known Subclasses:
AbstractWsClient
public abstract class AbstractHttpClient extends Object implements HttpClient, IpContext, FlowContext
-
-
Field Summary
Fields Modifier and Type Field Description protected HttpClientContextcontext
-
Constructor Summary
Constructors Constructor Description AbstractHttpClient()
-
Method Summary
Modifier and Type Method Description voidbecome(IpSocket socket)StringcipherSuite()Returns the cryptographic cipher suite used by the underlying network connection.voidclose()voiddidBecome(IpSocket socket)voiddidConnect()voiddidDisconnect()voiddidFail(Throwable error)voiddidRequest(HttpRequest<?> request)voiddidRespond(HttpResponse<?> response)voiddidSecure()voiddidTimeout()voiddoRequest(HttpRequester<?> requester)FlowControlflowControl()Returns the currentFlowControlstate of the underlying network channel.voidflowControl(FlowControl flowControl)Enqueues an atomic replacement of the underlying network channel's flow control state with a newflowControl.FlowControlflowControl(FlowModifier flowModifier)Enqueues an atomic modification to the underlying network channel's flow control state by applying aflowModifierdelta.HttpClientContexthttpClientContext()HttpSettingshttpSettings()longidleTimeout()booleanisClient()Returnstrueif the underlying network channel initiated an outgoing connection.booleanisConnected()Returnstrueif the underlying network channel is currently connected.booleanisSecure()Returnstrueif the underlying network transport is encrypted.booleanisServer()Returnstrueif the underlying network channel accepted an incoming connection.InetSocketAddresslocalAddress()Returns the IP address and port of the local endpoint of the underlying network connection.Collection<Certificate>localCertificates()Returns the certificate chain used to authenticate the local endpoint of the underlying network connection.PrincipallocalPrincipal()Returns the authenticated identity of the local endpoint of the underlying network connection.voidreadResponse()InetSocketAddressremoteAddress()Returns the IP address and port of the remote endpoint of the underlying network connection.Collection<Certificate>remoteCertificates()Returns the certificate chain used to authenticate the remote endpoint of the underlying network connection.PrincipalremotePrincipal()Returns the authenticated identity of the remote endpoint of the underlying network connection.StringsecurityProtocol()Returns the name of the transport-layer security protocol used by the underlying network connection.voidsetHttpClientContext(HttpClientContext context)voidwillBecome(IpSocket socket)voidwillConnect()voidwillRequest(HttpRequest<?> request)voidwillRespond(HttpResponse<?> response)voidwillSecure()
-
-
-
Field Detail
-
context
protected HttpClientContext context
-
-
Method Detail
-
httpClientContext
public HttpClientContext httpClientContext()
- Specified by:
httpClientContextin interfaceHttpClient
-
setHttpClientContext
public void setHttpClientContext(HttpClientContext context)
- Specified by:
setHttpClientContextin interfaceHttpClient
-
idleTimeout
public long idleTimeout()
- Specified by:
idleTimeoutin interfaceHttpClient
-
willRequest
public void willRequest(HttpRequest<?> request)
- Specified by:
willRequestin interfaceHttpClient
-
didRequest
public void didRequest(HttpRequest<?> request)
- Specified by:
didRequestin interfaceHttpClient
-
willRespond
public void willRespond(HttpResponse<?> response)
- Specified by:
willRespondin interfaceHttpClient
-
didRespond
public void didRespond(HttpResponse<?> response)
- Specified by:
didRespondin interfaceHttpClient
-
willConnect
public void willConnect()
- Specified by:
willConnectin interfaceHttpClient
-
didConnect
public void didConnect()
- Specified by:
didConnectin interfaceHttpClient
-
willSecure
public void willSecure()
- Specified by:
willSecurein interfaceHttpClient
-
didSecure
public void didSecure()
- Specified by:
didSecurein interfaceHttpClient
-
willBecome
public void willBecome(IpSocket socket)
- Specified by:
willBecomein interfaceHttpClient
-
didBecome
public void didBecome(IpSocket socket)
- Specified by:
didBecomein interfaceHttpClient
-
didTimeout
public void didTimeout()
- Specified by:
didTimeoutin interfaceHttpClient
-
didDisconnect
public void didDisconnect()
- Specified by:
didDisconnectin interfaceHttpClient
-
didFail
public void didFail(Throwable error)
- Specified by:
didFailin interfaceHttpClient
-
isConnected
public boolean isConnected()
Description copied from interface:IpContextReturnstrueif the underlying network channel is currently connected.- Specified by:
isConnectedin interfaceIpContext
-
isClient
public boolean isClient()
Description copied from interface:IpContextReturnstrueif the underlying network channel initiated an outgoing connection.
-
isServer
public boolean isServer()
Description copied from interface:IpContextReturnstrueif the underlying network channel accepted an incoming connection.
-
isSecure
public boolean isSecure()
Description copied from interface:IpContextReturnstrueif the underlying network transport is encrypted.
-
securityProtocol
public String securityProtocol()
Description copied from interface:IpContextReturns the name of the transport-layer security protocol used by the underlying network connection. Returnsnullif the underlying network channel is not currently connected, or if the underlying network connection is not secure.- Specified by:
securityProtocolin interfaceIpContext
-
cipherSuite
public String cipherSuite()
Description copied from interface:IpContextReturns the cryptographic cipher suite used by the underlying network connection. Returnsnullif the underlying network channel is not currently connected, or if the underlying network connection is not secure.- Specified by:
cipherSuitein interfaceIpContext
-
localAddress
public InetSocketAddress localAddress()
Description copied from interface:IpContextReturns the IP address and port of the local endpoint of the underlying network connection. Returnsnullif the underlying network channel is not currently connected.- Specified by:
localAddressin interfaceIpContext
-
localPrincipal
public Principal localPrincipal()
Description copied from interface:IpContextReturns the authenticated identity of the local endpoint of the underlying network connection. Returnsnullif the underlying network channel is not currently connected, or if the underlying network connection is not authenticated.- Specified by:
localPrincipalin interfaceIpContext
-
localCertificates
public Collection<Certificate> localCertificates()
Description copied from interface:IpContextReturns the certificate chain used to authenticate the local endpoint of the underlying network connection. Returnsnullif the underlying network channel is not currently connected, or if the underlying network connection is not authenticated.- Specified by:
localCertificatesin interfaceIpContext
-
remoteAddress
public InetSocketAddress remoteAddress()
Description copied from interface:IpContextReturns the IP address and port of the remote endpoint of the underlying network connection. Returnsnullif the underlying network channel is not currently connected.- Specified by:
remoteAddressin interfaceIpContext
-
remotePrincipal
public Principal remotePrincipal()
Description copied from interface:IpContextReturns the authenticated identity of the remote endpoint of the underlying network connection. Returnsnullif the underlying network channel is not currently connected, or if the underlying network connection is not authenticated.- Specified by:
remotePrincipalin interfaceIpContext
-
remoteCertificates
public Collection<Certificate> remoteCertificates()
Description copied from interface:IpContextReturns the certificate chain used to authenticate the remote endpoint of the underlying network connection. Returnsnullif the underlying network channel is not currently connected, or if the underlying network connection is not authenticated.- Specified by:
remoteCertificatesin interfaceIpContext
-
flowControl
public FlowControl flowControl()
Description copied from interface:FlowContextReturns the currentFlowControlstate of the underlying network channel.- Specified by:
flowControlin interfaceFlowContext
-
flowControl
public void flowControl(FlowControl flowControl)
Description copied from interface:FlowContextEnqueues an atomic replacement of the underlying network channel's flow control state with a newflowControl.- Specified by:
flowControlin interfaceFlowContext
-
flowControl
public FlowControl flowControl(FlowModifier flowModifier)
Description copied from interface:FlowContextEnqueues an atomic modification to the underlying network channel's flow control state by applying aflowModifierdelta.- Specified by:
flowControlin interfaceFlowContext
-
httpSettings
public HttpSettings httpSettings()
-
doRequest
public void doRequest(HttpRequester<?> requester)
-
readResponse
public void readResponse()
-
become
public void become(IpSocket socket)
-
close
public void close()
-
-