org.vfny.geoserver.zserver
Class GeoSearchTask

java.lang.Object
  extended byjava.util.Observable
      extended bycom.k_int.IR.SearchTask
          extended byorg.vfny.geoserver.zserver.GeoSearchTask
All Implemented Interfaces:
com.k_int.IR.InformationFragmentSource

public class GeoSearchTask
extends com.k_int.IR.SearchTask
implements com.k_int.IR.InformationFragmentSource

An extension of SearchTask that implements InformationFragmentSource. Thus this class does handles the query, and gets the results. To access the results some form of getInformationFragmentSource must be called.


Field Summary
 int geo_search_status
          The status of the search.
 
Fields inherited from class com.k_int.IR.SearchTask
create_time, max_messages, message_log, query, requestedSyntax, requestedSyntaxName, TASK_COMPLETE, TASK_EXECUTING, TASK_FAILURE, task_identifier, TASK_IDLE, TASK_MESSAGE_DIAGNOSTIC, TASK_MESSAGE_ERROR, TASK_MESSAGE_INFO, TASK_MESSAGE_WARNING, task_status_code, TASK_UNDEFINED, user_data
 
Fields inherited from interface com.k_int.IR.InformationFragmentSource
default_spec
 
Constructor Summary
GeoSearchTask(GeoSearchable source, com.k_int.IR.IRQuery q)
          Constructer to create a search task.
 
Method Summary
 void asyncGetFragment(int starting_fragment, int count, com.k_int.IR.RecordFormatSpecification spec, com.k_int.IR.IFSNotificationTarget target)
          Needed to conform to SearchTask interface.
 void destroy()
          Release all resources and shut down the object
 void destroyTask()
          From SearchTask abstract base class
 com.k_int.IR.AsynchronousEnumeration elements()
          Enumerate all the items availabe from this fragment source
 int evaluate(int timeout)
          Performs the evaluation.
 com.k_int.IR.InformationFragment[] getFragment(int starting_fragment, int count, com.k_int.IR.RecordFormatSpecification spec)
          Retrieves an array of records, from the starting fragment to the count.
 com.k_int.IR.InformationFragment getFragment(int index, com.k_int.IR.RecordFormatSpecification spec)
          Retrieves the record at the specified index in the specified format.
 int getFragmentCount()
          gets the fragment count.
 int getPrivateTaskStatusCode()
          Gets the task status code.
 com.k_int.IR.IRQuery getQuery()
           
 com.k_int.IR.IRStatusReport getStatusReport()
           
 com.k_int.IR.InformationFragmentSource getTaskResultSet()
           
 java.lang.String lookupPrivateStatusCode(int code)
          Converts an int of a status code to the string representation
 void setFragmentCount(int i)
          Sets the number of fragments (records) of this task.
 void setPrivateTaskStatusCode(int i)
          Sets the task status.
 
Methods inherited from class com.k_int.IR.SearchTask
addDiagnosticObserver, addFragmentSourceObserver, broadcastStatusMessage, cancelTask, getLastStatusMessages, getRequestedSyntax, getRequestedSyntaxName, getSubtasks, getTaskCreationTime, getTaskIdentifier, getTaskStatusCode, getUserData, hasSubtasks, logStatusMessage, setDiagnosticStatus, setMaxStatusMessageItems, setQuery, setRequestedSyntax, setRequestedSyntaxName, setTaskStatusCode, setUserData, waitForCondition, waitForStatus
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

geo_search_status

public int geo_search_status
The status of the search.

Constructor Detail

GeoSearchTask

public GeoSearchTask(GeoSearchable source,
                     com.k_int.IR.IRQuery q)
Constructer to create a search task.

Parameters:
source - The class that created this task.
q - the query to evaluate.
Method Detail

getPrivateTaskStatusCode

public int getPrivateTaskStatusCode()
Gets the task status code.

Returns:
the int representation of the status code.

setPrivateTaskStatusCode

public void setPrivateTaskStatusCode(int i)
Sets the task status.

Parameters:
i - the status.

lookupPrivateStatusCode

public java.lang.String lookupPrivateStatusCode(int code)
Converts an int of a status code to the string representation

Parameters:
code - the number of the code.
Returns:
the string representation of code.

evaluate

public int evaluate(int timeout)
             throws com.k_int.IR.SearchException
Performs the evaluation. To access the results getFragment must be called.

Parameters:
timeout - not implemented, needed for interface.
Returns:
the status task code.
Throws:
com.k_int.IR.SearchException

getFragment

public com.k_int.IR.InformationFragment getFragment(int index,
                                                    com.k_int.IR.RecordFormatSpecification spec)
Retrieves the record at the specified index in the specified format. Position based access to the result set. Implementation must be 1 based: IE, First record in result set is 1 not 0.

Parameters:
index - the index of the record to be returned.
spec - the preferred return format.
Returns:
the record in the specified format.

getFragment

public com.k_int.IR.InformationFragment[] getFragment(int starting_fragment,
                                                      int count,
                                                      com.k_int.IR.RecordFormatSpecification spec)
Retrieves an array of records, from the starting fragment to the count. Position based range access to the result set. Implementation must be 1 based: IE, First record in result set is 1 not 0. Local mappings (e.g to vector) must account for this!

Specified by:
getFragment in interface com.k_int.IR.InformationFragmentSource
Parameters:
starting_fragment - the position of the first record returned.
count - the number of records to be returned.
spec - the preferred return format.
Returns:
an array of records of size count.

setFragmentCount

public void setFragmentCount(int i)
Sets the number of fragments (records) of this task.

Parameters:
i - the number to set.

getFragmentCount

public int getFragmentCount()
gets the fragment count.

Specified by:
getFragmentCount in interface com.k_int.IR.InformationFragmentSource
Returns:
the number of records found by evaluate.

getTaskResultSet

public com.k_int.IR.InformationFragmentSource getTaskResultSet()

getQuery

public com.k_int.IR.IRQuery getQuery()

destroy

public void destroy()
Release all resources and shut down the object

Specified by:
destroy in interface com.k_int.IR.InformationFragmentSource

destroyTask

public void destroyTask()
From SearchTask abstract base class


elements

public com.k_int.IR.AsynchronousEnumeration elements()
Enumerate all the items availabe from this fragment source

Specified by:
elements in interface com.k_int.IR.InformationFragmentSource

getStatusReport

public com.k_int.IR.IRStatusReport getStatusReport()
Specified by:
getStatusReport in interface com.k_int.IR.InformationFragmentSource

asyncGetFragment

public void asyncGetFragment(int starting_fragment,
                             int count,
                             com.k_int.IR.RecordFormatSpecification spec,
                             com.k_int.IR.IFSNotificationTarget target)
Needed to conform to SearchTask interface.

Specified by:
asyncGetFragment in interface com.k_int.IR.InformationFragmentSource