public class NetworkOperationManager
extends java.lang.Object
HTTPRequestService
to perform
asynchronous operations (including but not limited to HTTP, FTP, etc network operations).
Request types should be registered with this class. ATAK Core tools can use Parcelable to pass
data to/from its Operation
instances. See Mission Package Tool for sample code.
Due to plugin class loading constraints, plugins should use something like JSON to to pass data
to/from its Operation
instances. See Enterprise Sync Plugin for sample code. Both
tools and plugins can receive callbacks upon completion. Use HTTPRequestManager
to
initiate operations.Modifier and Type | Field and Description |
---|---|
static int |
REQUEST_TYPE_FTP_UPLOAD |
static int |
REQUEST_TYPE_GET_CLIENT_LIST |
static int |
REQUEST_TYPE_GET_COT_EVENT |
static int |
REQUEST_TYPE_GET_COT_HISTORY |
static int |
REQUEST_TYPE_GET_FILE
This code provides a few simple Network Operation Types which may be used by other
tools which don't require special logic
|
static int |
REQUEST_TYPE_GET_FILES |
static int |
REQUEST_TYPE_GET_SERVER_GROUPS |
static int |
REQUEST_TYPE_GET_SERVER_VERSION |
Constructor and Description |
---|
NetworkOperationManager() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getClass(int requestType) |
static Operation |
getOperation(int requestType) |
static java.lang.Integer |
register(java.lang.String clazz,
Operation handler)
Register handler, return unique requestType.
|
static java.lang.Integer |
register(java.lang.String clazz,
Operation handler,
java.lang.String salt)
Register handler, return unique requestType.
|
public static final int REQUEST_TYPE_GET_FILE
public static final int REQUEST_TYPE_GET_FILES
public static final int REQUEST_TYPE_FTP_UPLOAD
public static final int REQUEST_TYPE_GET_CLIENT_LIST
public static final int REQUEST_TYPE_GET_SERVER_VERSION
public static final int REQUEST_TYPE_GET_COT_EVENT
public static final int REQUEST_TYPE_GET_COT_HISTORY
public static final int REQUEST_TYPE_GET_SERVER_GROUPS
public static java.lang.Integer register(java.lang.String clazz, Operation handler)
clazz
- the class to registerhandler
- the operation handlerpublic static java.lang.Integer register(java.lang.String clazz, Operation handler, java.lang.String salt)
clazz
- the class to registerhandler
- the operation handlersalt
- the salt to be used to generate a unique idpublic static Operation getOperation(int requestType)
public static java.lang.String getClass(int requestType)