com.blueworld.lassopro
Class LassoDSModule

java.lang.Object
  |
  +--com.blueworld.lassopro.LassoDSModule
All Implemented Interfaces:
LassoJavaModule

public abstract class LassoDSModule
extends java.lang.Object
implements LassoJavaModule

Base class for any datasource module. LassoDSModules are used to manipulate datasources. LassoDSModules are looked up by the datasource names they claim to support. They are instantiated once and used repeatedly by Lasso.

Every LassoDSModule must implement registerLassoModule method, and one or more methods with the same signature as DS_METHOD_PROTOTYPE.

Lasso calls registerLassoModule once at startup to give this module a chance to register its datasource(s). LassoDSModule must then call registerDSModule as many times as there are datasources implemented by this module.


Field Summary
static int ACTION_ADD
          Add new record to a database
static int ACTION_CLOSE
          Close current database connection
static int ACTION_DB_NAMES
          Return the names of all the datasources
static int ACTION_DELETE
          Delete database record
static int ACTION_EXISTS
          Does the specified datasource exist?
static int ACTION_INFO
          Return the column info
static int ACTION_INIT
          Datasource is being initialized
static int ACTION_RANDOM
          Return random database record
static int ACTION_SCHEMA_NAMES
          Return the names of the schemas in the specified datasource
static int ACTION_SEARCH
          Perform search on a datasource using specified criteria
static int ACTION_SQL
          Only needs to be supported by SQL-based databases
static int ACTION_TABLE_NAMES
          Return the names of the tables in the specified datasource
static int ACTION_TERM
          Datasource is being terminated
static int ACTION_TICKLE
          Sent to the datasource when a -database and -table are specified, but no action (or a -nothing action).
static int ACTION_UPDATE
          Update values in a database record
static int PROTECTION_NONE
          This column's values can be updated
static int PROTECTION_READ_ONLY
          This column's value is read-only
static int SORT_ASCENDING
          Sort records in ascending order (ASC)
static int SORT_CUSTOM
          Use custom order for ordering this column's values
static int SORT_DESCENDING
          Sort records in descending order (DESC)
 
Fields inherited from interface com.blueworld.lassopro.LassoJavaModule
ERR_NOERR
 
Constructor Summary
protected LassoDSModule()
           
 
Method Summary
 int DS_METHOD_PROTOTYPE(LassoCall lasso, int action, LassoValue data)
          A prototype for all datasource methods registered by registerDSModule.
protected  void registerDSModule(java.lang.String moduleName, java.lang.String methodName, int flags, java.lang.String longName, java.lang.String description)
          Registers this datasource with Lasso Professional 7.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.blueworld.lassopro.LassoJavaModule
registerLassoModule
 

Field Detail

ACTION_INIT

public static final int ACTION_INIT
Datasource is being initialized

See Also:
Constant Field Values

ACTION_TERM

public static final int ACTION_TERM
Datasource is being terminated

See Also:
Constant Field Values

ACTION_EXISTS

public static final int ACTION_EXISTS
Does the specified datasource exist? Must return ERR_NOERR to indicate that it does. Any other return value means that it doesn't exist.

See Also:
Constant Field Values

ACTION_DB_NAMES

public static final int ACTION_DB_NAMES
Return the names of all the datasources

See Also:
Constant Field Values

ACTION_SCHEMA_NAMES

public static final int ACTION_SCHEMA_NAMES
Return the names of the schemas in the specified datasource

See Also:
Constant Field Values

ACTION_TABLE_NAMES

public static final int ACTION_TABLE_NAMES
Return the names of the tables in the specified datasource

See Also:
Constant Field Values

ACTION_SEARCH

public static final int ACTION_SEARCH
Perform search on a datasource using specified criteria

See Also:
Constant Field Values

ACTION_ADD

public static final int ACTION_ADD
Add new record to a database

See Also:
Constant Field Values

ACTION_UPDATE

public static final int ACTION_UPDATE
Update values in a database record

See Also:
Constant Field Values

ACTION_DELETE

public static final int ACTION_DELETE
Delete database record

See Also:
Constant Field Values

ACTION_INFO

public static final int ACTION_INFO
Return the column info

See Also:
Constant Field Values

ACTION_SQL

public static final int ACTION_SQL
Only needs to be supported by SQL-based databases

See Also:
Constant Field Values

ACTION_RANDOM

public static final int ACTION_RANDOM
Return random database record

See Also:
Constant Field Values

ACTION_CLOSE

public static final int ACTION_CLOSE
Close current database connection

See Also:
Constant Field Values

ACTION_TICKLE

public static final int ACTION_TICKLE
Sent to the datasource when a -database and -table are specified, but no action (or a -nothing action). The database can, perhaps, set or reset its connection to the database. Or, it can do nothing.

See Also:
Constant Field Values

SORT_ASCENDING

public static final int SORT_ASCENDING
Sort records in ascending order (ASC)

See Also:
Constant Field Values

SORT_DESCENDING

public static final int SORT_DESCENDING
Sort records in descending order (DESC)

See Also:
Constant Field Values

SORT_CUSTOM

public static final int SORT_CUSTOM
Use custom order for ordering this column's values

See Also:
Constant Field Values

PROTECTION_NONE

public static final int PROTECTION_NONE
This column's values can be updated

See Also:
Constant Field Values

PROTECTION_READ_ONLY

public static final int PROTECTION_READ_ONLY
This column's value is read-only

See Also:
Constant Field Values
Constructor Detail

LassoDSModule

protected LassoDSModule()
Method Detail

registerDSModule

protected void registerDSModule(java.lang.String moduleName,
                                java.lang.String methodName,
                                int flags,
                                java.lang.String longName,
                                java.lang.String description)
Registers this datasource with Lasso Professional 7.

Parameters:
moduleName - the name of your datasource connector, as returned by [Lasso_DatasourceModuleName] LDML tag
methodName - the name of your module (class) main entry method. methodName method should have the same signature as DS_METHOD_PROTOTYPE
flags - unused
longName - unused
description - short description of your datasource connector. Can be null.

DS_METHOD_PROTOTYPE

public int DS_METHOD_PROTOTYPE(LassoCall lasso,
                               int action,
                               LassoValue data)
A prototype for all datasource methods registered by registerDSModule. Since methods are being registered by name, they must exactly match the value passed in a methodName parameter of registerDSModule call.

Parameters:
lasso - an object to be used for invoking various LassoCall methods
action - one of the database ACTION_ constants
data - datasource, host, or database name when action is one of the following: ACTION_EXISTS, ACTION_DB_NAMES, ACTION_SCHEMA_NAMES or ACTION_TABLE_NAMES. If action is ACTION_SQL, the data member of LassoValue object contains the full text of the SQL statement passed to the inline.