DataAccessor Object
Objects of the
DataAccessorclass enable scripts to perform SQL queries and LDAP searches using the Steel-Belted Radius Carrier SQL and LDAP data accessor plug-ins.All
DataAccessormethods are available to both realm selection and attribute filter scripts.Properties
FOUND
Purpose
The
FOUNDproperty is returned by theExecute()method when the requested data object is found.Example
found = (da.Execute() == DataAccessor.FOUND);
NOTFOUND
Purpose
The
NOTFOUNDproperty is returned by theExecute()method when the requested data object is not found.Example
notfound = (da.Execute() == DataAccessor.NOTFOUND);
FAILED
Purpose
The
FAILEDproperty is returned by theExecute()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
Parameters
Specifies the name of the data accessor, as configured in the
.genfile.
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
Specifies the name of the input container variable from the data accessor
.genfile.Specifies the string representation of the input variable value.
Returns
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
Specifies the name of the output container variable from the data accessor
.genfile.
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
Parameters
Returns
FOUND,NOTFOUND, ORFAILEDproperties.Example
found = (da.Execute() == DataAccessor.FOUND);
Clear()
Purpose
The Clear() method is used to clear accessor input and output container values.
Syntax
Parameters
Returns
Example
accessor.Clear();