|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jafer.interfaces.Databean
org.jafer.zclient.AbstractClient
public abstract class AbstractClient
Field Summary | |
---|---|
private int |
attempts
|
static int |
AUTO_RECONNECT
int AUTO_RECONNECT |
private int |
autoReconnect
|
protected Cache |
cache
Cache - cache made protected due to fact that ZClientDB still needs the cache |
private boolean |
checkRecordFormat
|
private java.lang.String[] |
dataBases
String[] dataBases |
private int |
dataCacheSize
|
static java.lang.String |
DEFAULT_DATABASE_NAME
String DEFAULT_DATABASE_NAME |
static int |
DEFAULT_DATACACHE_SIZE
int DEFAULT_DATACACHE_SIZE |
static java.lang.String |
DEFAULT_ELEMENT_SPEC
String DEFAULT_ELEMENT_SPEC |
static int |
DEFAULT_FETCH_SIZE
int DEFAULT_FETCH_SIZE |
static double |
DEFAULT_FETCH_VIEW
double DEFAULT_FETCH_VIEW |
static java.lang.String |
DEFAULT_RECORD_SCHEMA
String DEFAULT_RECORD_SCHEMA |
static int[] |
DEFAULT_RECORD_SYNTAX
|
static java.lang.String |
DEFAULT_RESULTSET_NAME
String DEFAULT_RESULTSET_NAME |
private org.w3c.dom.Document |
document
Document document |
private java.lang.String |
elementSpec
|
private int |
fetchSize
|
private double |
fetchView
|
private java.lang.String |
group
|
private java.lang.String |
host
|
protected static java.util.logging.Logger |
logger
Logger logger |
static int |
MAX_DATACACHE_SIZE
int MAX_DATACACHE_SIZE |
private int |
nResults
|
private int |
numberOfRequestRecords
|
private boolean |
parseQuery
|
private java.lang.String |
password
|
private int |
port
|
private java.lang.Object |
query
Node query |
protected java.lang.Integer |
recordCursor
|
private java.lang.String |
recordSchema
|
private int[] |
recordSyntax
|
private java.lang.String |
remoteAddress
|
private java.util.Hashtable |
resultsByDB
int[] dataBases |
private java.lang.String |
resultSetName
|
private java.util.Hashtable |
searchExceptions
Stores a reference to exception that occured in the last search or null if no errors occured |
private Session |
session
Session session |
private int |
startRecordNumber
|
private int |
timeout
|
static int |
TIMEOUT
int TIMEOUT |
protected java.lang.String |
userIP
|
private java.lang.String |
username
|
Constructor Summary | |
---|---|
AbstractClient()
Empty Constructor for the ZClient object |
Method Summary | |
---|---|
protected boolean |
allowReconnect()
returns true if ZClient should attempt reconnect |
void |
close()
close |
private void |
connect()
Description of the Method |
protected abstract Session |
createSession()
|
protected void |
finalize()
|
private int |
getAttempts()
Gets the attempts attribute of the ZClient object |
int |
getAutoReconnect()
Gets the autoReconnect attribute of the ZClient object |
int |
getAvailableSlots()
Returns the number of available slots currently in the cache |
Cache |
getCache()
Returns the current record cache object being used |
java.lang.String |
getCurrentDatabase()
Gets the CurrentDataBase attribute of the ZClient object |
DataObject |
getCurrentDataObject()
Gets the CurrentDataObject attribute of the ZClient object |
Field |
getCurrentRecord()
Gets the CurrentRecord attribute of the ZClient object |
java.lang.String |
getCurrentRecordSyntax()
Gets the CurrentRecordSyntax attribute of the ZClient object |
java.lang.String |
getCurrentRecordSyntaxName()
Gets the CurrentRecordSyntaxName value of the ZClient object |
private java.lang.String |
getDatabaseNames()
getDatabaseNames |
java.lang.String[] |
getDatabases()
Gets the DataBases attribute of the ZClient object |
int |
getDataCacheSize()
Gets the DataCacheSize attribute of the ZClient object |
org.w3c.dom.Document |
getDocument()
|
java.lang.String |
getElementSpec()
Gets the ElementSpec attribute of the ZClient object |
int |
getFetchSize()
Gets the fetchSize attribute of the ZClient object |
double |
getFetchView()
Gets the FetchView attribute of the ZClient object |
java.lang.String |
getGroup()
Get the group name set for accessing the datasource |
java.lang.String |
getHost()
Gets the Host attribute of the ZClient object |
protected int |
getNumberOfRequestRecords()
Gets the numberOfRequestRecords attribute of the ZClient object |
int |
getNumberOfResults()
Gets the NumberOfResults attribute of the ZClient object |
int |
getNumberOfResults(java.lang.String databaseName)
Gets the NumberOfResults attribute of the ZClient object |
java.lang.String |
getPassword()
Gets the Password attribute of the ZClient object |
int |
getPort()
Gets the Port attribute of the ZClient object |
java.lang.Object |
getQuery()
Gets the query attribute of the ZClient object |
int |
getRecordCursor()
Gets the RecordCursor attribute of the ZClient object |
protected java.lang.Integer |
getRecordCursorAsInteger()
Gets the RecordCursor attribute of the ZClient object |
java.lang.String |
getRecordSchema()
Get currently set record schema |
int[] |
getRecordSyntax()
|
java.lang.String |
getRemoteAddress()
Gets the remoteAddress attribute of the ZClient object (for Servlets) |
java.lang.String |
getResultSetName()
Gets the resultSetName attribute of the ZClient object |
JaferException |
getSearchException(java.lang.String database)
If a search fails this method will return the JaferException for the specified database |
JaferException[] |
getSearchException(java.lang.String[] databases)
If a search fails this method will return the JaferException for the specified databases |
protected Session |
getSession()
|
protected int |
getStartRecordNumber()
Gets setStartRecordNumber record number for Present |
Field[] |
getTerms(int noOfTerms,
int termStep,
int termPosition,
org.w3c.dom.Node term)
Get keywords or terms |
Field[] |
getTerms(int noOfTerms,
org.w3c.dom.Node term)
Get keywords or terms |
int |
getTimeout()
Gets the timeout attribute of the ZClient object |
java.lang.String |
getUsername()
Gets the Username attribute of the ZClient object |
protected void |
handleError(java.lang.String message)
|
protected void |
handleError(java.lang.String message,
JaferException e)
|
boolean |
isCheckRecordFormat()
Gets the checkRecordFormat attribute of the ZClient object |
boolean |
isParseQuery()
Gets the parseQuery attribute of the ZClient object |
protected void |
reConnect()
Description of the Method |
void |
saveQuery(java.lang.String file)
Description of the Method |
protected int |
search()
search |
private void |
setAttempts(int attempts)
Sets the reTry attribute of the ZClient object |
void |
setAutoReconnect(int autoReconnect)
Sets the autoReconnect attribute of the ZClient object |
void |
setCache(Cache cache)
Sets the record cache object to use |
void |
setCheckRecordFormat(boolean checkRecordFormat)
Sets the checkRecordFormat attribute of the ZClient object |
void |
setDatabases(java.lang.String database)
Sets the Databases attribute of the ZClient object |
void |
setDatabases(java.lang.String[] databases)
Set databases to search |
void |
setDataCacheSize(int dataCacheSize)
Sets the DataCacheSize attribute of the ZClient object |
private void |
setDefaults()
sets/checks default properties of the ZClient object |
void |
setDocument(org.w3c.dom.Document document)
|
void |
setElementSpec(java.lang.String elementSpec)
Sets the ElementSpec attribute of the ZClient object |
void |
setFetchSize(int fetchSize)
Sets the fetchSize attribute of the ZClient object |
void |
setFetchView(double fetchView)
Sets the FetchView attribute of the ZClient object |
void |
setGroup(java.lang.String group)
Set group name for accessing the data source |
void |
setHost(java.lang.String host)
Sets the Host attribute of the ZClient object |
protected void |
setNumberOfRequestRecords(int numberOfRequestRecords)
Sets the numberOfRequestRecords attribute of the ZClient object |
protected void |
setNumberOfResults(java.lang.String databaseName,
int numberOfResults)
|
void |
setParseQuery(boolean parseQuery)
Sets the parseQuery attribute of the ZClient object |
void |
setPassword(java.lang.String password)
Sets the password attribute of the ZClient object |
void |
setPort(int port)
Sets the Port attribute of the ZClient object |
private void |
setQuery(java.lang.Object query)
Sets the query attribute of the ZClient object |
void |
setRecordCursor(int nRecord)
Sets the RecordCursor attribute of the ZClient object |
void |
setRecordSchema(java.lang.String recordSchema)
Set current prefered record schema |
void |
setRecordSyntax(int[] recordSyntax)
|
void |
setRemoteAddress(java.lang.String remoteAddress)
Sets the remoteAddress attribute of the ZClient object (for Servlets) |
void |
setResultSetName(java.lang.String resultSetName)
Sets the resultSetName attribute of the ZClient object |
protected void |
setSearchException(java.lang.String[] databases,
JaferException exception)
|
protected void |
setSearchException(java.lang.String database,
JaferException exception)
|
private int |
setSearchResults(SearchResult[] resultsByDB)
Sets the nResults attribute of the ZClient object |
private void |
setSession(Session session)
|
protected void |
setStartRecordNumber(int nRecord)
sets startRecordNumber for Present |
void |
setTimeout(int timeout)
Sets the timeout attribute of the ZClient object |
void |
setUsername(java.lang.String username)
Sets the username attribute of the ZClient object |
int |
submitQuery(java.lang.Object query)
Description of the Method |
Methods inherited from class org.jafer.interfaces.Databean |
---|
getCacheSupport, getPresentSupport, getScanSupport, getSearchSupport |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_DATABASE_NAME
public static final java.lang.String DEFAULT_RESULTSET_NAME
public static final java.lang.String DEFAULT_ELEMENT_SPEC
public static final int DEFAULT_FETCH_SIZE
public static final double DEFAULT_FETCH_VIEW
public static final int DEFAULT_DATACACHE_SIZE
public static final int MAX_DATACACHE_SIZE
public static final int TIMEOUT
public static final int AUTO_RECONNECT
public static final java.lang.String DEFAULT_RECORD_SCHEMA
public static final int[] DEFAULT_RECORD_SYNTAX
private java.util.Hashtable searchExceptions
private int fetchSize
private int dataCacheSize
private int autoReconnect
private int timeout
private int attempts
private int numberOfRequestRecords
private int startRecordNumber
private int nResults
private int port
private double fetchView
private boolean checkRecordFormat
private boolean parseQuery
protected java.lang.Integer recordCursor
private java.lang.String elementSpec
protected java.lang.String userIP
private java.lang.String remoteAddress
private java.lang.String resultSetName
private java.lang.String recordSchema
private int[] recordSyntax
private java.lang.String host
private java.lang.String username
private java.lang.String password
private java.lang.String group
private java.lang.String[] dataBases
private java.util.Hashtable resultsByDB
private Session session
protected Cache cache
private org.w3c.dom.Document document
private java.lang.Object query
protected static java.util.logging.Logger logger
Constructor Detail |
---|
public AbstractClient()
Method Detail |
---|
private void setDefaults()
JaferException
- Description of Exceptionpublic int submitQuery(java.lang.Object query) throws JaferException
submitQuery
in interface Search
query
- Description of Parameter
JaferException
protected abstract Session createSession()
private void connect() throws JaferException
JaferException
- Description of Exceptionprotected void reConnect() throws JaferException
JaferException
- Description of Exceptionprotected int search() throws JaferException
JaferException
- -public void setRecordCursor(int nRecord) throws JaferException
setRecordCursor
in interface Present
nRecord
- The new RecordCursor value
JaferException
- Description of Exceptionprotected void handleError(java.lang.String message)
protected void handleError(java.lang.String message, JaferException e) throws JaferException
JaferException
public int getRecordCursor()
getRecordCursor
in interface Present
public void setDocument(org.w3c.dom.Document document)
public org.w3c.dom.Document getDocument()
private java.lang.String getDatabaseNames()
protected void finalize() throws JaferException
finalize
in class java.lang.Object
JaferException
public void close() throws JaferException
close
in interface Connection
JaferException
public void setRemoteAddress(java.lang.String remoteAddress)
setRemoteAddress
in interface Logging
remoteAddress
- The new remoteAddress valuepublic java.lang.String getRemoteAddress()
getRemoteAddress
in interface Logging
public void setParseQuery(boolean parseQuery)
setParseQuery
in interface Search
parseQuery
- The new parseQuery valuepublic boolean isParseQuery()
isParseQuery
in interface Search
public void setRecordSchema(java.lang.String recordSchema)
Present
setRecordSchema
in interface Present
recordSchema
- record schemapublic java.lang.String getRecordSchema()
Present
getRecordSchema
in interface Present
public void setRecordSyntax(int[] recordSyntax)
public int[] getRecordSyntax()
private void setSession(Session session)
protected Session getSession()
public void setCache(Cache cache)
Cache
setCache
in interface Cache
cache
- The concrete class implementing the org.jafer.record.Cache interfacepublic Cache getCache()
Cache
getCache
in interface Cache
public int getAvailableSlots()
getAvailableSlots
in interface Cache
public void setTimeout(int timeout)
setTimeout
in interface Connection
timeout
- The new timeout valuepublic int getTimeout()
getTimeout
in interface Connection
public void setAutoReconnect(int autoReconnect)
setAutoReconnect
in interface Connection
autoReconnect
- number of times to attempt reconnectionpublic int getAutoReconnect()
getAutoReconnect
in interface Connection
private void setAttempts(int attempts)
private int getAttempts()
protected boolean allowReconnect()
protected void setNumberOfRequestRecords(int numberOfRequestRecords)
numberOfRequestRecords
- The new numberOfRequestRecords valueprotected int getNumberOfRequestRecords()
protected void setStartRecordNumber(int nRecord)
nRecord
- The value of setRecordCursorprotected int getStartRecordNumber()
public Field getCurrentRecord() throws JaferException
getCurrentRecord
in interface Present
JaferException
- Description of Exceptionpublic DataObject getCurrentDataObject() throws JaferException
JaferException
- Description of Exceptionpublic java.lang.String getCurrentDatabase() throws JaferException
getCurrentDatabase
in interface Present
JaferException
- Description of Exceptionpublic java.lang.String getCurrentRecordSyntax() throws JaferException
JaferException
- Description of Exceptionpublic java.lang.String getCurrentRecordSyntaxName() throws JaferException
JaferException
- Description of Exceptionpublic void setHost(java.lang.String host)
setHost
in interface Z3950Connection
host
- The new Host valuepublic void setPort(int port)
setPort
in interface Z3950Connection
port
- The new Port valuepublic void setResultSetName(java.lang.String resultSetName)
setResultSetName
in interface Search
resultSetName
- The new resultSetName valuepublic void setDatabases(java.lang.String[] databases)
Search
setDatabases
in interface Search
databases
- databasespublic void setDatabases(java.lang.String database)
setDatabases
in interface Search
database
- The new Databases valuepublic void setUsername(java.lang.String username)
setUsername
in interface Authentication
username
- The new username valuepublic void setPassword(java.lang.String password)
setPassword
in interface Authentication
password
- The new password valuepublic void setCheckRecordFormat(boolean checkRecordFormat)
setCheckRecordFormat
in interface Present
checkRecordFormat
- The new checkRecordFormat valuepublic boolean isCheckRecordFormat()
isCheckRecordFormat
in interface Present
public void setElementSpec(java.lang.String elementSpec)
setElementSpec
in interface Present
elementSpec
- The new ElementSpec valuepublic void setDataCacheSize(int dataCacheSize)
setDataCacheSize
in interface Cache
dataCacheSize
- The new DataCacheSize valuepublic void setFetchSize(int fetchSize)
setFetchSize
in interface Cache
fetchSize
- The new fetchSize valuepublic void setFetchView(double fetchView)
setFetchView
in interface Cache
fetchView
- The new FetchView valueprivate int setSearchResults(SearchResult[] resultsByDB)
nResults
- The new nResults value
public java.lang.String getHost()
getHost
in interface Z3950Connection
public int getPort()
getPort
in interface Z3950Connection
public java.lang.String getResultSetName()
getResultSetName
in interface Search
public java.lang.String[] getDatabases()
getDatabases
in interface Search
public java.lang.String getUsername()
getUsername
in interface Authentication
public java.lang.String getPassword()
getPassword
in interface Authentication
public java.lang.String getGroup()
Authentication
getGroup
in interface Authentication
public void setGroup(java.lang.String group)
Authentication
setGroup
in interface Authentication
group
- Group name to setpublic java.lang.String getElementSpec()
getElementSpec
in interface Present
public java.lang.Object getQuery()
getQuery
in interface Search
public int getDataCacheSize()
getDataCacheSize
in interface Cache
public int getFetchSize()
getFetchSize
in interface Cache
public double getFetchView()
getFetchView
in interface Cache
public int getNumberOfResults()
getNumberOfResults
in interface Search
public int getNumberOfResults(java.lang.String databaseName)
getNumberOfResults
in interface Search
protected void setNumberOfResults(java.lang.String databaseName, int numberOfResults)
protected java.lang.Integer getRecordCursorAsInteger()
public void saveQuery(java.lang.String file) throws JaferException
saveQuery
in interface Search
file
- Description of Parameter
JaferException
public Field[] getTerms(int noOfTerms, org.w3c.dom.Node term)
Scan
getTerms
in interface Scan
noOfTerms
- no of terms to retrieveterm
- query to identify first term
public Field[] getTerms(int noOfTerms, int termStep, int termPosition, org.w3c.dom.Node term)
Scan
getTerms
in interface Scan
noOfTerms
- no of terms to retrievetermStep
- value to step through termstermPosition
- position of identified term in responseterm
- query to identify first term
private void setQuery(java.lang.Object query)
query
- The new query valueprotected void setSearchException(java.lang.String database, JaferException exception)
protected void setSearchException(java.lang.String[] databases, JaferException exception)
public JaferException getSearchException(java.lang.String database) throws JaferException
Search
getSearchException
in interface Search
database
- The name of the database to check
JaferException
public JaferException[] getSearchException(java.lang.String[] databases) throws JaferException
Search
getSearchException
in interface Search
databases
- The databases to search
JaferException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |