org.jafer.zclient
Interface Session

All Known Implementing Classes:
SRWSession, ZSession

public interface Session

This interface defines the methods that a session handler should support. It is used by the abstract client to search and retrieve data from the various session types currently SRW / ZClients


Method Summary
 void close()
          This method closes the current connection and any underlying binding classes
 java.lang.String getGroup()
          Returns the group for this session.
 int getId()
          Return the session Identifier
 java.lang.String getName()
          Return the name allocatted to this session
 java.lang.String getPassword()
          Return the password for the user connecting via this session
 java.lang.String getUsername()
          Return the username for the user connecting via this session
 void init(java.lang.String group, java.lang.String username, java.lang.String password)
          Initalise the session
 java.util.Vector present(int nRecord, int nRecords, int[] recordOID, java.lang.String eSpec, java.lang.String resultSetName)
          Obtain the requested records via the sessions connection to the server and return them to the caller
 java.util.Vector scan(java.lang.String[] databases, int nTerms, int step, int position, org.w3c.dom.Node term)
          Performs a scan on the sessions connection to the sever to retrieve a list of related terms
 java.util.Vector scan(java.lang.String[] databases, int nTerms, int step, int position, java.lang.Object termObject)
          Performs a scan on the sessions connection to the sever to retrieve a list of related terms
 SearchResult[] search(java.lang.Object queryObject, java.lang.String[] databases, java.lang.String resultSetName)
          Performs a search on the sessions connection to the sever to work out how many results would be returned for the search query
 

Method Detail

close

void close()
This method closes the current connection and any underlying binding classes


getGroup

java.lang.String getGroup()
Returns the group for this session. TODO NEED MORE DETAIL HERE

Returns:
The string representation of the group for this session.

getId

int getId()
Return the session Identifier

Returns:
The session identifier

getName

java.lang.String getName()
Return the name allocatted to this session

Returns:
The name of this session

getPassword

java.lang.String getPassword()
Return the password for the user connecting via this session

Returns:
The users password for the connection

getUsername

java.lang.String getUsername()
Return the username for the user connecting via this session

Returns:
The users username for the connection

init

void init(java.lang.String group,
          java.lang.String username,
          java.lang.String password)
          throws ConnectionException
Initalise the session

Parameters:
group - The group name for this session
username - The username of the user connecting via this session
password - The password of the user connecting via this session
Throws:
ConnectionException

present

java.util.Vector present(int nRecord,
                         int nRecords,
                         int[] recordOID,
                         java.lang.String eSpec,
                         java.lang.String resultSetName)
                         throws PresentException,
                                ConnectionException
Obtain the requested records via the sessions connection to the server and return them to the caller

Parameters:
nRecord - The index of the record that the retrieve should start at
nRecords - The maximum number of records that should be returned
recordOID - The record object identifier
eSpec - The element spec attribute of the ZClient
resultSetName - The result set name
Returns:
A Vector of DataObject returned from the server
Throws:
PresentException
ConnectionException

scan

java.util.Vector scan(java.lang.String[] databases,
                      int nTerms,
                      int step,
                      int position,
                      org.w3c.dom.Node term)
                      throws JaferException,
                             ConnectionException
Performs a scan on the sessions connection to the sever to retrieve a list of related terms

Parameters:
databases - An array of database names that are being scanned
nTerms - The maximum number of terms to return
step - ?????????????????????????????????????????????????????????
position - ?????????????????????????????????????????????????????
term - ?????????????????????????????????????????????????????????
Returns:
A vector of DataObjects representing the terms found
Throws:
JaferException
ConnectionException

scan

java.util.Vector scan(java.lang.String[] databases,
                      int nTerms,
                      int step,
                      int position,
                      java.lang.Object termObject)
                      throws JaferException,
                             ConnectionException
Performs a scan on the sessions connection to the sever to retrieve a list of related terms

Parameters:
databases - An array of database names that are being scanned
nTerms - The maximum number of terms to return
step - ?????????????????????????????????????????????????????????
position - ?????????????????????????????????????????????????????
termObject - ???????????????????????????????????????????????????
Returns:
A vector of DataObjects representing the terms found
Throws:
JaferException
ConnectionException

search

SearchResult[] search(java.lang.Object queryObject,
                      java.lang.String[] databases,
                      java.lang.String resultSetName)
                      throws JaferException,
                             ConnectionException
Performs a search on the sessions connection to the sever to work out how many results would be returned for the search query

Parameters:
queryObject - The query object to search against. Normally RPNNode or a simple Node that represents a JaferQuery
databases - The list of databases to be searched
resultSetName - The name to be given to the result set
Returns:
An array of search result objects that identify the number of results for each database searched
Throws:
JaferException
ConnectionException