|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jpl.mipl.mdms.FileService.komodo.fileMgmt.FileMgrDBMS
DBMS Access class, used for all File Management and User access DBMS access to a database. The constructor uses the information passed to establish connections with the DBMS ... TBD Note: There are try/catch blocks inside loops (jtest), but, the loops are all for handling unexpected disconnects from the DBMS.
Constructor Summary | |
FileMgrDBMS(String dataSource,
String registry,
String role,
boolean debug)
Constructor |
Method Summary | |
void |
addAndSetFileRef(String vftName,
String reference,
String fileType,
String fileName,
String link,
String comment)
Set a VFT reference. |
void |
addFileComplete(int fileId,
byte[] checksum)
Signal that an add operation has completed. |
void |
addFileType(String type,
String dir,
String comment,
String reserved,
String threshold,
String qaInterval,
String checksum,
String xml)
Method to make a new file type |
void |
addFileTypeToRole(String type,
String role)
Method to add file type to role |
void |
addReference(String vftName,
String reference,
String link,
String comment)
Create a vft reference. |
void |
addRole(String role,
String capabilities)
Method to add a new access role in the database |
void |
addUser(String name,
String passwd,
String privilege,
boolean addVFT)
Method to add a new user to the database |
void |
addUserToRole(String name,
String role)
Add user to a role |
void |
addVFT(String name,
String userName,
String title,
boolean notify)
Method to create a vft. |
void |
addVFTReader(String userName,
String vft)
Method to add vft reader. |
void |
archiveFile(int ftId,
String fileName,
String archive)
Method to add an archive msg to the file record. |
void |
cancelReference(String vft,
String reference)
Method to remove a file reference |
void |
changePassword(String name,
String passwd)
Change a user's password. |
void |
checkForUser(String userName,
String password,
UserProfile user)
Check to see if a file management user exists. |
void |
commentFile(int ftId,
String fileName,
String comment)
Method to add a comment to the file record. |
void |
deleteFile(int fileId)
Method to delete file from the dbms |
String |
delFileRef(String vft,
String reference)
Remove the assocation between a reference and a file. |
void |
delFileType(String type)
Delete a file type |
void |
delFileTypeFromRole(String type,
String role)
Method to delete a file type from role |
String |
delRef(String vft,
String reference)
Method to delete a vft reference. |
void |
delRole(String role)
Method to delete an access role |
void |
delUser(String name)
Method to delete a user record |
void |
delUserFromRole(String name,
String role)
Method to delete a user from role |
void |
delVFT(String vft)
Method to delete a vft. |
void |
delVFTReader(String user,
String vft)
Method to delete a vft reader from a vft |
String |
getFileList(int ftId,
String fileglob,
char modifier)
Return a string containing a short description of each file in a file type. |
String |
getFileList(int ftId,
String start,
String end)
Return a string containing a description of each file in a file type where the files' times are greater than or equal to start, and less then end. |
LinkedList |
getFileList(String fileType)
Method to return a list containing a description of each file in a file type. |
String |
getFileNames(int ftId,
String fileglob,
char modifier)
Return a string containing the names of files (for given file type) matched by a regular expression |
String |
getFileNames(int ftId,
String start,
String end)
Return a string containing the names of files (for given file type) matched by a start date, and before an optional end date. |
void |
getFileServerConfig(String serverName)
Get file server information. |
Hashtable |
getFileTypeInfoTable(String serverName)
Create a lookup table for each file type that this server handles, and enter each class into a hash table. |
LinkedList |
getFileTypeNames(String serverName)
Method to get file type names list from db |
String |
getRefFileInfo(String vft,
String reference)
Method to return a string containing a description of a referenced file. |
String |
getRefFileInfoAt(String vft,
String date,
String reference)
Return a string containing a description of a referenced file. |
String |
getRefs(String vft,
String date)
Method to return a string report of vft references, with comments. |
void |
getUserFTCapabilities(String userName,
UserProfile profile)
Create a lookup table for each file type for which a user has a capability. |
int |
getUserVFTCapabilities(String vft,
String userName)
Method to retrieve user vft capabilities |
void |
getUserVFTCapabilities(String userName,
UserProfile profile)
Create a lookup table for each VFT for which a user has a capability. |
Object[] |
getVFTAccess(String vft)
Method to get vft info. |
boolean |
isFileTypeLocked(int ftId)
Method to find out if a file type is already locked. |
void |
loadFileServerParams(String name,
boolean hotboot)
Load file server parameters into Configuration object |
int |
lockFile(String fileName,
int ftId,
int lockType)
Method to lock a file in the file service. |
String |
lockFileType(int ftId)
Method to update a record in the fileTypes table to lock it. |
String |
makeDomainFile()
Make a new domain file froim information stored in the DB |
void |
releaseFileLock(int fileId)
Method to release file lock |
void |
renameFile(int fileId,
String newName)
Method to add an archive msg to the file record. |
int |
replaceFile(int fileId,
Result profile)
Update a record in the files table with new information (size, contributor, modified date, etc. |
void |
setReference(String vft,
String reference,
String fileType,
String fileName)
Schedule a file reference to take effect at the next vft update |
String |
showRoles(String role)
Get access role information from db |
String |
showRolesForFileType(String fileType,
String role)
Get roles associated with a file type |
String |
showRolesForUser(String name)
Get roles associated with a user |
String |
showServerParameters(String name)
Get file server parameters. |
String |
showServers()
Get list of servers from db |
String |
showUsers(String name)
Get user information from db |
String |
showUserVFTs(String userName,
String vft)
Show the vfts a user can read. |
String |
showVFT(String vft,
String dateTime)
Method to get vft info. |
String |
showVFTReaders(String vft,
String userName)
Method to show the file system users who can read a vft. |
int |
startAddFile(Result profile)
Insert a record into the files table to signal the start of a file add. |
LinkedList |
startDelVFT(String vft)
Mark a vft for delete, and return a linked list of locations (links) to delete. |
int |
startGetFile(Result profile)
Get a read lock on the file, update the profile with additional information: size, checksum, etc. |
int |
startRenameTrans(int ftId,
String oldName,
String newName)
Start a rename file transaction by, in a single DBMS transaction, lock the file for rename, and record the new file name in the file record to persist the intended new name of the file, to be used for recovery from an unexpected termination of the File management process. |
void |
startServer()
Record server start time in database. |
LinkedList |
startUpdateVFT(String vft,
boolean lockIt)
Lock a VFT so that the VFTs references can be synched with the file system links. |
void |
stopServer()
Record server stop time in database. |
int |
transferReceipt(int userId,
int fileId,
int ftId,
char command,
String checksum)
Method to record a file transfer, get a receipt. |
void |
unlockFileType(int ftId)
Update a record in the fileTypes table to lock it. |
void |
updateVFT(String vft,
String userName,
String comment)
Method to update the VFT |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileMgrDBMS(String dataSource, String registry, String role, boolean debug) throws NamingException, IOException, SAXException, ParseException
dataSource
- Data source for sig events, e.g., FileMgrDB.registry
- Registry containing data source bindings.role
- Database role, allowing client to register events
to database.debug
- the debug flag
NamingException
- when DS lookup fail
IOException
- when registory/network I/O fail
SAXException
- when parser fails
ParseException
- when parsing failsMethod Detail |
public void getFileServerConfig(String serverName) throws SQLException
serverName
- the server name
SQLException
- when fail to load server info from DBpublic void loadFileServerParams(String name, boolean hotboot) throws SQLException
name
- parameters name spacehotboot
- if ture, only load parameters that make sense
SQLException
- when fail to load server parameters from DBjpl.mipl.mdms.FileService.util.Configuration
public String showServerParameters(String name) throws SQLException
name
- the server name
SQLException
- when failed to retrieve server parameterspublic void startServer() throws SQLException
SQLException
- when fail to retrieve data from DBpublic void stopServer() throws SQLException
SQLException
- when fail to retrieve data from DBpublic Hashtable getFileTypeInfoTable(String serverName) throws SQLException
serverName
- the server name
SQLException
- when fail to retrieve data from DBpublic void getUserFTCapabilities(String userName, UserProfile profile) throws SQLException
userName
- the file system user nameprofile
- the server-side profile, contains access info.
SQLException
- when fail to retrieve data from DBpublic void getUserVFTCapabilities(String userName, UserProfile profile) throws SQLException
userName
- the file system user nameprofile
- the server-side profile, contains access info.
SQLException
- when fail to retrieve data from DBpublic int startAddFile(Result profile) throws SQLException
profile
- the file profile information.
SQLException
- when fail to retrieve data from DBpublic void addFileComplete(int fileId, byte[] checksum) throws SQLException
fileId
- the handle to the internal file identifier.checksum
- the optional checksum. Could be "".
SQLException
- when failed to update databaseepublic int startRenameTrans(int ftId, String oldName, String newName) throws SQLException
ftId
- the internal identifier of the file type.oldName
- Name of the file to rename.newName
- Intended new name of the file.
SQLException
- when fail to retrieve data from DBpublic int replaceFile(int fileId, Result profile) throws SQLException
fileId
- internal file identifierprofile
- file information and result status
SQLException
- when fail to retrieve data from DBpublic int startGetFile(Result profile) throws SQLException
profile
- data describe to be sent
SQLException
- when failed to retrieve data from DBpublic void checkForUser(String userName, String password, UserProfile user) throws SQLException
Check to see if a file management user exists. The password is verified using one-way encryption. If the user/pasword combination is valid, then return the highest level of the user's permission.
checkForUser places these access levels into the user profile.
userName
- the file system user namepassword
- the user passworduser
- the profile contains user's access level and file type
permissions from database.
SQLException
- when failed to retrieve data from DBpublic int lockFile(String fileName, int ftId, int lockType) throws SQLException
Lock types:
fileName
- Name of the file to lock.ftId
- the file type ID as internal record referencelockType
- Type of lock.
SQLException
- when failed to retrieve data from DBpublic void releaseFileLock(int fileId) throws SQLException
fileId
- DBMS internal file identifier.
SQLException
- when failed to retrieve data from DBpublic void commentFile(int ftId, String fileName, String comment) throws SQLException
ftId
- DBMS internal file type identifierfileName
- the name of the filecomment
- the comment to be inserted
SQLException
- when failed to update databasepublic void archiveFile(int ftId, String fileName, String archive) throws SQLException
ftId
- DBMS internal file type identifier.fileName
- the name of the filearchive
- note.
SQLException
- when failed to update databasepublic void renameFile(int fileId, String newName) throws SQLException
fileId
- DBMS internal file identifier.newName
- the new file name
SQLException
- when failed to retrieve data from DBpublic void deleteFile(int fileId) throws SQLException
fileId
- DBMS internal file identifier.
SQLException
- when failed to retrieve data from DBpublic String getFileList(int ftId, String start, String end) throws SQLException
ftId
- the file type internal identifierstart
- time for listend
- time for list.
SQLException
- when failed to retrieve data from DBpublic String getFileList(int ftId, String fileglob, char modifier) throws SQLException
ftId
- the file type internal identifierfileglob
- the file globbing expressionmodifier
- if 'l', means get latest matching fileglob
SQLException
- when failed to retrieve data from DBpublic String getFileNames(int ftId, String fileglob, char modifier) throws SQLException
ftId
- the file type internal identifierfileglob
- the file globbing expressionmodifier
- if LATEST, means get latest matching fileglob
SQLException
- when failed to retrieve data from DBpublic String getFileNames(int ftId, String start, String end) throws SQLException
ftId
- the file type internal identifierstart
- the time for listend
- the time for list
SQLException
- when failed to retrieve data from DBpublic String lockFileType(int ftId) throws SQLException
ftId
- the file type internal identifier
SQLException
- when fail to retrieve data from DBpublic boolean isFileTypeLocked(int ftId) throws SQLException
ftId
- the file type internal identifier
SQLException
- when failed to retrieve data from DBpublic void unlockFileType(int ftId) throws SQLException
ftId
- the file type internal identifier
SQLException
- when failed to retrieve data from DBpublic int transferReceipt(int userId, int fileId, int ftId, char command, String checksum) throws SQLException
userId
- the internal identification of a user.fileId
- the internal identification of a file.ftId
- the internal identification of a file type.command
- the command, ('g', 'a', 'r').checksum
- the checksum value
SQLException
- when failed to retrieve data from DBpublic String getRefFileInfo(String vft, String reference) throws SQLException
vft
- the virtual file typereference
- the reference name
SQLException
- when failed to retrieve data from DBpublic String getRefFileInfoAt(String vft, String date, String reference) throws SQLException
vft
- the virtual file typedate
- the date stringreference
- (optional) reference name
SQLException
- when failed to retrieve data from DBpublic void addVFT(String name, String userName, String title, boolean notify) throws SQLException
name
- the vft nameuserName
- the user nametitle
- the vft titlenotify
- if true, user will be notified when updates available
SQLException
- when failed to retrieve data from DBpublic void addReference(String vftName, String reference, String link, String comment) throws SQLException
vftName
- the vft namereference
- the reference namelink
- the link namecomment
- the optinal comment for the reference
SQLException
- when failed to retrieve data from DBpublic void addAndSetFileRef(String vftName, String reference, String fileType, String fileName, String link, String comment) throws SQLException
vftName
- the vft namereference
- the reference namefileType
- the file typefileName
- the file namelink
- the link valuecomment
- optinal comment
SQLException
- when failed to retrieve data from DBpublic String delFileRef(String vft, String reference) throws SQLException
vft
- the vft namereference
- the reference name
SQLException
- when failed to retrieve data from DBpublic void updateVFT(String vft, String userName, String comment) throws SQLException
vft
- the vft nameuserName
- the Komodo user making the updatecomment
- the optional comment to associate with the update.
SQLException
- when failed to retrieve data from DBpublic LinkedList startUpdateVFT(String vft, boolean lockIt) throws SQLException
vft
- the VFT name.lockIt
- if false is passed, then return information w/o
locking the VFT.
SQLException
- when failed to retrieve data from DBpublic String showVFT(String vft, String dateTime) throws SQLException
vft
- the vft namedateTime
- the optional date. If not specified, use current time.
SQLException
- when failed to retrieve data from DBpublic Object[] getVFTAccess(String vft) throws SQLException
vft
- the vft name
SQLException
- when failed to retrieve data from DBpublic int getUserVFTCapabilities(String vft, String userName) throws SQLException
vft
- the vft nameuserName
- the user name
SQLException
- when failed to retrieve data from DBpublic String getRefs(String vft, String date) throws SQLException
vft
- the vft namedate
- optional reference date
SQLException
- when failed to retrieve data from DBpublic void setReference(String vft, String reference, String fileType, String fileName) throws SQLException
vft
- the vft namereference
- the reference namefileType
- the file typefileName
- the file name
SQLException
- when failed to retrieve data from DBpublic LinkedList startDelVFT(String vft) throws SQLException
vft
- the vft name
SQLException
- when failed to retrieve data from DBpublic void cancelReference(String vft, String reference) throws SQLException
vft
- the vft namereference
- the reference name
SQLException
- when failed to retrieve data from DBpublic void delVFT(String vft) throws SQLException
vft
- the vft name
SQLException
- when failed to retrieve data from DBpublic void delFileType(String type) throws SQLException
type
- the file type name
SQLException
- when failed to retrieve data from DBpublic String delRef(String vft, String reference) throws SQLException
vft
- the vft namereference
- the reference name
SQLException
- when failed to retrieve data from DBpublic void addFileTypeToRole(String type, String role) throws SQLException
type
- the file typerole
- the role
SQLException
- when failed to retrieve data from DBpublic void addVFTReader(String userName, String vft) throws SQLException
userName
- the user to be added to a list of vft readers.vft
- the vft.
SQLException
- when failed to retrieve data from DBpublic void addUserToRole(String name, String role) throws SQLException
name
- the user's namerole
- the role
SQLException
- when failed to retrieve data from DBpublic void addFileType(String type, String dir, String comment, String reserved, String threshold, String qaInterval, String checksum, String xml) throws SQLException
type
- file type namedir
- directory associate with file typecomment
- file type commentreserved
- disk space reserved to the file typethreshold
- the threshold value before sigevent is sentqaInterval
- the QA release intervalchecksum
- t or fxml
- OPTIONAL xml schema
SQLException
- when failed to retrieve data from DBpublic String makeDomainFile() throws SQLException
SQLException
- when failed to retrieve data from DBpublic void addRole(String role, String capabilities) throws SQLException
role
- the role namecapabilities
- the capabilities for the role (string rep of an int)
SQLException
- when failed to retrieve data from DBpublic void addUser(String name, String passwd, String privilege, boolean addVFT) throws SQLException
name
- the user namepasswd
- the user passwdprivilege
- user privileges (r)ead, (w)rite or (a)dminaddVFT
- to allow user to create a VFT (true of false).
SQLException
- when failed to retrieve data from DBpublic void changePassword(String name, String passwd) throws SQLException
name
- the user namepasswd
- the user passwd
SQLException
- when failed to retrieve data from DBpublic void delRole(String role) throws SQLException
role
- the access role name
SQLException
- when failed to retrieve data from DBpublic void delUser(String name) throws SQLException
name
- the user name
SQLException
- when failed to retrieve data from DBpublic void delFileTypeFromRole(String type, String role) throws SQLException
type
- the file typerole
- the role name
SQLException
- when failed to retrieve data from DBpublic void delVFTReader(String user, String vft) throws SQLException
vft
- the vft nameuser
- the user name
SQLException
- when failed to retrieve data from DBpublic void delUserFromRole(String name, String role) throws SQLException
name
- the user namerole
- the role name
SQLException
- when failed to retrieve data from DBpublic String showRoles(String role) throws SQLException
role
- the role name
SQLException
- when failed to retrieve data from DBpublic String showRolesForFileType(String fileType, String role) throws SQLException
fileType
- the file typerole
- the role name
SQLException
- when failed to retrieve data from DBpublic String showVFTReaders(String vft, String userName) throws SQLException
vft
- the vft nameuserName
- the user name
SQLException
- when failed to retrieve data from DBpublic String showUserVFTs(String userName, String vft) throws SQLException
userName
- the user namevft
- the vft name
SQLException
- when failed to retrieve data from DBpublic String showRolesForUser(String name) throws SQLException
name
- the user name
SQLException
- when failed to retrieve data from DBpublic String showUsers(String name) throws SQLException
name
- the user name
SQLException
- when failed to retrieve data from DBpublic String showServers() throws SQLException
SQLException
- when failed to retrieve data from DBpublic LinkedList getFileList(String fileType) throws SQLException
fileType
- file type name
SQLException
- when failed to retrieve data from DBpublic LinkedList getFileTypeNames(String serverName) throws SQLException
serverName
- the name of the file server.
SQLException
- when failed to retrieve data from DB
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |