jpl.mipl.mdms.FileService.komodo.fileMgmt
Class FileMgrDBMS

java.lang.Object
  |
  +--jpl.mipl.mdms.FileService.komodo.fileMgmt.FileMgrDBMS

public class FileMgrDBMS
extends Object

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.

Version:
$Id: FileMgrDBMS.java,v 1.10 2003/07/15 21:55:28 rap Exp $
Author:
Jeff Jacobson, G. Turek

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

FileMgrDBMS

public FileMgrDBMS(String dataSource,
                   String registry,
                   String role,
                   boolean debug)
            throws NamingException,
                   IOException,
                   SAXException,
                   ParseException
Constructor

Parameters:
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
Throws:
NamingException - when DS lookup fail
IOException - when registory/network I/O fail
SAXException - when parser fails
ParseException - when parsing fails
Method Detail

getFileServerConfig

public void getFileServerConfig(String serverName)
                         throws SQLException
Get file server information. Update Configuration object with server information.

Parameters:
serverName - the server name
Throws:
SQLException - when fail to load server info from DB

loadFileServerParams

public void loadFileServerParams(String name,
                                 boolean hotboot)
                          throws SQLException
Load file server parameters into Configuration object

Parameters:
name - parameters name space
hotboot - if ture, only load parameters that make sense
Throws:
SQLException - when fail to load server parameters from DB
See Also:
jpl.mipl.mdms.FileService.util.Configuration

showServerParameters

public String showServerParameters(String name)
                            throws SQLException
Get file server parameters.

Parameters:
name - the server name
Returns:
the server parameter string
Throws:
SQLException - when failed to retrieve server parameters

startServer

public void startServer()
                 throws SQLException
Record server start time in database. Assumes fsId is set.

Throws:
SQLException - when fail to retrieve data from DB

stopServer

public void stopServer()
                throws SQLException
Record server stop time in database. Assumes fsId_ is set.

Throws:
SQLException - when fail to retrieve data from DB

getFileTypeInfoTable

public Hashtable getFileTypeInfoTable(String serverName)
                               throws SQLException
Create a lookup table for each file type that this server handles, and enter each class into a hash table. Hash on fileType. Return hash table to caller.

Parameters:
serverName - the server name
Returns:
newly created hash of file type info.
Throws:
SQLException - when fail to retrieve data from DB

getUserFTCapabilities

public void getUserFTCapabilities(String userName,
                                  UserProfile profile)
                           throws SQLException
Create a lookup table for each file type for which a user has a capability.

Parameters:
userName - the file system user name
profile - the server-side profile, contains access info.
Throws:
SQLException - when fail to retrieve data from DB

getUserVFTCapabilities

public void getUserVFTCapabilities(String userName,
                                   UserProfile profile)
                            throws SQLException
Create a lookup table for each VFT for which a user has a capability.

Parameters:
userName - the file system user name
profile - the server-side profile, contains access info.
Throws:
SQLException - when fail to retrieve data from DB

startAddFile

public int startAddFile(Result profile)
                 throws SQLException
Insert a record into the files table to signal the start of a file add. The status associated with the file wil be "adding". After successfully completing the add file operation, use releaseLock to mark the file with a successful completion. Otherwise, delete the record. To mark the file OK, use setrile status

Parameters:
profile - the file profile information.
Returns:
the file ID as the DBMS internal file handle.
Throws:
SQLException - when fail to retrieve data from DB

addFileComplete

public void addFileComplete(int fileId,
                            byte[] checksum)
                     throws SQLException
Signal that an add operation has completed. Update checksum if required.

Parameters:
fileId - the handle to the internal file identifier.
checksum - the optional checksum. Could be "".
Throws:
SQLException - when failed to update databasee

startRenameTrans

public int startRenameTrans(int ftId,
                            String oldName,
                            String newName)
                     throws SQLException
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. The lock associated with the file will be for "rename". After successfully completing the rename file operation, use rename file to clear the lock and update the new file name. If an error occurs, call release lock as part of the transaction rollback.

Parameters:
ftId - the internal identifier of the file type.
oldName - Name of the file to rename.
newName - Intended new name of the file.
Returns:
the file ID as handle to the internal DB record
Throws:
SQLException - when fail to retrieve data from DB

replaceFile

public int replaceFile(int fileId,
                       Result profile)
                throws SQLException
Update a record in the files table with new information (size, contributor, modified date, etc.

Parameters:
fileId - internal file identifier
profile - file information and result status
Returns:
the file ID
Throws:
SQLException - when fail to retrieve data from DB

startGetFile

public int startGetFile(Result profile)
                 throws SQLException
Get a read lock on the file, update the profile with additional information: size, checksum, etc. The profile will be sent to the client.

Parameters:
profile - data describe to be sent
Returns:
the file ID
Throws:
SQLException - when failed to retrieve data from DB

checkForUser

public 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.

Parameters:
userName - the file system user name
password - the user password
user - the profile contains user's access level and file type permissions from database.
Throws:
SQLException - when failed to retrieve data from DB

lockFile

public int lockFile(String fileName,
                    int ftId,
                    int lockType)
             throws SQLException
Method to lock a file in the file service.

Lock types:

Parameters:
fileName - Name of the file to lock.
ftId - the file type ID as internal record reference
lockType - Type of lock.
Returns:
fileId for use releasing the lock.
Throws:
SQLException - when failed to retrieve data from DB

releaseFileLock

public void releaseFileLock(int fileId)
                     throws SQLException
Method to release file lock

Parameters:
fileId - DBMS internal file identifier.
Throws:
SQLException - when failed to retrieve data from DB

commentFile

public void commentFile(int ftId,
                        String fileName,
                        String comment)
                 throws SQLException
Method to add a comment to the file record.

Parameters:
ftId - DBMS internal file type identifier
fileName - the name of the file
comment - the comment to be inserted
Throws:
SQLException - when failed to update database

archiveFile

public void archiveFile(int ftId,
                        String fileName,
                        String archive)
                 throws SQLException
Method to add an archive msg to the file record.

Parameters:
ftId - DBMS internal file type identifier.
fileName - the name of the file
archive - note.
Throws:
SQLException - when failed to update database

renameFile

public void renameFile(int fileId,
                       String newName)
                throws SQLException
Method to add an archive msg to the file record.

Parameters:
fileId - DBMS internal file identifier.
newName - the new file name
Throws:
SQLException - when failed to retrieve data from DB

deleteFile

public void deleteFile(int fileId)
                throws SQLException
Method to delete file from the dbms

Parameters:
fileId - DBMS internal file identifier.
Throws:
SQLException - when failed to retrieve data from DB

getFileList

public String getFileList(int ftId,
                          String start,
                          String end)
                   throws SQLException
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.

Parameters:
ftId - the file type internal identifier
start - time for list
end - time for list.
Returns:
formatted string with list of files.
Throws:
SQLException - when failed to retrieve data from DB

getFileList

public String getFileList(int ftId,
                          String fileglob,
                          char modifier)
                   throws SQLException
Return a string containing a short description of each file in a file type.

Parameters:
ftId - the file type internal identifier
fileglob - the file globbing expression
modifier - if 'l', means get latest matching fileglob
Returns:
formatted string with list of files.
Throws:
SQLException - when failed to retrieve data from DB

getFileNames

public String getFileNames(int ftId,
                           String fileglob,
                           char modifier)
                    throws SQLException
Return a string containing the names of files (for given file type) matched by a regular expression

Parameters:
ftId - the file type internal identifier
fileglob - the file globbing expression
modifier - if LATEST, means get latest matching fileglob
Returns:
String of file names
Throws:
SQLException - when failed to retrieve data from DB

getFileNames

public String getFileNames(int ftId,
                           String start,
                           String end)
                    throws SQLException
Return a string containing the names of files (for given file type) matched by a start date, and before an optional end date.

Parameters:
ftId - the file type internal identifier
start - the time for list
end - the time for list
Returns:
string of file names
Throws:
SQLException - when failed to retrieve data from DB

lockFileType

public String lockFileType(int ftId)
                    throws SQLException
Method to update a record in the fileTypes table to lock it.

Parameters:
ftId - the file type internal identifier
Returns:
file type's directory location
Throws:
SQLException - when fail to retrieve data from DB

isFileTypeLocked

public boolean isFileTypeLocked(int ftId)
                         throws SQLException
Method to find out if a file type is already locked.

Parameters:
ftId - the file type internal identifier
Returns:
true if lock, false if not locked
Throws:
SQLException - when failed to retrieve data from DB

unlockFileType

public void unlockFileType(int ftId)
                    throws SQLException
Update a record in the fileTypes table to lock it.

Parameters:
ftId - the file type internal identifier
Throws:
SQLException - when failed to retrieve data from DB

transferReceipt

public int transferReceipt(int userId,
                           int fileId,
                           int ftId,
                           char command,
                           String checksum)
                    throws SQLException
Method to record a file transfer, get a receipt.

Parameters:
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
Returns:
receipt ID reference to a DB record
Throws:
SQLException - when failed to retrieve data from DB

getRefFileInfo

public String getRefFileInfo(String vft,
                             String reference)
                      throws SQLException
Method to return a string containing a description of a referenced file. Note: This function returns reference information whether or no the reference is set to a file.

Parameters:
vft - the virtual file type
reference - the reference name
Returns:
formatted string list of ...
Throws:
SQLException - when failed to retrieve data from DB

getRefFileInfoAt

public String getRefFileInfoAt(String vft,
                               String date,
                               String reference)
                        throws SQLException
Return a string containing a description of a referenced file. Note: This function returns reference information whether or not the reference is set to a file. Also includes a list of references that were created after the specified date. Use this information to remove references that did not exist at the time requested for a get VFT.

Parameters:
vft - the virtual file type
date - the date string
reference - (optional) reference name
Returns:
formatted string list of ...
Throws:
SQLException - when failed to retrieve data from DB

addVFT

public void addVFT(String name,
                   String userName,
                   String title,
                   boolean notify)
            throws SQLException
Method to create a vft.

Parameters:
name - the vft name
userName - the user name
title - the vft title
notify - if true, user will be notified when updates available
Throws:
SQLException - when failed to retrieve data from DB

addReference

public void addReference(String vftName,
                         String reference,
                         String link,
                         String comment)
                  throws SQLException
Create a vft reference.

Parameters:
vftName - the vft name
reference - the reference name
link - the link name
comment - the optinal comment for the reference
Throws:
SQLException - when failed to retrieve data from DB

addAndSetFileRef

public void addAndSetFileRef(String vftName,
                             String reference,
                             String fileType,
                             String fileName,
                             String link,
                             String comment)
                      throws SQLException
Set a VFT reference. If one does not already exist, create one and set it.

Parameters:
vftName - the vft name
reference - the reference name
fileType - the file type
fileName - the file name
link - the link value
comment - optinal comment
Throws:
SQLException - when failed to retrieve data from DB

delFileRef

public String delFileRef(String vft,
                         String reference)
                  throws SQLException
Remove the assocation between a reference and a file.

Parameters:
vft - the vft name
reference - the reference name
Returns:
reference location, so s/w can delete old link.
Throws:
SQLException - when failed to retrieve data from DB

updateVFT

public void updateVFT(String vft,
                      String userName,
                      String comment)
               throws SQLException
Method to update the VFT

Parameters:
vft - the vft name
userName - the Komodo user making the update
comment - the optional comment to associate with the update.
Throws:
SQLException - when failed to retrieve data from DB

startUpdateVFT

public LinkedList startUpdateVFT(String vft,
                                 boolean lockIt)
                          throws SQLException
Lock a VFT so that the VFTs references can be synched with the file system links. Returns a list of reference information required to delete old links, and create new ones.

Parameters:
vft - the VFT name.
lockIt - if false is passed, then return information w/o locking the VFT.
Returns:
a list of reference information
Throws:
SQLException - when failed to retrieve data from DB

showVFT

public String showVFT(String vft,
                      String dateTime)
               throws SQLException
Method to get vft info.

Parameters:
vft - the vft name
dateTime - the optional date. If not specified, use current time.
Returns:
vft info in string
Throws:
SQLException - when failed to retrieve data from DB

getVFTAccess

public Object[] getVFTAccess(String vft)
                      throws SQLException
Method to get vft info. Get id for now.

Parameters:
vft - the vft name
Returns:
an array of vft object reference
Throws:
SQLException - when failed to retrieve data from DB

getUserVFTCapabilities

public int getUserVFTCapabilities(String vft,
                                  String userName)
                           throws SQLException
Method to retrieve user vft capabilities

Parameters:
vft - the vft name
userName - the user name
Returns:
the user vft capability value (GET) if record exist
Throws:
SQLException - when failed to retrieve data from DB

getRefs

public String getRefs(String vft,
                      String date)
               throws SQLException
Method to return a string report of vft references, with comments.

Parameters:
vft - the vft name
date - optional reference date
Returns:
a string report of vft references, with comments.
Throws:
SQLException - when failed to retrieve data from DB

setReference

public void setReference(String vft,
                         String reference,
                         String fileType,
                         String fileName)
                  throws SQLException
Schedule a file reference to take effect at the next vft update

Parameters:
vft - the vft name
reference - the reference name
fileType - the file type
fileName - the file name
Throws:
SQLException - when failed to retrieve data from DB

startDelVFT

public LinkedList startDelVFT(String vft)
                       throws SQLException
Mark a vft for delete, and return a linked list of locations (links) to delete.

Parameters:
vft - the vft name
Returns:
a list of links to delete.
Throws:
SQLException - when failed to retrieve data from DB

cancelReference

public void cancelReference(String vft,
                            String reference)
                     throws SQLException
Method to remove a file reference

Parameters:
vft - the vft name
reference - the reference name
Throws:
SQLException - when failed to retrieve data from DB

delVFT

public void delVFT(String vft)
            throws SQLException
Method to delete a vft.

Parameters:
vft - the vft name
Throws:
SQLException - when failed to retrieve data from DB

delFileType

public void delFileType(String type)
                 throws SQLException
Delete a file type

Parameters:
type - the file type name
Throws:
SQLException - when failed to retrieve data from DB

delRef

public String delRef(String vft,
                     String reference)
              throws SQLException
Method to delete a vft reference.

Parameters:
vft - the vft name
reference - the reference name
Returns:
reference location for deleting.
Throws:
SQLException - when failed to retrieve data from DB

addFileTypeToRole

public void addFileTypeToRole(String type,
                              String role)
                       throws SQLException
Method to add file type to role

Parameters:
type - the file type
role - the role
Throws:
SQLException - when failed to retrieve data from DB

addVFTReader

public void addVFTReader(String userName,
                         String vft)
                  throws SQLException
Method to add vft reader.

Parameters:
userName - the user to be added to a list of vft readers.
vft - the vft.
Throws:
SQLException - when failed to retrieve data from DB

addUserToRole

public void addUserToRole(String name,
                          String role)
                   throws SQLException
Add user to a role

Parameters:
name - the user's name
role - the role
Throws:
SQLException - when failed to retrieve data from DB

addFileType

public void addFileType(String type,
                        String dir,
                        String comment,
                        String reserved,
                        String threshold,
                        String qaInterval,
                        String checksum,
                        String xml)
                 throws SQLException
Method to make a new file type

Parameters:
type - file type name
dir - directory associate with file type
comment - file type comment
reserved - disk space reserved to the file type
threshold - the threshold value before sigevent is sent
qaInterval - the QA release interval
checksum - t or f
xml - OPTIONAL xml schema
Throws:
SQLException - when failed to retrieve data from DB

makeDomainFile

public String makeDomainFile()
                      throws SQLException
Make a new domain file froim information stored in the DB

Returns:
formatted string that makes up the domain file
Throws:
SQLException - when failed to retrieve data from DB

addRole

public void addRole(String role,
                    String capabilities)
             throws SQLException
Method to add a new access role in the database

Parameters:
role - the role name
capabilities - the capabilities for the role (string rep of an int)
Throws:
SQLException - when failed to retrieve data from DB

addUser

public void addUser(String name,
                    String passwd,
                    String privilege,
                    boolean addVFT)
             throws SQLException
Method to add a new user to the database

Parameters:
name - the user name
passwd - the user passwd
privilege - user privileges (r)ead, (w)rite or (a)dmin
addVFT - to allow user to create a VFT (true of false).
Throws:
SQLException - when failed to retrieve data from DB

changePassword

public void changePassword(String name,
                           String passwd)
                    throws SQLException
Change a user's password.

Parameters:
name - the user name
passwd - the user passwd
Throws:
SQLException - when failed to retrieve data from DB

delRole

public void delRole(String role)
             throws SQLException
Method to delete an access role

Parameters:
role - the access role name
Throws:
SQLException - when failed to retrieve data from DB

delUser

public void delUser(String name)
             throws SQLException
Method to delete a user record

Parameters:
name - the user name
Throws:
SQLException - when failed to retrieve data from DB

delFileTypeFromRole

public void delFileTypeFromRole(String type,
                                String role)
                         throws SQLException
Method to delete a file type from role

Parameters:
type - the file type
role - the role name
Throws:
SQLException - when failed to retrieve data from DB

delVFTReader

public void delVFTReader(String user,
                         String vft)
                  throws SQLException
Method to delete a vft reader from a vft

Parameters:
vft - the vft name
user - the user name
Throws:
SQLException - when failed to retrieve data from DB

delUserFromRole

public void delUserFromRole(String name,
                            String role)
                     throws SQLException
Method to delete a user from role

Parameters:
name - the user name
role - the role name
Throws:
SQLException - when failed to retrieve data from DB

showRoles

public String showRoles(String role)
                 throws SQLException
Get access role information from db

Parameters:
role - the role name
Returns:
list of access role in string
Throws:
SQLException - when failed to retrieve data from DB

showRolesForFileType

public String showRolesForFileType(String fileType,
                                   String role)
                            throws SQLException
Get roles associated with a file type

Parameters:
fileType - the file type
role - the role name
Returns:
list of access roles in string
Throws:
SQLException - when failed to retrieve data from DB

showVFTReaders

public String showVFTReaders(String vft,
                             String userName)
                      throws SQLException
Method to show the file system users who can read a vft.

Parameters:
vft - the vft name
userName - the user name
Returns:
list of file system user names
Throws:
SQLException - when failed to retrieve data from DB

showUserVFTs

public String showUserVFTs(String userName,
                           String vft)
                    throws SQLException
Show the vfts a user can read. If userName is null, show vfts all users can read.

Parameters:
userName - the user name
vft - the vft name
Returns:
the list of vfts user can access
Throws:
SQLException - when failed to retrieve data from DB

showRolesForUser

public String showRolesForUser(String name)
                        throws SQLException
Get roles associated with a user

Parameters:
name - the user name
Returns:
the list of user roles
Throws:
SQLException - when failed to retrieve data from DB

showUsers

public String showUsers(String name)
                 throws SQLException
Get user information from db

Parameters:
name - the user name
Returns:
the list of user info
Throws:
SQLException - when failed to retrieve data from DB

showServers

public String showServers()
                   throws SQLException
Get list of servers from db

Returns:
the list of server info
Throws:
SQLException - when failed to retrieve data from DB

getFileList

public LinkedList getFileList(String fileType)
                       throws SQLException
Method to return a list containing a description of each file in a file type.

Parameters:
fileType - file type name
Returns:
linked list of FileInfo.
Throws:
SQLException - when failed to retrieve data from DB

getFileTypeNames

public LinkedList getFileTypeNames(String serverName)
                            throws SQLException
Method to get file type names list from db

Parameters:
serverName - the name of the file server.
Returns:
list of file type names
Throws:
SQLException - when failed to retrieve data from DB