|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kom.gateway.DBLow | +--kom.gateway.DBHigh
High (or intermediate) level database handling
Field Summary | |
(package private) static java.lang.String |
AdminURL
URL for Administrator (distinguished user) |
(package private) static KomData |
cache
Cache for form data |
(package private) static java.lang.String |
HomeURL
URL for Home |
(package private) static java.lang.String |
UsersURL
URL for Users |
Fields inherited from class kom.gateway.DBLow |
absCDBpath,
config,
fSep,
fSeparator,
msgAuth,
msgParts |
Constructor Summary | |
DBHigh(ServerConfig config)
Class constructor |
Method Summary | |
void |
addContent(java.lang.String ref,
KomData kd)
Adds cont* (content) record to the file database |
void |
addContent(java.lang.String ref,
java.lang.String key,
KomData kd)
Adds data to the file database |
(package private) void |
addDraft(java.lang.String ref,
KomData kd,
java.lang.String xnr)
Adds a file to the draft database |
void |
addInfo(java.lang.String key,
KomData kd)
Adds data to the main info file. |
void |
addLast(java.lang.String user,
java.lang.String curr)
Saves date-time of last notification sent for user |
void |
addMember(java.lang.String act,
java.lang.String user,
KomData kd)
Adds member data to an activity |
void |
addNews(java.lang.String user,
java.lang.String act,
KomData kd)
Adds data to a user news database part |
void |
addObj(java.lang.String ref,
java.lang.String part,
java.lang.String data)
Adds (appends) data to the file database |
void |
addObj(java.lang.String ref,
java.lang.String part,
java.lang.String data,
boolean apnd)
Adds data to the file database |
void |
addObject(java.lang.String ref,
KomData kd)
Adds object data to the database |
void |
addObject(java.lang.String ref,
java.lang.String key,
KomData kd)
Adds "labeled" object data to the database |
java.lang.String |
addQuery(java.lang.String userRef,
KomData kd)
Stores a query in the query database. |
void |
cleanDrafts(java.lang.String ref)
Removes any left-over MIME-formatted draft files |
java.lang.String |
contentCount(java.lang.String ref)
Counts valid cont* (content) records |
void |
createNews(java.lang.String user,
KomData kd)
Create a new news file for a user |
int |
depth(java.lang.String id)
Determines the "depth" of a URL by counting slashes. |
(package private) boolean |
expungeRef(java.lang.String ref)
Deletes all files accessed via a reference (directory and subdirs) |
java.lang.String |
findContent(java.lang.String ref)
Finds data in the file database |
KomData |
findDraft(java.lang.String ref,
java.lang.String xnr)
Finds data for a draft (uncommitted entry) |
java.lang.String |
findDraftData(java.lang.String ref,
java.lang.String xnr)
Finds data for a draft (uncommitted entry) |
java.lang.String |
findInfo()
Finds data in the file database |
java.lang.String |
findMemb(java.lang.String act)
Finds member data for an activity |
java.lang.String |
findNews(java.lang.String user)
Finds news data for a user |
java.lang.String |
findObject(java.lang.String ref)
Finds data in the file database |
java.lang.String |
findObject(java.lang.String ref,
java.lang.String part)
Finds data in the file database |
java.lang.String |
findQuery(java.lang.String userRef,
java.lang.String queryRef)
Retrieves a query from the query database. |
java.lang.String |
getFormContents(java.lang.String form)
Gets data for a form (HTML template) |
java.lang.String |
getQryDefault()
Gets default value fields for a query |
(package private) java.lang.String[] |
getQueries(java.lang.String userRef)
|
java.lang.String |
getseq(java.lang.String ref)
Gets the next free sequence number for a ref. |
(package private) java.lang.String[] |
getStringValues(java.lang.String ref,
java.lang.String part,
java.lang.String key)
Gets a String array of values from an object part |
(package private) java.util.Vector |
getValues(java.lang.String ref,
java.lang.String part,
java.lang.String key)
Gets a vector of values from an object part |
(package private) void |
invalidateCount(java.lang.String ref)
|
static boolean |
isEmpty(java.lang.String s)
Is the string empty or null? |
static boolean |
isStandard(java.lang.String url)
Determines if a url refers to one of a few standard directories |
java.lang.String[] |
listDraft(java.lang.String ref)
Makes a list of "drafts", i e uncommitted message file names |
void |
makeArea(java.lang.String path)
Allocates a database area if it does not exist already. |
void |
modObject(java.lang.String ref,
KomData kd)
Modifies object data in the database |
boolean |
msgExists(java.lang.String ref)
Finds any old mail |
(package private) java.lang.String |
nextDraft(java.lang.String ref,
KomData kd)
|
boolean |
queryExists(java.lang.String userRef,
java.lang.String queryRef)
Checks if query with specified ref exists in the database. |
java.lang.String |
ref2path(java.lang.String ref,
java.lang.String part)
Converts a reference to an object, plus a part identification, to a path in the database (relative to the document root). |
boolean |
refExists(java.lang.String ref)
Checks for existing KOM object |
void |
removeDraft(java.lang.String ref,
java.lang.String xnr,
java.lang.String old)
Removes a message from the draft database |
void |
removeQuery(java.lang.String userRef,
java.lang.String queryRef)
Removes a query from the query database |
void |
replaceObject(java.lang.String ref,
KomData kd)
Replaces an object |
java.lang.String |
Stream2String(java.io.InputStream is)
Creates a String from an InputStream |
java.io.InputStream |
String2Stream(java.lang.String data)
Creates an InputStream from a String |
java.io.InputStream |
StringBuffer2Stream(java.lang.StringBuffer data)
Creates an InputStream from a StringBuffer |
(package private) java.lang.String |
updateCount(java.lang.String ref)
Updates count of live objects at this level. |
java.lang.String |
updCount(java.lang.String ref,
java.lang.String key,
boolean create,
java.lang.String value)
Updates a "count" object part (e g "seq") |
java.lang.String |
updref(java.lang.String ref)
Gets a reference for the next child of a reference, creating a new area if necessary. |
java.lang.String |
updseq(java.lang.String ref)
Updates a "seq" object part |
Methods inherited from class kom.gateway.DBLow |
accessPart,
addFile,
areaExists,
basedRef,
createArea,
debugLog,
errorLog,
expungeFile,
File2Stream,
File2String,
findPart,
getFile,
getFileContents,
getFileStream,
getPath,
getStandard,
isMailSpool,
lastModified,
length,
listFiles,
makePart,
msgPartStream,
partfile,
partpath,
printStackTrace,
readObject,
removeFile,
replaceMime,
updseq1,
validate,
validate,
writeObject |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final java.lang.String HomeURL
static final java.lang.String UsersURL
static final java.lang.String AdminURL
static KomData cache
Constructor Detail |
public DBHigh(ServerConfig config)
config
- Server configuration dataMethod Detail |
public java.lang.String getFormContents(java.lang.String form)
form
- Name of formpublic java.lang.String getQryDefault()
public boolean msgExists(java.lang.String ref)
ref
- Like "/mail/47/"public boolean refExists(java.lang.String ref)
ref
- Reference to objectpublic void addObject(java.lang.String ref, KomData kd)
ref
- Object referencekd
- Object data as a KomData instancepublic void modObject(java.lang.String ref, KomData kd)
ref
- Object referencekd
- Object data as a KomData instancepublic void addObject(java.lang.String ref, java.lang.String key, KomData kd)
ref
- Object referencekey
- Key for labeling the datakd
- Object data as a KomData instancepublic java.lang.String findObject(java.lang.String ref)
public void addContent(java.lang.String ref, KomData kd)
ref
- Object refkd
- Content datavoid invalidateCount(java.lang.String ref)
public java.lang.String contentCount(java.lang.String ref)
ref
- What count refers topublic void addContent(java.lang.String ref, java.lang.String key, KomData kd)
ref
- Object refkey
- Data keykd
- Data contentpublic java.lang.String findContent(java.lang.String ref)
public void addLast(java.lang.String user, java.lang.String curr)
user
- User refcurr
- Current time-datepublic void addNews(java.lang.String user, java.lang.String act, KomData kd)
user
- User refact
- Activity refkd
- (Additional) news datapublic void createNews(java.lang.String user, KomData kd)
user
- User referencekd
- Data to put in the filepublic java.lang.String findNews(java.lang.String user)
user
- Ref to a userpublic void addMember(java.lang.String act, java.lang.String user, KomData kd)
act
- Activity referenceuser
- User refkd
- (Additional) member datapublic java.lang.String findMemb(java.lang.String act)
act
- Activity referencejava.lang.String updateCount(java.lang.String ref)
public void addObj(java.lang.String ref, java.lang.String part, java.lang.String data)
ref
- Object referencepart
- Part of object (e g "cont")data
- Data to put in the filepublic void addObj(java.lang.String ref, java.lang.String part, java.lang.String data, boolean apnd)
ref
- Object referencepart
- Part of object (e g "cont")data
- Data to put in the fileapnd
- True if data should be appended, false if overwritingpublic java.lang.String findObject(java.lang.String ref, java.lang.String part)
public java.lang.String ref2path(java.lang.String ref, java.lang.String part)
ref
- Main referencepart
- Part identificationpublic void addInfo(java.lang.String key, KomData kd)
key
- Key for retrieving the datakd
- Data to put in the filepublic java.lang.String findInfo()
public java.lang.String addQuery(java.lang.String userRef, KomData kd)
userRef
- User reference.kd
- Query to put in the database.public java.lang.String findQuery(java.lang.String userRef, java.lang.String queryRef)
userRef
- User reference.queryRef
- Thread reference.public boolean queryExists(java.lang.String userRef, java.lang.String queryRef)
userRef
- User reference.queryRef
- Query reference.public void removeQuery(java.lang.String userRef, java.lang.String queryRef)
userRef
- Reference to userqueryRef
- Reference to query to remove from the databasejava.lang.String[] getQueries(java.lang.String userRef)
void addDraft(java.lang.String ref, KomData kd, java.lang.String xnr)
ref
- Parent ref for draftkd
- Data to put in the draftjava.lang.String nextDraft(java.lang.String ref, KomData kd)
public java.io.InputStream String2Stream(java.lang.String data)
data
- Stringpublic java.io.InputStream StringBuffer2Stream(java.lang.StringBuffer data)
data
- StringBuffer instancepublic KomData findDraft(java.lang.String ref, java.lang.String xnr)
ref
- Parent idxnr
- Draft identificationpublic java.lang.String findDraftData(java.lang.String ref, java.lang.String xnr)
ref
- Parent idxnr
- Draft identificationpublic java.lang.String Stream2String(java.io.InputStream is)
is
- InputStreampublic void removeDraft(java.lang.String ref, java.lang.String xnr, java.lang.String old)
ref
- Parent refxnr
- Draft noold
- Older draftpublic void cleanDrafts(java.lang.String ref)
ref
- Parent refpublic void replaceObject(java.lang.String ref, KomData kd)
ref
- Object refkd
- New object datajava.util.Vector getValues(java.lang.String ref, java.lang.String part, java.lang.String key)
ref
- Object refpart
- Object partkey
- Key to valuesjava.lang.String[] getStringValues(java.lang.String ref, java.lang.String part, java.lang.String key)
ref
- Object refpart
- Object partkey
- Key to valuespublic java.lang.String[] listDraft(java.lang.String ref)
ref
- parent area of possible draftsboolean expungeRef(java.lang.String ref)
ref
- Ref to an object or areapublic java.lang.String updref(java.lang.String ref)
ref
- Parent referencepublic void makeArea(java.lang.String path)
path
- Reference to area (representing a thread, e g)public int depth(java.lang.String id)
id
- URL of the form /cat/act/thr/msg/, where one or more levels may be
missing at the end.public java.lang.String getseq(java.lang.String ref)
ref
- Reference to an area with a "seq" entry.public java.lang.String updseq(java.lang.String ref)
ref
- Object refpublic java.lang.String updCount(java.lang.String ref, java.lang.String key, boolean create, java.lang.String value)
ref
- Object refkey
- Part namecreate
- True if part should be created if missingvalue
- If non-null, place the value in the part (otherwise
add 1 to previous value)public static boolean isStandard(java.lang.String url)
url
- File urlpublic static boolean isEmpty(java.lang.String s)
s
- String
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |