Use the getAccountIterator action to return an object to the adapter used to perform iteration of existing users.
To perform account iteration (reconciliation, Load From Resource), you must define this action or the listAll action. If you do not define the getAccountIterator action, account iteration will be performed by calling listAll, and then calling getUser for each ID in the list from listAll.
In addition, if you do not define the getAccountIterator or the listAll action, then account iteration is not supported.
The actionContext map contains the following entries:
Key |
Value Type |
Value Description |
---|---|---|
conn |
java.sql.Connection |
JDBC connection to the customer’s database. |
adapter |
com.wavset.adapter.ScriptedJdbcResourceAdapter |
Adapter instance |
action |
java.lang.String |
The getAccountIterator string |
result |
java.util.Map |
(See result description below) |
errors |
java.util.List |
Initially, this value is an empty list. The script may add java.lang.String objects to this list if any errors are found during processing. |
trace |
com.waveset.adapter.Trace |
Object used to trace execution. Scripts can use the methods of this class to make themselves “debuggable” in a customer environment. |
The adapter expects the result map to be populated with the following entry:
Key |
Value Type |
Value Description |
---|---|---|
iterator |
com.waveset.adapter.script.ScriptedIterator |
The script must set this value to a generated instance of the ScriptedIterator interface.
public interface ScriptedIterator { public boolean hasNext(); public void next(java.util.Map nextObj); public void close();} See the next table for information about the nextObj map. The object must be capable of iterating over all the users in the customer’s database. The samples demonstrate how to accomplish this in BeanShell and Javascript. |
The adapter expects the nextObj map passed to the next method to be populated by the iterator with attributes for each iterated user.
Key |
Value Type |
Value Description |
---|---|---|
attrMap |
java.util.Map |
If the script is capable of directly retrieving the user attributes, then the script can set this entry with a map of the user attributes. The attribute names are defined in the Resource User Attribute column of the resource’s schema map. |
isDisabled |
java.lang.Boolean or java.lang.String |
If set by the script to a Boolean.TRUE or a true string, then the user is considered disabled. |
Any throw from within the script is considered a failure.
If the script encounters any errors, the script may also add appropriate strings to the errors key. The presence of any items in the errors List is considered a failure.