com.waveset.adapter
Class MSSQLServerResourceAdapter.AcctIter

java.lang.Object
  extended bycom.waveset.adapter.MSSQLServerResourceAdapter.AcctIter
All Implemented Interfaces:
AccountIterator
Enclosing class:
MSSQLServerResourceAdapter

public static class MSSQLServerResourceAdapter.AcctIter
extends java.lang.Object
implements AccountIterator

The implementation of the AccountIterator returned by getAccountIterator. This implementation iterates over the results of the sp_helplogins procedure, which performs a convenient join over the syslogins and sysusers tables. Sigh, it returns two result sets, the first one has just the logins, and seemingly only those in the master database. Columns are: LoginName, SID, DefDbName, DefLangName, AUser, ARemote The rowcount seems to be the same as the sysogins table. The second result set has what we need to associate the accounts and roles with each login. Columns are: LoginName, DBName, UserName, UserorAlias UserOrAlias is "User" if this represents a user account or "MemberOf" if this is a group membership row. Punting right now and just createing users for each login.


Field Summary
 
Fields inherited from interface com.waveset.adapter.AccountIterator
code_id
 
Constructor Summary
MSSQLServerResourceAdapter.AcctIter(MSSQLServerResourceAdapter adapter)
          Construct the iterator, run the query, and load the first user.
 
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

MSSQLServerResourceAdapter.AcctIter

public MSSQLServerResourceAdapter.AcctIter(MSSQLServerResourceAdapter adapter)
                                    throws WavesetException
Construct the iterator, run the query, and load the first user.

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.

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

Throws:
java.util.NoSuchElementException