public final class VirtualResponse extends Object implements Response
Response.Type
Constructor and Description |
---|
VirtualResponse() |
VirtualResponse(ResponseStatus status) |
Modifier and Type | Method and Description |
---|---|
boolean |
didRead() |
ResponseStatus |
getStatus() |
Response.Type |
getType() |
boolean |
isError() |
void |
read(InputStream in)
Reads itself from the provided
InputStream |
void |
write(OutputStream out)
Writes itself to the provided
OutputStream . |
public VirtualResponse()
public VirtualResponse(ResponseStatus status)
public boolean didRead()
didRead
in interface Response
Message.read(java.io.InputStream)
public ResponseStatus getStatus()
public Response.Type getType()
getType
in interface Response
Response.Type
of this response.public boolean isError()
public void read(InputStream in) throws ClientRuntimeException, ProviderException
Message
InputStream
read
in interface Message
in
- the steam to read from.ClientRuntimeException
- to indicate a system error, potentially network related
and hopefully recoverable. Typically used to wrap and propagate the IO stream's thrown
IOException
s.ProviderException
- to indicate operational error not directly related to the stream,
and should be treated as a bug.public void write(OutputStream out) throws ClientRuntimeException, ProviderException
Message
OutputStream
.write
in interface Message
out
- the stream to write to.ClientRuntimeException
- to indicate a system error, potentially network related
and hopefully recoverable. Typically used to wrap and propagate the IO stream's thrown
IOException
s.ProviderException
- to indicate operational error not directly related to the stream,
and should be treated as a bug.Copyright © 2009–2019. All rights reserved.