Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.stc.eindex.master.search.audit
Class AuditIterator

    java.lang.Object
      com.stc.eindex.page.PageIteratorWrapper
          com.stc.eindex.master.search.audit.AuditIterator

All Implemented Interfaces:
  java.io.Serializable

public class AuditIterator
extends PageIteratorWrapper
implements java.io.Serializable

The AuditIterator class represents an iterator containing the AuditDataObject objects returned by a call to lookupAuditLog. Use indexes to page through the AuditDataObject objects and to retrieve specific objects from the iterator.

See Also:
  Serialized Form

Constructor Summary
`AuditIterator(java.util.ArrayList fullData)` Creates a new instance of the AuditIterator class that does not maintain the connection to the server.
`AuditIterator(PageData pageData, int pageSize, int maxElements)` Creates a new instance of the AuditIterator class that maintains the connection to the server.

Method Summary
`AuditDataObject` | `absolute(int index)` Retrieves an audit data object (class AuditDataObject) at the specified index from the AuditIterator object.
`AuditDataObject[]` | `absolute(int index, int count)` Retrieves a series of rows from an AuditIterator object, beginning with the row at the specified index and continuing through the specified number of rows.
`AuditDataObject` | `first()` Retrieves the first row from an AuditIterator object.
`AuditDataObject[]` | `first(int count)` Retrieves the first rows in the iterator.
`AuditDataObject` | `next()` Retrieves the next row from an AuditIterator object.
`AuditDataObject[]` | `next(int count)` Retrieves the next series of rows in the iterator.
`AuditDataObject` | `prev()` Retrieves the previous row from an AuditIterator object.
`AuditDataObject[]` | `prev(int count)` Retrieves the previous series of rows in the iterator.
`void` | `sortBy(java.lang.String field, boolean reverse)` Sorts the objects in the AuditIterator by the specified comparator.

Methods inherited from class com.stc.eindex.page.PageIteratorWrapper
`close, count, currentPosition, getGenericIterator, hasNext`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AuditIterator

    public AuditIterator(java.util.ArrayList fullData)

  Creates a new instance of the AuditIterator class that does not maintain the connection to the server.

  Parameters:
    `fullData` - An array of all objects in the result set.
  Throws:
    None.

### AuditIterator

    public AuditIterator(PageData pageData,
                         int pageSize,
                         int maxElements)

  Creates a new instance of the AuditIterator class that maintains the connection to the server.

  Parameters:
    `pageData` - A session bean that stores the data retrieved from the server.
    `pageSize` - The size of each unit of data retrieved from the server.
    `maxElements` - The maximum number of elements retrieved for an audit log search.
  Throws:
    None.

Method Detail

### absolute

    public AuditDataObject absolute(int index)
                             throws PageException,
                                    java.rmi.RemoteException

  Retrieves an audit data object (class AuditDataObject) at the specified index from the AuditIterator object.

  Parameters:
    `index` - The row to retrieve.
  Returns:
    `AuditDataObject` - An audit data object.
  Throws:
    `PageException` - Thrown if an error occurs while retrieving the object.
    `java.rmi.RemoteException` - Thrown if the connection to the server goes down during processing.

### absolute

    public AuditDataObject[] absolute(int index,
                                      int count)
                               throws PageException,
                                      java.rmi.RemoteException

  Retrieves a series of rows from an AuditIterator object, beginning with the row at the specified index and continuing through the specified number of rows.

  Parameters:
    `index` - The first row to retrieve.
    `count` - The total number of rows to retrieve.
  Returns:
    `AuditDataObject[]` - An array of audit data objects.
  Throws:
    `PageException` - Thrown if an error occurs while retrieving the objects.
    `java.rmi.RemoteException` - Thrown if the connection to the server goes down during processing.

### first

    public AuditDataObject first()
                          throws PageException,
                                 java.rmi.RemoteException

  Retrieves the first row from an AuditIterator object.

  Parameters:
    None.

  Returns:
    `AuditDataObject` - An audit data object.
  Throws:
    `PageException` - Thrown if an error occurs while retrieving the object.
    `java.rmi.RemoteException` - Thrown if the connection to the server goes down during processing.

### first

    public AuditDataObject[] first(int count)
                            throws PageException,
                                   java.rmi.RemoteException

  Retrieves the first rows in the iterator. The number of rows retrieved is specified as a parameter to this method. If the number of rows specified by the parameter is greater than the number of records in the iterator, all rows are retrieved.

  Parameters:
    `count` - The total number of rows to retrieve.
  Returns:
    `AuditDataObject[]` - An array of audit data objects.
  Throws:
    `PageException` - Thrown if an error occurs while retrieving the objects.
    `java.rmi.RemoteException` - Thrown if the connection to the server goes down during processing.

### next

    public AuditDataObject next()
                         throws java.rmi.RemoteException,
                                PageException

  Retrieves the next row from an AuditIterator object. If the current index is 4, this method returns the row at index=4.

  Parameters:
    None.

  Returns:
    `AuditDataObject` - An audit data object.
  Throws:
    `PageException` - Thrown if the call to hasNext returns false.
    `java.rmi.RemoteException` - Thrown if the connection to the server goes down during processing.

### next

    public AuditDataObject[] next(int count)
                           throws java.rmi.RemoteException,
                                  PageException

  Retrieves the next series of rows in the iterator. The number of rows retrieved is specified as a parameter to this method. If the iterator does not have the specified number of rows remaining, it only retrieves the remaining rows.

  Parameters:
    `count` - The total number of rows to retrieve.
  Returns:
    `AuditDataObject[]` - An array of audit data objects.
  Throws:
    `PageException` - Thrown if the index is already at the end of the iterator.
    `java.rmi.RemoteException` - Thrown if the connection to the server goes down during processing.

### prev

    public AuditDataObject prev()
                         throws PageException,
                                java.rmi.RemoteException

  Retrieves the previous row from an AuditIterator object. If the current index is 5, this method returns the row at index=4 and leaves the position at index=4.

  Parameters:
    None.

  Returns:
    `AuditDataObject` - An audit data object.
  Throws:
    `PageException` - Thrown if the index is already at the beginning of the iterator.
    `java.rmi.RemoteException` - Thrown if the connection to the server goes down during processing.

### prev

    public AuditDataObject[] prev(int count)
                           throws PageException,
                                  java.rmi.RemoteException

  Retrieves the previous series of rows in the iterator. The number of rows retrieved is specified as a parameter to this method.

  Parameters:
    `count` - The total number of rows to retrieve.
  Returns:
    `AuditDataObject[]` - An array of audit data objects.
  Throws:
    `PageException` - Thrown if the index is already at the beginning of the iterator.
    `java.rmi.RemoteException` - Thrown if the connection to the server goes down during processing.

### sortBy

    public void sortBy(java.lang.String field,
                       boolean reverse)
                throws PageException,
                       java.rmi.RemoteException

  Sorts the objects in the AuditIterator by the specified comparator.

  Parameters:
    `field` - The name of the field to use as sorting criteria.
    `reverse` - An indicator of whether to sort in ascending or descending order. Specify true to sort in descending order, or specify false to sort in ascending order.
  Returns:
    `void` - None.
  Throws:
    `PageException` - Thrown if there is an error during sorting.
    `java.rmi.RemoteException` - Thrown if the connection to the server goes down during processing.

Overview | Package | Class | Tree | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2007 by Sun Microsystems, Inc. All Rights Reserved.