RemoteDataAdapter
Overview
The RemoteDataAdapter represents client-side access to data tables published on the server.
It can be used to retrieve schema information, to execute commands, to fill a data table(s) with data from the server or to apply local updates back to the server. It can also perform login, if required.
By default, a newly instantiated RemoteDataAdapter is configured for the standard services provided by Data Abstract 4.0 servers, like IDataAbstractService and IBaseLoginService with correspondent names **DataService ** LoginService . However, it's customizable in several ways: * If you've changed only names of any mentioned services on your server, simply call setDataServiceName / setLoginServiceName methods of the RemoteDataAdapter to change them on client as well. * If you need more advanced configuration for service calls, you can provide your own implementation of IDataAbstractService or IBaseLoginService and set it with setDataService / setLoginService methods.
Other components as data streamer, client channel, message can be also configured manually by using appropriate setter methods. You don't need to deal with it in most cases though. Use create() instead - a static methods that supports URL Schemes and will return preconfigured instance of RemoteDataAdapter class according to provided server target Url.
The RemoteDataAdapter gives possibility to work with DA server in both synchronous(blocking) and asynchronous(non-blocking) way. Last one will be very convenient on mobile platforms, that either prevent or even forbid synchronous network operation in the main (UI) thread. Therefore, for almost every do method you may find its doAsync clone. All async methods return RequestTask inheritors: the one difference between these inheritors is in type of returned result. fill and applyChanges tasks will have void result, they just update correspondent instances of datatables; executeCommand in turn provides getCommandResult
property to get the comand executoin result. The similar situation with readSchema that provides getSchema
and login that contains getLogged
method.
Location
- Reference: com.remobjects.dataabstract.jar
- Package: com.remobjects.dataabstract
- Ancestry: Object | RemoteDataAdapter
constructor
Default constructor that creates an instance of RemoteDataAdapter class with default data and login service names.
constructor
RemoteDataAdapter()
constructor (URI)
constructor(anURL: URI)
RemoteDataAdapter(URI anURL)
Parameters:
- anURL:
constructor (URI, String)
constructor(anURL: URI; aDataServiceName: String)
RemoteDataAdapter(URI anURL, String aDataServiceName)
Parameters:
- anURL:
- aDataServiceName:
constructor (URI, String, String)
constructor(anURL: URI; aDataServiceName: String; aLoginServiceName: String)
RemoteDataAdapter(URI anURL, String aDataServiceName, String aLoginServiceName)
Parameters:
- anURL:
- aDataServiceName:
- aLoginServiceName:
constructor (String, String)
Creates an instance of RemoteDataAdapter and sets custom names of remote services.
constructor(aDataServiceName: String; aLoginServiceName: String)
RemoteDataAdapter(String aDataServiceName, String aLoginServiceName)
Parameters:
- aDataServiceName: A custom name that will be used to talk to data service.
- aLoginServiceName: A custom name that will be used to talk to login service. If null or empty string is passed, then default will be used. you can pass null here if you know that you server doesn't requires authentication.
AcceptTableChanges
property AcceptTableChanges: Boolean read write;
Boolean AcceptTableChanges { __get; __set; }
addListener
Add a subscriber to adapter's notifications.
method addListener(aListener: RemoteDataAdapterListener)
void addListener(RemoteDataAdapterListener aListener)
Parameters:
- aListener: an instance of RemoteDataAdapterListener interface implementation - adapters notification listener interface. If you need to subscribe on just some notification(s), you can use AbstractRemoteDataAdapter class by extending it and overriding only necessary methods.
applyChanges (DataTable[])
apply local changes of a set of data tables up to the server.
method applyChanges(aDataTablesArray: array of DataTable)
void applyChanges(DataTable[] aDataTablesArray)
Parameters:
- aDataTablesArray: a set of tables with changes to be sent.
applyChanges (Delta[])
apply changes from passed set of deltas up to the server. This overload doesn't need a data table to collect changes, but a manually created array of deltas.
Parameters:
- aDeltasArray: an array of deltas to send to the server.
applyChanges (DataTable)
apply changes that were made locally with specific data table to the server.
Parameters:
- aDataTable: a data table with changes to be sent.
applyChangesAsync (DataTable[], Callback): UpdateRequestTask
method applyChangesAsync(aDataTablesArray: array of DataTable; aCallback: Callback): UpdateRequestTask
UpdateRequestTask applyChangesAsync(DataTable[] aDataTablesArray, Callback aCallback)
Parameters:
- aDataTablesArray:
- aCallback:
applyChangesAsync (Delta[], Callback): UpdateRequestTask
method applyChangesAsync(aDeltasArray: array of Delta; aCallback: Callback): UpdateRequestTask
UpdateRequestTask applyChangesAsync(Delta[] aDeltasArray, Callback aCallback)
Parameters:
- aDeltasArray:
- aCallback:
applyChangesAsync (DataTable, Callback): UpdateRequestTask
method applyChangesAsync(aDataTable: DataTable; aCallback: Callback): UpdateRequestTask
UpdateRequestTask applyChangesAsync(DataTable aDataTable, Callback aCallback)
Parameters:
- aDataTable:
- aCallback:
AutoCreateServices
property AutoCreateServices: Boolean read write;
Boolean AutoCreateServices { __get; __set; }
ClientChannel
property ClientChannel: ClientChannel read write;
ClientChannel ClientChannel { __get; __set; }
create (URI): RemoteDataAdapter
returns a preconfigured instance of the RemoteDataAdapter based on provided server target URI.
class method create(anURL: URI): RemoteDataAdapter
static RemoteDataAdapter create(URI anURL)
Parameters:
- anURL: a server target URI.
create (URI, String): RemoteDataAdapter
returns a preconfigured instance of the RemoteDataAdapter based on provided server target URI and aditionally sets custom name of the remote data service.
class method create(anURL: URI; aDataServiceName: String): RemoteDataAdapter
static RemoteDataAdapter create(URI anURL, String aDataServiceName)
Parameters:
- anURL: a server target URI.
- aDataServiceName: a custom name of server data service.
create (URI, String, String): RemoteDataAdapter
returns a preconfigured instance of the RemoteDataAdapter based on provided server target URI and aditionally sets custom names of the remote data and login services.
class method create(anURL: URI; aDataServiceName: String; aLoginServiceName: String): RemoteDataAdapter
static RemoteDataAdapter create(URI anURL, String aDataServiceName, String aLoginServiceName)
Parameters:
- anURL: a server target URI.
- aDataServiceName: a custom name of server data service.
- aLoginServiceName: a custom name of server login service. Default name is used if null or empty value was passed.
DataService
property DataService: IDataAbstractService read write;
IDataAbstractService DataService { __get; __set; }
DataServiceName
property DataServiceName: String read write;
String DataServiceName { __get; __set; }
DataStreamer
property DataStreamer: DataStreamer read write;
DataStreamer DataStreamer { __get; __set; }
DynamicSelect
property DynamicSelect: Boolean read write;
Boolean DynamicSelect { __get; __set; }
executeCommand (String): RemoteDataAdapter.RemoteCommandResult
Provides the ability to dynamically invoke commands (stored procedures or SQL statements) from the Schema published by your service.
To enable execution of commands from the client, set the AllowExecuteCommand property of your DataAbstractService to true and ensure that all published Commands in your schema are safe for execution. Also, you need to have proper authentication methods in place to prevent anonymous users from making malicious calls.
method executeCommand(aName: String): RemoteDataAdapter.RemoteCommandResult
RemoteDataAdapter.RemoteCommandResult executeCommand(String aName)
Parameters:
- aName: a command name from Schema.
executeCommand (String, DataParameter[]): RemoteDataAdapter.RemoteCommandResult
Provides the ability to dynamically invoke commands (stored procedures or SQL statements) from the Schema published by your service. This is an overload that accepts command parameters. Here, you need to pass them as an array of initialized DataParameter instances.
Note, that output parameters must be also included in theese arrays.
method executeCommand(aName: String; inParams: array of DataParameter): RemoteDataAdapter.RemoteCommandResult
RemoteDataAdapter.RemoteCommandResult executeCommand(String aName, DataParameter[] inParams)
Parameters:
- aName: a command name from Schema.
- inParams: an array of command parameters.
executeCommand (String, String[], Object[]): RemoteDataAdapter.RemoteCommandResult
Provides the ability to dynamically invoke commands (stored procedures or SQL statements) from the Schema published by your service. This is an overload that accepts command parameters. Here, you need to pass them as two separate arrays: an array of parameter names and commensurate array of parameter values.
Note, that output parameters must be also included in these arrays.
method executeCommand(aName: String; aParameterNames: array of String; aParameterValues: array of Object): RemoteDataAdapter.RemoteCommandResult
RemoteDataAdapter.RemoteCommandResult executeCommand(String aName, String[] aParameterNames, Object[] aParameterValues)
Parameters:
- aName: a command name from Schema.
- aParameterNames: an array of connamd parameter names.
- aParameterValues: an array of command parameter values.
executeCommandAsync (String, DataParameter[], CommandRequestTask.Callback): CommandRequestTask
The asynchronous version of executeCommand method that provides the ability to dynamically invoke commands (stored procedures or SQL statements) from the Schema published by your service. This is an overload that accepts command parameters. Here, you need to pass them as an array of initialized DataParameter instances.
Note, that output parameters must be also included in theese arrays.
method executeCommandAsync(aName: String; inParams: array of DataParameter; aCallback: CommandRequestTask.Callback): CommandRequestTask
CommandRequestTask executeCommandAsync(String aName, DataParameter[] inParams, CommandRequestTask.Callback aCallback)
Parameters:
- aName: A command name from Schema.
- inParams: An array of command parameters.
- aCallback: An instance of a callback that will be notified after a command request finish.
executeCommandAsync (String, String[], Object[], CommandRequestTask.Callback): CommandRequestTask
The asynchronous version of executeCommand method that provides the ability to dynamically invoke commands (stored procedures or SQL statements) from the Schema published by your service. This is an overload that accepts command parameters. Here, you need to pass them as two separate arrays: an array of parameter names and commensurate array of parameter values.
Note, that output parameters must be also included in these arrays.
method executeCommandAsync(aName: String; aParameterNames: array of String; aParameterValues: array of Object; aCallback: CommandRequestTask.Callback): CommandRequestTask
CommandRequestTask executeCommandAsync(String aName, String[] aParameterNames, Object[] aParameterValues, CommandRequestTask.Callback aCallback)
Parameters:
- aName: A command name from Schema.
- aParameterNames: An array of connamd parameter names.
- aParameterValues: An array of command parameter values.
- aCallback: An instance of a callback that will be notified after a command request finish.
executeCommandAsync (String, CommandRequestTask.Callback): CommandRequestTask
The asynchronous version of executeCommand method that provides the ability to dynamically invoke commands (stored procedures or SQL statements) from the Schema published by your service.
To enable execution of commands from the client, set the AllowExecuteCommand property of your DataAbstractService to true and ensure that all published Commands in your schema are safe for execution. Also, you need to have proper authentication methods in place to prevent anonymous users from making malicious calls.
method executeCommandAsync(aName: String; aCallback: CommandRequestTask.Callback): CommandRequestTask
CommandRequestTask executeCommandAsync(String aName, CommandRequestTask.Callback aCallback)
Parameters:
- aName: A command name from Schema.
- aCallback: An instance of a callback that will be notified after a command request finish.
fill (DataTable[])
The method fills given data tables with the data from the server.
Parameters:
- aDataTablesArray: an array of data tables to fill.
fill (DataTable[], WhereExpression[])
The method fills given data tables with the data from the server with a glance of table names and correspondent Dynamic Where clauses.
method fill(aDataTablesArray: array of DataTable; aWhereClauses: array of WhereExpression)
void fill(DataTable[] aDataTablesArray, WhereExpression[] aWhereClauses)
Parameters:
- aDataTablesArray: an array of data tables for filling.
- aWhereClauses: an array of Dynamic Where clauses for applying during the fill request.
fill (DataTable[], TableRequestInfo[])
The method fills given data tables with the data from the server. This overload gives you significant possibilities to customize your fill requests, where you can use the TableRequestInfo, created by yourself. You can create its inheritors of version 5 and version 6 as well.
method fill(aDataTablesArray: array of DataTable; aTableRequestInfosArray: array of TableRequestInfo)
void fill(DataTable[] aDataTablesArray, TableRequestInfo[] aTableRequestInfosArray)
Parameters:
- aDataTablesArray: an array of data tables for filling.
- aTableRequestInfosArray: an array of table request objects for applying during the fill request.
fill (DataTable)
The method fills the given data table with the data from the server. Please, consider: * table should be named the same as one of the schema's tables. * all existing data in the table will be erased before filling it with new bundle from the server.
Parameters:
- aDataTable: a data table instance to fill.
fill (DataTable, WhereExpression)
The method fills given data table with the data from the server with a glance of the table name and a Dynamic Where clause.
method fill(aDataTable: DataTable; aWhereClause: WhereExpression)
void fill(DataTable aDataTable, WhereExpression aWhereClause)
Parameters:
- aDataTable: a data table instance for filling.
- aWhereClause: a Dynamic Where clause for applying during request.
fill (DataTable, TableRequestInfo)
The method fills given data table with the data from the server. This overload gives you significant possibilities to customize your fill request, where you can use the TableRequestInfo, created by yourself. You can create its inheritors of version 5 and version 6 as well.
method fill(aDataTable: DataTable; aTableRequestInfo: TableRequestInfo)
void fill(DataTable aDataTable, TableRequestInfo aTableRequestInfo)
Parameters:
- aDataTable: a data table instance for filling.
- aTableRequestInfo: a table request object instance for applying during request.
fillAsync (DataTable[], WhereExpression[], Callback): FillRequestTask
method fillAsync(aDataTablesArray: array of DataTable; aWhereClauses: array of WhereExpression; aCallback: Callback): FillRequestTask
FillRequestTask fillAsync(DataTable[] aDataTablesArray, WhereExpression[] aWhereClauses, Callback aCallback)
Parameters:
- aDataTablesArray:
- aWhereClauses:
- aCallback:
fillAsync (DataTable[], TableRequestInfo[], Callback): FillRequestTask
method fillAsync(aDataTablesArray: array of DataTable; aTableRequestInfosArray: array of TableRequestInfo; aCallback: Callback): FillRequestTask
FillRequestTask fillAsync(DataTable[] aDataTablesArray, TableRequestInfo[] aTableRequestInfosArray, Callback aCallback)
Parameters:
- aDataTablesArray:
- aTableRequestInfosArray:
- aCallback:
fillAsync (DataTable[], Callback): FillRequestTask
method fillAsync(aDataTablesArray: array of DataTable; aCallback: Callback): FillRequestTask
FillRequestTask fillAsync(DataTable[] aDataTablesArray, Callback aCallback)
Parameters:
- aDataTablesArray:
- aCallback:
fillAsync (DataTable, WhereExpression, Callback): FillRequestTask
method fillAsync(aDataTable: DataTable; aWhereClause: WhereExpression; aCallback: Callback): FillRequestTask
FillRequestTask fillAsync(DataTable aDataTable, WhereExpression aWhereClause, Callback aCallback)
Parameters:
- aDataTable:
- aWhereClause:
- aCallback:
fillAsync (DataTable, Callback): FillRequestTask
method fillAsync(aDataTable: DataTable; aCallback: Callback): FillRequestTask
FillRequestTask fillAsync(DataTable aDataTable, Callback aCallback)
Parameters:
- aDataTable:
- aCallback:
fillAsync (DataTable, TableRequestInfo, Callback): FillRequestTask
method fillAsync(aDataTable: DataTable; aTableRequestInfo: TableRequestInfo; aCallback: Callback): FillRequestTask
FillRequestTask fillAsync(DataTable aDataTable, TableRequestInfo aTableRequestInfo, Callback aCallback)
Parameters:
- aDataTable:
- aTableRequestInfo:
- aCallback:
fillWithSql
The method fills given data table with the data from the server with a glance of SQL string using TableRequestInfoV6 with DA SQL under the hood.
method fillWithSql(aDataTable: DataTable; aSql: String; aParamsArray: array of DataParameter)
void fillWithSql(DataTable aDataTable, String aSql, DataParameter[] aParamsArray)
Parameters:
- aDataTable: a data table instance for filling.
- aSql: A DA SQL query string.
- aParamsArray: Optional parameters, if such required by SQL string.
fillWithSqlAsync
The asynchronous version of fillWithSql method that fills given data table with the data from the server with a glance of SQL string using TableRequestInvoV6 with DA SQL under the hood.
method fillWithSqlAsync(aDataTable: DataTable; aSql: String; aParamsArray: array of DataParameter; aCallback: FillRequestTask.Callback): FillRequestTask
FillRequestTask fillWithSqlAsync(DataTable aDataTable, String aSql, DataParameter[] aParamsArray, FillRequestTask.Callback aCallback)
Parameters:
- aDataTable: A data table instance to fill.
- aSql: A DA SQL query string.
- aParamsArray: Optional parameters, if such required by SQL string.
- aCallback: A callback instance to be notified after a fill request finish.
finalize protected
Releases all resources that could possibly be used by the adapter's instance.
method finalize
void finalize()
ForceApplySchema
property ForceApplySchema: Boolean read write;
Boolean ForceApplySchema { __get; __set; }
login (String): Boolean
This methods tries to login with the given user name, password and connection name. Used for cases when the server side service has multiple connections.
method login(aLoginString: String): Boolean
Boolean login(String aLoginString)
Parameters:
- aLoginString: a preformatted LoginEx string.
login (String, String): Boolean
This method tries to login with the given user name and password. It uses login service proxy associated with the adapter.
method login(aUserName: String; aPassword: String): Boolean
Boolean login(String aUserName, String aPassword)
Parameters:
- aUserName: A user name string.
- aPassword: A user's password.
login (String, String, String): Boolean
This method tries to login with the given user name and password. It uses login service proxy associated with the adapter.
method login(aUserName: String; aPassword: String; aConnectionName: String): Boolean
Boolean login(String aUserName, String aPassword, String aConnectionName)
Parameters:
- aUserName: A user name string.
- aPassword: A user's password.
- aConnectionName: A connection name of database to use for login.
loginAsync (String, LoginRequestTask.Callback): LoginRequestTask
The asynchronous version of login method that tries to login with the given user name, password and connection name. It's used in case server side service has multiple connections.
method loginAsync(aLoginString: String; aCallback: LoginRequestTask.Callback): LoginRequestTask
LoginRequestTask loginAsync(String aLoginString, LoginRequestTask.Callback aCallback)
Parameters:
- aLoginString: A preformatted LoginEx string.
- aCallback: A callback instance to be notified after a login request finish.
loginAsync (String, String, LoginRequestTask.Callback): LoginRequestTask
The asynchronous version of login method that tries to login with the given user name and password.
method loginAsync(aUserName: String; aPassword: String; aCallback: LoginRequestTask.Callback): LoginRequestTask
LoginRequestTask loginAsync(String aUserName, String aPassword, LoginRequestTask.Callback aCallback)
Parameters:
- aUserName: A user name string.
- aPassword: A user's password.
- aCallback: A callback instance to be notified after a login request finish.
loginAsync (String, String, String, LoginRequestTask.Callback): LoginRequestTask
The asynchronous version of login method that tries to login with the given user name and password.
method loginAsync(aUserName: String; aPassword: String; aConnectionName: String; aCallback: LoginRequestTask.Callback): LoginRequestTask
LoginRequestTask loginAsync(String aUserName, String aPassword, String aConnectionName, LoginRequestTask.Callback aCallback)
Parameters:
- aUserName: A user name string.
- aPassword: A user's password.
- aConnectionName: A connection name of database to use for login.
- aCallback: A callback instance to be notified after a login request finish.
LoginService
property LoginService: IBaseLoginService read write;
IBaseLoginService LoginService { __get; __set; }
LoginServiceName
property LoginServiceName: String read write;
String LoginServiceName { __get; __set; }
logout
Performs the log out.
method logout
void logout()
logoutAsync
Performs the log out asynchronously.
method logoutAsync(aCallback: Callback): LoginRequestTask
LoginRequestTask logoutAsync(Callback aCallback)
Parameters:
- aCallback: A callback instance to be notified after a login request finish.
Message
readSchema
The method returns a Schema for the Data Abstract service and caches it to avoid redundant server load.
method readSchema(aForceReRead: Boolean): Schema
Schema readSchema(Boolean aForceReRead)
Parameters:
- aForceReRead: If true, methods forces to redownload schema from the server in spite of the cached value.
readSchemaAsync
The method returns a Schema for the Data Abstract service asynchronously and caches it to avoid redundant server load. If adapter has cached schema, method returns this instance without extra network call.
method readSchemaAsync(aForceReRead: Boolean; aCallback: SchemaRequestTask.Callback): SchemaRequestTask
SchemaRequestTask readSchemaAsync(Boolean aForceReRead, SchemaRequestTask.Callback aCallback)
Parameters:
- aForceReRead: If true, methods forces to redownload schema from the server in spite of the cached value.
- aCallback: A callback instance to be notified after schema request finishes.
removeListener
removes adapter's listener, if it was actually subscribed (by calling addListener method).
method removeListener(aListener: RemoteDataAdapterListener)
void removeListener(RemoteDataAdapterListener aListener)
Parameters:
- aListener: an instance of the listener to remove.
shutdown
The method should be called when you don't need the instance any more. Internally, it will release resources if any have been acquired by the adapter.
method shutdown
void shutdown()
Status
property Status: DataAdapterStatus read;
DataAdapterStatus Status { __get; }
TaskCallbackExecutor
property TaskCallbackExecutor: Executor read write;
Executor TaskCallbackExecutor { __get; __set; }
TaskExecutor
property TaskExecutor: Executor read write;
Executor TaskExecutor { __get; __set; }
AcceptTableChanges
property AcceptTableChanges: Boolean read write;
Boolean AcceptTableChanges { __get; __set; }
AutoCreateServices
property AutoCreateServices: Boolean read write;
Boolean AutoCreateServices { __get; __set; }
ClientChannel
property ClientChannel: ClientChannel read write;
ClientChannel ClientChannel { __get; __set; }
DataService
property DataService: IDataAbstractService read write;
IDataAbstractService DataService { __get; __set; }
DataServiceName
property DataServiceName: String read write;
String DataServiceName { __get; __set; }
DataStreamer
property DataStreamer: DataStreamer read write;
DataStreamer DataStreamer { __get; __set; }
DynamicSelect
property DynamicSelect: Boolean read write;
Boolean DynamicSelect { __get; __set; }
ForceApplySchema
property ForceApplySchema: Boolean read write;
Boolean ForceApplySchema { __get; __set; }
LoginService
property LoginService: IBaseLoginService read write;
IBaseLoginService LoginService { __get; __set; }
LoginServiceName
property LoginServiceName: String read write;
String LoginServiceName { __get; __set; }
Message
Status
property Status: DataAdapterStatus read;
DataAdapterStatus Status { __get; }
TaskCallbackExecutor
property TaskCallbackExecutor: Executor read write;
Executor TaskCallbackExecutor { __get; __set; }
TaskExecutor
property TaskExecutor: Executor read write;
Executor TaskExecutor { __get; __set; }
create (URI): RemoteDataAdapter
returns a preconfigured instance of the RemoteDataAdapter based on provided server target URI.
class method create(anURL: URI): RemoteDataAdapter
static RemoteDataAdapter create(URI anURL)
Parameters:
- anURL: a server target URI.
create (URI, String): RemoteDataAdapter
returns a preconfigured instance of the RemoteDataAdapter based on provided server target URI and aditionally sets custom name of the remote data service.
class method create(anURL: URI; aDataServiceName: String): RemoteDataAdapter
static RemoteDataAdapter create(URI anURL, String aDataServiceName)
Parameters:
- anURL: a server target URI.
- aDataServiceName: a custom name of server data service.
create (URI, String, String): RemoteDataAdapter
returns a preconfigured instance of the RemoteDataAdapter based on provided server target URI and aditionally sets custom names of the remote data and login services.
class method create(anURL: URI; aDataServiceName: String; aLoginServiceName: String): RemoteDataAdapter
static RemoteDataAdapter create(URI anURL, String aDataServiceName, String aLoginServiceName)
Parameters:
- anURL: a server target URI.
- aDataServiceName: a custom name of server data service.
- aLoginServiceName: a custom name of server login service. Default name is used if null or empty value was passed.
constructor
Default constructor that creates an instance of RemoteDataAdapter class with default data and login service names.
constructor
RemoteDataAdapter()
constructor (URI)
constructor(anURL: URI)
RemoteDataAdapter(URI anURL)
Parameters:
- anURL:
constructor (URI, String)
constructor(anURL: URI; aDataServiceName: String)
RemoteDataAdapter(URI anURL, String aDataServiceName)
Parameters:
- anURL:
- aDataServiceName:
constructor (URI, String, String)
constructor(anURL: URI; aDataServiceName: String; aLoginServiceName: String)
RemoteDataAdapter(URI anURL, String aDataServiceName, String aLoginServiceName)
Parameters:
- anURL:
- aDataServiceName:
- aLoginServiceName:
constructor (String, String)
Creates an instance of RemoteDataAdapter and sets custom names of remote services.
constructor(aDataServiceName: String; aLoginServiceName: String)
RemoteDataAdapter(String aDataServiceName, String aLoginServiceName)
Parameters:
- aDataServiceName: A custom name that will be used to talk to data service.
- aLoginServiceName: A custom name that will be used to talk to login service. If null or empty string is passed, then default will be used. you can pass null here if you know that you server doesn't requires authentication.
addListener
Add a subscriber to adapter's notifications.
method addListener(aListener: RemoteDataAdapterListener)
void addListener(RemoteDataAdapterListener aListener)
Parameters:
- aListener: an instance of RemoteDataAdapterListener interface implementation - adapters notification listener interface. If you need to subscribe on just some notification(s), you can use AbstractRemoteDataAdapter class by extending it and overriding only necessary methods.
applyChanges (DataTable[])
apply local changes of a set of data tables up to the server.
method applyChanges(aDataTablesArray: array of DataTable)
void applyChanges(DataTable[] aDataTablesArray)
Parameters:
- aDataTablesArray: a set of tables with changes to be sent.
applyChanges (Delta[])
apply changes from passed set of deltas up to the server. This overload doesn't need a data table to collect changes, but a manually created array of deltas.
Parameters:
- aDeltasArray: an array of deltas to send to the server.
applyChanges (DataTable)
apply changes that were made locally with specific data table to the server.
Parameters:
- aDataTable: a data table with changes to be sent.
applyChangesAsync (DataTable[], Callback): UpdateRequestTask
method applyChangesAsync(aDataTablesArray: array of DataTable; aCallback: Callback): UpdateRequestTask
UpdateRequestTask applyChangesAsync(DataTable[] aDataTablesArray, Callback aCallback)
Parameters:
- aDataTablesArray:
- aCallback:
applyChangesAsync (Delta[], Callback): UpdateRequestTask
method applyChangesAsync(aDeltasArray: array of Delta; aCallback: Callback): UpdateRequestTask
UpdateRequestTask applyChangesAsync(Delta[] aDeltasArray, Callback aCallback)
Parameters:
- aDeltasArray:
- aCallback:
applyChangesAsync (DataTable, Callback): UpdateRequestTask
method applyChangesAsync(aDataTable: DataTable; aCallback: Callback): UpdateRequestTask
UpdateRequestTask applyChangesAsync(DataTable aDataTable, Callback aCallback)
Parameters:
- aDataTable:
- aCallback:
executeCommand (String): RemoteDataAdapter.RemoteCommandResult
Provides the ability to dynamically invoke commands (stored procedures or SQL statements) from the Schema published by your service.
To enable execution of commands from the client, set the AllowExecuteCommand property of your DataAbstractService to true and ensure that all published Commands in your schema are safe for execution. Also, you need to have proper authentication methods in place to prevent anonymous users from making malicious calls.
method executeCommand(aName: String): RemoteDataAdapter.RemoteCommandResult
RemoteDataAdapter.RemoteCommandResult executeCommand(String aName)
Parameters:
- aName: a command name from Schema.
executeCommand (String, DataParameter[]): RemoteDataAdapter.RemoteCommandResult
Provides the ability to dynamically invoke commands (stored procedures or SQL statements) from the Schema published by your service. This is an overload that accepts command parameters. Here, you need to pass them as an array of initialized DataParameter instances.
Note, that output parameters must be also included in theese arrays.
method executeCommand(aName: String; inParams: array of DataParameter): RemoteDataAdapter.RemoteCommandResult
RemoteDataAdapter.RemoteCommandResult executeCommand(String aName, DataParameter[] inParams)
Parameters:
- aName: a command name from Schema.
- inParams: an array of command parameters.
executeCommand (String, String[], Object[]): RemoteDataAdapter.RemoteCommandResult
Provides the ability to dynamically invoke commands (stored procedures or SQL statements) from the Schema published by your service. This is an overload that accepts command parameters. Here, you need to pass them as two separate arrays: an array of parameter names and commensurate array of parameter values.
Note, that output parameters must be also included in these arrays.
method executeCommand(aName: String; aParameterNames: array of String; aParameterValues: array of Object): RemoteDataAdapter.RemoteCommandResult
RemoteDataAdapter.RemoteCommandResult executeCommand(String aName, String[] aParameterNames, Object[] aParameterValues)
Parameters:
- aName: a command name from Schema.
- aParameterNames: an array of connamd parameter names.
- aParameterValues: an array of command parameter values.
executeCommandAsync (String, DataParameter[], CommandRequestTask.Callback): CommandRequestTask
The asynchronous version of executeCommand method that provides the ability to dynamically invoke commands (stored procedures or SQL statements) from the Schema published by your service. This is an overload that accepts command parameters. Here, you need to pass them as an array of initialized DataParameter instances.
Note, that output parameters must be also included in theese arrays.
method executeCommandAsync(aName: String; inParams: array of DataParameter; aCallback: CommandRequestTask.Callback): CommandRequestTask
CommandRequestTask executeCommandAsync(String aName, DataParameter[] inParams, CommandRequestTask.Callback aCallback)
Parameters:
- aName: A command name from Schema.
- inParams: An array of command parameters.
- aCallback: An instance of a callback that will be notified after a command request finish.
executeCommandAsync (String, String[], Object[], CommandRequestTask.Callback): CommandRequestTask
The asynchronous version of executeCommand method that provides the ability to dynamically invoke commands (stored procedures or SQL statements) from the Schema published by your service. This is an overload that accepts command parameters. Here, you need to pass them as two separate arrays: an array of parameter names and commensurate array of parameter values.
Note, that output parameters must be also included in these arrays.
method executeCommandAsync(aName: String; aParameterNames: array of String; aParameterValues: array of Object; aCallback: CommandRequestTask.Callback): CommandRequestTask
CommandRequestTask executeCommandAsync(String aName, String[] aParameterNames, Object[] aParameterValues, CommandRequestTask.Callback aCallback)
Parameters:
- aName: A command name from Schema.
- aParameterNames: An array of connamd parameter names.
- aParameterValues: An array of command parameter values.
- aCallback: An instance of a callback that will be notified after a command request finish.
executeCommandAsync (String, CommandRequestTask.Callback): CommandRequestTask
The asynchronous version of executeCommand method that provides the ability to dynamically invoke commands (stored procedures or SQL statements) from the Schema published by your service.
To enable execution of commands from the client, set the AllowExecuteCommand property of your DataAbstractService to true and ensure that all published Commands in your schema are safe for execution. Also, you need to have proper authentication methods in place to prevent anonymous users from making malicious calls.
method executeCommandAsync(aName: String; aCallback: CommandRequestTask.Callback): CommandRequestTask
CommandRequestTask executeCommandAsync(String aName, CommandRequestTask.Callback aCallback)
Parameters:
- aName: A command name from Schema.
- aCallback: An instance of a callback that will be notified after a command request finish.
fill (DataTable[])
The method fills given data tables with the data from the server.
Parameters:
- aDataTablesArray: an array of data tables to fill.
fill (DataTable[], WhereExpression[])
The method fills given data tables with the data from the server with a glance of table names and correspondent Dynamic Where clauses.
method fill(aDataTablesArray: array of DataTable; aWhereClauses: array of WhereExpression)
void fill(DataTable[] aDataTablesArray, WhereExpression[] aWhereClauses)
Parameters:
- aDataTablesArray: an array of data tables for filling.
- aWhereClauses: an array of Dynamic Where clauses for applying during the fill request.
fill (DataTable[], TableRequestInfo[])
The method fills given data tables with the data from the server. This overload gives you significant possibilities to customize your fill requests, where you can use the TableRequestInfo, created by yourself. You can create its inheritors of version 5 and version 6 as well.
method fill(aDataTablesArray: array of DataTable; aTableRequestInfosArray: array of TableRequestInfo)
void fill(DataTable[] aDataTablesArray, TableRequestInfo[] aTableRequestInfosArray)
Parameters:
- aDataTablesArray: an array of data tables for filling.
- aTableRequestInfosArray: an array of table request objects for applying during the fill request.
fill (DataTable)
The method fills the given data table with the data from the server. Please, consider: * table should be named the same as one of the schema's tables. * all existing data in the table will be erased before filling it with new bundle from the server.
Parameters:
- aDataTable: a data table instance to fill.
fill (DataTable, WhereExpression)
The method fills given data table with the data from the server with a glance of the table name and a Dynamic Where clause.
method fill(aDataTable: DataTable; aWhereClause: WhereExpression)
void fill(DataTable aDataTable, WhereExpression aWhereClause)
Parameters:
- aDataTable: a data table instance for filling.
- aWhereClause: a Dynamic Where clause for applying during request.
fill (DataTable, TableRequestInfo)
The method fills given data table with the data from the server. This overload gives you significant possibilities to customize your fill request, where you can use the TableRequestInfo, created by yourself. You can create its inheritors of version 5 and version 6 as well.
method fill(aDataTable: DataTable; aTableRequestInfo: TableRequestInfo)
void fill(DataTable aDataTable, TableRequestInfo aTableRequestInfo)
Parameters:
- aDataTable: a data table instance for filling.
- aTableRequestInfo: a table request object instance for applying during request.
fillAsync (DataTable[], WhereExpression[], Callback): FillRequestTask
method fillAsync(aDataTablesArray: array of DataTable; aWhereClauses: array of WhereExpression; aCallback: Callback): FillRequestTask
FillRequestTask fillAsync(DataTable[] aDataTablesArray, WhereExpression[] aWhereClauses, Callback aCallback)
Parameters:
- aDataTablesArray:
- aWhereClauses:
- aCallback:
fillAsync (DataTable[], TableRequestInfo[], Callback): FillRequestTask
method fillAsync(aDataTablesArray: array of DataTable; aTableRequestInfosArray: array of TableRequestInfo; aCallback: Callback): FillRequestTask
FillRequestTask fillAsync(DataTable[] aDataTablesArray, TableRequestInfo[] aTableRequestInfosArray, Callback aCallback)
Parameters:
- aDataTablesArray:
- aTableRequestInfosArray:
- aCallback:
fillAsync (DataTable[], Callback): FillRequestTask
method fillAsync(aDataTablesArray: array of DataTable; aCallback: Callback): FillRequestTask
FillRequestTask fillAsync(DataTable[] aDataTablesArray, Callback aCallback)
Parameters:
- aDataTablesArray:
- aCallback:
fillAsync (DataTable, WhereExpression, Callback): FillRequestTask
method fillAsync(aDataTable: DataTable; aWhereClause: WhereExpression; aCallback: Callback): FillRequestTask
FillRequestTask fillAsync(DataTable aDataTable, WhereExpression aWhereClause, Callback aCallback)
Parameters:
- aDataTable:
- aWhereClause:
- aCallback:
fillAsync (DataTable, Callback): FillRequestTask
method fillAsync(aDataTable: DataTable; aCallback: Callback): FillRequestTask
FillRequestTask fillAsync(DataTable aDataTable, Callback aCallback)
Parameters:
- aDataTable:
- aCallback:
fillAsync (DataTable, TableRequestInfo, Callback): FillRequestTask
method fillAsync(aDataTable: DataTable; aTableRequestInfo: TableRequestInfo; aCallback: Callback): FillRequestTask
FillRequestTask fillAsync(DataTable aDataTable, TableRequestInfo aTableRequestInfo, Callback aCallback)
Parameters:
- aDataTable:
- aTableRequestInfo:
- aCallback:
fillWithSql
The method fills given data table with the data from the server with a glance of SQL string using TableRequestInfoV6 with DA SQL under the hood.
method fillWithSql(aDataTable: DataTable; aSql: String; aParamsArray: array of DataParameter)
void fillWithSql(DataTable aDataTable, String aSql, DataParameter[] aParamsArray)
Parameters:
- aDataTable: a data table instance for filling.
- aSql: A DA SQL query string.
- aParamsArray: Optional parameters, if such required by SQL string.
fillWithSqlAsync
The asynchronous version of fillWithSql method that fills given data table with the data from the server with a glance of SQL string using TableRequestInvoV6 with DA SQL under the hood.
method fillWithSqlAsync(aDataTable: DataTable; aSql: String; aParamsArray: array of DataParameter; aCallback: FillRequestTask.Callback): FillRequestTask
FillRequestTask fillWithSqlAsync(DataTable aDataTable, String aSql, DataParameter[] aParamsArray, FillRequestTask.Callback aCallback)
Parameters:
- aDataTable: A data table instance to fill.
- aSql: A DA SQL query string.
- aParamsArray: Optional parameters, if such required by SQL string.
- aCallback: A callback instance to be notified after a fill request finish.
finalize protected
Releases all resources that could possibly be used by the adapter's instance.
method finalize
void finalize()
login (String): Boolean
This methods tries to login with the given user name, password and connection name. Used for cases when the server side service has multiple connections.
method login(aLoginString: String): Boolean
Boolean login(String aLoginString)
Parameters:
- aLoginString: a preformatted LoginEx string.
login (String, String): Boolean
This method tries to login with the given user name and password. It uses login service proxy associated with the adapter.
method login(aUserName: String; aPassword: String): Boolean
Boolean login(String aUserName, String aPassword)
Parameters:
- aUserName: A user name string.
- aPassword: A user's password.
login (String, String, String): Boolean
This method tries to login with the given user name and password. It uses login service proxy associated with the adapter.
method login(aUserName: String; aPassword: String; aConnectionName: String): Boolean
Boolean login(String aUserName, String aPassword, String aConnectionName)
Parameters:
- aUserName: A user name string.
- aPassword: A user's password.
- aConnectionName: A connection name of database to use for login.
loginAsync (String, LoginRequestTask.Callback): LoginRequestTask
The asynchronous version of login method that tries to login with the given user name, password and connection name. It's used in case server side service has multiple connections.
method loginAsync(aLoginString: String; aCallback: LoginRequestTask.Callback): LoginRequestTask
LoginRequestTask loginAsync(String aLoginString, LoginRequestTask.Callback aCallback)
Parameters:
- aLoginString: A preformatted LoginEx string.
- aCallback: A callback instance to be notified after a login request finish.
loginAsync (String, String, LoginRequestTask.Callback): LoginRequestTask
The asynchronous version of login method that tries to login with the given user name and password.
method loginAsync(aUserName: String; aPassword: String; aCallback: LoginRequestTask.Callback): LoginRequestTask
LoginRequestTask loginAsync(String aUserName, String aPassword, LoginRequestTask.Callback aCallback)
Parameters:
- aUserName: A user name string.
- aPassword: A user's password.
- aCallback: A callback instance to be notified after a login request finish.
loginAsync (String, String, String, LoginRequestTask.Callback): LoginRequestTask
The asynchronous version of login method that tries to login with the given user name and password.
method loginAsync(aUserName: String; aPassword: String; aConnectionName: String; aCallback: LoginRequestTask.Callback): LoginRequestTask
LoginRequestTask loginAsync(String aUserName, String aPassword, String aConnectionName, LoginRequestTask.Callback aCallback)
Parameters:
- aUserName: A user name string.
- aPassword: A user's password.
- aConnectionName: A connection name of database to use for login.
- aCallback: A callback instance to be notified after a login request finish.
logout
Performs the log out.
method logout
void logout()
logoutAsync
Performs the log out asynchronously.
method logoutAsync(aCallback: Callback): LoginRequestTask
LoginRequestTask logoutAsync(Callback aCallback)
Parameters:
- aCallback: A callback instance to be notified after a login request finish.
readSchema
The method returns a Schema for the Data Abstract service and caches it to avoid redundant server load.
method readSchema(aForceReRead: Boolean): Schema
Schema readSchema(Boolean aForceReRead)
Parameters:
- aForceReRead: If true, methods forces to redownload schema from the server in spite of the cached value.
readSchemaAsync
The method returns a Schema for the Data Abstract service asynchronously and caches it to avoid redundant server load. If adapter has cached schema, method returns this instance without extra network call.
method readSchemaAsync(aForceReRead: Boolean; aCallback: SchemaRequestTask.Callback): SchemaRequestTask
SchemaRequestTask readSchemaAsync(Boolean aForceReRead, SchemaRequestTask.Callback aCallback)
Parameters:
- aForceReRead: If true, methods forces to redownload schema from the server in spite of the cached value.
- aCallback: A callback instance to be notified after schema request finishes.
removeListener
removes adapter's listener, if it was actually subscribed (by calling addListener method).
method removeListener(aListener: RemoteDataAdapterListener)
void removeListener(RemoteDataAdapterListener aListener)
Parameters:
- aListener: an instance of the listener to remove.
shutdown
The method should be called when you don't need the instance any more. Internally, it will release resources if any have been acquired by the adapter.
method shutdown
void shutdown()