RS Target Methods

RS Target Connector Overview

The following diagram details the interaction between the Agent and a target Connector. Review the methods listed below the diagram.

RS Target Methods

IConnector.Preconnect

Preconnect allows a Connector to define the user interface (UI) that users use to create connections. Use Preconnect to specify any fields, such as Username, Password, or Database Name, that require user input to connect to your technology. Once a connection has been created, Preconnect is only called again if a user re-opens the connection UI to adjust the connection settings.

IConnector.Connect

Connect instructs the Connector to open communication with its datastore. The Connector can choose to maintain or drop this connection as desired while the Connector is in use.  Even if your Connector does not use this method to initialize a connection and keep it open, use the method to test that a connection can be made when it is called.

IConnector.Disconnect

Disconnect is called to instruct the Connector to close communication from its datastore and free any resources that may be associated with the connection.

IConnector.ExecuteOperation

ExecuteOperation is called by TIBCO Scribe® to perform one or more operations, such as create, update, or delete, on a given data object type, for example, an Account. For the TIBCO Scribe® RS Target role, you must implement all three operations, create, update, and delete. These operations are called with the OperationInput object which stores the filtering information for that operation. These LookupConditions specify which records are to be affected similar to a SQL ‘where’ clause.

The IConnector.ExecuteOperation target operations are:

  • Create — Causes a new record to be inserted into the target data source. Create is called when records have been detected in the source during replication.
  • Delete — Executed by TIBCO Scribe® when a record has been deleted from the source data. Delete uses filtering defined by the OperationInput.LookupCondition properties to specify which record to delete.
  • Update — Executed when a record has been changed in the RS source data. Update uses filtering defined by the OperationInput.LookupCondition properties to specify which record to update.

IConnector.ExecuteMethod

TIBCO Scribe® calls ExecuteMethod to perform Connector-specific logic. Unlike operations which always operate on a single object type, such as an Account, methods are capable of consuming and returning any number of different object types. The MethodInput object that is passed in provides the method name and other information needed to execute the method. The returned MethodResult object returns the results of the method execution, including data or error information as needed.

The IConnector.ExecuteMethod target methods are:

  • GetObjectDefinitionTIBCO Scribe® executes this method to retrieve a specific Object's definition, including a list of the object’s properties or fields.
  • CreateOrUpdateObjectForReplicationTIBCO Scribe® executes this method to create or update the schema an object that is being replicated. The method input provides the definition of the object and the property or field definitions in the MethodInput parameter. Your implementation of this method must:
    1. Check if the object already exists and create a new one if it does not.
    2. Compare the property definitions against the existing object and update the object's schema when a change has been detected.
    3. Finally, if no change is detected, no changes to the data source are made. In this case, define the SchemaChanged property in MethodInput and set it to false.
  • GetLastReplicationSyncDateTIBCO Scribe® executes this target side method to retrieve the last modification date for a specific object. TIBCO Scribe® provides the following information to this method in the MethodResult object:
    • ObjectName — The name of the object that contains the last modification date.
    • ModificationDateFullName — The property or field name that is expected to contain the last modification date information.

IConnector.GetMetadataProvider

GetMetadataProvider is a required method called by TIBCO Scribe® to retrieve an active instance of the Object that inherits the IMetadataProvider interface. This allows TIBCO Scribe® to access the IMetadataProvider specific methods.

IMetadataProvider.ResetMetadata

ResetMetadata is a required method called by TIBCO Scribe® to inform the Connector that the user wants TIBCO Scribe® to be aware of any schema changes to the data source. If you are caching information about object or field names, you need to clear this cache so that schema changes are visible in TIBCO Scribe®.