public class MissionPackageReceiver extends android.content.BroadcastReceiver implements DirectoryWatcher.FileUpdateCallback, DropDown.OnStateListener, MPReceiveInitiator, FileTransferLog.Listener
android.content.BroadcastReceiver.PendingResult
DirectoryWatcher.FileUpdateCallback.OPERATION
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CONNECTION_TIMEOUT_SECS |
static int |
DEFAULT_FILESIZE_THRESHOLD_NOGO_MB |
static int |
DEFAULT_TRANSFER_TIMEOUT_SECS |
static java.lang.String |
MISSIONPACKAGE
Open Mission Package tool UI
|
static java.lang.String |
MISSIONPACKAGE_DELETE
Support other components deleting an existing Mission Package
|
static java.lang.String |
MISSIONPACKAGE_DOWNLOAD
Support downloading Mission Packages from a server
|
static java.lang.String |
MISSIONPACKAGE_LOG
View Log List list
|
static java.lang.String |
MISSIONPACKAGE_MAPSELECT
Select Map Item via Map View
|
static java.lang.String |
MISSIONPACKAGE_POST
Support sending a Mission Package to a server
|
static java.lang.String |
MISSIONPACKAGE_QUERY
Support querying Mission Packages available on a server
|
static java.lang.String |
MISSIONPACKAGE_REMOVE_LASSO
Remove a list of contents using the lasso tool
|
static java.lang.String |
MISSIONPACKAGE_SAVE
Support other components saving a Mission Package, and optionally sending it
|
static java.lang.String |
MISSIONPACKAGE_SEND
Callback intent sent after selecting send-to contacts from list
|
static java.lang.String |
MISSIONPACKAGE_UPDATE
Support other components saving changes to an existing Mission Package (without displaying UI/list)
|
static java.lang.String |
MISSIONPACKGE_DETAIL
Display details of a Mission Package that was received
|
protected static java.lang.String |
TAG |
static java.lang.String |
TOOL_ID |
Constructor and Description |
---|
MissionPackageReceiver(MapView mapView,
MissionPackageMapComponent component)
ctor
|
Modifier and Type | Method and Description |
---|---|
void |
add(MissionPackageManifest contents,
java.lang.String userName) |
void |
addDownloadHandler(MissionPackageDownloadHandler h) |
static void |
addFileToSkip(java.io.File file)
Deprecated.
|
void |
dispose() |
void |
fileUpdateCallback(java.io.File file,
DirectoryWatcher.FileUpdateCallback.OPERATION op,
long newestFileTime) |
MissionPackageMapComponent |
getComponent() |
long |
getConnectionTimeoutMS() |
long |
getHighThresholdInBytes() |
long |
getLowThresholdInBytes() |
MapView |
getMapView() |
static Contact |
getNetworkContact(java.lang.String contactUID)
Find contact by UID
|
long |
getNogoThresholdInBytes() |
static Route |
getRouteWithPoint(MapView mapView,
PointMapItem item) |
int |
getSecureWebServerPort() |
static java.lang.String |
getSender(FileTransfer fileTransfer) |
static java.lang.String |
getSenderCallsign(java.lang.String callsign,
java.lang.String uid) |
long |
getTransferTimeoutMS() |
static java.lang.String |
getURL(int serverPort,
java.lang.String action,
FileInfo fi,
java.util.List<BasicNameValuePair> additionalQueryParameters)
Build out URL to download a FileInfo DB file
|
MissionPackageViewUserState |
getUserState() |
int |
getWebServerPort() |
MPReceiver |
initiateReceive(java.lang.String fileName,
java.lang.String transferName,
java.lang.String sha256hash,
long expectedByteLength,
java.lang.String senderCallsign)
A new MP download request was received with the given details; the
ReceiveInitiator should set set the system up to receive the MP
and return an MPReceiver that will handle the download.
|
void |
onDropDownClose() |
void |
onDropDownSelectionRemoved() |
void |
onDropDownSizeChanged(double width,
double height) |
void |
onDropDownVisible(boolean v) |
void |
onEvent(FileTransferLog log,
boolean added) |
void |
onReceive(android.content.Context context,
android.content.Intent intent) |
void |
promptForNetworkSettings() |
void |
removeDownloadHandler(MissionPackageDownloadHandler h) |
void |
showQueryResultsView(java.util.List<MissionPackageQueryResult> results,
java.lang.String serverConnectString) |
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, goAsync, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras
protected static final java.lang.String TAG
public static final java.lang.String MISSIONPACKAGE
public static final java.lang.String MISSIONPACKGE_DETAIL
public static final java.lang.String MISSIONPACKAGE_LOG
public static final java.lang.String MISSIONPACKAGE_MAPSELECT
public static final java.lang.String MISSIONPACKAGE_SAVE
public static final java.lang.String MISSIONPACKAGE_SEND
public static final java.lang.String MISSIONPACKAGE_UPDATE
public static final java.lang.String MISSIONPACKAGE_DELETE
public static final java.lang.String MISSIONPACKAGE_POST
public static final java.lang.String MISSIONPACKAGE_QUERY
public static final java.lang.String MISSIONPACKAGE_DOWNLOAD
public static final java.lang.String MISSIONPACKAGE_REMOVE_LASSO
public static final int DEFAULT_FILESIZE_THRESHOLD_NOGO_MB
public static final int DEFAULT_CONNECTION_TIMEOUT_SECS
public static final int DEFAULT_TRANSFER_TIMEOUT_SECS
public static final java.lang.String TOOL_ID
public MissionPackageReceiver(MapView mapView, MissionPackageMapComponent component)
mapView
- component
- public MapView getMapView()
public void dispose()
public void onReceive(android.content.Context context, android.content.Intent intent)
onReceive
in class android.content.BroadcastReceiver
public void promptForNetworkSettings()
public static Route getRouteWithPoint(MapView mapView, PointMapItem item)
public void showQueryResultsView(java.util.List<MissionPackageQueryResult> results, java.lang.String serverConnectString)
public void onEvent(FileTransferLog log, boolean added)
onEvent
in interface FileTransferLog.Listener
public MissionPackageMapComponent getComponent()
public static java.lang.String getURL(int serverPort, java.lang.String action, FileInfo fi, java.util.List<BasicNameValuePair> additionalQueryParameters) throws java.lang.Exception
serverPort
- action
- fi
- additionalQueryParameters
- java.lang.Exception
public static Contact getNetworkContact(java.lang.String contactUID)
contactUID
- public MissionPackageViewUserState getUserState()
public MPReceiver initiateReceive(java.lang.String fileName, java.lang.String transferName, java.lang.String sha256hash, long expectedByteLength, java.lang.String senderCallsign)
MPReceiveInitiator
initiateReceive
in interface MPReceiveInitiator
fileName
- remote sender's preferred name for the filetransferName
- remote sender's logical name for the transfersha256hash
- sha256 hash of the file, as reported by the senderexpectedByteLength
- length of file, as reported by sender. 0 if
not given by sender.senderCallsign
- callsign of the sending devicepublic int getWebServerPort()
public int getSecureWebServerPort()
public long getLowThresholdInBytes()
public long getHighThresholdInBytes()
public long getNogoThresholdInBytes()
public long getTransferTimeoutMS()
public long getConnectionTimeoutMS()
public static java.lang.String getSender(FileTransfer fileTransfer)
public static java.lang.String getSenderCallsign(java.lang.String callsign, java.lang.String uid)
@Deprecated public static void addFileToSkip(java.io.File file)
public void fileUpdateCallback(java.io.File file, DirectoryWatcher.FileUpdateCallback.OPERATION op, long newestFileTime)
fileUpdateCallback
in interface DirectoryWatcher.FileUpdateCallback
public void add(MissionPackageManifest contents, java.lang.String userName)
public void onDropDownSelectionRemoved()
onDropDownSelectionRemoved
in interface DropDown.OnStateListener
public void onDropDownVisible(boolean v)
onDropDownVisible
in interface DropDown.OnStateListener
public void onDropDownSizeChanged(double width, double height)
onDropDownSizeChanged
in interface DropDown.OnStateListener
public void onDropDownClose()
onDropDownClose
in interface DropDown.OnStateListener
public void addDownloadHandler(MissionPackageDownloadHandler h)
public void removeDownloadHandler(MissionPackageDownloadHandler h)