Package | com.esri.tracking.connector |
Class | public class Connector |
Inheritance | Connector ![]() |
Property | Defined By | ||
---|---|---|---|
isConnected : Boolean [read-only]
Indicates whether the socket connection is open or not. | Connector | ||
isLoggedIn : Boolean [read-only]
Indicates whether or not currently logged in to the Tracking Server. | Connector | ||
messageFormatManager : MessageFormatManager [read-only]
Gets most recent MessageFormatManager returned by the Tracking Server. | Connector | ||
password : String [read-only]
Gets most recent password used to log in. | Connector | ||
port : int [read-only]
Gets most recent port number used to connect. | Connector | ||
remoteHostname : String [read-only]
Gets most recent hostname used to connect. | Connector | ||
username : String [read-only]
Gets username used to log in. | Connector |
Method | Defined By | ||
---|---|---|---|
The constructor. | Connector | ||
authenticateAsync(username:String, password:String):void
Authenticates with the Tracking Server using the provided username and password. | Connector | ||
connectAsync(remoteHostname:String, port:int):void
Connects asynchronously to given remoteHostname at given port. | Connector | ||
disconnectAsync(preserveSession:Boolean):void
Disconnects connection and closes socket to gateway. | Connector | ||
getActionListAsync():void
Sends a request to the Tracking Server for available actions. | Connector | ||
getAuxiliaryDataAsync(serviceName:String):void
Sends a request to the Tracking Server for the auxiliary data of
a complex service. | Connector | ||
getGatewayStatisticsAsync(array:Array):void | Connector | ||
getServiceDefinitionsAsync():void
Sends a request to the Tracking Server for service definitions available to the
current user. | Connector | ||
getServiceNames():Array
Gets most recent list of services available. | Connector | ||
getSubscribedServiceNames():Array
Gets the list of subscribed services. | Connector | ||
getSymbolFromIDAsync(symbolId:String, imgSize:int, isMOLESymbol:Boolean):void
Sends a request to the Tracking Server for a symbol. | Connector | ||
getSymbolFromXMLAsync(xmlRequest:String, isMOLESymbol:Boolean):void
Sends a request to the Tracking Server for a symbol. | Connector | ||
getUnsubscribedServiceNames():Array
Gets the list of unsubscribed services. | Connector | ||
Publishes a message to other clients connected to the gateway, including the client
publishing the message. | Connector | ||
subscribeToServiceAsync(serviceName:String):void
Sends a request to the gateway to subscribe to a single service. | Connector | ||
subscribeToServiceListAsync(subscribeServiceNames:Array):void
Sends a request to the gateway to subscribe to a list of services. | Connector | ||
unsubscribeFromServiceAsync(serviceName:String):void
Sends a request to the gateway to unsubscribe from a single service. | Connector | ||
unsubscribeFromServiceListAsync(unsubscribeServiceNames:Array):void
Sends a request to the gateway to unsubscribe from a list of services. | Connector |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when a response to an action list request is received. | Connector | |||
Dispatched when a response to set AOI request is received. | Connector | |||
Dispatched when a response to an authentication request is received. | Connector | |||
Dispatched when auxiliary data is received. | Connector | |||
Dispatched when a response to a connection request is received. | Connector | |||
Dispatched when a response to a disconnect request is received. | Connector | |||
Dispatched when gateway monitoring data is received. | Connector | |||
Dispatched when a general error occurs. | Connector | |||
Dispatched when an observation is received. | Connector | |||
Dispatched when a response to a request for service definitions is received. | Connector | |||
Dispatched when a response a subscribe request is received. | Connector | |||
Dispatched when a response symbol request is received. | Connector | |||
Dispatched when a response to an unsubscribe request is received. | Connector |
isConnected | property |
isConnected:Boolean
[read-only] Indicates whether the socket connection is open or not.
public function get isConnected():Boolean
isLoggedIn | property |
isLoggedIn:Boolean
[read-only] Indicates whether or not currently logged in to the Tracking Server.
public function get isLoggedIn():Boolean
messageFormatManager | property |
messageFormatManager:MessageFormatManager
[read-only] Gets most recent MessageFormatManager returned by the Tracking Server.
public function get messageFormatManager():MessageFormatManager
password | property |
password:String
[read-only] Gets most recent password used to log in.
public function get password():String
port | property |
port:int
[read-only] Gets most recent port number used to connect.
public function get port():int
remoteHostname | property |
remoteHostname:String
[read-only] Gets most recent hostname used to connect.
public function get remoteHostname():String
username | property |
username:String
[read-only] Gets username used to log in.
public function get username():String
Connector | () | Constructor |
public function Connector()
The constructor.
authenticateAsync | () | method |
public function authenticateAsync(username:String, password:String):void
Authenticates with the Tracking Server using the provided username and password. Listen to authenticateResponse event to detect completion or error.
Parameters
username:String — Username for authentication.
| |
password:String — Password for authentication.
|
See also
connectAsync | () | method |
public function connectAsync(remoteHostname:String, port:int):void
Connects asynchronously to given remoteHostname at given port. Listen to connectResponse event to detect completion or error.
Parameters
remoteHostname:String — Hostname of the Tracking Server Gateway.
| |
port:int — Port number of the Tracking Server Gateway.
|
See also
disconnectAsync | () | method |
public function disconnectAsync(preserveSession:Boolean):void
Disconnects connection and closes socket to gateway. Listen to disconnectResponse event to detect completion or error.
Parameters
preserveSession:Boolean — Specifies whether or not to preserve the gateway session.
|
See also
getActionListAsync | () | method |
public function getActionListAsync():void
Sends a request to the Tracking Server for available actions. Listen to actionListResponse event to detect completion or error.
See also
getAuxiliaryDataAsync | () | method |
public function getAuxiliaryDataAsync(serviceName:String):void
Sends a request to the Tracking Server for the auxiliary data of a complex service. Listen to auxiliaryDataReceived event to detect received data.
Parameters
serviceName:String — Name of complex service.
|
See also
getGatewayStatisticsAsync | () | method |
public function getGatewayStatisticsAsync(array:Array):void
Parameters
array:Array |
getServiceDefinitionsAsync | () | method |
public function getServiceDefinitionsAsync():void
Sends a request to the Tracking Server for service definitions available to the current user. Listen to serviceDefinitionsResponse event to detect completion or error.
See also
getServiceNames | () | method |
public function getServiceNames():Array
Gets most recent list of services available.
ReturnsArray — Array of service names
|
getSubscribedServiceNames | () | method |
public function getSubscribedServiceNames():Array
Gets the list of subscribed services.
ReturnsArray — Array of subscribed service names
|
getSymbolFromIDAsync | () | method |
public function getSymbolFromIDAsync(symbolId:String, imgSize:int, isMOLESymbol:Boolean):void
Sends a request to the Tracking Server for a symbol. If requesting a MOLE symbol, MOLE must be installed on the Tracking Server. Currently only MOLE symbols are supported. Listen to symbolResponse to detect completion or error.
Parameters
symbolId:String — Indicates text id of the symbol.
| |
imgSize:int — Indicates the length of one side of the symbol.
| |
isMOLESymbol:Boolean — Specifies whether requested symbol is a MOLE symbol or not.
|
See also
getSymbolFromXMLAsync | () | method |
public function getSymbolFromXMLAsync(xmlRequest:String, isMOLESymbol:Boolean):void
Sends a request to the Tracking Server for a symbol. If requesting a MOLE symbol, MOLE must be installed on the Tracking Server. Currently only MOLE symbols are supported. Listen to symbolResponse to detect completion or error.
Parameters
xmlRequest:String — XML string containing request.
| |
isMOLESymbol:Boolean — Specifies whether requested symbol is a MOLE symbol or not.
|
See also
getUnsubscribedServiceNames | () | method |
public function getUnsubscribedServiceNames():Array
Gets the list of unsubscribed services.
ReturnsArray — Array of unsubscribed service names
|
setAOIForServiceAsync | () | method |
public function setAOIForServiceAsync(serviceName:String, aoiEnvelope:TmsEnvelope, aoiType:SetAOIType):Boolean
Publishes a message to other clients connected to the gateway, including the client publishing the message. Listen to observationReceived event to detect received message.
Parameters
serviceName:String — Message to be published
| |
aoiEnvelope:TmsEnvelope — Service name of the message
| |
aoiType:SetAOIType |
Boolean |
See also
subscribeToServiceAsync | () | method |
public function subscribeToServiceAsync(serviceName:String):void
Sends a request to the gateway to subscribe to a single service. Listen to subscribeResponse event to detect completion or error.
Parameters
serviceName:String — Name of service to subscribe to
|
See also
subscribeToServiceListAsync | () | method |
public function subscribeToServiceListAsync(subscribeServiceNames:Array):void
Sends a request to the gateway to subscribe to a list of services. Listen to subscribeResponse event to detect completion or error.
Parameters
subscribeServiceNames:Array — Array of service names to subscribe to
|
See also
unsubscribeFromServiceAsync | () | method |
public function unsubscribeFromServiceAsync(serviceName:String):void
Sends a request to the gateway to unsubscribe from a single service. Listen to unsubscribeResponse event to detect completion or error.
Parameters
serviceName:String — Name of service to unsubscribe from
|
See also
unsubscribeFromServiceListAsync | () | method |
public function unsubscribeFromServiceListAsync(unsubscribeServiceNames:Array):void
Sends a request to the gateway to unsubscribe from a list of services. Listen to unsubscribeResponse event to detect completion or error.
Parameters
unsubscribeServiceNames:Array — Array of service names to unsubscribe from
|
See also
actionListResponse | Event |
com.esri.tracking.connector.events.ActionListEvent
com.esri.tracking.connector.events.ActionListEvent.ACTION_LIST_RESPONSE
Dispatched when a response to an action list request is received.
Defines the value of thetype
property of an actionListResponse
event.
aoiResponse | Event |
com.esri.tracking.connector.events.SetAOIEvent
com.esri.tracking.connector.events.AOIEvent.AOI_RESPONSE
Dispatched when a response to set AOI request is received.
authenticateResponse | Event |
com.esri.tracking.connector.events.AuthenticateEvent
com.esri.tracking.connector.events.AuthenticateEvent.AUTHENTICATE_RESPONSE
Dispatched when a response to an authentication request is received.
Defines the value of thetype
property of an authenticateResponse
event.
auxiliaryDataReceived | Event |
com.esri.tracking.connector.events.AuxiliaryDataEvent
com.esri.tracking.connector.events.AuxiliaryDataEvent.AUXILIARY_DATA_RECEIVED
Dispatched when auxiliary data is received.
Defines the value of thetype
property of an auxiliaryDataReceived
event.
connectResponse | Event |
com.esri.tracking.connector.events.ConnectEvent
com.esri.tracking.connector.events.ConnectEvent.CONNECT_RESPONSE
Dispatched when a response to a connection request is received.
Defines the value of thetype
property of an connectResponse
event.
disconnectResponse | Event |
com.esri.tracking.connector.events.DisconnectEvent
com.esri.tracking.connector.events.DisconnectEvent.DISCONNECT_RESPONSE
Dispatched when a response to a disconnect request is received.
Defines the value of thetype
property of an disconnectResponse
event.
gatewayDataReceived | Event |
com.esri.tracking.connector.events.GatewayDataEvent
com.esri.tracking.connector.events.GatewayDataEvent.GATEWAY_DATA_RECEIVED
Dispatched when gateway monitoring data is received.
Defines the value of thetype
property of an gatewayDataReceived
event.
generalError | Event |
com.esri.tracking.connector.events.GeneralErrorEvent
com.esri.tracking.connector.events.GeneralErrorEvent.GENERAL_ERROR
Dispatched when a general error occurs. This error could be caused due to a number of different reasons and can occur at any time. It is recommended to place an event listener early in the client code to catch these types of errors.
Defines the value of thetype
property of an generalError
event.
observationReceived | Event |
com.esri.tracking.connector.events.ObservationEvent
com.esri.tracking.connector.events.ObservationEvent.OBSERVATION_RECEIVED
Dispatched when an observation is received.
Defines the value of thetype
property of an observationReceived
event.
serviceDefinitionsResponse | Event |
com.esri.tracking.connector.events.ServiceDefinitionsEvent
com.esri.tracking.connector.events.ServiceDefinitionsEvent.SERVICE_DEFINITIONS_RESPONSE
Dispatched when a response to a request for service definitions is received.
Defines the value of thetype
property of an serviceDefinitionsResponse
event.
subscribeResponse | Event |
com.esri.tracking.connector.events.SubscribeEvent
com.esri.tracking.connector.events.SubscribeEvent.SUBSCRIBE_RESPONSE
Dispatched when a response a subscribe request is received.
Defines the value of thetype
property of an subscribeResponse
event.
symbolResponse | Event |
com.esri.tracking.connector.events.SymbolEvent
com.esri.tracking.connector.events.SymbolEvent.SYMBOL_RESPONSE
Dispatched when a response symbol request is received.
Defines the value of thetype
property of an symbolResponse
event.
unsubscribeResponse | Event |
com.esri.tracking.connector.events.UnsubscribeEvent
com.esri.tracking.connector.events.UnsubscribeEvent.UNSUBSCRIBE_RESPONSE
Dispatched when a response to an unsubscribe request is received.
Defines the value of thetype
property of an unsubscribeResponse
event.
private var connector:Connector = new Connector(); private function start():void { connector.addEventListener(ConnectEvent.CONNECT_RESPONSE, connector_connectResponse); connector.connectAsync("servername", 5506); } private function connector_connectResponse(evt:ConnectEvent):void { if (evt.succeeded == true) { connector.addEventListener(AuthenticateEvent.AUTHENTICATE_RESPONSE, connector_authenticateResponse); connector.authenticateAsync("username", "password"); } else { Alert.show(evt.errorMessage, "Connection Error"); } } private function connector_authenticateResponse(evt:AuthenticateEvent):void { if (evt.succeeded == true) { connector.addEventListener(ServiceDefinitionsEvent.SERVICE_DEFINITIONS_RESPONSE, connector_serviceDefinitionsResponse); connector.getServiceDefinitionsAsync(); } else { Alert.show(evt.errorMessage, "Authentication Error"); } } private function connector_serviceDefinitionsResponse(evt:ServiceDefinitionsEvent):void { if (evt.succeeded == true) { // Do something with services received. } else { Alert.show(evt.errorMessage, "Service Definitions Error"); } }