[Contents] [Prev] [Next] [Index] [Report an Error] [No Frames]


DataAccessor Object

Objects of the DataAccessor class enable scripts to perform SQL queries and LDAP searches using the Steel-Belted Radius Carrier SQL and LDAP data accessor plug-ins.

All DataAccessor methods are available to both realm selection and attribute filter scripts.

Properties

FOUND

Purpose

The FOUND property is returned by the Execute() method when the requested data object is found.

Example

found = (da.Execute() == DataAccessor.FOUND);

NOTFOUND

Purpose

The NOTFOUND property is returned by the Execute() method when the requested data object is not found.

Example

notfound = (da.Execute() == DataAccessor.NOTFOUND);

FAILED

Purpose

The FAILED property is returned by the Execute() method when the data request fails.

Example

failed = (da.Execute() == DataAccessor.FAILED);

Constructor

The data accessor name is given as an argument to the object constructor.

new DataAccessor()

Purpose

The new DataAccessor() object instance is required to use the DataAccessor methods.

Syntax

new DataAccessor(name)

Parameters


name

Specifies the name of the data accessor, as configured in the .gen file.


Returns

The new DataAccessor() object reference.

Example

da = new DataAccessor("LDAP-Accessor");

Methods

SetInputVariable()

Purpose

The SetInputVariable() method is used to set a named variable in the data accessor input container.

Syntax

accessor.SetInputVariable(name, value)

Parameters


name

Specifies the name of the input container variable from the data accessor .gen file.

value

Specifies the string representation of the input variable value.


Returns

Nothing.

Example

SetInputVariable ("Phone-Number", "5551212");

GetOutputVariable()

Purpose

The GetOutputVariable() method is used to get a named variable from the data accessor output container.

Syntax

accessor.GetOuputVariable(name)

Parameters


name

Specifies the name of the output container variable from the data accessor .gen file.


Returns

The string representation of the output variable value.

Example

address = GetOutputVariable ("Street-Address");

Execute()

Purpose

The Execute() method is used to execute the query or search using the current input container data values.

Syntax

accessor.Execute()

Parameters

Nothing.

Returns

FOUND, NOTFOUND, OR FAILED properties.

Example

found = (da.Execute() == DataAccessor.FOUND);

Clear()

Purpose

The Clear() method is used to clear accessor input and output container values.

Syntax

accessor.Clear()

Parameters

Nothing.

Returns

Nothing.

Example

accessor.Clear();


[Contents] [Prev] [Next] [Index] [Report an Error] [No Frames]