Packagecom.esri.bacore.client
Classpublic class BAClient
InheritanceBAClient Inheritance AbstractClient Inheritance Object
Subclasses BAOnlineClient, BAServerClient

The BAClient class is the base class for Community Analyst Clients.

A BAClient instance decodes the result with the ArcGIS JSON decoder and provides additional conversion of the result to an object of a specific type. It does this by applying a result processor registered for the result type requested. After that the result object can be additionally post-processed by the task parameters instance if it implements the IResultProcessor interface. Finally, a result handler function from the calling Community Analyst Task can do additional transformations of the result object before returning it to a client.

See also

BATask


Public Properties
 PropertyDefined By
 Inheritedconcurrency : String = multiple
Value that indicates how to handle multiple calls to the same task.
AbstractClient
 InheriteddisableClientCaching : Boolean
If true, adds a timestamp parameter ("_ts") to the REST request to prevent the request from being loaded from the browser's cache.
AbstractClient
 InheritedproxyURL : String
The URL to proxy the request through.
AbstractClient
 InheritedrequestTimeout : Number = -1
The request timeout in seconds.
AbstractClient
 InheritedshowBusyCursor : Boolean = false
If true, a busy cursor is displayed while a service is executing.
AbstractClient
 Inheritedtoken : String
Token for accessing a secure HTTP client.
AbstractClient
 InheritedtokenProvider : ITokenProvider
Provider responsible for updating the security token if the last one expires.
AbstractClient
 Inheritedurl : String
URL of the task.
AbstractClient
Public Methods
 MethodDefined By
  
BAClient(url:Object = null)
Creates a new instance of the BAClient class.
BAClient
 Inherited
combineUrl(baseUrl:String, urlSuffix:String):String
[static] Combines a base URL with a suffix.
AbstractClient
 Inherited
dispatchEventOnTask(event:Event, asyncToken:AsyncToken):void
[static] Dispatches an event on the requester task associated with the given async token.
AbstractClient
 Inherited
notifyOnError(error:Error, asyncToken:AsyncToken):void
[static] Creates fault event from an error and notifies async token responders using the notifyOnFault method.
AbstractClient
 Inherited
notifyOnFault(fault:*, asyncToken:AsyncToken):void
[static] Notifies async token responders on fault and dispatches the fault event on the requester task.
AbstractClient
 Inherited
notifyOnResult(result:*, asyncToken:AsyncToken):void
[static] Notifies async token responders on result and dispatches an event on the requester task.
AbstractClient
 Inherited
send(task:IEventDispatcher, logError:Function, urlSuffix:String, urlVariables:URLVariables, responder:IResponder, operation:Function, timeout:Number = -1, disableCaching:Boolean = false, url:String = null):AsyncToken
Sends a request to HTTP service.
AbstractClient
Protected Methods
 MethodDefined By
  
addResultProcessor(resultType:BAResultType, processor:Function):void
Registers a processor of a result which will convert a JSON decoded object to an object of the specified type.
BAClient
Constructor Detail
BAClient()Constructor
public function BAClient(url:Object = null)

Creates a new instance of the BAClient class.

Parameters
url:Object (default = null) — The base URL of the client.
Method Detail
addResultProcessor()method
protected function addResultProcessor(resultType:BAResultType, processor:Function):void

Registers a processor of a result which will convert a JSON decoded object to an object of the specified type.

A processor signature is processor(asyncToken:AsyncToken):void. It gets the asyncToken.resultObject property value containing the result object decoded from JSON, converts it to an instance of the required result type, and assigns the result back to the asyncToken.resultObject property. If conversion cannot be done for some reason, the processor can throw an error or assign null to the asyncToken.resultObject property.

Parameters

resultType:BAResultType — A result type the result processor will be registered for.
 
processor:Function — A result processor function.