|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jpl.mipl.mdms.FileService.komodo.registry.dbms.SybaseRegistry
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 | |
SybaseRegistry(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,
RegistryHandler handler)
Set a VFT reference. |
void |
addFileComplete(int fileId,
byte[] checksum,
RegistryHandler handler)
Signal that an add operation has completed. |
int |
addFileType(String serverGroup,
String type,
String dir,
String comment,
String reserved,
String threshold,
String qaInterval,
String checksum,
String xml,
RegistryHandler handler)
Method to make a new file type |
void |
addFileTypeToRole(String type,
String role,
RegistryHandler handler)
Method to add file type to role |
void |
addReference(String vftName,
String reference,
String link,
String comment,
RegistryHandler handler)
Create a vft reference. |
void |
addRole(String role,
String capabilities,
RegistryHandler handler)
Method to add a new access role in the database |
void |
addUser(String name,
String passwd,
String privilege,
boolean addVFT,
RegistryHandler handler)
Method to add a new user to the database |
void |
addUserToRole(String name,
String role,
RegistryHandler handler)
Add user to a role |
void |
addVFT(String name,
String userName,
String title,
boolean notify,
RegistryHandler handler)
Method to create a vft. |
void |
addVFTReader(String userName,
String vft,
RegistryHandler handler)
Method to add vft reader. |
void |
archiveFile(int ftId,
String fileName,
String archive,
RegistryHandler handler)
Method to add an archive msg to the file record. |
void |
cancelReference(String vft,
String reference,
RegistryHandler handler)
Method to remove a file reference |
void |
changePassword(String name,
String passwd,
RegistryHandler handler)
Change a user's password. |
void |
commentFile(int ftId,
String fileName,
String comment,
RegistryHandler handler)
Method to add a comment to the file record. |
void |
deleteFile(int fileId,
RegistryHandler handler)
Method to delete file from the dbms |
String |
delFileRef(String vft,
String reference,
RegistryHandler handler)
Remove the assocation between a reference and a file. |
void |
delFileType(String type,
RegistryHandler handler)
Delete a file type |
void |
delFileTypeFromRole(String type,
String role,
RegistryHandler handler)
Method to delete a file type from role |
int |
delRef(String vft,
String reference,
RegistryHandler handler)
Method to delete a vft reference. |
void |
delRole(String role,
RegistryHandler handler)
Method to delete an access role |
void |
delUser(String name,
RegistryHandler handler)
Method to delete a user record |
void |
delUserFromRole(String name,
String role,
RegistryHandler handler)
Method to delete a user from role |
void |
delVFT(String vft,
RegistryHandler handler)
Method to delete a vft. |
void |
delVFTReader(String user,
String vft,
RegistryHandler handler)
Method to delete a vft reader from a vft |
int |
getFileList(int ftId,
String fileglob,
char modifier,
RegistryHandler handler)
Return a string containing a short description of each file in a file type. |
int |
getFileList(int ftId,
String start,
String end,
RegistryHandler handler)
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. |
int |
getFileList(String fileType,
RegistryHandler handler)
Method to return a list containing a description of each file in a file type. |
int |
getFileServerConfig(String serverName,
RegistryHandler handler)
Get file server information. |
int |
getFileTypeInfoTable(RegistryHandler handler)
Extracts all file types in the registry that are associated with the current server group. |
int |
getFileTypeNames(String serverName,
RegistryHandler handler)
Method to get file type names list from db |
int |
getRefFileInfo(String vft,
String reference,
RegistryHandler handler)
Method to return a string containing a description of a referenced file. |
int |
getRefFileInfoAt(String vft,
String date,
String reference,
RegistryHandler handler)
Return a string containing a description of a referenced file. |
int |
getRefs(String vft,
String date,
RegistryHandler handler)
Method to return a string report of vft references, with comments. |
int |
getUserFTCapabilities(String userName,
RegistryHandler handler)
Retrieve user's capabilities for all file types that are available. |
void |
getUserInfo(String userName,
Authenticator auth,
RegistryHandler handler)
Check to see if a file management user exists. |
int |
getUserVFTCapabilities(String userName,
RegistryHandler handler)
Create a lookup table for each VFT for which a user has a capability. |
int |
getUserVFTCapabilities(String vft,
String userName,
RegistryHandler handler)
Method to retrieve user vft capabilities |
int |
getVFT(String vft,
String dateTime,
RegistryHandler handler)
Method to get vft info. |
int |
getVFTReaders(String vft,
String userName,
RegistryHandler handler)
Method to retrieve VFT readers info |
boolean |
isFileTypeLocked(int ftId,
RegistryHandler handler)
Method to find out if a file type is already locked. |
int |
loadFileServerParams(String name,
RegistryHandler handler)
Load file server parameters into Configuration object |
int |
lockFile(String fileName,
int ftId,
int lockType,
RegistryHandler handler)
Method to lock a file in the file service. |
String |
lockFileType(int ftId,
RegistryHandler handler)
Method to update a record in the fileTypes table to lock it. |
void |
makeDomainFile(String servername,
RegistryHandler handler)
Make a new domain file froim information stored in the DB |
void |
releaseFileLock(int fileId,
RegistryHandler handler)
Method to release file lock |
void |
renameFile(int fileId,
String newName,
RegistryHandler handler)
Method to add an archive msg to the file record. |
void |
replaceFile(int fileId,
String contributor,
String contributeServer,
long filesize,
byte[] checksum,
String comment,
RegistryHandler handler)
Update a record in the files table with new information (size, contributor, modified date, etc. |
void |
resetFileLock(int fileId,
RegistryHandler handler)
Method to reset file lock |
void |
setReference(String vft,
String reference,
String fileType,
String fileName,
RegistryHandler handler)
Schedule a file reference to take effect at the next vft update |
int |
showRoles(String role,
RegistryHandler handler)
Get access role information from db |
int |
showRolesForFileType(String fileType,
String role,
RegistryHandler handler)
Get roles associated with a file type |
int |
showRolesForUser(String name,
RegistryHandler handler)
Get roles associated with a user |
int |
showServers(RegistryHandler handler)
Get list of servers from db |
int |
showUsers(String name,
RegistryHandler handler)
Get user information from db |
int |
showUserVFTs(String userName,
String vft,
RegistryHandler handler)
Show the vfts a user can read. |
int |
showVFTReaders(String vft,
String userName,
RegistryHandler handler)
Method to show the file system users who can read a vft. |
int |
startAddFile(int ftId,
String filename,
String contributor,
String contributeServer,
long size,
String comment,
RegistryHandler handler)
Insert a record into the files table to signal the start of a file add. |
int |
startDelVFT(String vft,
RegistryHandler handler)
Mark a vft for delete, and return a linked list of locations (links) to delete. |
int |
startGetFile(String filename,
int fileTypeId,
RegistryHandler handler)
Get a read lock on the file. |
int |
startRenameTrans(int ftId,
String oldName,
String newName,
RegistryHandler handler)
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(RegistryHandler handler)
Record server start time in database. |
int |
startUpdateVFT(String vft,
boolean lockIt,
RegistryHandler handler)
Lock a VFT so that the VFTs references can be synched with the file system links. |
void |
stopServer(RegistryHandler handler)
Record server stop time in database. |
int |
transferReceipt(int userId,
int fileId,
int ftId,
char command,
String checksum,
RegistryHandler handler)
Method to record a file transfer, get a receipt. |
void |
unlockFileType(int ftId,
RegistryHandler handler)
Update a record in the fileTypes table to lock it. |
void |
unlockVFT(String vft,
RegistryHandler handler)
Method to unlock an VFT record. |
void |
updateVFT(String vft,
String userName,
String comment,
RegistryHandler handler)
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 SybaseRegistry(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 int getFileServerConfig(String serverName, RegistryHandler handler)
getFileServerConfig
in interface Registry
serverName
- the server namehandler
- the registry handler
jpl.mipl.mdms.FileService.util.Configuration
public int loadFileServerParams(String name, RegistryHandler handler)
loadFileServerParams
in interface Registry
name
- parameters name spacehandler
- the registry handler
jpl.mipl.mdms.FileService.util.Configuration
public void startServer(RegistryHandler handler)
startServer
in interface Registry
handler
- the error handlerpublic void stopServer(RegistryHandler handler)
stopServer
in interface Registry
handler
- the error handlerpublic int getFileTypeInfoTable(RegistryHandler handler)
getFileTypeInfoTable
in interface Registry
handler
- The registry handler to handles the return results.
public int getUserFTCapabilities(String userName, RegistryHandler handler)
getUserFTCapabilities
in interface Registry
userName
- the file system user name.handler
- the handler for retrieved values.
public int getUserVFTCapabilities(String userName, RegistryHandler handler)
getUserVFTCapabilities
in interface Registry
userName
- the file system user namehandler
- The registry handler reference.
public int startAddFile(int ftId, String filename, String contributor, String contributeServer, long size, String comment, RegistryHandler handler)
startAddFile
in interface Registry
ftId
- the file type idfilename
- the file namecontributor
- the contributor of the filecontributeServer
- the server that contributed the filesize
- the size of the filecomment
- any comment associated with the filehandler
- the registry handler reference.
public void addFileComplete(int fileId, byte[] checksum, RegistryHandler handler)
addFileComplete
in interface Registry
fileId
- the handle to the internal file identifier.checksum
- the optional checksum. Could be "".handler
- the error handlerpublic int startRenameTrans(int ftId, String oldName, String newName, RegistryHandler handler)
startRenameTrans
in interface Registry
ftId
- the internal identifier of the file type.oldName
- Name of the file to rename.newName
- Intended new name of the file.handler
- the data and error handler
public void replaceFile(int fileId, String contributor, String contributeServer, long filesize, byte[] checksum, String comment, RegistryHandler handler)
replaceFile
in interface Registry
fileId
- internal file identifiercontributor
- the contributor of the filecontributeServer
- the server that contributed the filefilesize
- the size of the filechecksum
- the message digest values, may be nullcomment
- any message associated with the file, may be nullhandler
- the erro handlerpublic int startGetFile(String filename, int fileTypeId, RegistryHandler handler)
startGetFile
in interface Registry
filename
- The file namefileTypeId
- the file type idhandler
- the registry handler to handle the return results.
public void getUserInfo(String userName, Authenticator auth, RegistryHandler handler)
getUserInfo
in interface Registry
userName
- the file system user nameauth
- The authenticator object referencehandler
- The registry handler to handle return result setpublic int lockFile(String fileName, int ftId, int lockType, RegistryHandler handler)
Lock types:
lockFile
in interface Registry
fileName
- Name of the file to lock.ftId
- the file type ID as internal record referencelockType
- Type of lock.handler
- the registry handler
public void releaseFileLock(int fileId, RegistryHandler handler)
releaseFileLock
in interface Registry
fileId
- DBMS internal file identifier.handler
- the registry handler.public void resetFileLock(int fileId, RegistryHandler handler)
resetFileLock
in interface Registry
fileId
- DBMS internal file identifierhandler
- the registry handlerpublic void commentFile(int ftId, String fileName, String comment, RegistryHandler handler)
commentFile
in interface Registry
ftId
- DBMS internal file type identifierfileName
- the name of the filecomment
- the comment to be insertedhandler
- the error handlerpublic void archiveFile(int ftId, String fileName, String archive, RegistryHandler handler)
archiveFile
in interface Registry
ftId
- DBMS internal file type identifier.fileName
- the name of the filearchive
- note.handler
- the error handlerpublic void renameFile(int fileId, String newName, RegistryHandler handler)
renameFile
in interface Registry
fileId
- DBMS internal file identifier.newName
- the new file namehandler
- the error handlerpublic void deleteFile(int fileId, RegistryHandler handler)
deleteFile
in interface Registry
fileId
- DBMS internal file identifier.handler
- the error handlerpublic int getFileList(int ftId, String start, String end, RegistryHandler handler)
getFileList
in interface Registry
ftId
- the file type internal identifierstart
- time for listend
- time for list.handler
- the registry handler
public int getFileList(int ftId, String fileglob, char modifier, RegistryHandler handler)
getFileList
in interface Registry
ftId
- the file type internal identifierfileglob
- the file globbing expressionmodifier
- if 'l', means get latest matching fileglobhandler
- a registry handler that handles each result set record
public String lockFileType(int ftId, RegistryHandler handler)
lockFileType
in interface Registry
ftId
- the file type internal identifierhandler
- the error handler
public boolean isFileTypeLocked(int ftId, RegistryHandler handler)
isFileTypeLocked
in interface Registry
ftId
- the file type internal identifierhandler
- the error handler
public void unlockFileType(int ftId, RegistryHandler handler)
unlockFileType
in interface Registry
ftId
- the file type internal identifierhandler
- the error handlerpublic int transferReceipt(int userId, int fileId, int ftId, char command, String checksum, RegistryHandler handler)
transferReceipt
in interface Registry
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 valuehandler
- the error handler
public int getRefFileInfo(String vft, String reference, RegistryHandler handler)
getRefFileInfo
in interface Registry
vft
- the virtual file typereference
- the reference namehandler
- the result and error handler
public int getRefFileInfoAt(String vft, String date, String reference, RegistryHandler handler)
getRefFileInfoAt
in interface Registry
vft
- the virtual file typedate
- the date stringreference
- (optional) reference namehandler
- the data and error handler
public void addVFT(String name, String userName, String title, boolean notify, RegistryHandler handler)
addVFT
in interface Registry
name
- the vft nameuserName
- the user nametitle
- the vft titlenotify
- if true, user will be notified when updates availablehandler
- the data and error handlerpublic void addReference(String vftName, String reference, String link, String comment, RegistryHandler handler)
addReference
in interface Registry
vftName
- the vft namereference
- the reference namelink
- the link namecomment
- the optinal comment for the referencehandler
- the data and error handlerpublic void addAndSetFileRef(String vftName, String reference, String fileType, String fileName, String link, String comment, RegistryHandler handler)
addAndSetFileRef
in interface Registry
vftName
- the vft namereference
- the reference namefileType
- the file typefileName
- the file namelink
- the link valuecomment
- optinal commenthandler
- the data and error handlerpublic String delFileRef(String vft, String reference, RegistryHandler handler)
delFileRef
in interface Registry
vft
- the vft namereference
- the reference namehandler
- the data and error handler
public void updateVFT(String vft, String userName, String comment, RegistryHandler handler)
updateVFT
in interface Registry
vft
- the vft nameuserName
- the Komodo user making the updatecomment
- the optional comment to associate with the update.handler
- the data and error handlerpublic int startUpdateVFT(String vft, boolean lockIt, RegistryHandler handler)
startUpdateVFT
in interface Registry
vft
- the VFT name.lockIt
- if false is passed, then return information w/o
locking the VFT.handler
- the registry handler
public void unlockVFT(String vft, RegistryHandler handler)
unlockVFT
in interface Registry
vft
- The VFT namehandler
- the error handlerpublic int getVFT(String vft, String dateTime, RegistryHandler handler)
getVFT
in interface Registry
vft
- the vft namedateTime
- the optional date. If not specified, use current time.handler
- the data and error handler
public int getVFTReaders(String vft, String userName, RegistryHandler handler)
getVFTReaders
in interface Registry
vft
- the vft nameuserName
- the user namehandler
- the data and error handler
public int getUserVFTCapabilities(String vft, String userName, RegistryHandler handler)
getUserVFTCapabilities
in interface Registry
vft
- the vft nameuserName
- the user namehandler
- the registry handler
public int getRefs(String vft, String date, RegistryHandler handler)
getRefs
in interface Registry
vft
- the vft namedate
- optional reference datehandler
- the data and error handler
public void setReference(String vft, String reference, String fileType, String fileName, RegistryHandler handler)
setReference
in interface Registry
vft
- the vft namereference
- the reference namefileType
- the file typefileName
- the file namehandler
- the registry handler objectpublic int startDelVFT(String vft, RegistryHandler handler)
startDelVFT
in interface Registry
vft
- the vft namehandler
- the data and error handler
public void cancelReference(String vft, String reference, RegistryHandler handler)
cancelReference
in interface Registry
vft
- the vft namereference
- the reference namehandler
- the error handlerpublic void delVFT(String vft, RegistryHandler handler)
delVFT
in interface Registry
vft
- the vft namehandler
- the error handlerpublic void delFileType(String type, RegistryHandler handler)
delFileType
in interface Registry
type
- the file type namehandler
- the error handlerpublic int delRef(String vft, String reference, RegistryHandler handler)
delRef
in interface Registry
vft
- the vft namereference
- the reference namehandler
- the data and error handler
public void addFileTypeToRole(String type, String role, RegistryHandler handler)
addFileTypeToRole
in interface Registry
type
- the file typerole
- the rolehandler
- the error handlerpublic void addVFTReader(String userName, String vft, RegistryHandler handler)
addVFTReader
in interface Registry
userName
- the user to be added to a list of vft readers.vft
- the vft.handler
- the error handlerpublic void addUserToRole(String name, String role, RegistryHandler handler)
addUserToRole
in interface Registry
name
- the user's namerole
- the rolehandler
- the error handlerpublic int addFileType(String serverGroup, String type, String dir, String comment, String reserved, String threshold, String qaInterval, String checksum, String xml, RegistryHandler handler)
addFileType
in interface Registry
serverGroup
- the server group name.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 schemahandler
- the registry handler
public void makeDomainFile(String servername, RegistryHandler handler)
makeDomainFile
in interface Registry
servername
- the name of the serverhandler
- the handler for the domain file resultspublic void addRole(String role, String capabilities, RegistryHandler handler)
addRole
in interface Registry
role
- the role namecapabilities
- the capabilities for the role (string rep of an int)handler
- the error handlerpublic void addUser(String name, String passwd, String privilege, boolean addVFT, RegistryHandler handler)
addUser
in interface Registry
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).handler
- the data and error handlepublic void changePassword(String name, String passwd, RegistryHandler handler)
changePassword
in interface Registry
name
- the user namepasswd
- the user passwdhandler
- the error handlerpublic void delRole(String role, RegistryHandler handler)
delRole
in interface Registry
role
- the access role namehandler
- the error handlerpublic void delUser(String name, RegistryHandler handler)
delUser
in interface Registry
name
- the user namehandler
- the error handlerpublic void delFileTypeFromRole(String type, String role, RegistryHandler handler)
delFileTypeFromRole
in interface Registry
type
- the file typerole
- the role namehandler
- the error handlerpublic void delVFTReader(String user, String vft, RegistryHandler handler)
delVFTReader
in interface Registry
user
- the user namevft
- the vft namehandler
- the error handlerpublic void delUserFromRole(String name, String role, RegistryHandler handler)
delUserFromRole
in interface Registry
name
- the user namerole
- the role namehandler
- the error handlerpublic int showRoles(String role, RegistryHandler handler)
showRoles
in interface Registry
role
- the role namehandler
- the registry handler
public int showRolesForFileType(String fileType, String role, RegistryHandler handler)
showRolesForFileType
in interface Registry
fileType
- the file typerole
- the role namehandler
- the result handler
public int showVFTReaders(String vft, String userName, RegistryHandler handler)
showVFTReaders
in interface Registry
vft
- the vft nameuserName
- the user namehandler
- the registry handler
public int showUserVFTs(String userName, String vft, RegistryHandler handler)
showUserVFTs
in interface Registry
userName
- the user namevft
- the vft namehandler
- the registry handler
public int showRolesForUser(String name, RegistryHandler handler)
showRolesForUser
in interface Registry
name
- the user namehandler
- the error handler
public int showUsers(String name, RegistryHandler handler)
showUsers
in interface Registry
name
- the user namehandler
- the registry handler
public int showServers(RegistryHandler handler)
showServers
in interface Registry
handler
- the erro rhandler
public int getFileList(String fileType, RegistryHandler handler)
getFileList
in interface Registry
fileType
- file type namehandler
- the registry handler
public int getFileTypeNames(String serverName, RegistryHandler handler)
getFileTypeNames
in interface Registry
serverName
- the name of the file server.handler
- the registry handler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |