Packagenet.user1.reactor
Classpublic class ServerEvent
InheritanceServerEvent Inheritance flash.events.Event

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

Server.addEventListener()


Public Methods
 MethodDefined 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
Public Constants
 ConstantDefined 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
Constructor Description
ServerEvent()Constructor
public function ServerEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, upcProcessingRecord:UPCProcessingRecord = null, status:String = null)

Constructor.

Parameters
type:String
 
bubbles:Boolean (default = false)
 
cancelable:Boolean (default = false)
 
upcProcessingRecord:UPCProcessingRecord (default = null)
 
status:String (default = null)
Method Descriptions
clone()method
override public function clone():Event

Returns
Event
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();
     }
     
For a list of specific status values that can be returned during a particular event, see the documentation for that event.

Returns
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.

Returns
UPCProcessingRecord

See also

toString()method 
override public function toString():String

Returns
String
Constant Descriptions
RESET_UPC_STATS_RESULTConstant
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_RESULTConstant 
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_SYNCConstant 
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());
     }
     
For utilities that can convert a time from milliseconds-from-1970 format to human-readable dates and times, see the NumericFormatter class.

See also

net.user1.reactor.utils.NumericFormatter
UPC_PROCESSEDConstant 
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();
     
To retrieve information about the processed UPC message, use the ServerEvent class's getUPCProcessingRecord() method.

See also

WATCH_FOR_PROCESSED_UPCS_RESULTConstant 
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