org.starhope.appius.user
Class UserListSQLIterator

java.lang.Object
  extended by org.starhope.appius.user.UserListIterator
      extended by org.starhope.appius.user.UserListSQLIterator
All Implemented Interfaces:
Iterator<UserListEntry>, RecordLoader<UserListEntry>, HasSubversionRevision
Direct Known Subclasses:
UserBuddyListSQLIterator, UserIgnoreListSQLIterator, UserListGeneralSQLIterator

public abstract class UserListSQLIterator
extends UserListIterator

WRITEME: Document this type.

Author:
brpocock@star-hope.org

Field Summary
private  Connection con
          WRITEME: Document this brpocock@star-hope.org
private  boolean hasNext
          WRITEME: Document this brpocock@star-hope.org
private  UserListEntry next
          WRITEME: Document this brpocock@star-hope.org
private  ResultSet rs
          WRITEME: Document this brpocock@star-hope.org
private  PreparedStatement st
          WRITEME: Document this brpocock@star-hope.org
 
Fields inherited from class org.starhope.appius.user.UserListIterator
moniker, userID, userLogin
 
Constructor Summary
UserListSQLIterator(AbstractUser user, String listMoniker)
          WRITEME: Document this constructor brpocock@star-hope.org
 
Method Summary
 void changed(UserListEntry changedRecord)
          accept a notification from a record that it has been changed.
private  void fetchNext()
          WRITEME: Document this method brpocock@star-hope.org
protected abstract  String getSQL()
          WRITEME: Document this method brpocock@star-hope.org
 String getSubversionRevision()
           Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.
 boolean hasNext()
           
 void initializeStorage(String storageURL)
          Prepare the RecordLoader for accessing a given storage medium.
private  void initSQL()
          WRITEME: Document this method brpocock@star-hope.org
 boolean isRealtime()
           
 UserListEntry loadRecord(int id)
          Load the record with the given ID number from the storage system
 UserListEntry loadRecord(String identifier)
          Load the data record identified from the storage system.
 UserListEntry next()
           
 void removeRecord(UserListEntry record)
           
 void saveRecord(UserListEntry record)
          Save a record back to the storage system
 
Methods inherited from class org.starhope.appius.user.UserListIterator
add, remove, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.starhope.appius.util.RecordLoader
refresh
 

Field Detail

rs

private ResultSet rs
WRITEME: Document this brpocock@star-hope.org


con

private Connection con
WRITEME: Document this brpocock@star-hope.org


st

private PreparedStatement st
WRITEME: Document this brpocock@star-hope.org


hasNext

private boolean hasNext
WRITEME: Document this brpocock@star-hope.org


next

private UserListEntry next
WRITEME: Document this brpocock@star-hope.org

Constructor Detail

UserListSQLIterator

public UserListSQLIterator(AbstractUser user,
                           String listMoniker)
WRITEME: Document this constructor brpocock@star-hope.org

Parameters:
user - WRITEME
listMoniker - WRITEME
Method Detail

changed

public void changed(UserListEntry changedRecord)
Description copied from interface: RecordLoader
accept a notification from a record that it has been changed.

Parameters:
changedRecord - the record that has been changed
See Also:
RecordLoader.changed(org.starhope.appius.util.DataRecord)

fetchNext

private void fetchNext()
WRITEME: Document this method brpocock@star-hope.org


getSQL

protected abstract String getSQL()
WRITEME: Document this method brpocock@star-hope.org

Returns:
WRITEME

getSubversionRevision

public String getSubversionRevision()
Description copied from interface: HasSubversionRevision

Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.

As an example,the Subversion revision string for this file is "$Rev: 1968 $"

 
 @Override
 public String getSubversionRevision () {
        return "$Rev: ";
 }
 

Returns:
The Subversion revision level for this class's source code file.
See Also:
HasSubversionRevision.getSubversionRevision()

hasNext

public boolean hasNext()
See Also:
Iterator.hasNext()

initializeStorage

public void initializeStorage(String storageURL)
                       throws NotReadyException
Description copied from interface: RecordLoader
Prepare the RecordLoader for accessing a given storage medium. Usually identifies a URL for the storage mechanism, but can also pull information from AppiusConfig.

Parameters:
storageURL - A URL or identifier of the storage engine. The syntax is specific to the RecordLoader implementation.
Throws:
NotReadyException - if the storage engine can't be initialised
See Also:
RecordLoader.initializeStorage(java.lang.String)

initSQL

private void initSQL()
WRITEME: Document this method brpocock@star-hope.org


isRealtime

public boolean isRealtime()
Returns:
true, if this is a type that requires realtime performance on changes. Note that I/O bound storage such as SQL database saves and file writes will generally return false, whereas RPC mirroring will probably want to return true, unless latency is not an issue.
See Also:
RecordLoader.isRealtime()

loadRecord

public UserListEntry loadRecord(int id)
                         throws NotFoundException
Description copied from interface: RecordLoader
Load the record with the given ID number from the storage system

Parameters:
id - the ID number for the record
Returns:
the data record in question
Throws:
NotFoundException - if the record can't be loaded
See Also:
RecordLoader.loadRecord(int)

loadRecord

public UserListEntry loadRecord(String identifier)
                         throws NotFoundException
Description copied from interface: RecordLoader
Load the data record identified from the storage system. The format and interpretation of the identifier is specific to the data record type, but must be a guaranteed-unique

Parameters:
identifier - the identifier for the record
Returns:
the data record in question
Throws:
NotFoundException - if the record can't be loaded
See Also:
RecordLoader.loadRecord(java.lang.String)

next

public UserListEntry next()
See Also:
Iterator.next()

removeRecord

public void removeRecord(UserListEntry record)
Parameters:
record - Record to be deleted/removed
See Also:
RecordLoader.removeRecord(org.starhope.appius.util.DataRecord)

saveRecord

public void saveRecord(UserListEntry record)
Description copied from interface: RecordLoader
Save a record back to the storage system

Parameters:
record - the record to be saved
See Also:
RecordLoader.saveRecord(org.starhope.appius.util.DataRecord)