EventBus com.mobiledgex.matchingengine.MatchingEngine.getEdgeEventsBus | ( | ) |
This is an event bus for EdgeEvents. You can specify your own ExecutorService with MatchingEgnine init.
If you want to send a response back to the server, call getEdgeEventsConnection() to access Utility functions to help with the response.
boolean com.mobiledgex.matchingengine.MatchingEngine.isAutoMigrateEdgeEventsConnection | ( | ) |
Automatically switched EdgeEventsConnection
synchronized boolean com.mobiledgex.matchingengine.EdgeEventsConnection.postLatencyUpdate | ( | Site | site, |
Location | location | ||
) |
Outbound ClientEdgeEvent to DME. Post already collected site statistics. A DME administrator of your Application may request an client application to collect performance NetTest stats to their current AppInst with the ServerEdgeEvent EVENT_LATENCY_REQUEST.
site | |
location |
synchronized boolean com.mobiledgex.matchingengine.EdgeEventsConnection.postLocationUpdate | ( | Location | location | ) |
Outbound Client to Server location update. If there is a closer cloudlet, this will cause a Guava ServerEdgeEvent EVENT_CLOUDLET_UPDATE message to be sent to subscribers.
location | (Android location format) |
synchronized boolean com.mobiledgex.matchingengine.MatchingEngine.restartEdgeEvents | ( | ) | throws DmeDnsException |
This is required, if the app needs to swap AppInst edge servers, and auto reconnect to the next DME's EdgeEventsConnection is disabled.
DmeDnsException | if the next DME for the EdgeEventsConnection for some reason doesn't exist in DNS yet. |
CompletableFuture< Boolean > com.mobiledgex.matchingengine.MatchingEngine.restartEdgeEventsFuture | ( | ) |
CompletableFuture wrapper for restartEdgeEvents running on MatchingEngine ExecutorService pool. The background task might throw a DmeDnsException exception, and return false.
edgeEventsConfig | the configuration for background run EdgeEvents. |
synchronized boolean com.mobiledgex.matchingengine.EdgeEventsConnection.runEdgeEvents | ( | ) |
Fires off tasks to run EdgeEvents monitoring as per config. EdgeEvents must be enabled. This is separate from the normal SDK handled events, like latency requests and new cloudlet availability. Those EdgeEvents, you should subscribe to.
Cancel with stopEdgeEvents.
dmeHost | DME hostname. |
dmePort | |
edgeEventsConfig | |
network | override network. |
synchronized void com.mobiledgex.matchingengine.MatchingEngine.setAutoMigrateEdgeEventsConnection | ( | boolean | autoMigrateEdgeEventsConnection | ) |
When you switch AppInsts between Cloudlets, the EdgeEventsConnection should also migrate. If set to false, when notified of a newCLoudlet availability, call "switchedToNewFindCloudlet() to indicate the app has finally migrated to the new cloudlet.
autoMigrateEdgeEventsConnection |
synchronized void com.mobiledgex.matchingengine.MatchingEngine.setEnableEdgeEvents | ( | boolean | enableEdgeEvents | ) |
Enable or disable edge events API.
enableEdgeEvents | this defaults to true in the MatchingEngine. |
synchronized boolean com.mobiledgex.matchingengine.MatchingEngine.startEdgeEvents | ( | EdgeEventsConfig | edgeEventsConfig | ) |
startEdgeEvents() begins processing as soon as a FindCloudletReply is FIND_FOUND with the EdgeEventsConfig given.
If you want to handle the EdgeEvents with a custom handler, call getEdgeEventsBus(), register your class, and @Subscribe to either these event objects:
The errors on the EdgeEventsBus is useful for the app to attach a handler
edgeEventsConfig | a events profile on how to monitor the edgeConnection state. null to use defaults. |
synchronized CompletableFuture< Boolean > com.mobiledgex.matchingengine.MatchingEngine.startEdgeEventsFuture | ( | EdgeEventsConfig | edgeEventsConfig | ) |
CompletableFuture wrapper for startEdgeEvents running on MatchingEngine ExecutorService pool.
edgeEventsConfig | the configuration for background run EdgeEvents. |
synchronized boolean com.mobiledgex.matchingengine.MatchingEngine.stopEdgeEvents | ( | ) |
Stops processsing of DME server pushed EdgeEvents.
CompletableFuture< Boolean > com.mobiledgex.matchingengine.MatchingEngine.stopEdgeEventsFuture | ( | ) |
Stops processsing of DME server pushed EdgeEvents. Futures version.
synchronized boolean com.mobiledgex.matchingengine.MatchingEngine.switchedToNextCloudlet | ( | ) | throws DmeDnsException |
Just an alias to restartEdgeEvents. Blocking call.
DmeDnsException | if the next DME for the EdgeEventsConnection for some reason doesn't exist in DNS yet. |
synchronized boolean com.mobiledgex.matchingengine.EdgeEventsConnection.testConnectAndPostLatencyUpdate | ( | int | internalPort, |
Location | location | ||
) |
Outbound ClientEdgeEvent to DME. Post site statistics with the most recent FindCloudletReply. A DME administrator of your Application may request an client application to collect performance stats to their current AppInst with the ServerEdgeEvent EVENT_LATENCY_REQUEST.
This utility function uses the default network path. It does not swap network interfaces.
internalPort | the internal port of your App definition. Not the public mapped port for the edge instance. |
android | format GPS location. |
synchronized boolean com.mobiledgex.matchingengine.EdgeEventsConnection.testConnectAndPostLatencyUpdate | ( | Location | location | ) |
Outbound ClientEdgeEvent to DME. Post site statistics with the most recent FindCloudletReply. A DME administrator of your Application may request an client application to collect performance NetTest stats to their current AppInst with the ServerEdgeEvent EVENT_LATENCY_REQUEST.
This utility function uses the default network path. It does not swap network interfaces.
android | format GPS location. |
number | of samples to test |
synchronized boolean com.mobiledgex.matchingengine.EdgeEventsConnection.testPingAndPostLatencyUpdate | ( | Location | location | ) |
Outbound ClientEdgeEvent to DME. Post site statistics with the most recent FindCloudletReply. A DME administrator of your Application may request an client application to collect performance stats to their current AppInst with the ServerEdgeEvent EVENT_LATENCY_REQUEST.
android | format location |