Package | net.user1.reactor |
Class | public class ServerEvent |
Inheritance | ServerEvent ![]() |
Since : | Reactor 1.0.0 |
ServerEvent is a simple data class used to pass information from an application's Server object to registered event-listeners when a server event occurs. The ServerEvent class also defines constants representing the available server events.
To register for a server event, use the Server class's addEventListener() method.
See also
Method | Defined By | ||
---|---|---|---|
ServerEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, upcProcessingRecord:UPCProcessingRecord = null, status:String = null)
Constructor. | ServerEvent | ||
clone():Event [override] | ServerEvent | ||
getStatus():String
Returns the status of the operation to which this event pertains. | ServerEvent | ||
Returns the UPCProcessingRecord object for a UPC that was processed by
Union Server. | ServerEvent | ||
toString():String [override] | ServerEvent |
Constant | Defined By | ||
---|---|---|---|
RESET_UPC_STATS_RESULT : String = RESET_UPC_STATS_RESULT [static]
Dispatched when the server reports the result of a reset-UPC-stats
attempt by the current client. | ServerEvent | ||
STOP_WATCHING_FOR_PROCESSED_UPCS_RESULT : String = STOP_WATCHING_FOR_PROCESSED_UPCS_RESULT [static]
Dispatched when the server reports the result of a stop-watching-for-processed-UPCs
attempt by the current client. | ServerEvent | ||
TIME_SYNC : String = TIME_SYNC [static]
Dispatched when the server sends the current server time in response to
an earlier invocation of Server's syncTime() method by the current client. | ServerEvent | ||
UPC_PROCESSED : String = UPC_PROCESSED [static]
Dispatched when the current client is watching for "processed UPC messages"
and the server finishes processing an inbound UPC message. | ServerEvent | ||
WATCH_FOR_PROCESSED_UPCS_RESULT : String = WATCH_FOR_PROCESSED_UPCS_RESULT [static]
Dispatched when the server reports the result of a watch-for-processed-UPCs
attempt by the current client. | ServerEvent |
ServerEvent | () | Constructor |
public function ServerEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, upcProcessingRecord:UPCProcessingRecord = null, status:String = null)
Constructor.
Parameterstype:String | |
bubbles:Boolean (default = false )
| |
cancelable:Boolean (default = false )
| |
upcProcessingRecord:UPCProcessingRecord (default = null )
| |
status:String (default = null )
|
clone | () | method |
override public function clone():Event
ReturnsEvent |
getStatus | () | method |
public function getStatus():String
Since : | Reactor 1.1.0 |
Returns the status of the operation to which this event pertains. The getStatus() method's return value is always one of the Status class's constants. For example, if the Server.WATCH_FOR_PROCESSED_UPCS_RESULT event occurs in response to a successful watch-for-processed-UPCs attempt, getStatus() will return the value of Status.SUCCESS. To respond to a status, compare the return of getStatus() to one of the Status constants. For example,
if (e.getStatus() != Status.SUCCESS) { showWatchFailedDialog(); }
String |
See also
getUPCProcessingRecord | () | method |
public function getUPCProcessingRecord():UPCProcessingRecord
Since : | Reactor 1.1.0 |
Returns the UPCProcessingRecord object for a UPC that was processed by Union Server. Applies to the ServerEvent.UPC_PROCESSED event only.
ReturnsUPCProcessingRecord |
See also
toString | () | method |
override public function toString():String
ReturnsString |
RESET_UPC_STATS_RESULT | Constant |
public static const RESET_UPC_STATS_RESULT:String = RESET_UPC_STATS_RESULT
Since : | Reactor 1.1.0 |
Dispatched when the server reports the result of a reset-UPC-stats attempt by the current client. To determine the result of the attempt, use getStatus(), which has the following possible return values:
See also
STOP_WATCHING_FOR_PROCESSED_UPCS_RESULT | Constant |
public static const STOP_WATCHING_FOR_PROCESSED_UPCS_RESULT:String = STOP_WATCHING_FOR_PROCESSED_UPCS_RESULT
Since : | Reactor 1.1.0 |
Dispatched when the server reports the result of a stop-watching-for-processed-UPCs attempt by the current client. To determine the result of the attempt, use getStatus(), which has the following possible return values:
See also
TIME_SYNC | Constant |
public static const TIME_SYNC:String = TIME_SYNC
Since : | Reactor 1.0.0 |
Dispatched when the server sends the current server time in response to an earlier invocation of Server's syncTime() method by the current client. Listeners for ServerEvent.TIME_SYNC can retreive the approximate time on the server via Server's getServerTime() method, as follows:
protected function timeSyncListener (e:ServerEvent):void { trace("Time is: " + Server(e.target).getServerTime()); }
See also
UPC_PROCESSED | Constant |
public static const UPC_PROCESSED:String = UPC_PROCESSED
Since : | Reactor 1.1.0 |
Dispatched when the current client is watching for "processed UPC messages" and the server finishes processing an inbound UPC message. To watch for processed UPC messages, use the Server class's watchForProcessedUPCs() method. For example,
reactor.getServer().watchForProcessedUPCs();
See also
WATCH_FOR_PROCESSED_UPCS_RESULT | Constant |
public static const WATCH_FOR_PROCESSED_UPCS_RESULT:String = WATCH_FOR_PROCESSED_UPCS_RESULT
Since : | Reactor 1.1.0 |
Dispatched when the server reports the result of a watch-for-processed-UPCs attempt by the current client. To determine the result of the attempt, use getStatus(), which has the following possible return values:
See also