org.jafer.zoom
Class ConnectionImpl

java.lang.Object
  extended by org.jafer.zoom.ConnectionImpl
All Implemented Interfaces:
java.io.Serializable, org.z3950.zoom.Configurable, org.z3950.zoom.Connection

public class ConnectionImpl
extends java.lang.Object
implements org.z3950.zoom.Connection

Implementation of Zoom Connection class. Sets up a Jafer Zclient and handles interfacing to Jafer for querying and processing results. Note that support is presently limited to CQL queries only. Note that this class is loaded by the Zoom ConnectionFactory class, which looks for the class name in a file called META-INF/services/org.z3950.zoom.Connection in the classpath.

See Also:
Serialized Form

Field Summary
(package private)  java.net.URL connectionURL
           
(package private)  java.lang.String databaseName
           
(package private)  java.lang.String[] databaseNames
           
(package private) static java.lang.String DEFAULT_RECORD_SCHEMA
           
(package private)  java.lang.String host
           
(package private) static java.lang.String IMPLEMENTATION_ID
           
(package private) static java.lang.String IMPLEMENTATION_NAME
           
(package private) static java.lang.String IMPLEMENTATION_VERSION
           
(package private)  int numberOfEntries
           
(package private)  int port
           
(package private)  java.lang.String preferredRecordSyntax
           
(package private)  int presentChunk
           
(package private)  java.lang.String recordSchema
           
(package private)  ZClient zclient
           
 
Constructor Summary
ConnectionImpl()
           
 
Method Summary
 void addResultSetListener(org.z3950.zoom.ResultSetListener listener)
           
 void addScanSetListener(org.z3950.zoom.ResultSetListener listener)
           
 void close()
          Close the connection.
 void connect()
          Connects to a Jafer z39.50 target.
 java.lang.Object get(java.lang.String optionName)
           
 java.lang.String getCharset()
           
 java.net.URL getConnectionURL()
           
 java.lang.String getDatabaseName()
           
 java.lang.String[] getDatabaseNames()
           
 java.lang.String getElementSetName()
           
 java.lang.String getGroup()
           
 java.lang.String getHost()
           
 java.lang.String getImplementationId()
           
 java.lang.String getImplementationName()
           
 java.lang.String getImplementationVersion()
           
 java.lang.String getLang()
           
 int getLargeSetLowerBound()
           
 int getMaximumRecordSize()
           
 java.lang.String getMediumSetElementSetName()
           
 int getMediumSetPresentNumber()
           
 int getNumberOfEntries()
           
 java.lang.String getPassword()
           
 int getPort()
           
 int getPreferredRecordSize()
           
 java.lang.String getPreferredRecordSyntax()
           
 int getPresentChunk()
           
 java.lang.String getProxy()
           
 java.lang.String getSmallSetElementSetName()
           
 int getSmallSetUpperBound()
           
 java.lang.String getTargetImplementationId()
           
 java.lang.String getTargetImplementationName()
           
 java.lang.String getTargetImplementationVersion()
           
 java.lang.String getUser()
           
 ZClient getZClient()
          Get the Jafer ZClient.
 boolean isNamedResultSets()
           
 boolean isPiggyBack()
          docs say this piggy back should be in Result Set!
 void removeResultSetListener(org.z3950.zoom.ResultSetListener listener)
           
 void removeScanSetListener(org.z3950.zoom.ResultSetListener listener)
           
 org.z3950.zoom.ScanSet scan(org.z3950.zoom.Query q)
           
 org.z3950.zoom.ResultSet search(org.z3950.zoom.Query q)
          Performs a search against a Jafer connection.
 void set(java.lang.String optionName, java.lang.Object value)
           
 void setCharset(java.lang.String charset)
           
 void setConnectionURL(java.net.URL connectionURL)
           
 void setDatabaseName(java.lang.String databaseName)
           
 void setDatabaseNames(java.lang.String[] databaseNames)
           
 void setElementSetName(java.lang.String elementSetName)
           
 void setGroup(java.lang.String group)
           
 void setHost(java.lang.String host)
           
 void setLang(java.lang.String lang)
           
 void setLargeSetLowerBound(int largeSetLowerBound)
           
 void setMaximumRecordSize(int maximumRecordSize)
           
 void setMediumSetElementSetName(java.lang.String mediumSetElementSetName)
           
 void setMediumSetPresentNumber(int mediumSetPresentNumber)
           
 void setNamedResultSets(boolean namedResultsSets)
           
 void setNumberOfEntries(int numberOfEntries)
           
 void setPassword(java.lang.String password)
           
 void setPiggyBack(boolean piggyBack)
           
 void setPort(int port)
           
 void setPreferredRecordSize(int preferredRecordSize)
           
 void setPreferredRecordSyntax(java.lang.String preferredRecordSyntax)
           
 void setPresentChunk(int presentChunk)
           
 void setProxy(java.lang.String proxy)
           
 void setSmallSetElementSetName(java.lang.String smallSetElementSetName)
           
 void setSmallSetUpperBound(int smallSetUpperBound)
           
 void setUser(java.lang.String user)
           
 void startScan(org.z3950.zoom.Query q)
           
 void startSearch(org.z3950.zoom.Query q)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMPLEMENTATION_ID

static final java.lang.String IMPLEMENTATION_ID
See Also:
Constant Field Values

IMPLEMENTATION_NAME

static final java.lang.String IMPLEMENTATION_NAME
See Also:
Constant Field Values

IMPLEMENTATION_VERSION

static final java.lang.String IMPLEMENTATION_VERSION
See Also:
Constant Field Values

DEFAULT_RECORD_SCHEMA

static final java.lang.String DEFAULT_RECORD_SCHEMA
See Also:
Constant Field Values

host

java.lang.String host

port

int port

connectionURL

java.net.URL connectionURL

zclient

ZClient zclient

recordSchema

java.lang.String recordSchema

preferredRecordSyntax

java.lang.String preferredRecordSyntax

presentChunk

int presentChunk

numberOfEntries

int numberOfEntries

databaseName

java.lang.String databaseName

databaseNames

java.lang.String[] databaseNames
Constructor Detail

ConnectionImpl

public ConnectionImpl()
Method Detail

connect

public void connect()
             throws SystemException
Connects to a Jafer z39.50 target.

Specified by:
connect in interface org.z3950.zoom.Connection
Throws:
SystemException

search

public org.z3950.zoom.ResultSet search(org.z3950.zoom.Query q)
                                throws DiagnosticException,
                                       SystemException
Performs a search against a Jafer connection.

Specified by:
search in interface org.z3950.zoom.Connection
Throws:
DiagnosticException
SystemException

close

public void close()
Close the connection.

Specified by:
close in interface org.z3950.zoom.Connection

getZClient

public ZClient getZClient()
Get the Jafer ZClient. Used by RsultSet and Record for record processing.


getImplementationId

public java.lang.String getImplementationId()
Specified by:
getImplementationId in interface org.z3950.zoom.Connection

getImplementationName

public java.lang.String getImplementationName()
Specified by:
getImplementationName in interface org.z3950.zoom.Connection

getImplementationVersion

public java.lang.String getImplementationVersion()
Specified by:
getImplementationVersion in interface org.z3950.zoom.Connection

getHost

public java.lang.String getHost()
Specified by:
getHost in interface org.z3950.zoom.Connection

setHost

public void setHost(java.lang.String host)
Specified by:
setHost in interface org.z3950.zoom.Connection

getPort

public int getPort()
Specified by:
getPort in interface org.z3950.zoom.Connection

setPort

public void setPort(int port)
Specified by:
setPort in interface org.z3950.zoom.Connection

setPreferredRecordSyntax

public void setPreferredRecordSyntax(java.lang.String preferredRecordSyntax)
Specified by:
setPreferredRecordSyntax in interface org.z3950.zoom.Connection

getPreferredRecordSyntax

public java.lang.String getPreferredRecordSyntax()
Specified by:
getPreferredRecordSyntax in interface org.z3950.zoom.Connection

setPresentChunk

public void setPresentChunk(int presentChunk)
Specified by:
setPresentChunk in interface org.z3950.zoom.Connection

getPresentChunk

public int getPresentChunk()
Specified by:
getPresentChunk in interface org.z3950.zoom.Connection

setNumberOfEntries

public void setNumberOfEntries(int numberOfEntries)
Specified by:
setNumberOfEntries in interface org.z3950.zoom.Connection

getNumberOfEntries

public int getNumberOfEntries()
Specified by:
getNumberOfEntries in interface org.z3950.zoom.Connection

getDatabaseName

public java.lang.String getDatabaseName()
Specified by:
getDatabaseName in interface org.z3950.zoom.Connection

setDatabaseName

public void setDatabaseName(java.lang.String databaseName)
Specified by:
setDatabaseName in interface org.z3950.zoom.Connection

getDatabaseNames

public java.lang.String[] getDatabaseNames()
Specified by:
getDatabaseNames in interface org.z3950.zoom.Connection

setDatabaseNames

public void setDatabaseNames(java.lang.String[] databaseNames)
Specified by:
setDatabaseNames in interface org.z3950.zoom.Connection

scan

public org.z3950.zoom.ScanSet scan(org.z3950.zoom.Query q)
                            throws DiagnosticException,
                                   SystemException
Specified by:
scan in interface org.z3950.zoom.Connection
Throws:
DiagnosticException
SystemException

getUser

public java.lang.String getUser()
Specified by:
getUser in interface org.z3950.zoom.Connection

setUser

public void setUser(java.lang.String user)
Specified by:
setUser in interface org.z3950.zoom.Connection

getGroup

public java.lang.String getGroup()
Specified by:
getGroup in interface org.z3950.zoom.Connection

setGroup

public void setGroup(java.lang.String group)
Specified by:
setGroup in interface org.z3950.zoom.Connection

getPassword

public java.lang.String getPassword()
Specified by:
getPassword in interface org.z3950.zoom.Connection

setPassword

public void setPassword(java.lang.String password)
Specified by:
setPassword in interface org.z3950.zoom.Connection

getProxy

public java.lang.String getProxy()
Specified by:
getProxy in interface org.z3950.zoom.Connection

setProxy

public void setProxy(java.lang.String proxy)
Specified by:
setProxy in interface org.z3950.zoom.Connection

getMaximumRecordSize

public int getMaximumRecordSize()
Specified by:
getMaximumRecordSize in interface org.z3950.zoom.Connection

setMaximumRecordSize

public void setMaximumRecordSize(int maximumRecordSize)
Specified by:
setMaximumRecordSize in interface org.z3950.zoom.Connection

getPreferredRecordSize

public int getPreferredRecordSize()
Specified by:
getPreferredRecordSize in interface org.z3950.zoom.Connection

setPreferredRecordSize

public void setPreferredRecordSize(int preferredRecordSize)
Specified by:
setPreferredRecordSize in interface org.z3950.zoom.Connection

getLang

public java.lang.String getLang()
Specified by:
getLang in interface org.z3950.zoom.Connection

setLang

public void setLang(java.lang.String lang)
Specified by:
setLang in interface org.z3950.zoom.Connection

getCharset

public java.lang.String getCharset()
Specified by:
getCharset in interface org.z3950.zoom.Connection

setCharset

public void setCharset(java.lang.String charset)
Specified by:
setCharset in interface org.z3950.zoom.Connection

getTargetImplementationId

public java.lang.String getTargetImplementationId()
Specified by:
getTargetImplementationId in interface org.z3950.zoom.Connection

getTargetImplementationName

public java.lang.String getTargetImplementationName()
Specified by:
getTargetImplementationName in interface org.z3950.zoom.Connection

getTargetImplementationVersion

public java.lang.String getTargetImplementationVersion()
Specified by:
getTargetImplementationVersion in interface org.z3950.zoom.Connection

isNamedResultSets

public boolean isNamedResultSets()
Specified by:
isNamedResultSets in interface org.z3950.zoom.Connection

setNamedResultSets

public void setNamedResultSets(boolean namedResultsSets)
Specified by:
setNamedResultSets in interface org.z3950.zoom.Connection

isPiggyBack

public boolean isPiggyBack()
docs say this piggy back should be in Result Set!

Specified by:
isPiggyBack in interface org.z3950.zoom.Connection

setPiggyBack

public void setPiggyBack(boolean piggyBack)
Specified by:
setPiggyBack in interface org.z3950.zoom.Connection

getSmallSetUpperBound

public int getSmallSetUpperBound()
Specified by:
getSmallSetUpperBound in interface org.z3950.zoom.Connection

setSmallSetUpperBound

public void setSmallSetUpperBound(int smallSetUpperBound)
Specified by:
setSmallSetUpperBound in interface org.z3950.zoom.Connection

getLargeSetLowerBound

public int getLargeSetLowerBound()
Specified by:
getLargeSetLowerBound in interface org.z3950.zoom.Connection

setLargeSetLowerBound

public void setLargeSetLowerBound(int largeSetLowerBound)
Specified by:
setLargeSetLowerBound in interface org.z3950.zoom.Connection

getMediumSetPresentNumber

public int getMediumSetPresentNumber()
Specified by:
getMediumSetPresentNumber in interface org.z3950.zoom.Connection

setMediumSetPresentNumber

public void setMediumSetPresentNumber(int mediumSetPresentNumber)
Specified by:
setMediumSetPresentNumber in interface org.z3950.zoom.Connection

getSmallSetElementSetName

public java.lang.String getSmallSetElementSetName()
Specified by:
getSmallSetElementSetName in interface org.z3950.zoom.Connection

setSmallSetElementSetName

public void setSmallSetElementSetName(java.lang.String smallSetElementSetName)
Specified by:
setSmallSetElementSetName in interface org.z3950.zoom.Connection

getMediumSetElementSetName

public java.lang.String getMediumSetElementSetName()
Specified by:
getMediumSetElementSetName in interface org.z3950.zoom.Connection

setMediumSetElementSetName

public void setMediumSetElementSetName(java.lang.String mediumSetElementSetName)
Specified by:
setMediumSetElementSetName in interface org.z3950.zoom.Connection

getConnectionURL

public java.net.URL getConnectionURL()
Specified by:
getConnectionURL in interface org.z3950.zoom.Connection

setConnectionURL

public void setConnectionURL(java.net.URL connectionURL)
Specified by:
setConnectionURL in interface org.z3950.zoom.Connection

setElementSetName

public void setElementSetName(java.lang.String elementSetName)
Specified by:
setElementSetName in interface org.z3950.zoom.Connection

getElementSetName

public java.lang.String getElementSetName()
Specified by:
getElementSetName in interface org.z3950.zoom.Connection

addResultSetListener

public void addResultSetListener(org.z3950.zoom.ResultSetListener listener)
Specified by:
addResultSetListener in interface org.z3950.zoom.Connection

removeResultSetListener

public void removeResultSetListener(org.z3950.zoom.ResultSetListener listener)
Specified by:
removeResultSetListener in interface org.z3950.zoom.Connection

addScanSetListener

public void addScanSetListener(org.z3950.zoom.ResultSetListener listener)
Specified by:
addScanSetListener in interface org.z3950.zoom.Connection

removeScanSetListener

public void removeScanSetListener(org.z3950.zoom.ResultSetListener listener)
Specified by:
removeScanSetListener in interface org.z3950.zoom.Connection

startSearch

public void startSearch(org.z3950.zoom.Query q)
                 throws DiagnosticException,
                        SystemException
Specified by:
startSearch in interface org.z3950.zoom.Connection
Throws:
DiagnosticException
SystemException

startScan

public void startScan(org.z3950.zoom.Query q)
               throws DiagnosticException,
                      SystemException
Specified by:
startScan in interface org.z3950.zoom.Connection
Throws:
DiagnosticException
SystemException

set

public void set(java.lang.String optionName,
                java.lang.Object value)
         throws java.lang.NoSuchMethodException,
                java.lang.reflect.InvocationTargetException,
                java.lang.IllegalAccessException
Specified by:
set in interface org.z3950.zoom.Configurable
Throws:
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException

get

public java.lang.Object get(java.lang.String optionName)
                     throws java.lang.NoSuchMethodException,
                            java.lang.reflect.InvocationTargetException,
                            java.lang.IllegalAccessException
Specified by:
get in interface org.z3950.zoom.Configurable
Throws:
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException