|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.safs.sockets.AbstractProtocolRunner org.safs.android.LocalControlRunner
public class LocalControlRunner
This class is the "local" controller side implementation of an AbstractSocketRunner. The class provides the SocketProtocol implementation needed by the DJavaHook to communicate with the SAFS Messenger Service on an Android device or emulator.
When using the Android Emulator, the emulator must be configured to "see" Socket requests on its local port 2410 coming from the controller on port 2411. Do this with the adb forwarding command to the running emulator as follows:
adb forward tcp:2411 tcp:2410
There is an initial handshake or verification that occurs between this remote controller server and the on-device Service to confirm the device port owner is a SAFS TCP Messenger Service.
DJavaHook
,
MessengerService
,
DroidEngine
Field Summary |
---|
Fields inherited from class org.safs.sockets.AbstractProtocolRunner |
---|
_debugEnabled, protocolserver, runnerlisteners |
Constructor Summary | |
---|---|
LocalControlRunner()
Default no-op constructor setting the Runner to use all defaults. |
|
LocalControlRunner(LocalControlListener listener)
Constructor setting Runner to use all defaults while registering a LocalControlListener. |
Method Summary | |
---|---|
void |
processProtocolMessage(java.lang.String message)
Routine called by the asynchronous run loop when a message has been received from the remote SocketProtocol. |
boolean |
sendDispatchFile(java.lang.String filepath)
Send the remote client a DISPATCHFILE message with the filepath to a file suitable for Properties loading. |
boolean |
sendDispatchProps(java.util.Properties trd)
Send the remote client a DISPATCHPROPS message containing a Serialized Properties object containing all the testRecordData and other data needed for the execution of the Dispatch. |
boolean |
sendMessage(java.lang.String message)
Send the remote client and arbitrary MESSAGE content. |
boolean |
sendShutdown()
Send the remote client a shutdown command |
Methods inherited from class org.safs.sockets.AbstractProtocolRunner |
---|
addListener, debug, getListenerName, onReceiveConnection, onReceiveDebug, onReceiveLocalShutdown, onReceiveRemoteShutdown, removeListener, run, sendProtocolMessage, setListenerName, shutdownThread |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocalControlRunner()
public LocalControlRunner(LocalControlListener listener)
listener
- to register with the new instance.Method Detail |
---|
public boolean sendDispatchProps(java.util.Properties trd)
"dispatchprops:char[]data"
sendDispatchProps
in class AbstractProtocolRunner
Properties
- trd to serialize with properties.store
Properties.store(OutputStream, String)
,
RemoteClientRunner.notifyDispatchProps(char[])
,
MessengerService.onReceiveDispatchProps(char[])
,
DroidEngine.onRemoteDispatchProps(java.util.Properties)
public boolean sendDispatchFile(java.lang.String filepath)
"dispatchfile:filpath"
The remote client is expected to receive the Dispatch and forward the filepath info to the actual remote engine.
sendDispatchFile
in class AbstractProtocolRunner
filepath
-
RemoteClientRunner.notifyDispatchFile(String)
,
MessengerService.onReceiveDispatchFile(String)
,
DroidEngine.onRemoteDispatchFile(String)
public boolean sendMessage(java.lang.String message)
The remote client is expected to forward the message to the remote engine with the "message:" prefix stripped off. These messages are NOT part of the standard SAFS protocol and it is up to the local and remote engines to know what to do with them.
message
-
RemoteClientRunner.notifyMessage(String)
,
MessengerService.onReceiveMessage(String)
,
DroidEngine.onRemoteMessage(String)
public boolean sendShutdown()
sendShutdown
in class AbstractProtocolRunner
RemoteClientRunner.notifyMessage(String)
,
MessengerService.onReceiveRemoteShutdown(int)
,
DroidEngine.onRemoteShutdown()
public void processProtocolMessage(java.lang.String message)
processProtocolMessage
in class AbstractProtocolRunner
LocalControlListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |