Open SiteSearch 4.1.1
Final

ORG.oclc.webz
Class ZServer

java.lang.Object
  |
  +--ORG.oclc.webz.ZServer
Direct Known Subclasses:
IniServer

public class ZServer
extends Object
implements ServerConnect

The ZServer class maintains configuration for a Z39.50 Server input from the JaSSI configuration file. This information is used to customize Z39.50 access to the server. The class provides methods to retrieve the configuration information for the object.

The ZServer class also maintains a Hashtable object of Db objects containing database configuration information for the list of databases that the server "owns". The combination of server configuration and database information provides all the information necessary to perform Z3950 activities.

See Also:
Db, Log

Field Summary
protected  boolean authoRequired
          String data type indicating whether the remote server requires an autho-password.
protected  Hashtable dbList
          Hashtable object containing the Db database objects that this server owns.
protected  boolean fCanDoDedup
          boolean data type indicating whether the server supports dedup requests - the OCLC ZBase server supports this feature (default=true).
protected  boolean fCanDoMultiDbSearch
          boolean data type indicating whether the server supports mulitple database names in search/scan requests - the OCLC ZBase server supports this feature (default=true).
protected  boolean fCanDoReconnect
          boolean data type indicating whether the server supports reconnections for the same Z3950 session - the OCLC ZBase server supports this feature (default=true).
protected  boolean fCanDoScan
          boolean data type indicating whether the server supports Z3950 scan (default=true).
protected  boolean fCanDoSort
          boolean data type indicating whether the server supports Z3950 sort (default=true).
protected  boolean fMustDeleteFirst
          boolean data type indicating whether a delete result set request is required before each search request (default=false).
protected  boolean fNoPiggybackedPresents
          boolean data type indicating whether the server does not support a search-read request (default=false).
protected  boolean fSummaryDbResults
          boolean data type indicating whether the server supports a search response with per-db results - the OCLC ZBase Z3950 server supports this feature (default=false).
protected  boolean fTriggerResourceControl
          boolean data type indicating whether the server supports a Z3950 Trigger Resource request (default=true).
protected  boolean fUseDefaultResultSetName
          boolean data type indicating whether server only supports "default" result set names (default=false).
protected  boolean fUseElementSetNames
          boolean data type indicating whether the server supports element set names (default=true).
protected  boolean fUseRefId
          boolean data type indicating whether the server supports the use of reference Ids on the Z3950 requests (default=true).
protected  boolean fUseSortAttributes
          boolean data type indicating the method of Z3950 sort request encoding.
protected  String hostName
          String data type containing the hostname of the Z3950 server for client connections.
protected  String id
          String data type containing the default Z3950 init authorization (default="autho").
protected  String initOptions
          String data type containing the Z3950 init options.
protected  int largeSetLowerBound
          integer data type containing the Z3950 largeSetLowerBound value - see Z3950 standard (default=10000000).
protected  int maximumMsgSize
          integer data type containing the Z3950 maximum message size (default=10000000).
protected  String passWord
          String data type containing the default Z3950 init password (default="password").
protected  int preferredMsgSize
          integer data type containing the Z3950 preferred message size (default=5000000).
protected  int queryType
          integer data type cotaining the Z3950 Query Type (1,101) where the default is Type 101 - See the Z3950 Standard.
protected  int replaceIndicator
          integer data type indicating that duplicate resultsets on Z3950 search requests should be replaced with the most current results (default=1).
protected  String serverName
          String data type containing the name of the Z3950 server.
protected  int serverPort
          integer data type containing the port of the Z3950 server for client connections where 0 indicates to use the OpServe to locate the server.
protected  String serverType
          String data type defining the type of server = "Z39".
protected  int smallSetUpperBound
          integer data type containing the Z3950 smallSetUpperBound value - see Z3950 standard (default=0).
protected  int timeoutPeriod
          integer data type containing timeout period in seconds for waiting for Z3950 responses (default=480 seconds(8 minues) and 0 indicates not to time).
 Class widgets2Infix
           
protected  String widgets2InfixClass
           
 
Constructor Summary
ZServer()
          Constructs a ZServer object.
ZServer(String name, IniFile ini)
          Constructs a ZServer object for the input server name by reading server configuration information from the input iniFile object.
ZServer(String name, String host, int port)
          Constructs a ZServer object for the input server name, host, and port.
 
Method Summary
 boolean authoRequired()
          Returns a boolean indicating whether the remote server requires an authorization/password.
 Hashtable dbList()
          Returns a Hashtable object containing all the Db objects for databases this ZServer owns.
 boolean fCanDoDedup()
          Returns a boolean indicating whether the server supports dedup requests.
 boolean fCanDoMultiDbSearch()
          Returns a boolean indicating whether the server supports multiple dbnames on a search/scan request.
 boolean fCanDoRanked()
          Returns a boolean indicating whether the server supports ranked retrieval requests - unsupported at this time.
 boolean fCanDoReconnect()
          Returns a boolean indicating whether the server supports reconnection for existing sessions.
 boolean fCanDoScan()
          Returns a boolean indicating whether the server supports scan (wordlist browse).
 boolean fCanDoSort()
          Returns a boolean indicating whether the server supports sort.
 boolean fMustDeleteFirst()
          Returns a boolean indicating whether the server requires a delete resultset request before each search request.
 boolean fNoPiggybackedPresents()
          Returns a boolean indicating whether the server does not support records to be returned on a search request.
 boolean fSummaryDbResults()
          Returns a boolean indicating whether a request for summary database results should be added to the search request - See the Z3950 specification.
 boolean fTriggerResourceControl()
          Returns a boolean indicating whether the server supports the Z3950 Trigger Resource Control request.
 boolean fUseDefaultResultSetName()
          Returns a boolean indicating whether to use a "default" resultset name on search requests.
 boolean fUseElementSetNames()
          Returns a boolean indicating whether the server supports ElementSet Names on Z3950 requests.
 boolean fUseRefId()
          Returns a boolean indicating whether the server supports the use of Reference Ids on Z3950 requests.
 boolean fUseSortAttributes()
          Returns a boolean indicating whether Z3950 Sort requests use the SortAttributes tag to encode the sort request.
 ServerLocation getServerLocation(String sessionId)
          Retrieves a ServerLocation object containing a port and host to connect to for this server from the SiteSearch OpServe process which provides load balancing among servers.
 String hostName()
          Returns a String containing the hostname of the Z3950 server.
 String id()
          Returns a String containing the default authorization for the Z39.50 server.
 void init(String name, IniFile ini)
          Initializes the Z39.50 Server object for the input server name by reading server configuration information from the input iniFile object.
 String initOptions()
          Returns a String containing the init options for a Z3950 Init request.
 int largeSetLowerBound()
          Returns an integer containing the large set lower bound value to use in Z3950 Search requests.
 int maximumMsgSize()
          Returns an integer containing the maximum message size for the Z3950 server.
 String passWord()
          Returns a String containing the default password for the Z39.50 server
 int preferredMsgSize()
          Returns an integer containing the preferred message size for the server.
 int queryType()
          Returns an integer containing the Z3950 query Type (1/101/0).
 int replaceIndicator()
          Returns an integer containing the Replace indicator value.
 int scanStepSize()
          Returns an integer containing the step size to use in Z3950 Scan requests.
 String serverName()
          Returns a String containing the name of the server.
 int serverPort()
          Returns an integer containing the port for Z3950 connections.
 String serverType()
          Returns a String containing the type classification of the server.
 void setId(String id)
          Sets the Default Authorization for the Server to the input String.
 void setPassword(String password)
          Sets the Default Password for the Server to the input String.
 int smallSetUpperBound()
          Returns an integer containing the small set upper bound to use in Z3950 Search requests.
 int timeoutPeriod()
          Returns an integer containing the number of seconds to wait for a Z3950 response.
 String toString()
          Generates the String representation of the object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serverName

protected String serverName
String data type containing the name of the Z3950 server.

serverPort

protected int serverPort
integer data type containing the port of the Z3950 server for client connections where 0 indicates to use the OpServe to locate the server.

hostName

protected String hostName
String data type containing the hostname of the Z3950 server for client connections.

serverType

protected String serverType
String data type defining the type of server = "Z39".

queryType

protected int queryType
integer data type cotaining the Z3950 Query Type (1,101) where the default is Type 101 - See the Z3950 Standard.

dbList

protected Hashtable dbList
Hashtable object containing the Db database objects that this server owns.

initOptions

protected String initOptions
String data type containing the Z3950 init options.

fUseDefaultResultSetName

protected boolean fUseDefaultResultSetName
boolean data type indicating whether server only supports "default" result set names (default=false).

fNoPiggybackedPresents

protected boolean fNoPiggybackedPresents
boolean data type indicating whether the server does not support a search-read request (default=false).

fMustDeleteFirst

protected boolean fMustDeleteFirst
boolean data type indicating whether a delete result set request is required before each search request (default=false).

fSummaryDbResults

protected boolean fSummaryDbResults
boolean data type indicating whether the server supports a search response with per-db results - the OCLC ZBase Z3950 server supports this feature (default=false).

fTriggerResourceControl

protected boolean fTriggerResourceControl
boolean data type indicating whether the server supports a Z3950 Trigger Resource request (default=true).

fUseRefId

protected boolean fUseRefId
boolean data type indicating whether the server supports the use of reference Ids on the Z3950 requests (default=true).

fUseElementSetNames

protected boolean fUseElementSetNames
boolean data type indicating whether the server supports element set names (default=true).

fCanDoMultiDbSearch

protected boolean fCanDoMultiDbSearch
boolean data type indicating whether the server supports mulitple database names in search/scan requests - the OCLC ZBase server supports this feature (default=true).

fCanDoReconnect

protected boolean fCanDoReconnect
boolean data type indicating whether the server supports reconnections for the same Z3950 session - the OCLC ZBase server supports this feature (default=true).

fCanDoDedup

protected boolean fCanDoDedup
boolean data type indicating whether the server supports dedup requests - the OCLC ZBase server supports this feature (default=true).

fCanDoSort

protected boolean fCanDoSort
boolean data type indicating whether the server supports Z3950 sort (default=true).

fCanDoScan

protected boolean fCanDoScan
boolean data type indicating whether the server supports Z3950 scan (default=true).

fUseSortAttributes

protected boolean fUseSortAttributes
boolean data type indicating the method of Z3950 sort request encoding. Defines whether to encode using the sort Fields or sort Attributes encoding (default=false). See the Z3950 standard.

replaceIndicator

protected int replaceIndicator
integer data type indicating that duplicate resultsets on Z3950 search requests should be replaced with the most current results (default=1).

smallSetUpperBound

protected int smallSetUpperBound
integer data type containing the Z3950 smallSetUpperBound value - see Z3950 standard (default=0).

largeSetLowerBound

protected int largeSetLowerBound
integer data type containing the Z3950 largeSetLowerBound value - see Z3950 standard (default=10000000).

preferredMsgSize

protected int preferredMsgSize
integer data type containing the Z3950 preferred message size (default=5000000).

maximumMsgSize

protected int maximumMsgSize
integer data type containing the Z3950 maximum message size (default=10000000).

id

protected String id
String data type containing the default Z3950 init authorization (default="autho").

passWord

protected String passWord
String data type containing the default Z3950 init password (default="password").

timeoutPeriod

protected int timeoutPeriod
integer data type containing timeout period in seconds for waiting for Z3950 responses (default=480 seconds(8 minues) and 0 indicates not to time).

authoRequired

protected boolean authoRequired
String data type indicating whether the remote server requires an autho-password.

widgets2InfixClass

protected String widgets2InfixClass

widgets2Infix

public Class widgets2Infix
Constructor Detail

ZServer

public ZServer()
Constructs a ZServer object.

ZServer

public ZServer(String name,
               String host,
               int port)
Constructs a ZServer object for the input server name, host, and port.
Parameters:
name - the name of the Z39.50 Server
host - the hostname to connect to
port - the port to connect to

ZServer

public ZServer(String name,
               IniFile ini)
Constructs a ZServer object for the input server name by reading server configuration information from the input iniFile object.
Parameters:
name - the name of the Z39.50 Server
ini - the JaSSI configuration ini file
Method Detail

init

public void init(String name,
                 IniFile ini)
Initializes the Z39.50 Server object for the input server name by reading server configuration information from the input iniFile object.
Specified by:
init in interface ServerConnect
Parameters:
name - the name of the Z39.50 Server
ini - the JaSSI configuration ini file

authoRequired

public boolean authoRequired()
Returns a boolean indicating whether the remote server requires an authorization/password.
Returns:
boolean

dbList

public Hashtable dbList()
Returns a Hashtable object containing all the Db objects for databases this ZServer owns.
Returns:
Hashtable

fCanDoDedup

public boolean fCanDoDedup()
Returns a boolean indicating whether the server supports dedup requests.
Returns:
boolean

fCanDoMultiDbSearch

public boolean fCanDoMultiDbSearch()
Returns a boolean indicating whether the server supports multiple dbnames on a search/scan request. Only the Java based OCLC Z39.50 server supports this capability.
Returns:
boolean

fCanDoRanked

public boolean fCanDoRanked()
Returns a boolean indicating whether the server supports ranked retrieval requests - unsupported at this time.
Returns:
boolean

fCanDoReconnect

public boolean fCanDoReconnect()
Returns a boolean indicating whether the server supports reconnection for existing sessions. Only the Java based OCLC Z39.50 server supports this capability.
Returns:
boolean

fCanDoScan

public boolean fCanDoScan()
Returns a boolean indicating whether the server supports scan (wordlist browse).
Returns:
boolean

fCanDoSort

public boolean fCanDoSort()
Returns a boolean indicating whether the server supports sort.
Returns:
boolean

fSummaryDbResults

public boolean fSummaryDbResults()
Returns a boolean indicating whether a request for summary database results should be added to the search request - See the Z3950 specification.
Returns:
boolean

fMustDeleteFirst

public boolean fMustDeleteFirst()
Returns a boolean indicating whether the server requires a delete resultset request before each search request. See the Z39.50 specification.
Returns:
boolean

fNoPiggybackedPresents

public boolean fNoPiggybackedPresents()
Returns a boolean indicating whether the server does not support records to be returned on a search request. See the Z39.50 specification.
Returns:
boolean

fTriggerResourceControl

public boolean fTriggerResourceControl()
Returns a boolean indicating whether the server supports the Z3950 Trigger Resource Control request. See the Z39.50 specification.
Returns:
boolean

fUseDefaultResultSetName

public boolean fUseDefaultResultSetName()
Returns a boolean indicating whether to use a "default" resultset name on search requests. See the Z39.50 specification.
Returns:
boolean

fUseElementSetNames

public boolean fUseElementSetNames()
Returns a boolean indicating whether the server supports ElementSet Names on Z3950 requests. See the Z39.50 specification.
Returns:
boolean

fUseRefId

public boolean fUseRefId()
Returns a boolean indicating whether the server supports the use of Reference Ids on Z3950 requests. See the Z39.50 specification.
Returns:
boolean

fUseSortAttributes

public boolean fUseSortAttributes()
Returns a boolean indicating whether Z3950 Sort requests use the SortAttributes tag to encode the sort request.
Returns:
boolean where false indicates to encode the request using the SortFields tag and true indicates to encode the request using the SortAttributes tag - See the Z39.50 specification.

getServerLocation

public ServerLocation getServerLocation(String sessionId)
Retrieves a ServerLocation object containing a port and host to connect to for this server from the SiteSearch OpServe process which provides load balancing among servers.
Returns:
LoadBalancer

hostName

public String hostName()
Returns a String containing the hostname of the Z3950 server.
Specified by:
hostName in interface ServerConnect
Returns:
String

id

public String id()
Returns a String containing the default authorization for the Z39.50 server.
Returns:
String

setId

public void setId(String id)
Sets the Default Authorization for the Server to the input String.
Parameters:
id - the authorization string

setPassword

public void setPassword(String password)
Sets the Default Password for the Server to the input String.
Parameters:
password - the password

initOptions

public String initOptions()
Returns a String containing the init options for a Z3950 Init request. See the Z39.50 specification
Returns:
String

largeSetLowerBound

public int largeSetLowerBound()
Returns an integer containing the large set lower bound value to use in Z3950 Search requests. See the Z39.50 specification
Returns:
int

maximumMsgSize

public int maximumMsgSize()
Returns an integer containing the maximum message size for the Z3950 server. See the Z39.50 specification.
Returns:
int

passWord

public String passWord()
Returns a String containing the default password for the Z39.50 server
Returns:
String

preferredMsgSize

public int preferredMsgSize()
Returns an integer containing the preferred message size for the server. See the Z39.50 specification.
Returns:
int

queryType

public int queryType()
Returns an integer containing the Z3950 query Type (1/101/0).
Returns:
int

replaceIndicator

public int replaceIndicator()
Returns an integer containing the Replace indicator value.
Returns:
int

scanStepSize

public int scanStepSize()
Returns an integer containing the step size to use in Z3950 Scan requests. See the Z39.50 specification.
Returns:
int

smallSetUpperBound

public int smallSetUpperBound()
Returns an integer containing the small set upper bound to use in Z3950 Search requests. See the Z39.50 specification
Returns:
int

serverName

public String serverName()
Returns a String containing the name of the server.
Specified by:
serverName in interface ServerConnect
Returns:
int

serverPort

public int serverPort()
Returns an integer containing the port for Z3950 connections.
Specified by:
serverPort in interface ServerConnect
Returns:
int

serverType

public String serverType()
Returns a String containing the type classification of the server.
Specified by:
serverType in interface ServerConnect
Returns:
String "Z39"

timeoutPeriod

public int timeoutPeriod()
Returns an integer containing the number of seconds to wait for a Z3950 response.
Returns:
int

toString

public String toString()
Generates the String representation of the object
Specified by:
toString in interface ServerConnect
Returns:
String
Overrides:
toString in class Object

Open SiteSearch 4.1.1
Final