com.waveset.adapter
Class SybaseResourceAdapter.SybaseAccountIterator

java.lang.Object
  extended bycom.waveset.adapter.SybaseResourceAdapter.SybaseAccountIterator
All Implemented Interfaces:
AccountIterator
Enclosing class:
SybaseResourceAdapter

public static class SybaseResourceAdapter.SybaseAccountIterator
extends java.lang.Object
implements AccountIterator

The implementation of the AccountIterator returned by getAccountIterator. We originally started by querying the master.dbo.syslogins table but we're arguably only supposed to be showing accounts in this database, so we can just use sp_helpusers.


Field Summary
 
Fields inherited from interface com.waveset.adapter.AccountIterator
code_id
 
Constructor Summary
SybaseResourceAdapter.SybaseAccountIterator(java.sql.Connection con, SybaseResourceAdapter adapter)
          Construct the iterator, run the query, prep for iteration.
 
Method Summary
 void close()
          Release resources required for the iteration.
 boolean hasNext()
          Return true if there are more users.
 WSUser next()
          Returns the next user object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SybaseResourceAdapter.SybaseAccountIterator

public SybaseResourceAdapter.SybaseAccountIterator(java.sql.Connection con,
                                                   SybaseResourceAdapter adapter)
                                            throws WavesetException
Construct the iterator, run the query, prep for iteration.

If we hit an error, auto-close so the caller doesn't have to worry about it.

Method Detail

close

public void close()
Release resources required for the iteration.

Specified by:
close in interface AccountIterator

hasNext

public boolean hasNext()
                throws WavesetException
Return true if there are more users.

Specified by:
hasNext in interface AccountIterator
Throws:
WavesetException

next

public WSUser next()
            throws java.util.NoSuchElementException
Returns the next user object. If the _eof flag isn't set, we've advanced the cursor to the first row of information for the next user.

Under Sybase, there is only one row per user.

Specified by:
next in interface AccountIterator
Returns:
the next account

Throws:
java.util.NoSuchElementException