com.sun.mdm.index.page
Interface PageAdapter

All Known Implementing Classes:
ArrayPageAdapter, AssumedMatchPageAdapter, EuidPageAdapter, IteratorPageAdapter, PotentialDuplicatePageAdapter, TransactionPageAdapter

public interface PageAdapter

Page adapter interface


Method Summary
 void activate()
          When the stateful session bean activates, it will first call this method.
 void close()
          When the stateful session bean is removed, it will first call this method.
 int count()
          Get a count of all the objects in the data source
 boolean hasNext()
          Return true if there are more records
 void idleTimeOut()
          After the timeout period has expired, this method is called to allow the data source to perform resource conservation activities.
 java.lang.Object next()
          Get the next element
 void passivate()
          When the stateful session bean passivates, it will first call this method on the data source.
 java.lang.Object prev()
          Get the previous element
 void setCurrentPosition(int index)
          Set the current position of the adapter
 void setReadForwardOnly(boolean forwardOnly)
          Set the forward only mode that will clear all the DataPage objects of of a given loaded page i when we start reading/loading the next page i+1.
 void sort(java.util.Comparator c)
          Sort the records based on comparator
 void sortSummary(java.util.Comparator c)
          Sort the records based on comparator
 

Method Detail

activate

public void activate()
When the stateful session bean activates, it will first call this method.


close

public void close()
When the stateful session bean is removed, it will first call this method.


count

public int count()
          throws PageException
Get a count of all the objects in the data source

Returns:
Number of records in adapter
Throws:
PageException - An error occured.

hasNext

public boolean hasNext()
                throws PageException
Return true if there are more records

Returns:
True if there are more records
Throws:
PageException - An error occured

idleTimeOut

public void idleTimeOut()
After the timeout period has expired, this method is called to allow the data source to perform resource conservation activities.


next

public java.lang.Object next()
                      throws PageException
Get the next element

Returns:
Next element
Throws:
PageException - An error occured.

passivate

public void passivate()
When the stateful session bean passivates, it will first call this method on the data source. If there are any resources that must be freed prior to passivation, this is the time to do it.


prev

public java.lang.Object prev()
                      throws PageException
Get the previous element

Returns:
Previous element
Throws:
PageException - An error occured.

setCurrentPosition

public void setCurrentPosition(int index)
                        throws PageException
Set the current position of the adapter

Parameters:
index - current position
Throws:
PageException - An error occured.

setReadForwardOnly

public void setReadForwardOnly(boolean forwardOnly)
                        throws PageException
Set the forward only mode that will clear all the DataPage objects of of a given loaded page i when we start reading/loading the next page i+1.

Parameters:
forwardOnly - forward only mode
Throws:
PageException - An error occured.

sort

public void sort(java.util.Comparator c)
          throws PageException
Sort the records based on comparator

Parameters:
c - Comparator to sort by
Throws:
PageException - An error occured.

sortSummary

public void sortSummary(java.util.Comparator c)
                 throws PageException
Sort the records based on comparator

Parameters:
c - Comparator to sort by
Throws:
PageException - An error occured.


Sun Microsystems, Inc.