|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Database Transaction Inteface between Server and Database
Category: Baseline
Inherits from: Client:
Method Summary | |
int |
ChangePassword(java.lang.String UserId,
java.lang.String OldPassword,
java.lang.String NewPassword)
Change the password of the given user. |
int |
ChangePermission(int FileID,
int PermissionType,
int NewPermission)
Allows changing the permissions for the given user. |
int |
CreateUser(java.lang.String UserName,
java.lang.String Password)
Creates a new user in the database. |
boolean |
GetSubtree(FileInfo fileInfo,
int dirId,
int userId)
Gets the contents of the directory mentioned. |
int |
LoginUser(java.lang.String UserName,
java.lang.String Password)
Log information of the user login in the database. |
int |
LogoutUser(int UserId)
Gives a clean exit to the client and passed necessary information to end the session to the database. |
boolean |
RenameFile(java.lang.String oldName,
java.lang.String newName,
int currentDirId,
int userId)
Renames the given file with the new filename. |
Method Detail |
public int LoginUser(java.lang.String UserName, java.lang.String Password)
UserName
- the name of a user logging inPassword
- the password of the user logging in.
InvalidName
- if UserName does not exist in the database
InvalidPassword
- if Password is not valid
DBConnectionLost
- if database connection is lostpublic int LogoutUser(int UserId)
UserId
- the name of a user logging in
InvalidId
- if UserId does not exist in the database
NotLoggedIn
- if the user is not logged in
DBConnectionLost
- if database connection is lostpublic int CreateUser(java.lang.String UserName, java.lang.String Password)
UserName
- the name of a user to be createdPassword
- the password of a user to be created
InvalidUserName
- if UserName is not a valid name (invalid chars etc.)
UserAlreadyExits
- if UserName already exists
InvalidPasssssword
- if Password is invalid (too short)
DBConnectionLost
- if database connection is lostpublic int ChangePassword(java.lang.String UserId, java.lang.String OldPassword, java.lang.String NewPassword)
UserId
- The Id of a user whose password has been changedOldPassword
- The old password of a userNewPassword
- The new password of a user
InvalidUserId
- if UserId does not exist
InvalidOldPassword
- if OldPassword is invalid.
InvalidNewPassword
- if Password is invalid (too short)
DBConnectionLost
- if database connection is lostpublic int ChangePermission(int FileID, int PermissionType, int NewPermission)
PermissionType
- The permission (read, write, execute) to be changed.NewPermission
- The new permission
InvalidFileId
- If FileID is invalid
InsufficentPermisions
- if user does not have enough permissions for the operations
DBConnectionLost
- if database connection is lostpublic boolean GetSubtree(FileInfo fileInfo, int dirId, int userId)
fileInfo
- an object which contains the file list and the indentification of parent directory.dirId
- the identification number of the target directoryuserId
- the identification number of the user
InvalidDirectory
- if dirId does not exists in the database
PermissionDenied
- if a user has no permission on the directory
ConnectionFail
- if database connection is closed in transactionpublic boolean RenameFile(java.lang.String oldName, java.lang.String newName, int currentDirId, int userId)
oldName
- the name of a file which is to be changednewName
- the changed name of the filecurrentDirId
- the identification number of a current directoryuserId
- the identification number of the user
NoSuchFile
- if oldName does not exists in the database
InvalidFileName
- if newName is not valid
NoCurrentDir
- if currentDirId does not exists in the database
ConnectionFail
- if database connection is closed in transaction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |