TSimpleLoginService Class

From RemObjects Wiki
Jump to: navigation, search

This is a Library topic for Data Abstract for Delphi
This page is generated from external data, please do not update

InterfacesClassesEnumsAliasesImplements

Contents

Overview

Implements the base service for user authentication with the ISimpleLoginService service interface.

A service of this type will be automatically created for you if you select the Simple Login template when starting a new project.


Location

SimpleLoginService_Impl.pas

Implemented interfaces


Properties

AcquireConnection     (declared in TDataAbstractService)

Toggles whether the service can automatically acquire a connection when needed (true, default) or not (false).



property AcquireConnection: boolean read write


AllowAllFieldsInDynamicWhere     (declared in TDataAbstractService)

By security reasons, only fields that are present in table definition can be used in Dynamic Where expression.

This property allows to override default behavior and use any fields in such expressions. (Default value is False).



property AllowAllFieldsInDynamicWhere: Boolean read write


AllowDataAccess     (declared in TDataAbstractService)

Allows the clients to access schema information from the published schema (true, default) or not (false). Set this property to false if you want to prevent clients from accessing the data published by the ServiceSchema. This might be done on a per-client basis, depending on user rights, by setting the property on the OnActivate event.



property AllowDataAccess: boolean read write


AllowDynamicSelect     (declared in TDataAbstractService)

Allows clients to use Dynamic Select feature.



property AllowDynamicSelect: boolean read write


AllowDynamicWhere     (declared in TDataAbstractService)

Allows clients to use Dynamic Where feature.



property AllowDynamicWhere: boolean read write


AllowExecuteCommands     (declared in TDataAbstractService)

Allows clients to execute commands that are published in the schema (true) or not (false, default). Set this property to true if you want to enable clients to manually execute commands defined in the ServiceSchema.



property AllowExecuteCommands: boolean read write


AllowExecuteSQL     (declared in TDataAbstractService)

Allows clients to execute custom SQL, as command or for retrieving data published in the schema (true) or not (false, default). Since enabling this option opens a huge security risk, AllowExecuteSQL is set to false by default. If enabled, client applications can send custom SQL text to the server for execution, including code that could potentially harm or destroy the database. Even when using proper user authentication and trusting the client applications, this is a high security risk, as client applications could be modified to send malicious code, or a new client could be written by attackers.



property AllowExecuteSQL: boolean read write


AllowSchemaAccess     (declared in TDataAbstractService)

Allows clients to access data from the published schema (true, default) or not (false). While access to schema information from the server is often helpful while designing the client application, most clients do not need to refresh schema information from the server at runtime. Although proper use of user authentication will restrict access, disabling this option for production servers prevents unnecessary exposure of the server's schema.



property AllowSchemaAccess: boolean read write


AllowUpdates     (declared in TDataAbstractService)

Allows clients to update data.



property AllowUpdates: boolean read write


AllowWhereSQL     (declared in TDataAbstractService)

Allows clients to transmit custom WHERE clauses as part of fetching data (true) or not (false, default). Since WHERE clauses are plain text base SQL, enabling this option opens a huge security risk, as malicious clients could use SQL injections to perform unexpected database operations as part of the submitted WHERE clause. Even when using proper user authentication and trusting the client applications, this is a high security risk, as client applications could be modified to send malicious code, or a new client could be written by attackers. Please also refer to the Where Clauses help topic for more details.



property AllowWhereSQL: boolean read write


AutoCreateBusinessProcessors     (declared in TDataAbstractService)

Specifies if the service will automatically instantiate TDABusinessProcessors to process deltas, if needed. If set to true (default), the service will use the TDABusinessProcessors dropped on the service to perform updates, if present, but will automatically create new Business Processors if none are configured for a particular data table. If set to false, the server will only process deltas for tables that explicitly have a business processor configured for them; if none is configured, the delta will be rejected with an exception.



property AutoCreateBusinessProcessors: boolean read write


ClientID     (declared in TRORemoteDataModule)

The unique identifier for the client connected to the service. It is equal to the session ID if the session already exists. When the service method is called, this property is already initialized with a proper value. Do not change it unless you know what you are doing!



property ClientID: TGUID read write


Connection     (declared in TDataAbstractService)

Returns a live connection to the back-end database based on the configured ConnectionName value. If a connection was previously requested, the same instance will be returned, if a fresh connection to the database couldn't be obtained from the connection manager. Once a connection is acquired, it will be held on until the service gets deactivated, or ReleaseConnection is called.



property Connection: IDAConnection read write


ConnectionName     (declared in TDataAbstractService)

Defines the name of the connection that this service will use to connect to the back-end database. If set, all data access done by the service will use the specified connection; if not set, the default connection as defined in connection manager will be used. A typical use case for this property would be to set the connection name in the OnActivate or BeforeAcquireConnection event to match a specific connection, which, for example, could have been stored in the Sessions. The default code provided by the MultiDb Server template uses this approach. When setting ConnectionName and a connection is already acquired, make sure to call the ReleaseConnection method, so that a new connection will be obtained when needed.



property ConnectionName: string read write


EventRepository     (declared in TRORemoteDataModule)

Points to the event repository (TROEventRepository instance) for the service. The value must be set to use the events feature.



property EventRepository: TROEventRepository read write


ExportedDataTables     (declared in TDataAbstractService)

Maintains a list of server-side TDADataTables that will be published by the server, alongside the data tables defined in the schema. This allows the service to publish data that does not necessarily come from the back-end database targeted by the schema and connection, but also from other sources. For example, the TDADataTables could be filled from a different database, loaded from a file on disk, or manually filled from code. For the client application, these tables will look like any other data table published by the server.



property ExportedDataTables: TDADataTableReferenceCollection read write


LegacyEvents     (declared in TRORemoteDataModule)

Enables or disables the legacy events mode for the service. The default value is true. The legacy mode is less secure and it is recommended to set this property to false for new projects. Note that refusing to use the legacy mode will break compatibility with legacy Delphi clients.



property LegacyEvents: boolean read write


NewSession     (declared in TRORemoteDataModule)

Indicates that the client's session was just created, i.e. this indicates the first connection of a so far unknown client.



property NewSession: boolean read


ProcessDeltasWithoutUpdateRules     (declared in TDataAbstractService)

Manages whether the service will process deltas for which no update rules have been defined (true) or not (false). If set to true (default), the service will process all delta packets it receives. If set to false, it will only process those deltas for which an update rule has been defined. Please refer to the Update Rules help topic for more details on update rules.



property ProcessDeltasWithoutUpdateRules: boolean read write


RefCount     (declared in TRORemoteDataModule)

Reference counter - this class is the interfaced object.



property RefCount: integer read


RequiresSession     (declared in TRORemoteDataModule)

This property should be set to true (perhaps with the designer) to make the service protected and to disallow unauthenticated clients to call its methods. Read more.



property RequiresSession: boolean read write


ReturnFullSchema     (declared in TDataAbstractService)

Allows to return full schema including content of statements. by default is False. We recommend to not change this value by security reasons.



property ReturnFullSchema: boolean read write


ReturnUpdateFailureDelta     (declared in TDataAbstractService)

Part of Reconcile Dialog feature. Allows to return of failed changes to client via setting RaiseExceptionAtError for all autogenerated TDABusinessProcessor. by default is True.

Can be used for applying changes for several tables in one transaction with False value.

See also TDABusinessProcessor.RaiseExceptionAtError



property ReturnUpdateFailureDelta: boolean read write


ScriptProvider     (declared in TDataAbstractService)

Specifies Business Rules Scripting provider.



property ScriptProvider: IDAScriptProvider read write


ServiceDataStreamer     (declared in TDataAbstractService)

References the TDADataStreamer that will be used to stream data to and from the network. The data streamer determines the format that will be used to send data on the wire, so the type selected on the service must match the type selected for the TDARemoteDataAdapter.DataStreamer property on the client. Note that data streamers are not re-entrant, so every service instance must use its own data streamer instance. The best way to achieve this is to make sure the data streamer component is dropped into the service module itself, and not referenced from elsewhere. Also note that the data streamer assigned to the ServiceDataStreamer should be reserved for use by the service only. If you do any custom processing requiring a data streamer in your own code (such as filling server-side TDADataTables), make sure to use a second streamer instance for this, to avoid conflicts.



property ServiceDataStreamer: TDADataStreamer read write


ServiceSchema     (declared in TDataAbstractService)

This property points to the TDASchema component defining the schema that will be published by this service. This can be a schema component located on the service data module or (more typically) on a separate global data module in the server application. Data Abstract uses a 1:1 mapping of services and schemas, where every service publishes one schema. Depending on your application design and the scope of your server, you might only use one schema for the entire data access, or logically partition your data tables across different schemas (and services). Locating the schema on a global data module rather than the service module itself might provide a slight performance benefit, as the schema structure only has to be loaded into memory once (on application startup), not every time a new service instance is created. Also note that the TDAConnectionManager (referenced from the schema) must be located off the service module and in a global location for connection pooling to work properly across service instances.



property ServiceSchema: TDASchema read write


Session     (declared in TRORemoteDataModule)

Provides access to the session object of the current connection. If the session does not exist, it is created at the moment of property access.



property Session: TROSession read


SessionManager     (declared in TRORemoteDataModule)

Points to the session manager to use. It is necessary to assign the session manager if the protected service is being developed and/or it is necessary to use the events feature.



property SessionManager: TROCustomSessionManager read write


Transport     (declared in TRORemoteDataModule)

Provides access to the transport object that processes the current network (or other) connection to the server. Various information, such as client IP address, can be available via the transport objects.



property Transport: IROTransport read


Instance Methods

constructor Create   override     (declared in TDataAbstractService)

Standard component constructor.


constructor Create(aOwner: TComponent)


Parameters:

  • aOwner:


destructor Destroy   override     (declared in TDataAbstractService)



destructor Destroy


_AddRef   protected virtual stdcall     (declared in TRORemoteDataModule)

Increments the reference counter of the instance. Avoid calling this method unless necessary.


function _AddRef: Integer


_OnActivate   protected     (declared in TRORemoteDataModule)

Called just after the service is created and before any service method is called. Don't override this method, use the OnActivate event instead.


procedure _OnActivate(aClientID: TGUID; const aMessage: IROMessage)


Parameters:

  • aClientID:
  • aMessage:


_OnDeactivate   protected     (declared in TRORemoteDataModule)

Called after the service method completes and before the service instance is freed. Don't override this method, use the OnDeactivate event instead.


procedure _OnDeactivate(aClientID: TGUID)


Parameters:

  • aClientID:


_Release   protected virtual stdcall     (declared in TRORemoteDataModule)

Decrements the reference counter of the instance. Avoid calling this method unless necessary.


function _Release: Integer


AllowRemoteEventsRegistration   protected     (declared in TRORemoteDataModule)

Obsolete, replaced by the LegacyEvents property.


function AllowRemoteEventsRegistration: boolean


Assign   override



procedure Assign(Source: TPersistent)


Parameters:

  • Source:


Check   protected     (declared in TDataAbstractService)

Validates TDataAbstractService properties.


procedure Check(CheckOnlyDataStreamer: Boolean)


Parameters:


CheckForConnectionManager     (declared in TDataAbstractService)

Validates ServiceSchema.ConnectionManager property.


procedure CheckForConnectionManager


CreateSession     (declared in TRORemoteDataModule)

Creates a new session object and makes it available via the Session property. As a rule, there is no need to call this method because the session is created automatically when required.


procedure CreateSession


CustomRequireSession   protected virtual     (declared in TRORemoteDataModule)

Internal use only, don't override.


function CustomRequireSession(const aMessage: IROMessage): boolean


Parameters:

  • aMessage:


DestroySession     (declared in TRORemoteDataModule)

Destroys the current session object. This method is primarily used to destroy the session in case of unsuccessful client authentication.


procedure DestroySession


DoBeforeGetDatasetData   protected virtual     (declared in TDataAbstractService)

Fires BeforeGetDatasetData event.


procedure DoBeforeGetDatasetData(const aDataset: IDADataset; const aIncludeSchema: Boolean; const aMaxRecords: Integer)


Parameters:

  • aDataset:
  • aIncludeSchema:
  • aMaxRecords:


DoBeforeGetDatasetSchema   protected     (declared in TDataAbstractService)

Fires BeforeGetDatasetSchema event.


procedure DoBeforeGetDatasetSchema(const aDataset: IDADataset)


Parameters:

  • aDataset:


DoCommitTransaction   protected virtual     (declared in TDataAbstractService)

Commits transaction, fires OnUpdateDataCommitTransaction event and related Business Rules Scripting Events


procedure DoCommitTransaction(aConnection: IDAConnection)


Parameters:

  • aConnection:


DoOnActivate   protected virtual     (declared in TRORemoteDataModule)

Internal use only, don't override. Use the OnActivate event instead.


procedure DoOnActivate(aClientID: TGUID; const aMessage: IROMessage)


Parameters:

  • aClientID:
  • aMessage:


DoOnDeactivate   protected override     (declared in TDataAbstractService)

Destroys default connection.


procedure DoOnDeactivate(aClientID: TGUID)


Parameters:

  • aClientID:


DoRollbackTransaction   protected virtual     (declared in TDataAbstractService)

Rollbacks transaction, fires OnUpdateDataRollBackTransaction event and related Business Rules Scripting Events


procedure DoRollbackTransaction(aConnection: IDAConnection)


Parameters:

  • aConnection:


DoStartTransaction   protected virtual     (declared in TDataAbstractService)

Starts transaction, fires OnUpdateDataBeginTransaction event and related Business Rules Scripting Events


function DoStartTransaction(var aConnection: IDAConnection): Boolean


Parameters:

  • aConnection:


DoValidateCommandAccess   protected     (declared in TDataAbstractService)

Fires ValidateCommandExecution event and related Business Rules Scripting Events


procedure DoValidateCommandAccess(const aConnection: IDAConnection; const aDatasetName: string; const aParamNames: array of string; const aParamValues: array of variant)


Parameters:

  • aConnection:
  • aDatasetName:
  • aParamNames:
  • aParamValues:


DoValidateDataTableAccess   protected     (declared in TDataAbstractService)

Fires ValidateDatasetAccess event and related Business Rules Scripting Events


procedure DoValidateDataTableAccess(const aDatasetName: string; const aParamNames: array of string; const aParamValues: array of variant)


Parameters:

  • aDatasetName:
  • aParamNames:
  • aParamValues:


DoValidateDirectSQLAccess   protected     (declared in TDataAbstractService)

Fires ValidateDirectSQLAccess event and related Business Rules Scripting Events


procedure DoValidateDirectSQLAccess(const aConnection: IDAConnection; const aSQLText: string; const aParamNames: array of string; const aParamValues: array of variant)


Parameters:

  • aConnection:
  • aSQLText:
  • aParamNames:
  • aParamValues:


ExecuteCommand   protected     (declared in TDataAbstractService)

Executes specified command


function ExecuteCommand(const aCommandName: Utf8String; const aParameterArray: DataParameterArray): Integer


Parameters:

  • aCommandName: Command name in the Schema
  • aParameterArray: List of input paramaters


ExecuteCommandEx   protected     (declared in TDataAbstractService)

Executes specified command


function ExecuteCommandEx(const aCommandName: Utf8String; const aInputParameters: DataParameterArray; out aOutputParameters: DataParameterArray): Integer


Parameters:

  • aCommandName: Command name in the Schema
  • aInputParameters: List of input paramaters
  • aOutputParameters: List of output paramaters


GetCommandSchema   protected     (declared in TDataAbstractService)

Returns the definitions of the schema commands identified by the names passed through the parameter.


function GetCommandSchema(const aCommandNameArray: StringArray): Utf8String


Parameters:

  • aCommandNameArray: specifies the name or names of the commands


GetConnectionForObject   protected virtual     (declared in TDataAbstractService)

Returns connection for specified object


function GetConnectionForObject(const aName: string): IDAConnection


Parameters:

  • aName: name of object


GetData   protected     (declared in TDataAbstractService)

Returns a stream that includes the data of all data tables indicated in the first parameter. Each data table can return a different number of rows or be opened using specific parameters that are passed as TableInfoRequest in the second parameter.

This method provides the primary means of fetching data from the server to the client, and is invoked when the Fill method is called on a client-side TDARemoteDataAdapter component.


function GetData(const aTableNameArray: StringArray; const aTableRequestInfoArray: TableRequestInfoArray): Binary


Parameters:

  • aTableNameArray: specifies the name or names of the tables to retrieve
  • aTableRequestInfoArray: specifies one or several TableRequestInfo with additional options


GetDatasetScripts   protected     (declared in TDataAbstractService)

Returns client-side Business Rules scripts in xml format


function GetDatasetScripts(const DatasetNames: Utf8String): Utf8String


Parameters:

  • DatasetNames: List of dataset names which should be devided by comma


GetDispatchInfo   protected virtual     (declared in TRORemoteDataModule)

Fires the OnGetDipsatchInfo event. For internal use only, don't call or override.


procedure GetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage)


Parameters:

  • aTransport:
  • aMessage:


GetEventsData   protected     (declared in TRORemoteDataModule)

Collects events data to the memory stream. For internal use only, don't call or override.


function GetEventsData(const ClientID: Ansistring; out EventsData: Binary): integer


Parameters:

  • ClientID:
  • EventsData:


GetSchema   protected     (declared in TDataAbstractService)

Returns the schema referenced by the service to the calling client application, as XML.


function GetSchema(const aFilter: Utf8String): Utf8String


Parameters:

  • aFilter:


GetScriptContext   protected virtual     (declared in TDataAbstractService)

Returns Business Rules script content


function GetScriptContext: IDAServerScriptContext


GetTableSchema   protected     (declared in TDataAbstractService)

Returns the definitions of the schema data tables identified by the names passed through the parameter.


function GetTableSchema(const aTableNameArray: StringArray): Utf8String


Parameters:

  • aTableNameArray: specifies the name or names of the tables


IsRetained   protected     (declared in TRORemoteDataModule)

For internal use only.


function IsRetained(const anObject: TObject): boolean


Parameters:

  • anObject:


Loaded   protected override     (declared in TDataAbstractService)

Initializes the component after the form file has been read into memory.


procedure Loaded


Login   protected



function Login(const aUserID: Utf8String; const aPassword: Utf8String; out aUserInfo: UserInfo): Boolean


Parameters:

  • aUserID:
  • aPassword:
  • aUserInfo:


LoginEx   protected override



function LoginEx(const aLoginString: Utf8String): Boolean


Parameters:

  • aLoginString:


Logout   protected     (declared in TBaseLoginService)



procedure Logout


Notification   protected override     (declared in TDataAbstractService)

For internal use only.


procedure Notification(AComponent: TComponent; Operation: TOperation)


Parameters:

  • AComponent:
  • Operation:


QueryInterface   protected override     (declared in TRORemoteDataModule)

For internal use only, this method is required for COM.


function QueryInterface(const IID: TGUID; out Obj: ): HResult


Parameters:

  • IID:
  • Obj:


RegisterEventClient (AnsiString, AnsiString)   protected overload     (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type. Must be called for every client that needs to receive events in LegacyEvents = false mode.


procedure RegisterEventClient(const ClientID: AnsiString; const EventTypes: AnsiString)


Parameters:

  • ClientID: Client identifier to subscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.


RegisterEventClient (TGUID, AnsiString)   protected overload     (declared in TRORemoteDataModule)



procedure RegisterEventClient(const ClientID: TGUID; const EventTypes: AnsiString)


Parameters:

  • ClientID:
  • EventTypes:


RegisterEventClient (TROSession, AnsiString)   protected overload     (declared in TRORemoteDataModule)



procedure RegisterEventClient(const aSession: TROSession; const EventTypes: AnsiString)


Parameters:

  • aSession:
  • EventTypes:


RegisterForDataChangeNotification   protected     (declared in TDataAbstractService)

Registers a new table which will be refreshed automatically after other users apply changes to it.

This method isn't implemented yet!


procedure RegisterForDataChangeNotification(const aTableName: Utf8String)


Parameters:

  • aTableName: table name


ReleaseConnection     (declared in TDataAbstractService)

Releases any connection currently acquired in the Connection property.


procedure ReleaseConnection


ReleaseObject   protected     (declared in TRORemoteDataModule)

For internal use only.


procedure ReleaseObject(const anObject: TObject)


Parameters:

  • anObject:


RetainObject   protected     (declared in TRORemoteDataModule)

For internal use only.


procedure RetainObject(const anObject: TObject)


Parameters:

  • anObject:


ServiceValidateRoles   protected     (declared in TRORemoteDataModule)



procedure ServiceValidateRoles(aRequiredRoles: array of string)


Parameters:

  • aRequiredRoles:


SimpleGetData   protected virtual     (declared in TDataAbstractService)

Simplified GetData method that is used in Odata calls


function SimpleGetData(const Request: SimpleRequestInfoArray): SimpleDataResultArray


Parameters:

  • Request: the requests to send to the server. These will all be processed in the same transaction.


SimpleUpdateData   protected virtual     (declared in TDataAbstractService)

Simplified UpdateData method that is used in Odata calls


function SimpleUpdateData(const aDelta: SimpleDeltaArray): SimpleDeltaArray


Parameters:

  • aDelta: delta list to process


SQLExecuteCommand   protected     (declared in TDataAbstractService)

Executes the passed SQL statement as a command.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set False by default, to prevent SQL commands from being executed.


function SQLExecuteCommand(const aSQLText: Utf8String): Integer


Parameters:

  • aSQLText: SQL statement


SQLExecuteCommandEx   protected     (declared in TDataAbstractService)

Executes the passed SQL statement as a command. Supports Dynamic Where feature.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set False by default, to prevent SQL commands from being executed.


function SQLExecuteCommandEx(const aSQLText: Utf8String; const aDynamicWhereXML: UnicodeString): Integer


Parameters:

  • aSQLText: SQL statement
  • aDynamicWhereXML: xml with Dynamic Where condition


SQLGetData   protected     (declared in TDataAbstractService)

Executes the passed SQL statement and returns the record set as streamed data table.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set false by default, to prevent SQL commands from being executed.


function SQLGetData(const aSQLText: Utf8String; const aIncludeSchema: Boolean; const aMaxRecords: Integer): Binary


Parameters:

  • aSQLText: SQL statement
  • aIncludeSchema: Specifies that response should contain schema
  • aMaxRecords: Specifies the maximum number of records to retrieve from the server. A value of -1 (default) will retrieve all records.


SQLGetDataEx   protected     (declared in TDataAbstractService)

Executes the passed SQL statement and returns the record set as streamed data table. Supports Dynamic Where feature.

Note: Allowing clients to execute arbitrary SQL statements poses a security risk and should only be allowed with caution and when using proper authentication mechanisms to prevent anonymous users from making such calls.

The AllowExecuteCommands property is set false by default, to prevent SQL commands from being executed.


function SQLGetDataEx(const aSQLText: Utf8String; const aIncludeSchema: Boolean; const aMaxRecords: Integer; const aDynamicWhereXML: UnicodeString): Binary


Parameters:

  • aSQLText: SQL statement
  • aIncludeSchema: Specifies that response should contain schema
  • aMaxRecords: Specifies the maximum number of records to retrieve from the server. A value of -1 (default) will retrieve all records.
  • aDynamicWhereXML: xml with Dynamic Where condition


UnregisterEventClient   protected     (declared in TRORemoteDataModule)

The action is opposite to RegisterEventClient, it cancels the subscription. Unregistration is not absolutely necessary as the client session dies after some time of inactivity but allows to conserve some system resources.


procedure UnregisterEventClient(const ClientID: AnsiString; const EventTypes: AnsiString)


Parameters:

  • ClientID: Client identifier to unsubscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to unsubscribe the client from.


UnregisterForDataChangeNotification   protected     (declared in TDataAbstractService)

Unregisters a table that was registered by the RegisterForDataChangeNotification method.

This method isn't implemented yet!


procedure UnregisterForDataChangeNotification(const aTableName: Utf8String)


Parameters:

  • aTableName: table name


UpdateData   protected     (declared in TDataAbstractService)

Applies the deltas encoded in the passed stream to the database and returns a stream that includes status information about the applied updates and possibly refreshed data for the client.

This method provides the primary means of applying data updates from the client back to the server, and is invoked when the Update method is called on a client-side remote data adapter component.


function UpdateData(const aDelta: Binary): Binary


Parameters:

  • aDelta: delta list to process


Events

AfterAcquireConnection     (declared in TDataAbstractService)

Fires right after a new connection is acquired through the Connection property. Use this event to make perform initializations on the new connection, such as opening a transaction, or setting connection options.



property AfterAcquireConnection: TDAConnectionAcquiredEvent read write delegate: procedure Invoke(Sender: TDARemoteService; const ConnectionName: string; const AcquiredConnection: IDAConnection)


AfterExecuteCommand     (declared in TDataAbstractService)

Fires right after a command was executed.



property AfterExecuteCommand: TDAAfterExecuteCommandEvent read write delegate: procedure Invoke(const Sender: IDASQLCommand; ActualSQL: string; ElapsedMilliseconds: Cardinal)


AfterGetDatasetData     (declared in TDataAbstractService)

Fires right after data for a dataset (data table) was retrieved.



property AfterGetDatasetData: TDAGetDatasetDataEvent read write delegate: procedure Invoke(const Dataset: IDADataset; const IncludeSchema: Boolean; const MaxRecords: Integer)


AfterGetDatasetSchema     (declared in TDataAbstractService)

Fires right after schema info for a dataset (data table) was retrieved.



property AfterGetDatasetSchema: TDAGetDatasetSchemaEvent read write delegate: procedure Invoke(const Dataset: IDADataset)


AfterProcessDeltas     (declared in TDataAbstractService)

Fires right after deltas for a data table have been processed.



property AfterProcessDeltas: TDAProcessDeltasEvent read write delegate: procedure Invoke(Sender: TDARemoteService; DeltaStructs: TDADeltaStructList)


AfterReleaseConnection     (declared in TDataAbstractService)

Fires right after a connection is released.



property AfterReleaseConnection: TDAConnectionReleasedEvent read write delegate: procedure Invoke(Sender: TDARemoteService; const ConnectionName: string)


BeforeAcquireConnection     (declared in TDataAbstractService)

Fires just before a new connection is acquired through the Connection property. Use this event to make last-minute configurations before the connection will be acquired, such as changing the ConnectionName.



property BeforeAcquireConnection: TDAAcquireConnectionEvent read write delegate: procedure Invoke(Sender: TDARemoteService; var ConnectionName: string)


BeforeExecuteCommand     (declared in TDataAbstractService)

Fires just before a command will be executed.



property BeforeExecuteCommand: TDABeforeExecuteCommandEvent read write delegate: procedure Invoke(const Sender: IDASQLCommand)


BeforeExecuteDeltaCommand     (declared in TDataAbstractService)

Fires just before a delta command will be executed.



property BeforeExecuteDeltaCommand: TDABeforeExecuteCommandEvent read write delegate: procedure Invoke(const Sender: IDASQLCommand)


BeforeGetDatasetData     (declared in TDataAbstractService)

Fires just before data for a dataset (data table) is retrieved.



property BeforeGetDatasetData: TDAGetDatasetDataEvent read write delegate: procedure Invoke(const Dataset: IDADataset; const IncludeSchema: Boolean; const MaxRecords: Integer)


BeforeGetDatasetSchema     (declared in TDataAbstractService)

Fires just before schema info for a dataset (data table) is retrieved.



property BeforeGetDatasetSchema: TDAGetDatasetSchemaEvent read write delegate: procedure Invoke(const Dataset: IDADataset)


BeforeProcessDeltas     (declared in TDataAbstractService)

Fires just before deltas for a data table will be processed.



property BeforeProcessDeltas: TDAProcessDeltasEvent read write delegate: procedure Invoke(Sender: TDARemoteService; DeltaStructs: TDADeltaStructList)


BeforeReleaseConnection     (declared in TDataAbstractService)

Fires just before the connection is released. Use this event to perform any finalization tasks on the new connection, such as closing a transaction, or setting connection options.



property BeforeReleaseConnection: TDAConnectionAcquiredEvent read write delegate: procedure Invoke(Sender: TDARemoteService; const ConnectionName: string; const AcquiredConnection: IDAConnection)


OnAcquireConnectionFailure     (declared in TDataAbstractService)

Fired when acquiring a connection failed.



property OnAcquireConnectionFailure: TDAAcquireConnectionFailureEvent read write delegate: procedure Invoke(Sender: TDARemoteService; const ConnectionName: string; Error: Exception)


OnActivate     (declared in TRORemoteDataModule)

Called just after the service is created and before any service method is called. Handle this event for everything you need to do when the service instance is created.



property OnActivate: TActivateEvent read write delegate: procedure Invoke(const aClientID: TGUID; aSession: TROSession; const aMessage: IROMessage)


OnBeforeRegisterEventClient     (declared in TRORemoteDataModule)

Called when the new client is being registered to receive events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).



property OnBeforeRegisterEventClient: TRegisterEventClientEvent read write delegate: procedure Invoke(const aClientID: TGUID; const EventTypes: Ansistring)


OnBeforeUnregisterEventClient     (declared in TRORemoteDataModule)

Called when the client is being unsubscribed from events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).



property OnBeforeUnregisterEventClient: TRegisterEventClientEvent read write delegate: procedure Invoke(const aClientID: TGUID; const EventTypes: Ansistring)


OnBusinessProcessorAutoCreated     (declared in TDataAbstractService)

Fires whenever a new TDABusinessProcessor was auto-created to process deltas. You can use this event to perform additional configuration on the Business Processor before it will be used.



property OnBusinessProcessorAutoCreated: TDABusinessProcessorAutoCreatedEvent read write delegate: procedure Invoke(aSender: TRORemoteDataModule; BusinessProcessor: TDABusinessProcessor)


OnDeactivate     (declared in TRORemoteDataModule)

Called after the service method completes and before the service instance is freed. Handle this event to perform actions on service destruction, such as disposing of resources.



property OnDeactivate: TDeactivateEvent read write delegate: procedure Invoke(const aClientID: TGUID; aSession: TROSession)


OnGetDispatchInfo     (declared in TRORemoteDataModule)

This event is fired before the invoker executes the service method. Handle this event to preview remote methods about to be executed; the input parameters allow to get all information about the upcoming call including the remote method parameters and the calling client transport object.



property OnGetDispatchInfo: TGetDispatchInfoEvent read write delegate: procedure Invoke(const aTransport: IROTransport; const aMessage: IROMessage)


OnGetSchemaAsXMLEvent     (declared in TDataAbstractService)

Fires whenever a client retrieves the ServiceSchema. You can use this event to manually adjust or filter the Schema XML before it will be returned to the client.



property OnGetSchemaAsXMLEvent: TDAGetSchemaAsXMLEvent read write delegate: procedure Invoke(Sender: TDARemoteService; var SchemaXML: AnsiString)


OnLogin

Implements this event handler to provide the actual login procedure. Ideally this method should:

  • Validate the passed login credentials,
  • Create a new session if login is considered successful,
  • Fill the outgoing UserInfo class with any information that should be sent back to the client.

Skeleton code for the event handler will automatically be created for you if you select the Simple Login template when starting a new project.



property OnLogin: TSimpleLoginEvent read write delegate: procedure Invoke(Sender: TObject; aUserID: Utf8String; aPassword: Utf8String; out aUserInfo: UserInfo; var aLoginSuccessful: boolean)


OnLogout     (declared in TBaseLoginService)

Implement this event handler to provide the actual logout procedure.



property OnLogout: TNotifyEvent read write


OnProcessDeltasError     (declared in TDataAbstractService)

Fires if an error occurred while processing deltas. Among other things, you can use this event to determine whether processing of the remaining delta changes should continue, or if all changes should be rejected.



property OnProcessDeltasError: TDAProcessDeltasErrorEvent read write delegate: procedure Invoke(Sender: TDARemoteService; DeltaStructs: TDADeltaStructList; Error: Exception; var DoRaise: boolean)


OnUnknownMacroVariable     (declared in TDataAbstractService)

Fires when unknown macro variable is found. it can be usable when user-defined variables are used inside sql or Dynamic Where expression.



property OnUnknownMacroVariable: TOnUnknownIdentifier read write delegate: function Invoke(Sender: TObject; const Name: string; const OrgName: string; var Value: string): Boolean


OnUpdateDataBeginTransaction     (declared in TDataAbstractService)

Fires when a transaction will be started for processing a new set of deltas. You can handle this event to determine if the transaction should be started (default) or not.



property OnUpdateDataBeginTransaction: TDAUpdateDataTransactionEvent read write delegate: procedure Invoke(Sender: TDARemoteService; var UseDefaultTransactionLogic: Boolean)


OnUpdateDataCommitTransaction     (declared in TDataAbstractService)

Fires when a transaction used for processing deltas will be committed. You can handle this event to determine if the transaction should be committed (default) or not.



property OnUpdateDataCommitTransaction: TDAUpdateDataTransactionEvent read write delegate: procedure Invoke(Sender: TDARemoteService; var UseDefaultTransactionLogic: Boolean)


OnUpdateDataRollBackTransaction     (declared in TDataAbstractService)

Fires when a transaction used for processing deltas will be rolled back due to errors. You can handle this event to determine if the transaction should be rolled back (default) or not.



property OnUpdateDataRollBackTransaction: TDAUpdateDataTransactionEvent read write delegate: procedure Invoke(Sender: TDARemoteService; var UseDefaultTransactionLogic: Boolean)


OnValidateRoles     (declared in TRORemoteDataModule)



property OnValidateRoles: TValidateRolesEvent read write delegate: procedure Invoke(aRoles: array of string; var aAllow: Boolean)


ValidateCommandExecution     (declared in TDataAbstractService)

Fires before a command is executed. You can use this event handler to do validation, for example to check if the current user is allowed to execute the command in question, and raise an exception if the operation should be aborted.



property ValidateCommandExecution: TDASchemaElementAccessValidationEvent read write delegate: procedure Invoke(Sender: TObject; const aConnection: IDAConnection; const aDatasetName: string; const aParamNames: array of string; const aParamValues: array of variant; aSchema: TDASchema; var Allowed: boolean)


ValidateDatasetAccess     (declared in TDataAbstractService)

Fires before a data access retrieves data tables. You can use this event handler to do validation, for example to check if the current user is allowed to access the data table(s) in question, and raise an exception if the data access should be aborted.



property ValidateDatasetAccess: TDASchemaElementAccessValidationEvent read write delegate: procedure Invoke(Sender: TObject; const aConnection: IDAConnection; const aDatasetName: string; const aParamNames: array of string; const aParamValues: array of variant; aSchema: TDASchema; var Allowed: boolean)


ValidateDirectSQLAccess     (declared in TDataAbstractService)

Fires before a SQL command is executed. You can use this event handler to do validation, for example to check if the current user is allowed to execute the command in question, and raise an exception if the operation should be aborted.



property ValidateDirectSQLAccess: TDASQLValidationEvent read write delegate: procedure Invoke(Sender: TObject; const aConnection: IDAConnection; const aSQLText: string; const aParamNames: array of string; const aParamValues: array of variant; var Allowed: boolean)


See Also


Product: RemObjects Data Abstract
Available Editions: Data Abstract for .NET, Delphi and Xcode

GlossaryArticlesFeaturesLibrarySamples

Personal tools
Namespaces

Variants
Actions
Navigation
products
platforms
special
Toolbox