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

Quick Search    Search Deep

com.k_int.z3950.IRClient
Class Z3950SearchTask  view Z3950SearchTask download Z3950SearchTask.java

java.lang.Object
  extended byjava.util.Observable
      extended bycom.k_int.IR.SearchTask
          extended bycom.k_int.z3950.IRClient.Z3950SearchTask
All Implemented Interfaces:
com.k_int.IR.InformationFragmentSource

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


Field Summary
private static LoggingContext cat
           
static int dbg_counter
           
private  int default_present_chunk_size
           
private  int default_present_timeout
           
private  com.k_int.codec.util.OIDRegisterEntry default_recsyn
           
private  com.k_int.IR.RecordFormatSpecification default_spec
           
private  int fragment_count
           
private  java.util.Hashtable outstanding_requests
           
private static java.lang.String[] private_status_types
           
private  java.util.Properties properties
           
private  Z3950Origin protocol_endpoint
           
private static com.k_int.codec.util.OIDRegister reg
           
 int z3950_status
           
static int ZSTATUS_ALL_PRESENTED
           
static int ZSTATUS_ERROR
           
static int ZSTATUS_IDLE
           
static int ZSTATUS_NONE
           
static int ZSTATUS_PRESENTING
           
static int ZSTATUS_SEARCH_COMPLETE
           
static int ZSTATUS_SEARCHING
           
static int ZSTATUS_SORT_COMPLETE
           
static int ZSTATUS_SORTING
           
 
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 class java.util.Observable
 
Constructor Summary
Z3950SearchTask(Z3950Origin protocol_endpoint, java.util.Observer[] observers, int default_present_chunk_size, java.util.Properties properties)
           
 
Method Summary
 void asyncGetFragment(int starting_fragment, int count, com.k_int.IR.RecordFormatSpecification spec, com.k_int.IR.IFSNotificationTarget target)
           
 void cancelTask()
          Cancel any active operation, but leave all the searchTask's data intact
 void destroy()
          From InformationFragmentSource interface
 void destroyTask()
          From SearchTask base class
 com.k_int.IR.AsynchronousEnumeration elements()
          Enumerate all the items availabe from this fragment source
 int evaluate(int timeout)
          Evaluate the query, waiting at most timeout milliseconds, returning the search status.
protected  void finalize()
          Called on an object by the Virtual Machine at most once, at some point after the Object is determined unreachable but before it is destroyed.
 com.k_int.IR.InformationFragment[] getFragment(int starting_fragment, int count, com.k_int.IR.RecordFormatSpecification spec)
          Position based range access to the result set.
 int getFragmentCount()
          Current number of fragments available
 int getPrivateTaskStatusCode()
           
 com.k_int.IR.IRStatusReport getStatusReport()
          If this source aggregates other sources, there status reports can be found here, return null if this is an original source of data.
 com.k_int.IR.InformationFragmentSource getTaskResultSet()
          getTaskResultSet.
private  com.k_int.IR.RecordFormatSpecification interpretSpec(com.k_int.IR.RecordFormatSpecification spec)
           
 java.lang.String lookupPrivateStatusCode(int code)
           
protected  com.k_int.IR.InformationFragment[] processRecords(com.k_int.gen.Z39_50_APDU_1995.Records_type r)
           
 void setFragmentCount(int i)
           
protected  void setPrivateStatusCode(int code)
           
private  java.lang.String strval(com.k_int.IR.FormatProperty p)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class com.k_int.IR.SearchTask
addDiagnosticObserver, addFragmentSourceObserver, broadcastStatusMessage, getLastStatusMessages, getQuery, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ZSTATUS_NONE

public static final int ZSTATUS_NONE
See Also:
Constant Field Values

ZSTATUS_IDLE

public static final int ZSTATUS_IDLE
See Also:
Constant Field Values

ZSTATUS_SEARCHING

public static final int ZSTATUS_SEARCHING
See Also:
Constant Field Values

ZSTATUS_SEARCH_COMPLETE

public static final int ZSTATUS_SEARCH_COMPLETE
See Also:
Constant Field Values

ZSTATUS_PRESENTING

public static final int ZSTATUS_PRESENTING
See Also:
Constant Field Values

ZSTATUS_ALL_PRESENTED

public static final int ZSTATUS_ALL_PRESENTED
See Also:
Constant Field Values

ZSTATUS_SORTING

public static final int ZSTATUS_SORTING
See Also:
Constant Field Values

ZSTATUS_SORT_COMPLETE

public static final int ZSTATUS_SORT_COMPLETE
See Also:
Constant Field Values

ZSTATUS_ERROR

public static final int ZSTATUS_ERROR
See Also:
Constant Field Values

private_status_types

private static final java.lang.String[] private_status_types

z3950_status

public int z3950_status

protocol_endpoint

private Z3950Origin protocol_endpoint

fragment_count

private int fragment_count

cat

private static LoggingContext cat

dbg_counter

public static int dbg_counter

default_present_timeout

private int default_present_timeout

default_present_chunk_size

private int default_present_chunk_size

properties

private java.util.Properties properties

default_recsyn

private com.k_int.codec.util.OIDRegisterEntry default_recsyn

reg

private static com.k_int.codec.util.OIDRegister reg

default_spec

private com.k_int.IR.RecordFormatSpecification default_spec

outstanding_requests

private java.util.Hashtable outstanding_requests
Constructor Detail

Z3950SearchTask

public Z3950SearchTask(Z3950Origin protocol_endpoint,
                       java.util.Observer[] observers,
                       int default_present_chunk_size,
                       java.util.Properties properties)
Method Detail

finalize

protected void finalize()
Description copied from class: java.lang.Object
Called on an object by the Virtual Machine at most once, at some point after the Object is determined unreachable but before it is destroyed. You would think that this means it eventually is called on every Object, but this is not necessarily the case. If execution terminates abnormally, garbage collection does not always happen. Thus you cannot rely on this method to always work. For finer control over garbage collection, use references from the java.lang.ref package.

Virtual Machines are free to not call this method if they can determine that it does nothing important; for example, if your class extends Object and overrides finalize to do simply super.finalize().

finalize() will be called by a java.lang.Thread that has no locks on any Objects, and may be called concurrently. There are no guarantees on the order in which multiple objects are finalized. This means that finalize() is usually unsuited for performing actions that must be thread-safe, and that your implementation must be use defensive programming if it is to always work.

If an Exception is thrown from finalize() during garbage collection, it will be patently ignored and the Object will still be destroyed.

It is allowed, although not typical, for user code to call finalize() directly. User invocation does not affect whether automatic invocation will occur. It is also permitted, although not recommended, for a finalize() method to "revive" an object by making it reachable from normal code again.

Unlike constructors, finalize() does not get called for an object's superclass unless the implementation specifically calls super.finalize().

The default implementation does nothing.


setPrivateStatusCode

protected void setPrivateStatusCode(int code)

getPrivateTaskStatusCode

public int getPrivateTaskStatusCode()

lookupPrivateStatusCode

public java.lang.String lookupPrivateStatusCode(int code)

evaluate

public int evaluate(int timeout)
             throws com.k_int.IR.TimeoutExceededException,
                    com.k_int.IR.SearchException
Description copied from class: com.k_int.IR.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.


getFragment

public com.k_int.IR.InformationFragment[] getFragment(int starting_fragment,
                                                      int count,
                                                      com.k_int.IR.RecordFormatSpecification spec)
                                               throws com.k_int.IR.PresentException
Description copied from interface: com.k_int.IR.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 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)
Specified by:
asyncGetFragment in interface com.k_int.IR.InformationFragmentSource

processRecords

protected com.k_int.IR.InformationFragment[] processRecords(com.k_int.gen.Z39_50_APDU_1995.Records_type r)

setFragmentCount

public void setFragmentCount(int i)

getFragmentCount

public int getFragmentCount()
Description copied from interface: com.k_int.IR.InformationFragmentSource
Current number of fragments available

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

cancelTask

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


getTaskResultSet

public com.k_int.IR.InformationFragmentSource getTaskResultSet()
Description copied from class: com.k_int.IR.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. 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.


destroy

public void destroy()
From InformationFragmentSource interface

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

destroyTask

public void destroyTask()
From SearchTask base class


elements

public com.k_int.IR.AsynchronousEnumeration elements()
Description copied from interface: com.k_int.IR.InformationFragmentSource
Enumerate all the items availabe from this fragment source

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

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


getStatusReport

public com.k_int.IR.IRStatusReport getStatusReport()
Description copied from interface: com.k_int.IR.InformationFragmentSource
If this source aggregates other sources, there status reports can be found here, return null if this is an original source of data.

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

interpretSpec

private com.k_int.IR.RecordFormatSpecification interpretSpec(com.k_int.IR.RecordFormatSpecification spec)

strval

private java.lang.String strval(com.k_int.IR.FormatProperty p)