com.k_int.z3950.server.demo
Class DemoSearchTask

java.lang.Object
  |
  +--java.util.Observable
        |
        +--com.k_int.IR.SearchTask
              |
              +--com.k_int.z3950.server.demo.DemoSearchTask
All Implemented Interfaces:
InformationFragmentSource

public class DemoSearchTask
extends SearchTask
implements InformationFragmentSource


Field Summary
 int demo_search_status
           
 
Fields inherited from class com.k_int.IR.SearchTask
create_time, max_messages, message_log, query, TASK_COMPLETE, TASK_EXECUTING_ASYNC, TASK_EXECUTING_SYNC, TASK_FAILURE, task_identifier, TASK_IDLE, task_status_code, user_data
 
Constructor Summary
DemoSearchTask(DemoSearchable source, java.util.Observer[] observers)
           
 
Method Summary
 void destroy()
          Release all resources and shut down the object
 void destroyTask()
          From SearchTask abstract base class
 int evaluate(int timeout)
          Evaluate the query, waiting at most timeout milliseconds, returning the search status.
 InformationFragment getFragment(int index)
          Position based access to the result set.
 InformationFragment[] getFragment(int starting_fragment, int count)
          Position based range access to the result set.
 InformationFragment getFragment(java.lang.String handle)
          Allow access to the set of objects based on a handle system (DOI?)
 int getFragmentCount()
          Current number of fragments available
 int getPrivateTaskStatusCode()
           
 java.lang.String getStatusReport()
          Return a string based status report intended for display to the user Typical FragmentSource states include EMPTY, FILLING, COMPLETE, and SOURCE_NO_LONGER_AVAILABLE these should be presented in a human readable form.
 InformationFragmentSource getTaskResultSet()
          getTaskResultSet.
 java.lang.String lookupPrivateStatusCode(int code)
           
 void setFragmentCount(int i)
           
 void setPrivateTaskStatusCode(int i)
           
 void store(int id, InformationFragment fragment)
           
 
Methods inherited from class com.k_int.IR.SearchTask
addFragmentSourceObserver, cancelTask, getLastStatusMessages, getQuery, getSubtasks, getTaskCreationTime, getTaskIdentifier, getTaskStatusCode, getUserData, hasSubtasks, logStatusMessage, setMaxStatusMessageItems, setQuery, setTaskStatusCode, setUserData, 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
 
Methods inherited from interface com.k_int.IR.InformationFragmentSource
addFragmentSourceObserver
 

Field Detail

demo_search_status

public int demo_search_status
Constructor Detail

DemoSearchTask

public DemoSearchTask(DemoSearchable source,
                      java.util.Observer[] observers)
Method Detail

getPrivateTaskStatusCode

public int getPrivateTaskStatusCode()
Overrides:
getPrivateTaskStatusCode in class SearchTask

setPrivateTaskStatusCode

public void setPrivateTaskStatusCode(int i)

lookupPrivateStatusCode

public java.lang.String lookupPrivateStatusCode(int code)
Overrides:
lookupPrivateStatusCode in class SearchTask

evaluate

public int evaluate(int timeout)
Description copied from class: SearchTask
Evaluate the query, waiting at most timeout milliseconds, returning the search status. InformationFragmentSource object should be used to check the final number of result records.
Overrides:
evaluate in class SearchTask

getFragment

public InformationFragment getFragment(java.lang.String handle)
Description copied from interface: InformationFragmentSource
Allow access to the set of objects based on a handle system (DOI?)
Specified by:
getFragment in interface InformationFragmentSource

getFragment

public InformationFragment getFragment(int index)
Description copied from interface: InformationFragmentSource
Position based 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 InformationFragmentSource

getFragment

public InformationFragment[] getFragment(int starting_fragment,
                                         int count)
Description copied from interface: InformationFragmentSource
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 InformationFragmentSource

store

public void store(int id,
                  InformationFragment fragment)

setFragmentCount

public void setFragmentCount(int i)

getFragmentCount

public int getFragmentCount()
Description copied from interface: InformationFragmentSource
Current number of fragments available
Specified by:
getFragmentCount in interface InformationFragmentSource

getTaskResultSet

public InformationFragmentSource getTaskResultSet()
Description copied from class: SearchTask
getTaskResultSet. Search tasks delagate the responsibility of managing a result set to an instance of the InformationFragmentSource. Often, the SearchTask will implement InformationFragmentSource itself, and return (this) as the realisation of the getTaskResultSet method. Other SearchTasks may use some cache managing FragmentSource to wrapper the source result set and return that object.
Overrides:
getTaskResultSet in class SearchTask

destroy

public void destroy()
Description copied from interface: InformationFragmentSource
Release all resources and shut down the object
Specified by:
destroy in interface InformationFragmentSource

destroyTask

public void destroyTask()
From SearchTask abstract base class
Overrides:
destroyTask in class SearchTask

getStatusReport

public java.lang.String getStatusReport()
Description copied from interface: InformationFragmentSource
Return a string based status report intended for display to the user Typical FragmentSource states include EMPTY, FILLING, COMPLETE, and SOURCE_NO_LONGER_AVAILABLE these should be presented in a human readable form.
Specified by:
getStatusReport in interface InformationFragmentSource


Copyright © 2001 Knowledge Integration Ltd. All Rights Reserved.