Packagecom.esri.bao.tasks
Classpublic class BAOnlineClient
InheritanceBAOnlineClient Inheritance BAClient Inheritance AbstractClient Inheritance Object

The BAOnlineClient class is the client class encapsulating a Community Analyst HTTP (REST) Service.

View the examples

See also

BAOnlineTokenProvider
UserCredentials


Public Properties
 PropertyDefined By
  activeDatasetID : String = null
Active dataset ID.
BAOnlineClient
 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
  
BAOnlineClient(url:Object = null)
Creates a new instance of the client.
BAOnlineClient
 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
  
prepareUrl(baseUrl:String, urlSuffix:String):String
[override]
BAOnlineClient
Property Detail
activeDatasetIDproperty
public var activeDatasetID:String = null

Active dataset ID. Null value means using the default Community Analyst dataset. The value of this variable is used as an initial value of the activeDatasetID property of a task when it is created using the BAOnlineClient class instance in its constructor.

Constructor Detail
BAOnlineClient()Constructor
public function BAOnlineClient(url:Object = null)

Creates a new instance of the client.

The base URL to the Community Analyst Web Services looks as follows:

http://{host}:{port}

The {host} and {port} parameters in this URL should be substituted with valid Community Analyst host name and port, respectively.

If the base URL is null or empty, the "http://baoapi.esri.com" value is assigned as the base URL.

Parameters
url:Object (default = null) — The base URL to the Community Analyst Web Services.
Method Detail
prepareUrl()method
override protected function prepareUrl(baseUrl:String, urlSuffix:String):String

Parameters

baseUrl:String
 
urlSuffix:String

Returns
String
Examples
The code snippet below shows how to create an instance of this class. To get the example working, specify valid values for username, password and URLs.
     
     var tokenProvider:BAOnlineTokenProvider = new BAOnlineTokenProvider(new UserCredentials("username", "password"));
     
     // "https://baoapi.esri.com" is the default value for token provider url.
     //tokenProvider.url = "https://baoapi.esri.com";
     
     var client:BAOnlineClient = new BAOnlineClient();
     
     // "http://baoapi.esri.com" is the default value for BAOnlineClient url.
     //client.url = "http://baoapi.esri.com";
     client.tokenProvider = tokenProvider;