Package org.apache.pivot.web
Class PostQuery
- java.lang.Object
-
- org.apache.pivot.util.concurrent.Task<V>
-
- org.apache.pivot.io.IOTask<V>
-
- org.apache.pivot.web.Query<java.net.URL>
-
- org.apache.pivot.web.PostQuery
-
public class PostQuery extends Query<java.net.URL>
Executes an HTTP POST operation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.pivot.web.Query
Query.Method, Query.Status
-
Nested classes/interfaces inherited from class org.apache.pivot.io.IOTask
IOTask.MonitoredInputStream, IOTask.MonitoredOutputStream
-
-
Field Summary
Fields Modifier and Type Field Description static Query.Method
METHOD
-
Fields inherited from class org.apache.pivot.web.Query
DEFAULT_PORT
-
Fields inherited from class org.apache.pivot.io.IOTask
bytesReceived, bytesSent
-
Fields inherited from class org.apache.pivot.util.concurrent.Task
abort, DEFAULT_EXECUTOR_SERVICE, timeout
-
-
Constructor Summary
Constructors Constructor Description PostQuery(java.lang.String hostname, int port, java.lang.String path, boolean secure)
PostQuery(java.lang.String hostname, int port, java.lang.String path, boolean secure, java.util.concurrent.ExecutorService executorService)
PostQuery(java.lang.String hostname, java.lang.String path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.URL
execute()
Synchronously executes the POST operation.Query.Method
getMethod()
java.lang.Object
getValue()
Returns the value that will be POSTed to the server when the query is executed.void
setValue(java.lang.Object value)
Sets the value that will be POSTed to the server when the query is executed.-
Methods inherited from class org.apache.pivot.web.Query
execute, getBytesExpected, getBytesReceived, getBytesSent, getHostname, getHostnameVerifier, getLocation, getParameters, getPath, getPort, getProxy, getQueryListeners, getRequestHeaders, getResponseHeaders, getSerializer, getStatus, isSecure, setHostnameVerifier, setProxy, setSerializer
-
Methods inherited from class org.apache.pivot.util.concurrent.Task
abort, execute, execute, getBackgroundThread, getExecutorService, getFault, getResult, getTimeout, isPending, setTimeout
-
-
-
-
Field Detail
-
METHOD
public static final Query.Method METHOD
-
-
Constructor Detail
-
PostQuery
public PostQuery(java.lang.String hostname, java.lang.String path)
-
PostQuery
public PostQuery(java.lang.String hostname, int port, java.lang.String path, boolean secure)
-
PostQuery
public PostQuery(java.lang.String hostname, int port, java.lang.String path, boolean secure, java.util.concurrent.ExecutorService executorService)
-
-
Method Detail
-
getMethod
public Query.Method getMethod()
-
getValue
public java.lang.Object getValue()
Returns the value that will be POSTed to the server when the query is executed.- Returns:
- The value to send.
-
setValue
public void setValue(java.lang.Object value)
Sets the value that will be POSTed to the server when the query is executed.- Parameters:
value
- The value to POST to the server.
-
execute
public java.net.URL execute() throws QueryException
Synchronously executes the POST operation.- Specified by:
execute
in classTask<java.net.URL>
- Returns:
- A URL that uniquely identifies the location of the resource
created on the server by the operation, or
null
if the server did not return a location. - Throws:
QueryException
-
-