public interface ProtocolRequestWriter extends ProtocolWriter
BytesWriter
Modifier and Type | Method and Description |
---|---|
ProtocolRequestWriter |
beginRequest()
Start a request
|
ProtocolRequestWriter |
endRequest()
Finish a request
|
ProtocolRequestWriter |
writeData(DataSource source)
Set a DataSource as request data
|
ProtocolRequestWriter |
writeMethodName(java.lang.String name)
Write the method name of the request
|
ProtocolRequestWriter |
writeName(java.lang.String name)
Write the name of a parameter
|
ProtocolRequestWriter |
writeValue(boolean value)
Write the value of a parameter
|
ProtocolRequestWriter |
writeValue(double value)
Write the value of a parameter
|
ProtocolRequestWriter |
writeValue(float value)
Write the value of a parameter
|
ProtocolRequestWriter |
writeValue(long value)
Write the value of a parameter
|
ProtocolRequestWriter |
writeValue(java.lang.Object value)
Write the value of a parameter
|
ProtocolRequestWriter |
writeValue(java.lang.String value)
Write the value of a parameter
|
close
ProtocolRequestWriter beginRequest() throws java.io.IOException
java.io.IOException
- on a failed IO operationProtocolRequestWriter writeData(DataSource source) throws java.io.IOException
source
- a non-null DataSource objectjava.io.IOException
- on a failed IO operationjava.lang.IllegalArgumentException
- on a null argumentProtocolRequestWriter writeMethodName(java.lang.String name) throws java.io.IOException
name
- a non-null stringjava.io.IOException
- on a failed IO operationjava.lang.IllegalArgumentException
- on a null argumentProtocolRequestWriter writeName(java.lang.String name) throws java.io.IOException
ProtocolWriter
Every call of this method should be followed by a call to one the variants of writeValue()
writeName
in interface ProtocolWriter
name
- the non-null name of the parameterjava.io.IOException
- on a failed IO operationProtocolRequestWriter writeValue(java.lang.Object value) throws java.io.IOException
ProtocolWriter
Every call to this or the other variants of writeValue()
should be preceded by a call to
ProtocolWriter.writeName(String).
The provided argument must be a non-null object, of type String
or any of the boxed variants of
primitive types. An object will be accepted if Class.isPrimitive() returns true for the object type.
writeValue
in interface ProtocolWriter
value
- a non-null objectjava.io.IOException
- on a failed IO operationProtocolRequestWriter writeValue(java.lang.String value) throws java.io.IOException
ProtocolWriter
Every call to this or the other variants of writeValue()
should be preceded by a call to
ProtocolWriter.writeName(String).
writeValue
in interface ProtocolWriter
value
- a non-null String objectjava.io.IOException
- on failed IO operationsProtocolRequestWriter writeValue(double value) throws java.io.IOException
ProtocolWriter
Every call to this or the other variants of writeValue()
should be preceded by a call to
ProtocolWriter.writeName(String).
writeValue
in interface ProtocolWriter
value
- a doublejava.io.IOException
- on a failed IO operationProtocolRequestWriter writeValue(float value) throws java.io.IOException
ProtocolWriter
Every call to this or the other variants of writeValue()
should be preceded by a call to
ProtocolWriter.writeName(String).
writeValue
in interface ProtocolWriter
value
- a floatjava.io.IOException
- on a failed IO operationProtocolRequestWriter writeValue(long value) throws java.io.IOException
ProtocolWriter
Every call to this or the other variants of writeValue()
should be preceded by a call to
ProtocolWriter.writeName(String).
writeValue
in interface ProtocolWriter
value
- a longjava.io.IOException
- on a failed IO operationProtocolRequestWriter writeValue(boolean value) throws java.io.IOException
ProtocolWriter
Every call to this or the other variants of writeValue()
should be preceded by a call to
ProtocolWriter.writeName(String).
writeValue
in interface ProtocolWriter
value
- a booleanjava.io.IOException
- on a failed IO operationProtocolRequestWriter endRequest() throws java.io.IOException
java.io.IOException
- on a failed IO operation