public abstract class Call
extends java.lang.Object
Constructor and Description |
---|
Call()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getClientAddress()
Returns the client address.
|
int |
getClientPort()
Returns the client port.
|
java.lang.String |
getHostDomain()
Returns the host domain.
|
int |
getHostPort()
Returns the host port.
|
java.util.logging.Logger |
getLogger()
Returns the logger.
|
java.lang.String |
getMethod()
Returns the request method.
|
Protocol |
getProtocol()
Returns the exact protocol (HTTP or HTTPS).
|
java.lang.String |
getReasonPhrase()
Returns the reason phrase.
|
protected Representation |
getRepresentation(java.io.InputStream stream)
Returns the representation wrapping the given stream.
|
protected Representation |
getRepresentation(java.nio.channels.ReadableByteChannel channel)
Returns the representation wrapping the given channel.
|
Series<Header> |
getRequestHeaders()
Returns the modifiable list of request headers.
|
java.lang.String |
getRequestUri()
Returns the URI on the request line (most like a relative reference, but
not necessarily).
|
Series<Header> |
getResponseHeaders()
Returns the modifiable list of server headers.
|
java.lang.String |
getServerAddress()
Returns the response address.
|
int |
getServerPort()
Returns the server port.
|
int |
getStatusCode()
Returns the status code.
|
java.security.Principal |
getUserPrincipal()
Returns the user principal.
|
java.lang.String |
getVersion()
Returns the protocol version used.
|
static boolean |
isBroken(java.lang.Throwable exception)
Returns true if the given exception is caused by a broken connection.
|
protected abstract boolean |
isClientKeepAlive()
Indicates if the client wants a persistent connection.
|
boolean |
isConfidential()
Indicates if the confidentiality of the call is ensured (ex: via SSL).
|
boolean |
isConnectionBroken(java.lang.Throwable exception)
Returns true if the given exception is caused by a broken connection.
|
protected boolean |
isKeepAlive()
Indicates if both the client and the server want a persistent connection.
|
protected boolean |
isRequestChunked()
Indicates if the request entity is chunked.
|
protected boolean |
isResponseChunked()
Indicates if the response entity is chunked.
|
protected abstract boolean |
isServerKeepAlive()
Indicates if the server wants a persistent connection.
|
protected void |
setClientAddress(java.lang.String clientAddress)
Sets the client address.
|
protected void |
setClientPort(int clientPort)
Sets the client port.
|
protected void |
setConfidential(boolean confidential)
Indicates if the confidentiality of the call is ensured (ex: via SSL).
|
void |
setHostDomain(java.lang.String hostDomain)
Sets the host domain name.
|
void |
setHostPort(int hostPort)
Sets the host port.
|
protected void |
setMethod(java.lang.String method)
Sets the request method.
|
void |
setProtocol(Protocol protocol)
Sets the exact protocol used (HTTP or HTTPS).
|
void |
setReasonPhrase(java.lang.String reasonPhrase)
Sets the reason phrase.
|
protected void |
setRequestUri(java.lang.String requestUri)
Sets the full request URI.
|
void |
setServerAddress(java.lang.String responseAddress)
Sets the response address.
|
void |
setServerPort(int serverPort)
Sets the server port.
|
void |
setStatusCode(int code)
Sets the status code.
|
void |
setUserPrincipal(java.security.Principal principal)
Sets the user principal.
|
void |
setVersion(java.lang.String version)
Sets the protocol version used.
|
public static boolean isBroken(java.lang.Throwable exception)
exception
- The exception to inspect.public java.lang.String getClientAddress()
public int getClientPort()
public java.lang.String getHostDomain()
public int getHostPort()
public java.util.logging.Logger getLogger()
public java.lang.String getMethod()
public Protocol getProtocol()
public java.lang.String getReasonPhrase()
protected Representation getRepresentation(java.io.InputStream stream)
stream
- The response input stream.protected Representation getRepresentation(java.nio.channels.ReadableByteChannel channel)
channel
- The response channel.public Series<Header> getRequestHeaders()
public java.lang.String getRequestUri()
public Series<Header> getResponseHeaders()
public java.lang.String getServerAddress()
public int getServerPort()
public int getStatusCode() throws java.io.IOException
java.io.IOException
public java.security.Principal getUserPrincipal()
public java.lang.String getVersion()
protected abstract boolean isClientKeepAlive()
public boolean isConfidential()
public boolean isConnectionBroken(java.lang.Throwable exception)
exception
- The exception to inspect.protected boolean isKeepAlive()
protected boolean isRequestChunked()
protected boolean isResponseChunked()
protected abstract boolean isServerKeepAlive()
protected void setClientAddress(java.lang.String clientAddress)
clientAddress
- The client address.protected void setClientPort(int clientPort)
clientPort
- The client port.protected void setConfidential(boolean confidential)
confidential
- True if the confidentiality of the call is ensured (ex: via
SSL).public void setHostDomain(java.lang.String hostDomain)
hostDomain
- The baseRef domain name.public void setHostPort(int hostPort)
hostPort
- The host port.protected void setMethod(java.lang.String method)
method
- The request method.public void setProtocol(Protocol protocol)
protocol
- The protocol.public void setReasonPhrase(java.lang.String reasonPhrase)
reasonPhrase
- The reason phrase.protected void setRequestUri(java.lang.String requestUri)
requestUri
- The full request URI.public void setServerAddress(java.lang.String responseAddress)
responseAddress
- The response address.public void setServerPort(int serverPort)
serverPort
- The server port.public void setStatusCode(int code)
code
- The status code.public void setUserPrincipal(java.security.Principal principal)
principal
- The user principal.public void setVersion(java.lang.String version)
version
- The protocol version used.Copyright © 2005-2024 Restlet.