|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpivot.util.concurrent.Task<V>
pivot.io.IOTask<V>
pivot.web.Query<V>
V
- The type of the value retrieved or sent via the query. For GET operations,
it is Object
; for POST operations, the type is URL
. For PUT
and DELETE, it is Void
.public abstract class Query<V>
Abstract base class for web queries. A web query is an asynchronous operation that executes one of the following HTTP methods:
Nested Class Summary | |
---|---|
class |
Query.ArgumentsDictionary
Arguments dictionary implementation. |
protected static class |
Query.Method
The supported HTTP methods. |
class |
Query.RequestPropertiesDictionary
Request properties dictionary implementation. |
class |
Query.ResponsePropertiesDictionary
Response properties dictionary implementation. |
Nested classes/interfaces inherited from class pivot.io.IOTask |
---|
IOTask.MonitoredInputStream, IOTask.MonitoredOutputStream |
Field Summary | |
---|---|
static int |
DEFAULT_PORT
|
Fields inherited from class pivot.io.IOTask |
---|
bytesReceived, bytesSent |
Fields inherited from class pivot.util.concurrent.Task |
---|
abort, timeout |
Constructor Summary | |
---|---|
Query(java.lang.String hostname,
int port,
java.lang.String path,
boolean secure)
Creates a new web query. |
Method Summary | |
---|---|
protected java.lang.Object |
execute(Query.Method method,
java.lang.Object value)
|
Query.ArgumentsDictionary |
getArguments()
Returns the web query's arguments dictionary. |
long |
getBytesExpected()
Gets the number of bytes that are expected to be received from the server in the body of the server's HTTP response. |
long |
getBytesReceived()
Gets the number of bytes that have been received from the server in the body of the server's HTTP response. |
long |
getBytesSent()
Gets the number of bytes that have been sent in the body of this query's HTTP request. |
java.lang.String |
getHostname()
|
javax.net.ssl.HostnameVerifier |
getHostnameVerifier()
|
java.net.URL |
getLocation()
|
java.lang.String |
getPath()
|
int |
getPort()
|
ListenerList<QueryListener<V>> |
getQueryListeners()
Returns the query listener list. |
Query.RequestPropertiesDictionary |
getRequestProperties()
Returns the web query's request property dictionary. |
Query.ResponsePropertiesDictionary |
getResponseProperties()
Returns the web query's response property dictionary. |
Serializer<?> |
getSerializer()
Returns the serializer used to stream the value passed to or from the web query. |
boolean |
isSecure()
|
void |
setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
|
void |
setSerializer(Serializer<?> serializer)
Sets the serializer used to stream the value passed to or from the web query. |
Methods inherited from class pivot.util.concurrent.Task |
---|
abort, execute, execute, getDispatcher, getFault, getResult, getTimeout, isPending, setTimeout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_PORT
Constructor Detail |
---|
public Query(java.lang.String hostname, int port, java.lang.String path, boolean secure)
hostname
- port
- path
- secure
- Method Detail |
---|
public java.lang.String getHostname()
public java.lang.String getPath()
public int getPort()
public boolean isSecure()
public javax.net.ssl.HostnameVerifier getHostnameVerifier()
public void setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
public java.net.URL getLocation()
public Query.ArgumentsDictionary getArguments()
public Query.RequestPropertiesDictionary getRequestProperties()
public Query.ResponsePropertiesDictionary getResponseProperties()
public Serializer<?> getSerializer()
JSONSerializer
is used.
public void setSerializer(Serializer<?> serializer)
serializer
- The serializer (must be non-null).public long getBytesSent()
For POST and PUT requests, this number will increment in between the
connected
and
requestSent
phases of the
QueryListener lifecycle methods. Interested listeners can poll
for this value during that phase.
public long getBytesReceived()
This number will increment in between the
requestSent
and
responseReceived
phases of
the QueryListener lifecycle methods. Interested listeners can
poll for this value during that phase.
public long getBytesExpected()
If the server did not specify a Content-Length HTTP response header, a value of -1 will be returned to indicate that this value is unknown.
protected java.lang.Object execute(Query.Method method, java.lang.Object value) throws QueryException
QueryException
public ListenerList<QueryListener<V>> getQueryListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |