Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.k_int.IR
Class SearchTask  view SearchTask download SearchTask.java

java.lang.Object
  extended byjava.util.Observable
      extended bycom.k_int.IR.SearchTask

public abstract class SearchTask
extends java.util.Observable

Title: SearchTask


Field Summary
protected  long create_time
           
protected  int max_messages
           
protected  java.util.Vector message_log
           
protected  IRQuery query
           
protected  com.k_int.codec.util.OIDRegisterEntry requestedSyntax
           
protected  java.lang.String requestedSyntaxName
           
static int TASK_COMPLETE
           
static int TASK_EXECUTING
           
static int TASK_FAILURE
           
protected  java.lang.String task_identifier
           
static int TASK_IDLE
           
static int TASK_MESSAGE_DIAGNOSTIC
           
static int TASK_MESSAGE_ERROR
           
static int TASK_MESSAGE_INFO
           
static int TASK_MESSAGE_WARNING
           
protected  int task_status_code
           
static int TASK_UNDEFINED
           
protected  java.lang.Object user_data
           
 
Fields inherited from class java.util.Observable
 
Constructor Summary
SearchTask()
           
SearchTask(java.util.Observer[] observers)
           
SearchTask(java.lang.String task_identifier)
           
SearchTask(java.lang.String task_identifier, java.util.Observer[] observers)
           
 
Method Summary
 void addDiagnosticObserver(java.util.Observer o)
           
 void addFragmentSourceObserver(java.util.Observer o)
          Deprecated. to be removed in release 1.3
 void broadcastStatusMessage(int message_type, java.lang.Object message)
          Broadcast a status message which can be observed by any observer which is monitoring an IREvent.MESSAGE_EVENT
 void cancelTask()
          Cancel any active operation, but leave all the searchTask's data intact
 void destroyTask()
          Shut down the task and release any resources, maybe notify our creating searchable.
abstract  int evaluate(int timeout)
          Evaluate the query, waiting at most timeout milliseconds, returning the search status.
 java.util.Vector getLastStatusMessages()
          Deprecated. Will be removed in 1.3, register a diagnostic observer instead and use this to log messages
 int getPrivateTaskStatusCode()
           
 IRQuery getQuery()
           
 com.k_int.codec.util.OIDRegisterEntry getRequestedSyntax()
           
 java.lang.String getRequestedSyntaxName()
           
 java.util.Enumeration getSubtasks()
           
 long getTaskCreationTime()
           
 java.lang.String getTaskIdentifier()
           
abstract  InformationFragmentSource getTaskResultSet()
          getTaskResultSet.
 int getTaskStatusCode()
           
 java.lang.Object getUserData()
           
 boolean hasSubtasks()
           
 void logStatusMessage(int message_type, java.lang.Object message)
          Deprecated. Will be removed in 1.3, register a diagnostic observer instead and use this to log messages
 java.lang.String lookupPrivateStatusCode(int code)
           
 void setDiagnosticStatus(java.lang.String status_code, java.lang.String target_name, java.lang.String addinfo)
          Set the diagnostic status.
 void setMaxStatusMessageItems(int i)
          Store at most n status messages.
 void setQuery(IRQuery query)
           
 void setRequestedSyntax(com.k_int.codec.util.OIDRegisterEntry rs)
           
 void setRequestedSyntaxName(java.lang.String rsn)
           
 void setTaskStatusCode(int task_status_code)
           
 void setUserData(java.lang.Object o)
           
 void waitForCondition(Condition condition, long timeout)
          Wait for up to timeout seconds until expression condition to true.
 void waitForStatus(int status, long timeout)
          Wait for a specified status.
 
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

TASK_UNDEFINED

public static final int TASK_UNDEFINED
See Also:
Constant Field Values

TASK_IDLE

public static final int TASK_IDLE
See Also:
Constant Field Values

TASK_EXECUTING

public static final int TASK_EXECUTING
See Also:
Constant Field Values

TASK_COMPLETE

public static final int TASK_COMPLETE
See Also:
Constant Field Values

TASK_FAILURE

public static final int TASK_FAILURE
See Also:
Constant Field Values

TASK_MESSAGE_ERROR

public static final int TASK_MESSAGE_ERROR
See Also:
Constant Field Values

TASK_MESSAGE_WARNING

public static final int TASK_MESSAGE_WARNING
See Also:
Constant Field Values

TASK_MESSAGE_INFO

public static final int TASK_MESSAGE_INFO
See Also:
Constant Field Values

TASK_MESSAGE_DIAGNOSTIC

public static final int TASK_MESSAGE_DIAGNOSTIC
See Also:
Constant Field Values

task_status_code

protected int task_status_code

task_identifier

protected java.lang.String task_identifier

user_data

protected java.lang.Object user_data

query

protected IRQuery query

create_time

protected long create_time

requestedSyntax

protected com.k_int.codec.util.OIDRegisterEntry requestedSyntax

requestedSyntaxName

protected java.lang.String requestedSyntaxName

message_log

protected java.util.Vector message_log

max_messages

protected int max_messages
Constructor Detail

SearchTask

public SearchTask()

SearchTask

public SearchTask(java.util.Observer[] observers)

SearchTask

public SearchTask(java.lang.String task_identifier)

SearchTask

public SearchTask(java.lang.String task_identifier,
                  java.util.Observer[] observers)
Method Detail

evaluate

public abstract int evaluate(int timeout)
                      throws TimeoutExceededException,
                             SearchException
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.


addFragmentSourceObserver

public void addFragmentSourceObserver(java.util.Observer o)
Deprecated. to be removed in release 1.3


addDiagnosticObserver

public void addDiagnosticObserver(java.util.Observer o)

getRequestedSyntax

public com.k_int.codec.util.OIDRegisterEntry getRequestedSyntax()

setRequestedSyntax

public void setRequestedSyntax(com.k_int.codec.util.OIDRegisterEntry rs)

getRequestedSyntaxName

public java.lang.String getRequestedSyntaxName()

setRequestedSyntaxName

public void setRequestedSyntaxName(java.lang.String rsn)

getTaskIdentifier

public java.lang.String getTaskIdentifier()

getTaskStatusCode

public int getTaskStatusCode()

setTaskStatusCode

public void setTaskStatusCode(int task_status_code)

setDiagnosticStatus

public void setDiagnosticStatus(java.lang.String status_code,
                                java.lang.String target_name,
                                java.lang.String addinfo)
Set the diagnostic status. This broadcasts a Daignostic event which a diagnostic observer can observe and react to


waitForStatus

public void waitForStatus(int status,
                          long timeout)
                   throws TimeoutExceededException
Wait for a specified status. timeout=-1 = return immediatelt, 0=block until complete, positive integer = num seconds to wait.


waitForCondition

public void waitForCondition(Condition condition,
                             long timeout)
                      throws TimeoutExceededException
Wait for up to timeout seconds until expression condition to true.


getPrivateTaskStatusCode

public int getPrivateTaskStatusCode()

lookupPrivateStatusCode

public java.lang.String lookupPrivateStatusCode(int code)

hasSubtasks

public boolean hasSubtasks()

getSubtasks

public java.util.Enumeration getSubtasks()

setUserData

public void setUserData(java.lang.Object o)

getUserData

public java.lang.Object getUserData()

cancelTask

public void cancelTask()
Cancel any active operation, but leave all the searchTask's data intact


getTaskResultSet

public abstract InformationFragmentSource getTaskResultSet()
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. This method returns a producer object that is used by consumers such as the result set enumeration to list all the records found by a search task.


setQuery

public void setQuery(IRQuery query)

getQuery

public IRQuery getQuery()

getLastStatusMessages

public java.util.Vector getLastStatusMessages()
Deprecated. Will be removed in 1.3, register a diagnostic observer instead and use this to log messages

Get the last n status messages.


logStatusMessage

public void logStatusMessage(int message_type,
                             java.lang.Object message)
Deprecated. Will be removed in 1.3, register a diagnostic observer instead and use this to log messages

Log a status message.


broadcastStatusMessage

public void broadcastStatusMessage(int message_type,
                                   java.lang.Object message)
Broadcast a status message which can be observed by any observer which is monitoring an IREvent.MESSAGE_EVENT


setMaxStatusMessageItems

public void setMaxStatusMessageItems(int i)
Store at most n status messages.


getTaskCreationTime

public long getTaskCreationTime()

destroyTask

public void destroyTask()
Shut down the task and release any resources, maybe notify our creating searchable. It is essential that this method be called on the object.