Open SiteSearch 4.1.1
Final

ORG.oclc.webz
Class ZUserData

java.lang.Object
  |
  +--ORG.oclc.webz.ZUserData

public class ZUserData
extends Object
implements UserApplicationContext

The ZUserData class is a core class to maintain information of all the Z39.50 activity for a user, from the search history, the list of Z39.50 databases the user has access to, and the currently active Z39.50 connections. It also provides methods to find any information about a user's Z39.50 activities and database/server objects the user has access to.

See Also:
UserStateObject, ZDb, ZServer, WebZUserHistory

Field Summary
protected  int accessControlInterruptedCommand
           
protected  Hashtable zSessions
          Hashtable object containing a list of the active Z39session objects for the user.
 
Constructor Summary
ZUserData()
          Constructs a ZUserData object.
 
Method Summary
 int accessControlInterruptedCommand()
          Returns an integer containing the WebZUserHistory action number for which the command was interrupted because a bad autho was passed to a remote server in ZBase.
 void addDatabaseToDbList(String dbName, int status)
          Adds the dbname to the user's list of valid databases with the status set to the incoming status
 void addDbtoList(ZDb db)
          Adds a ZDb object to the user's database table.
 void delete(UserStateObject user)
          Cleans up the ZUserData object for the input UserStateObject by closing all Z3950 connections and releasing access to any objects the class maintains.
 void deleteDatabaseFromDbList(String dbName)
          Deletes the dbname from the user's list of valid databases.
 int entryNumber(String resultSetName)
          Retrieves an integer containing the history entry number within the Vector of WebZUserHistory objectes for the input resultSetName.
 void flushCache(String format)
          Flush the FETCH cache
 String formattedSortKeys(String resultSetName, String separator, boolean addSortOrder)
          Creates a String containing a formatted list of the textual sortKey names for display based for the input resultSetName.
static ZUserData get(UserStateObject user)
          Retrieves a ZUserData object for the input UserStateObject.
 CacheData getCacheData(String format)
          Get the CacheData object for the given format
 ZDb getDb(String resultSetName)
          Retrieves a ZDb object for first database in input resultSetName's DbResults array from the search.
 ZDb getDb(String resultSetName, int whichDb)
          Retrieves a ZDb object object for a database for the input resultSetName and the item number from within the DbResults array from the search.
 String getDbName(String resultSetName)
          Retrieves a String containing the database name(s) for the input resultSetName.
 String getDbName(String resultSetName, int whichDb)
          Retrieves a String containing a particular database name for the resultSetName and the item number within the DbResults array.
 String getDbNameFromZName(String zName)
          Retrieves a String containing the dbname from the input zName of the database.
 String getDisplayQuery(String resultSetName)
          Retrieves a String containing the display (pretty) query for the input resultSetName.
 String getDisplayQueryLimits(String resultSetName)
          Retrieves a String containing the display (pretty) query limits for the input resultSetName.
 String getElementSetName(String resultSetName)
          Retrieves a String containing the ElementSetName used on the last present request for the input resultSetName.
 String getFormattingClass(String resultSetName)
          Retrieves a String containing the formatting class used on the last present request for the input resultSetName.
 int getHistoryEntryNumber(String resultSetName)
          Retrieves an integer containing an index into the Vector of WebZUserHistory objects for the SEARCH activity history entry of the input resultSetName.
 ImageInfo getImageInfo(String dbname, String resultSetName, int recno)
          Retrieves an ImageInfo object from the Vector or WebZUserHistory objects for the input record number/resultset which can be used as a guide to retrieve images from a newton database.
 int getIntLastResultSet()
          Retrieves an integer containing the value for the last resultSetName EXCLUDING temporary database searches.
 int getIntLastResultSet(boolean includeTDbSearches)
          Retrieves an integer containing the value for the last resultSetName INCLUDING temporary database searches.
 ZDb getLastDbGroup()
          Retrieves the last ZDb object saved in the Vector of WebZUserHistory objects INCLUDING temporary database searches.
 ZDb getLastDbGroup(boolean includeTDbSearches)
          Retrieves the last ZDb object saved in the Vector of WebZUserHistory objects EXCLUDING temporary database searches.
 String getLastDbName()
          Retrieves a String containing the database name(s) of the last database searched.
 DbResults[] getLastDbResults()
          Retrieves the DbResults array saved in the Vector of WebZUserHistory objects EXCLUDING temporary database searches.
 DbResults[] getLastDbResults(boolean includeTDbSearches)
          Retrieves the DbResults array saved in the Vector of WebZUserHistory objects INCLUDING temporary database searches.
 WebZUserHistory getLastHistoryEntry(String resultSetName)
          Retrieves a WebZUserHistory object for the last history entry for any activity on the input resultSetName.
 String getLastResultSet()
          Retrieves a String containing the last resultSetName EXCLUDING temporary database searches.
 String getLastResultSet(boolean includeTDbSearches)
          Retrieves a String containing the last resultSetName used INCLUDING temporary database (tdbname) searches.
 String getLongDbName(String dbname)
          Retrieves a String containing the database longName(s) separated by spaces for the input database name.
 String getLongDbName(String dbname, String separator)
          Retrieves a String containing the database longName(s) separated by the input separator for the input database name.
 int getOriginalPostingsForDedupedSearch(String dedupResultSetName)
          Returns an integer containing the result count of the original search results for a deduped search.
 String getOriginalResultSetForDedupedSearch(String dedupResultSetName)
          Returns a string containing the resultset name of the original search results for a deduped search.
 int getPostings(String resultSetName)
          Retrieves an integer containing the database postings count for the first database in the DbResults array object for the search specified in the input resultSetName.
 int getPostings(String resultSetName, int whichDb)
          Retrieves an integer containing the database postings count for the input resultSetName and the item number within the DbResults array object for the search.
 int getPostings(String resultSetName, String dbname)
          Retrieves an integer containing the database postings count for the input database name in the resultSet
 String getQuery(String resultSetName)
          Retrieves a String containing the query string used on the Z3950 query for the input resultSetName.
 String getQueryComponent(String resultSetName, String componentName)
          Retrieves a String containing the query component data for the input resultSetName and the component(widget) name.
 DataPairs getQueryComponents(String resultSetName)
          Retrieves the DataPairs object containing all the components of a query for the input resultSetName.
 String getQueryLimits(String resultSetName)
          Retrieves a String containing the query limts used in the Z3950 query for the input resultSetName.
 Vector getResultSets()
          Retrieves a Vector object containing a list of Strings with all currently used search resultSetNames.
 DataPairs getScanQueryData()
          Retrieves a DataPairs object containing the components of the SCAN query terms from the LAST executed scan request.
 String getSearchElementSetName(String resultSetName)
          Retrieves a String containing the ElementSetName from the search request for the input resultSetName.
 WebZUserHistory getSearchHistoryEntry(String resultSetName)
          Retrieves a WebZUserHistory object for the SEARCH activity history entry of the input resultSetName.
 DbResults[] getSearchResults(String resultSetName)
          Retrieves a DbResults array containing the search results for the input resultSetName.
 String[] getSortedDbNames()
          Retrieves a String array object containing the user's database names in sorted order.
 String[] getSortKeys(String resultSetName)
          Retrieves a String array object containing the sortKeys for the input resultSetName.
 int[] getSortOrders(String resultSetName)
          Retrieves an integer array object containing the sortOrders for the input resultSetName.
 int getTotalPostings(String resultSetName)
          Retrieves an integer containing the total postings count for the input resultSetName.
 ZDb getZDb(String dbname)
          Retrieves a ZDb object for the input database name.
 ZDb getZDbFromSearch(String resultSetName)
          Retrieves the ZDb object used in the search named by the input resultSetName.
 Hashtable getZDbList()
          Retrieves a Hashtable object containing a list of ZDb objects that the user has access to.
 ZServer getZServer()
          Retrieves a ZServer object for the current ZServer object in use.
 ZServer getZServer(ZDb db)
          Retrieves the ZServer object that services the input ZDb object.
 Z39session getZSession()
          Retrieves a Z39session object for the current ZServer the user has access to.
 Z39session getZSession(ZServer zServer)
          Retrieves a Z39session object connected to the server defined in the input ZServer object.
 boolean hasDefaultDbList()
          Returns boolean indicating whether the user has a database list that is customized for their session(profiled) or the globally available database list defined for all users.
 void init(UserStateObject user)
          Initializes the ZUserData object for the input UserStateObject.
 DataDir initUserInformation()
          Retrieves the DataDir object containing the Z3950-INIT UserInformation data to be passed on the init request to the server.
 boolean initZSession(UserStateObject user)
          Establishes a Z3950 session on the current Z39 server for the user by issuing a Z3950 Init Request.
 boolean initZSession(UserStateObject user, Z39session z39sess, ZServer zServer)
          Establishes a Z3950 session for user for the input Z39session and ZServer objects by issuing a Z3950 Init Request.
 boolean initZSession(UserStateObject user, ZDb Db)
          Establishes a Z3950 session for the user for the input ZDb Database object by issuing a Z3950 Init Request.
 boolean initZSession(UserStateObject user, ZDb Db, String autho, String password)
          Establishes a Z3950 session for the user for input Database using the input autho and password by issuing a Z3950 Init Request.
 boolean initZSession(UserStateObject user, ZDb Db, String autho, String password, String newPassword)
          Establishes a Z3950 session for the user for the input ZDb Database object, autho, password, and newpassword by issuing a Z3950 Init Request.
 boolean isDbGroupSearch(String resultSetName)
          Returns a boolean whether the search is a DbGroup search (multiple databases) for the input resultSetName.
 boolean isDeduped(String resultSetName)
          Returns a boolean indicating whether the search's results are from a deduped sorted resultset.
 boolean isRanked(String resultSetName)
          Returns a boolean indicating whether the search's results are ranked for the input resultSetName.
 boolean isSorted(String resultSetName)
          Returns a boolean indicating whether the search's results are sorted for the input resultSetName.
 boolean isTemp(String resultSetName)
          Returns a boolean indicating whether the search's results are from a temporary database (tdbname) search for the input resultSetName.
 void removeDbfromList(ZDb db)
          Removes the input ZDb object from the user's database list.
 String[] requiresInputAuthorization(String dbname)
          Returns a String array of database names from the input dbname string containing the names that require input authorization.
 void resetDbList(Vector dbList, int status)
          Resets the user's list of ZDb objects to the list of database names provided in input Vector.
 void saveImageInfo(String resultSetName, ImageInfo imageInfo)
          Saves an ImageInfo info object in the user's Vector of WebZUserHistory objects for the input record number/resultset which can be used as a guide to retrieve images from a newton database.
 void setDbAuthorization(String dbname, String autho, String password)
          Sets the db autho / password for the input database name(s).
 ZDb setDbFromWidgets(DataPairs widgets)
          Sets up the dbname and dbgroup from the input widgets in the user state as "dbname" and "dbgroup" and returns the correct ZDb object.
 void setDedupPreferredDatabaseNames(String dbnames)
          Sets the dedup preferred database name list to the input space separated list of database names for user's dedup requests so that the application can control the order of the returned duplicates duplicates on a per user basis - otherwise the database configuration information is used.
 void setInitUserInformation(DataDir initUserInformation)
          Sets a DataDir containing the Z3950-INIT UserInformation data that will be passed in the init request to the server.
 String toString()
          Generates a String representation of the object.
 void updateCache(String resultSetName, int realStartRecno, int numrecs, String format, String syntax, Vector dataRecs)
          Update the cache with the current data
 Z39session z39session()
          Returns a Z39session object for the current Z3950 session in use.
 ZDb zDb()
          Returns a ZDb object for the current database in use.
 ZServer zServer()
          Returns a ZServer object for the current ZServer in use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

zSessions

protected Hashtable zSessions
Hashtable object containing a list of the active Z39session objects for the user.

accessControlInterruptedCommand

protected int accessControlInterruptedCommand
Constructor Detail

ZUserData

public ZUserData()
Constructs a ZUserData object.
Method Detail

accessControlInterruptedCommand

public int accessControlInterruptedCommand()
Returns an integer containing the WebZUserHistory action number for which the command was interrupted because a bad autho was passed to a remote server in ZBase.
Returns:
int

saveImageInfo

public void saveImageInfo(String resultSetName,
                          ImageInfo imageInfo)
Saves an ImageInfo info object in the user's Vector of WebZUserHistory objects for the input record number/resultset which can be used as a guide to retrieve images from a newton database.
Parameters:
resulSetName - the resultSet for the image object
imageInfo - the ImageInfo object for the recordnum

getImageInfo

public ImageInfo getImageInfo(String dbname,
                              String resultSetName,
                              int recno)
Retrieves an ImageInfo object from the Vector or WebZUserHistory objects for the input record number/resultset which can be used as a guide to retrieve images from a newton database.
Parameters:
dbname - the name of the database
resulSetName - the resultSet for the image object
recno - the record number with the resultSet
Returns:
ImageInfo or null

getElementSetName

public String getElementSetName(String resultSetName)
Retrieves a String containing the ElementSetName used on the last present request for the input resultSetName.
Parameters:
resulSetName - the resultSet for the present
String - or null

getSearchElementSetName

public String getSearchElementSetName(String resultSetName)
Retrieves a String containing the ElementSetName from the search request for the input resultSetName.
Parameters:
resulSetName - the resultSet for the present
String - or null

getFormattingClass

public String getFormattingClass(String resultSetName)
Retrieves a String containing the formatting class used on the last present request for the input resultSetName.
Parameters:
resulSetName - the resultSet for the present
Returns:
String or null

getSearchResults

public DbResults[] getSearchResults(String resultSetName)
Retrieves a DbResults array containing the search results for the input resultSetName.
Parameters:
resultSetName - the search resultSetName
Returns:
DbResults

entryNumber

public int entryNumber(String resultSetName)
Retrieves an integer containing the history entry number within the Vector of WebZUserHistory objectes for the input resultSetName.
Parameters:
resultSetName - the search resultset name
Returns:
int (-1 indicates not found)

getLastResultSet

public String getLastResultSet()
Retrieves a String containing the last resultSetName EXCLUDING temporary database searches.
Returns:
String

getLastResultSet

public String getLastResultSet(boolean includeTDbSearches)
Retrieves a String containing the last resultSetName used INCLUDING temporary database (tdbname) searches.
Parameters:
includeTDbSearches - flag indicating whether to include/ignore temporary database searches in the lookup.
Returns:
String

getLastDbGroup

public ZDb getLastDbGroup()
Retrieves the last ZDb object saved in the Vector of WebZUserHistory objects INCLUDING temporary database searches.
Returns:
ZDb

getLastDbGroup

public ZDb getLastDbGroup(boolean includeTDbSearches)
Retrieves the last ZDb object saved in the Vector of WebZUserHistory objects EXCLUDING temporary database searches.
Parameters:
includeTDbSearches - flag indicating whether to include/ignore temporary database searches in the lookup.
Returns:
ZDb

getLastDbResults

public DbResults[] getLastDbResults()
Retrieves the DbResults array saved in the Vector of WebZUserHistory objects EXCLUDING temporary database searches.
Returns:
DbResults[]

getLastDbResults

public DbResults[] getLastDbResults(boolean includeTDbSearches)
Retrieves the DbResults array saved in the Vector of WebZUserHistory objects INCLUDING temporary database searches.
Parameters:
includeTDbSearches - flag indicating whether to include/ignore temporary database searches in the lookup.
Returns:
DbResults[]

getScanQueryData

public DataPairs getScanQueryData()
Retrieves a DataPairs object containing the components of the SCAN query terms from the LAST executed scan request.
Returns:
DataPairs

getQuery

public String getQuery(String resultSetName)
Retrieves a String containing the query string used on the Z3950 query for the input resultSetName.
Parameters:
resultSetName - the search resultset name
Returns:
String or null

getDisplayQuery

public String getDisplayQuery(String resultSetName)
Retrieves a String containing the display (pretty) query for the input resultSetName.
Parameters:
resultSetName - the search resultset name
Returns:
String or null

getQueryComponent

public String getQueryComponent(String resultSetName,
                                String componentName)
Retrieves a String containing the query component data for the input resultSetName and the component(widget) name.
Parameters:
resultSetName - the search resultset name
componentName - the index or term widget from the input query.
Returns:
String or null

getQueryComponents

public DataPairs getQueryComponents(String resultSetName)
Retrieves the DataPairs object containing all the components of a query for the input resultSetName.
Parameters:
resultSetName - the search resultset name
Returns:
DataPairs or null

getQueryLimits

public String getQueryLimits(String resultSetName)
Retrieves a String containing the query limts used in the Z3950 query for the input resultSetName.
Parameters:
resultSetName - the search resultset name
Returns:
String or null

getDisplayQueryLimits

public String getDisplayQueryLimits(String resultSetName)
Retrieves a String containing the display (pretty) query limits for the input resultSetName.
Parameters:
resultSetName - the search resultset name
Returns:
String or null

getSortKeys

public String[] getSortKeys(String resultSetName)
Retrieves a String array object containing the sortKeys for the input resultSetName.
Parameters:
resultSetName - the search resultset name
Returns:
String[]

getSortOrders

public int[] getSortOrders(String resultSetName)
Retrieves an integer array object containing the sortOrders for the input resultSetName.
Parameters:
resultSetName - the search resultset name
Returns:
int[]

isSorted

public boolean isSorted(String resultSetName)
Returns a boolean indicating whether the search's results are sorted for the input resultSetName.
Parameters:
resultSetName - the search resultset name
Returns:
boolean

isRanked

public boolean isRanked(String resultSetName)
Returns a boolean indicating whether the search's results are ranked for the input resultSetName.
Parameters:
resultSetName - the search resultset name
Returns:
boolean

isTemp

public boolean isTemp(String resultSetName)
Returns a boolean indicating whether the search's results are from a temporary database (tdbname) search for the input resultSetName.
Parameters:
resultSetName - the search resultset name
Returns:
boolean

isDeduped

public boolean isDeduped(String resultSetName)
Returns a boolean indicating whether the search's results are from a deduped sorted resultset.
Parameters:
resultSetName - the search resultset name
Returns:
boolean

isDbGroupSearch

public boolean isDbGroupSearch(String resultSetName)
Returns a boolean whether the search is a DbGroup search (multiple databases) for the input resultSetName.
Parameters:
resultSetName - the search resultset name
Returns:
boolean

getResultSets

public Vector getResultSets()
Retrieves a Vector object containing a list of Strings with all currently used search resultSetNames.
Returns:
Vector

toString

public String toString()
Generates a String representation of the object.
Returns:
String
Overrides:
toString in class Object

init

public void init(UserStateObject user)
Initializes the ZUserData object for the input UserStateObject. The user is given access to all databases in the system which will possibly be altered after user profiling.
Specified by:
init in interface UserApplicationContext

hasDefaultDbList

public boolean hasDefaultDbList()
Returns boolean indicating whether the user has a database list that is customized for their session(profiled) or the globally available database list defined for all users.
Returns:
boolean

resetDbList

public void resetDbList(Vector dbList,
                        int status)
Resets the user's list of ZDb objects to the list of database names provided in input Vector.
Parameters:
dbList - Vector of authorized database names.
status - ZDb authorization status for the database.
See Also:
ZDb

addDatabaseToDbList

public void addDatabaseToDbList(String dbName,
                                int status)
Adds the dbname to the user's list of valid databases with the status set to the incoming status
Parameters:
dbName - the authorized Database name
status - the ZDb authorization status for the database.
See Also:
ZDb

deleteDatabaseFromDbList

public void deleteDatabaseFromDbList(String dbName)
Deletes the dbname from the user's list of valid databases.
Parameters:
dbName - the authorized Database name

setDedupPreferredDatabaseNames

public void setDedupPreferredDatabaseNames(String dbnames)
Sets the dedup preferred database name list to the input space separated list of database names for user's dedup requests so that the application can control the order of the returned duplicates duplicates on a per user basis - otherwise the database configuration information is used.
Parameters:
dbnames - space separated list of database names

getSortedDbNames

public String[] getSortedDbNames()
Retrieves a String array object containing the user's database names in sorted order.
Returns:
String[]

addDbtoList

public void addDbtoList(ZDb db)
Adds a ZDb object to the user's database table.

delete

public void delete(UserStateObject user)
Cleans up the ZUserData object for the input UserStateObject by closing all Z3950 connections and releasing access to any objects the class maintains.
Specified by:
delete in interface UserApplicationContext
Parameters:
user - the UserStateObject that owns this application context

getDbName

public String getDbName(String resultSetName)
Retrieves a String containing the database name(s) for the input resultSetName.
Parameters:
resultSetName - the name of the search to access
Returns:
String

getDbName

public String getDbName(String resultSetName,
                        int whichDb)
Retrieves a String containing a particular database name for the resultSetName and the item number within the DbResults array.
Parameters:
resultSetName - the name of the search to access
whichDb - the db entry to access in the search result
Returns:
String

formattedSortKeys

public String formattedSortKeys(String resultSetName,
                                String separator,
                                boolean addSortOrder)
Creates a String containing a formatted list of the textual sortKey names for display based for the input resultSetName.
Parameters:
resultSetName - the name of the sorted resultset
separator - the string separator for multiple keys
addSortOrder - flag to indicate whether to add the sort order in parens. (a) or (d)
Returns:
String

getDbNameFromZName

public String getDbNameFromZName(String zName)
Retrieves a String containing the dbname from the input zName of the database.
Parameters:
zName - the z39.50 database name
Returns:
String the dbname

getDb

public ZDb getDb(String resultSetName,
                 int whichDb)
Retrieves a ZDb object object for a database for the input resultSetName and the item number from within the DbResults array from the search.
Parameters:
resultSetName - the name of the search to access
whichDb - the db entry to access in the search result
Returns:
ZDb database object

getDb

public ZDb getDb(String resultSetName)
Retrieves a ZDb object for first database in input resultSetName's DbResults array from the search.
Parameters:
resultSetName - the name of the search to access
Returns:
ZDb database object

getZDbFromSearch

public ZDb getZDbFromSearch(String resultSetName)
Retrieves the ZDb object used in the search named by the input resultSetName.
Parameters:
resultSetName - the name of the search to access
Returns:
ZDb database object

getSearchHistoryEntry

public WebZUserHistory getSearchHistoryEntry(String resultSetName)
Retrieves a WebZUserHistory object for the SEARCH activity history entry of the input resultSetName.
Parameters:
resultSetName - the name of the resultSet for the search result
Returns:
int offset into the search history entries

getLastHistoryEntry

public WebZUserHistory getLastHistoryEntry(String resultSetName)
Retrieves a WebZUserHistory object for the last history entry for any activity on the input resultSetName.
Parameters:
resultSetName - the name of the resultSet for the search result
Returns:
int offset into the search history entries

getHistoryEntryNumber

public int getHistoryEntryNumber(String resultSetName)
Retrieves an integer containing an index into the Vector of WebZUserHistory objects for the SEARCH activity history entry of the input resultSetName.
Parameters:
resultSetName - the name of the resultSet for the search result
Returns:
int offset into the search history entries

getIntLastResultSet

public int getIntLastResultSet()
Retrieves an integer containing the value for the last resultSetName EXCLUDING temporary database searches.
Returns:
int -1 if no entries exist

getIntLastResultSet

public int getIntLastResultSet(boolean includeTDbSearches)
Retrieves an integer containing the value for the last resultSetName INCLUDING temporary database searches.
Parameters:
includeTDbSearches - flag indicating whether to include/ignore temporary database searches in the lookup.
Returns:
int -1 if no entries exist

getLastDbName

public String getLastDbName()
Retrieves a String containing the database name(s) of the last database searched.
Returns:
String

getLongDbName

public String getLongDbName(String dbname)
Retrieves a String containing the database longName(s) separated by spaces for the input database name.
Returns:
String of the full names

getLongDbName

public String getLongDbName(String dbname,
                            String separator)
Retrieves a String containing the database longName(s) separated by the input separator for the input database name.
Returns:
String of the full names

getPostings

public int getPostings(String resultSetName,
                       int whichDb)
Retrieves an integer containing the database postings count for the input resultSetName and the item number within the DbResults array object for the search. search result entry.
Parameters:
resultSetName - the name of the search to access
whichDb - the db entry to access in the search result
Returns:
int

getPostings

public int getPostings(String resultSetName,
                       String dbname)
Retrieves an integer containing the database postings count for the input database name in the resultSet
Parameters:
resultSetName - the name of the search to access
dbname - the database name to find the postings for
Returns:
int

getPostings

public int getPostings(String resultSetName)
Retrieves an integer containing the database postings count for the first database in the DbResults array object for the search specified in the input resultSetName.
Parameters:
resultSetName - the name of the search to access
Returns:
int

getTotalPostings

public int getTotalPostings(String resultSetName)
Retrieves an integer containing the total postings count for the input resultSetName. search result entry.
Parameters:
resultSetName - the search resultset name.
Returns:
int

getOriginalPostingsForDedupedSearch

public int getOriginalPostingsForDedupedSearch(String dedupResultSetName)
Returns an integer containing the result count of the original search results for a deduped search.
Parameters:
dedupResultSetName - the deduped search resultset name
Returns:
integer - original search postings count before the dedup

getOriginalResultSetForDedupedSearch

public String getOriginalResultSetForDedupedSearch(String dedupResultSetName)
Returns a string containing the resultset name of the original search results for a deduped search.
Parameters:
dedupResultSetName - the deduped search resultset name
Returns:
String

setDbFromWidgets

public ZDb setDbFromWidgets(DataPairs widgets)
Sets up the dbname and dbgroup from the input widgets in the user state as "dbname" and "dbgroup" and returns the correct ZDb object.
Parameters:
widgets - the input widgets from a command.
Returns:
ZDb the correct ZDb object for searching.

getZDb

public ZDb getZDb(String dbname)
Retrieves a ZDb object for the input database name.
Parameters:
dbname - the name of the database
Returns:
ZDb

setDbAuthorization

public void setDbAuthorization(String dbname,
                               String autho,
                               String password)
Sets the db autho / password for the input database name(s).
Parameters:
dbname - the name of the database
autho - the authorization
password - the password
Returns:
void

requiresInputAuthorization

public String[] requiresInputAuthorization(String dbname)
Returns a String array of database names from the input dbname string containing the names that require input authorization.
Parameters:
dbname - the name of the database
Returns:
String[]

getZDbList

public Hashtable getZDbList()
Retrieves a Hashtable object containing a list of ZDb objects that the user has access to.
Returns:
Hashtable containing references to the database objects

getZSession

public Z39session getZSession()
Retrieves a Z39session object for the current ZServer the user has access to.
Returns:
Z39session that can be used to send/receive Z39.50 requests
See Also:
Z39session

getZSession

public Z39session getZSession(ZServer zServer)
Retrieves a Z39session object connected to the server defined in the input ZServer object.
Parameters:
ZServer - Z39.50 server object
Returns:
Z39session that can be used to send/receive Z39.50 requests
See Also:
Z39session

getZServer

public ZServer getZServer()
Retrieves a ZServer object for the current ZServer object in use.
Returns:
ZServer

getZServer

public ZServer getZServer(ZDb db)
Retrieves the ZServer object that services the input ZDb object.
Parameters:
ZDb - database object
Returns:
ZServer

setInitUserInformation

public void setInitUserInformation(DataDir initUserInformation)
Sets a DataDir containing the Z3950-INIT UserInformation data that will be passed in the init request to the server.
Parameters:
initUserInformation - the DataDir containing the information.

initUserInformation

public DataDir initUserInformation()
Retrieves the DataDir object containing the Z3950-INIT UserInformation data to be passed on the init request to the server.
Returns:
DataDir or null

initZSession

public boolean initZSession(UserStateObject user)
                     throws Exception
Establishes a Z3950 session on the current Z39 server for the user by issuing a Z3950 Init Request.
Parameters:
user - the user context
Returns:
boolean indicating success or failure of the init
Throws:
Exception - thrown from Z39.50 init processing

initZSession

public boolean initZSession(UserStateObject user,
                            ZDb Db)
                     throws Exception
Establishes a Z3950 session for the user for the input ZDb Database object by issuing a Z3950 Init Request.
Parameters:
user - the user context
ZDb - the database object
Returns:
boolean indicating success or failure of the init
Throws:
Exception - thrown from Z39.50 init processing

initZSession

public boolean initZSession(UserStateObject user,
                            ZDb Db,
                            String autho,
                            String password)
                     throws Exception
Establishes a Z3950 session for the user for input Database using the input autho and password by issuing a Z3950 Init Request.
Parameters:
user - the user context
ZDb - the database object
autho - for the init request
password - for the init request
Returns:
boolean indicating success or failure of the init
Throws:
Exception - thrown from Z39.50 init processing

initZSession

public boolean initZSession(UserStateObject user,
                            ZDb Db,
                            String autho,
                            String password,
                            String newPassword)
                     throws Exception
Establishes a Z3950 session for the user for the input ZDb Database object, autho, password, and newpassword by issuing a Z3950 Init Request.
Parameters:
user - the user context
ZDb - the database object
autho - for the init request
password - for the init request
newPassword - for the init request
Returns:
boolean indicating success or failure of the init
Throws:
Exception - thrown from Z39.50 init processing

initZSession

public boolean initZSession(UserStateObject user,
                            Z39session z39sess,
                            ZServer zServer)
                     throws Exception
Establishes a Z3950 session for user for the input Z39session and ZServer objects by issuing a Z3950 Init Request. The user state entities set as a result of the Init are:
msg
code
zcode
zmsg
Parameters:
user - the user context
Z39session - the class to build the connection on
ZServer - the Z39.50 server object
Returns:
boolean indicating success or failure of the init
Throws:
Exception - thrown from Z39.50 init processing

removeDbfromList

public void removeDbfromList(ZDb db)
Removes the input ZDb object from the user's database list.
Parameters:
ZDb - the database to remove

zDb

public ZDb zDb()
Returns a ZDb object for the current database in use.
Returns:
Zdb

zServer

public ZServer zServer()
Returns a ZServer object for the current ZServer in use.
Returns:
ZServer

z39session

public Z39session z39session()
Returns a Z39session object for the current Z3950 session in use.
Returns:
Z39session

get

public static ZUserData get(UserStateObject user)
Retrieves a ZUserData object for the input UserStateObject. A new ZUserData object is created if not found and stored in the user state object - The ZUserData database list is initialized with access to all the available Z39.50 databases.
Parameters:
user - the user object
Returns:
ZUserData

getCacheData

public CacheData getCacheData(String format)
Get the CacheData object for the given format
Parameters:
format - The desire format
Returns:
CacheData

updateCache

public void updateCache(String resultSetName,
                        int realStartRecno,
                        int numrecs,
                        String format,
                        String syntax,
                        Vector dataRecs)
Update the cache with the current data
Parameters:
resultSetName - The result set name
resultSetStartRecno - The result set start record number
numrecs - The number of records in the set
format - The record format
syntax - The record syntax
dataRecs - The records

flushCache

public void flushCache(String format)
Flush the FETCH cache
Parameters:
format - of the records

Open SiteSearch 4.1.1
Final