public abstract class ResponseSupport extends Object implements Response
Response.Type
Modifier and Type | Field and Description |
---|---|
protected Command |
cmd |
protected boolean |
didRead |
protected boolean |
isError |
protected ResponseStatus |
status |
protected Response.Type |
type |
Constructor and Description |
---|
ResponseSupport(Command cmd,
Response.Type type) |
Modifier and Type | Method and Description |
---|---|
protected void |
assertResponseRead()
a bit aggressive but to force out the little bugs ..
|
boolean |
didRead() |
protected boolean |
didRead(boolean value)
called by child classes to indicate if & when their read operation has completed
|
ResponseStatus |
getStatus() |
Response.Type |
getType() |
boolean |
isError() |
void |
write(OutputStream out)
Writes itself to the provided
OutputStream . |
protected Response.Type type
protected ResponseStatus status
protected Command cmd
protected boolean didRead
protected boolean isError
public ResponseSupport(Command cmd, Response.Type type)
protected final boolean didRead(boolean value)
protected final void assertResponseRead()
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 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.