com.mentata.sg8
Class SG8Search

java.lang.Object
  extended bycom.mentata.sg8.SG8Discovery
      extended bycom.mentata.sg8.SG8Search

public class SG8Search
extends SG8Discovery

A bean defining a directory search and its results. This bean shares the information used for a directory search, including the filter, the total number of matching entries, a desired batch size, the current page, total pages, and the action to which the search results are to be forwarded. The bean uses a pseudo property to iterate through search results, providing access to each entry via the properties inherited from SG8Discovery. It also has properties providing an action hyperlink to the current entry or an implicit SG8Discovery bean.

Since:
0.7
Author:
Jon Roberts

Constructor Summary
SG8Search()
           
 
Method Summary
 String getAction()
          Returns the gateway action for the search results.
 SG8Discovery getDiscovery()
          Returns an SG8 discovery bean containing the first entry in the search results.
 String getFilter()
          Returns the filter from the search.
 String getHyperlink()
          Returns a hyperlink to the gateway servlet against the current entry.
 int getPage()
          Returns the page number for the search results.
 int getPages()
          Returns the number of total pages for the search results.
 LDAPEntry[] getResults()
          Returns the results matching the search.
 int getSize()
          Returns the total number of entries matching the search.
 boolean isNext()
          Iterates to the next entry in the search results.
 void setAction(String action)
          Sets the gateway action for the search results.
 void setFilter(String filter)
          Sets the filter for the search.
 void setPage(int page)
          Sets the page number for the search results.
 void setResults(LDAPEntry[] results)
          Sets the results matching the search.
 
Methods inherited from class com.mentata.sg8.SG8Discovery
getAttribute, getAttributelist, getKeywords, getObject, getSg8attribute, setAttribute, setCurrentattribute, setCurrentlist, setObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SG8Search

public SG8Search()
Method Detail

setFilter

public void setFilter(String filter)
Sets the filter for the search.

Parameters:
filter - an LDAP filter

getFilter

public String getFilter()
Returns the filter from the search.

Returns:
the LDAP filter

setAction

public void setAction(String action)
Sets the gateway action for the search results.

Parameters:
action - an SG8 servlet name

getAction

public String getAction()
Returns the gateway action for the search results.

Returns:
the SG8 servlet name

setPage

public void setPage(int page)
Sets the page number for the search results.

Parameters:
page - a page number

getPage

public int getPage()
Returns the page number for the search results.

Returns:
the page number

getPages

public int getPages()
Returns the number of total pages for the search results.

Returns:
the number of pages

setResults

public void setResults(LDAPEntry[] results)
Sets the results matching the search.

Parameters:
results - LDAP entries matching the search

getResults

public LDAPEntry[] getResults()
Returns the results matching the search.

Returns:
the matching LDAP entries

getSize

public int getSize()
Returns the total number of entries matching the search.

Returns:
the number of matching entries

getHyperlink

public String getHyperlink()
Returns a hyperlink to the gateway servlet against the current entry.

Returns:
the SG8 hyperlink

isNext

public boolean isNext()
               throws SG8Exception
Iterates to the next entry in the search results.

Returns:
whether another entry remains
Throws:
SG8Exception - if the search object cannot be populated

getDiscovery

public SG8Discovery getDiscovery()
                          throws SG8Exception
Returns an SG8 discovery bean containing the first entry in the search results.

Returns:
the SG8 discovery bean
Throws:
SG8Exception - if the discovery object cannot be populated