|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ORG.oclc.db.Db
Db is an abstract classes which defines methods that need to be implemented by an object in order to be a Z39.50 server.
Field Summary | |
static int |
CLOSED
|
protected Object |
dbNames
Object naming database. |
protected int |
dbVersion
|
protected static boolean |
dumpConfigInfo
Global flag indicating whether configuration information should dumped to the Server Log files. |
protected static IniFileSection |
globals
Global variables used by all Db objects. |
static String[] |
modeNames
|
static int |
OPEN
|
protected static Object |
opsClient
The OpsClient object from the server started on random hosts. |
protected Db[] |
parents
|
protected Sorts |
sortMap
Available sorts for this Db. |
static int |
UPDATE
|
protected int |
users
|
static int |
WAITINGTOCLOSE
|
Constructor Summary | |
protected |
Db()
Db cannot be instantiated because it is an abstract class. |
Method Summary | |
abstract void |
accessAllowed(Object dbUserData)
Determines whether the user is authorized to search the database and throws the appropriate exception indicating whether some action needs to be taken. |
abstract void |
accessControl(Object accessControlResponse,
Object dbUserData)
Process the information from an AccessControl response to set user specific authorization information. |
protected void |
browse()
Increments browse transaction count. |
abstract TermInfo[] |
browse(String query,
int preferredPosition,
int numTerms,
DataDir Z39attributesPlusTerm,
DataDir resultSetAttributes,
int stepSize,
Object dbUserData)
Perform a browse. |
protected Key[] |
buildSortKeys(String hitlist,
String[] keys,
int[] order,
Object dedupCriteria,
Object userData)
Return sort keys for the records in the hitlist. |
abstract void |
close()
close this Db. |
void |
closewhenidle()
|
abstract void |
connect(Object userInformation,
Object dbUserData)
Create a connection to this Db for a user. |
static String[] |
dbnames()
|
protected void |
deleteHitlist()
Increments deleteHitlist transaction count. |
abstract void |
deleteHitlist(String hitlist,
Object dbUserData)
Delete the specified hitlist. |
abstract void |
disconnect(Object dbUserData)
Destroy a connection to this Db for a user. |
abstract ExtSvcData |
extsvc(ExtSvcData esData,
ExtSvcHandler esHandler,
Object dbUserData)
Performs an Extended Services request. |
protected static String |
filterName(String name)
Filter the dbname of blanks. |
abstract TermComponentPostings[] |
getComponentResults(String hitlist,
Object dbUserData)
Get the database component term postings summaries for the specified hitlist. |
static Db |
getDb(String[] DbList)
Get a Db object for this database name. |
static String |
getDbNames(String[] DbList)
Convert a list of database names into a single name. |
abstract DbResults[] |
getDbResults(String hitlist,
Object dbUserData)
Get the database search summaries for the specified hitlist. |
static Enumeration |
getDbs()
|
static IniFileSection |
getGlobals()
|
String |
getName()
|
static int |
getOpenedFilesCount()
Get the number of opened Files count. |
static int |
getOutstandingCount()
|
String |
getStats()
|
boolean |
hasUsers()
Check if any users are associated with this Db. |
protected abstract boolean |
init(IniFile inifile,
String which)
Initialize this Db object. |
abstract Object |
initDbUserData(String sessionId,
Object access,
Log log,
Object userDbMap)
Creates a database User data object for searching the database - Each database has it's own unique DbUserData object. |
int |
numUsers()
|
abstract boolean |
OK()
Check if the Db is open and ready for requests. |
protected static Db |
openDb(IniFile ini,
String dbSection)
Open a database. |
static void |
openDbs(IniFile ini,
String databaseSection,
boolean verbose)
Open all databases listed in the databaseSection of the IniFile. |
abstract int |
postings(String hitlist,
Object dbUserData)
Get postings for a specified hitlist. |
protected void |
present()
Increments present transaction count. |
abstract DbPresentData[] |
present(String hitlist,
int startPoint,
int numRecs,
String elementSetName,
String syntax,
Object dbUserData)
Get the specified records from the specified hitlist. |
boolean |
rolldatabase(IniFile inifile,
String inifilesection)
|
int |
rolldatabaseusers()
|
protected void |
search()
Increments search transaction count. |
abstract int |
search(String query,
String hitlist,
boolean replaceFlag,
DataDir Z39attributesPlusTerm,
boolean doRestrictorSummary,
Object additionalSearchInfo,
Object dbUserData)
Perform a search. |
void |
setOps(Object opsClient)
Save a reference to an operations client object. |
static void |
setSearchMode(String dbname,
int mode)
|
static Db |
SetupDatabase(Db[] dbs,
String name)
Use this to create a new merged Db from an array of existing Dbs. |
static Db |
SetupDatabase(IniFile inifile,
String which)
Use this to create a Db object. |
protected void |
sort()
Increments sort transaction count. |
protected Object[] |
sort(String hitlist,
String[] keys,
int[] order,
Object dupCriteria,
Object userData)
Sort the hitlist according to the keys and return a list of offsets. |
abstract void |
sort(String hitlist,
String sortedList,
String[] keys,
int[] order,
boolean fUseSortAttributes,
boolean sortAccrossDbs,
Object dupCriteria,
Object userData)
Sort the hitlist according to the keys. |
protected abstract boolean |
supportsScan()
Does this Db support scan requests? |
protected abstract boolean |
supportsSort()
Does this Db support sort requests? |
protected abstract void |
unsort(String hitlist,
Object userData)
Unsort the hitlist. |
void |
updateOpenedFiles(int count)
Update the opened files count. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected Object dbNames
protected Sorts sortMap
protected Db[] parents
protected int dbVersion
protected int users
protected static IniFileSection globals
protected static boolean dumpConfigInfo
protected static Object opsClient
public static int CLOSED
public static int OPEN
public static int UPDATE
public static int WAITINGTOCLOSE
public static String[] modeNames
Constructor Detail |
protected Db()
Method Detail |
public static final Db SetupDatabase(IniFile inifile, String which) throws Exception
inifile
- Contains 'ZBaseDbType=classname' to load Db objectwhich
- Section in inifile to look for type and other information.public static final Db SetupDatabase(Db[] dbs, String name)
public String getStats()
public static int getOutstandingCount()
public String getName()
protected static String filterName(String name)
public static final int getOpenedFilesCount()
public void updateOpenedFiles(int count)
the
- number of files to add to the countpublic void setOps(Object opsClient)
opsClient
- the ops client object.protected final void present()
protected final void search()
protected final void sort()
protected final void browse()
protected final void deleteHitlist()
public abstract Object initDbUserData(String sessionId, Object access, Log log, Object userDbMap)
sessionId
- assigned by something elseaccess
- the object containing access info to connect to an
access serverlog
- the Log object for the user for tracingpublic abstract void accessAllowed(Object dbUserData) throws AccessControl, Diagnostic1
dbUserData
- user data object containing hitlistspublic abstract int postings(String hitlist, Object dbUserData) throws Diagnostic1
hitlist
- result set namedbUserData
- user data object containing hitlistsprotected abstract boolean init(IniFile inifile, String which) throws Exception
inifile
- for parameterswhich
- section name for inifile for this Dbprotected abstract boolean supportsScan()
protected abstract boolean supportsSort()
public abstract DbPresentData[] present(String hitlist, int startPoint, int numRecs, String elementSetName, String syntax, Object dbUserData) throws Exception, Diagnostic1
hitlist
- result set namestartPoint
- starts at 1numRecs
- to retrieveelementSetName
- view of record to retrievesyntax
- in which to return recorddbUserData
- user data containing hitlistspublic abstract int search(String query, String hitlist, boolean replaceFlag, DataDir Z39attributesPlusTerm, boolean doRestrictorSummary, Object additionalSearchInfo, Object dbUserData) throws Exception, Diagnostic1, AccessControl, PartialResults
query
- type 0 query or null if this is not type 0hitlist
- result set name to createreplaceFlag
- can this hitlist overwrite a previous one?Z39attributesPlusTerm
- non-type 0 querydoRestrictorSummary
- flag to return a summary of recordsadditionalSearchInfo
- the Z39.50 additional Search Info fielddbUserData
- user data containing hitlistspublic abstract TermInfo[] browse(String query, int preferredPosition, int numTerms, DataDir Z39attributesPlusTerm, DataDir resultSetAttributes, int stepSize, Object dbUserData) throws Exception, Diagnostic1, AccessControl, PartialResults
query
- starting termpreferredPosition
- of the query term in the returned listnumTerms
- to returnZ39attributesPlusTerm
- term plus starting point attributesresultSetAttributes
- result set attributes if they are different
from the starting point attributesstepSize
- number of terms between termsdbUserData
- user data containing hitlistspublic abstract ExtSvcData extsvc(ExtSvcData esData, ExtSvcHandler esHandler, Object dbUserData) throws Exception, Diagnostic1, AccessControl
function
- the ES function - see Z39.50 apipackageType
- the type of ES requestesTask
- the ES task packageuserId
- the ES userIddescription
- the ES description field.packageName
- the ES package namewaitAction
- the ES wait action valuepublic abstract void deleteHitlist(String hitlist, Object dbUserData) throws Exception, Diagnostic1
hitlist
- the one to deletedbUserData
- user data containing hitlistspublic abstract boolean OK()
public abstract DbResults[] getDbResults(String hitlist, Object dbUserData)
hitlist
- result set namedbUserData
- user data containing hitlistspublic abstract TermComponentPostings[] getComponentResults(String hitlist, Object dbUserData)
hitlist
- result set namedbUserData
- user data containing hitlistspublic abstract void accessControl(Object accessControlResponse, Object dbUserData)
accessControlResponse
- object containing the access control
responsedbUserData
- user data containing hitlistspublic abstract void close()
public boolean hasUsers()
public int numUsers()
public abstract void connect(Object userInformation, Object dbUserData) throws Diagnostic1
userInformation
- the userInformation data from the Z3950 Init requestdbUserData
- the user's database information for searching the
database.public abstract void disconnect(Object dbUserData)
dbUserData
- created by connectpublic abstract void sort(String hitlist, String sortedList, String[] keys, int[] order, boolean fUseSortAttributes, boolean sortAccrossDbs, Object dupCriteria, Object userData) throws Exception, Diagnostic1
hitlist
- result set namesortedList
- result set name for sorted resultskeys
- sort key parametersorder
- ascending or descendingfUseSortAttributes
- flag to sort by use attributessortAccrossDatabases
- flag to indicate to tell the ZBase that
the results should be the sort of all the records from all the databases
in the group vs. having the sorts be within each db not merged together
where true indicates to sort accross database boundaries.dupCriteria
- the dedup criteria to use for a dedup sort.
for each record.userData
- user data containing hitlistsprotected abstract void unsort(String hitlist, Object userData)
hitlist
- result set name
userData user data containing hitlistsprotected Key[] buildSortKeys(String hitlist, String[] keys, int[] order, Object dedupCriteria, Object userData) throws Exception, Diagnostic1
hitlist
- result set namekeys
- sort key parametersorder
- ascending or descendinguserData
- user data containing hitlistsprotected Object[] sort(String hitlist, String[] keys, int[] order, Object dupCriteria, Object userData) throws Exception, Diagnostic1
hitlist
- result set namekeys
- sort key parametersorder
- ascending or descendingdupCriteria
- the dedup criteria to use for a dedup sort.
for each record.userData
- user data containing hitlistspublic static String getDbNames(String[] DbList)
DbList
- list of database namespublic static Db getDb(String[] DbList)
DbList
- list of database namesprotected static Db openDb(IniFile ini, String dbSection)
ini
- configuration filedbSection
- section containing database parameterspublic static void openDbs(IniFile ini, String databaseSection, boolean verbose)
ini
- configuration filedatabaseSection
- section containing list of databasesverbose
- flag indicating whether to dump configuration information
to the logspublic static String[] dbnames()
public static Enumeration getDbs()
public static void setSearchMode(String dbname, int mode)
public void closewhenidle()
public boolean rolldatabase(IniFile inifile, String inifilesection)
public int rolldatabaseusers()
public static IniFileSection getGlobals()
|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |