Interface FileServant


public interface FileServant

Connection Inteface between Server and Client

Category: Baseline

Inherits from:

Client:


Method Summary
 int Authenticate(java.lang.String UserName, java.lang.String Password)
          Authenticates the user into the File Server database.
 int ChangeFilePermissions(int FileId, int ReadPermission, int WritePermission, int ExecutePermission)
          Change the permissions of the given file.
 int ChangePassword(java.lang.String UserName, java.lang.String OldPassword, java.lang.String NewPassword)
          Allows the User to change his/her password.
 int CreateFile(java.lang.String FileName, int ParentDirId)
          Creates a new file for the user in the sub directory selected.
 int DeleteFile(int FileId)
          Delete the given file.
 list FindFile(java.lang.String FileName, int StartDirId)
          Change find the path of the given file.
 FileList GetSubTree(int UserId, int ParentId)
          Get the list of files and directories in the given directory.
 int RenameFile(int FileId, java.lang.String NewFileName)
          Change the name of the given file.
 

Method Detail

Authenticate

public int Authenticate(java.lang.String UserName,
                        java.lang.String Password)
Authenticates the user into the File Server database. [Category: Baseline] [Clients: ]

Parameters:
UserName - Name of the user
Password - Password of the user trying to login
Returns:
status The resulting status of the call
Throws:
InvalidUserName - if the UserName does not exist
InvalidPassword - if Password is not valid
DBException - if there is a database exception

ChangePassword

public int ChangePassword(java.lang.String UserName,
                          java.lang.String OldPassword,
                          java.lang.String NewPassword)
Allows the User to change his/her password. [Category: Baseline] [Clients: ]

Parameters:
UserName - The name name of the user who is trying to change password
OldPassword - The old password of the user
NewPassword - The new password of the user
Returns:
status The status of the call
Throws:
InvalidPassword - if the OldPassword is not valid
NewPasswordTooShort - if NewPassword is less than 6 characters

GetSubTree

public FileList GetSubTree(int UserId,
                           int ParentId)
Get the list of files and directories in the given directory. [Category: Baseline] [Clients: ]

Parameters:
UserId - The Id of the user requesting the directory listing
ParentId - The Id of the Folder whose children are desired
Returns:
FileList The list of the children of the given folder
Throws:
InvalidUserId - if the UserId is not valid
InvalidParentId - if the ParentId is not valid
InsufficientPriviledges - if UserId does not have the priviledges in the directory

RenameFile

public int RenameFile(int FileId,
                      java.lang.String NewFileName)
Change the name of the given file. [Category: Baseline] [Clients: ]

Parameters:
FileId - The Id of the file to be renamed
NewFileName - The new name of the file
Returns:
status The status of the operation
Throws:
InvalidFileId - if the FileId is not valid
InvalidFileName - if the NewFileName is not valid (Blank etc.)
FileLocked - if the file is currently locked by some other user
InsufficientPriviledges - if UserId does not have the priviledges on the file

ChangeFilePermissions

public int ChangeFilePermissions(int FileId,
                                 int ReadPermission,
                                 int WritePermission,
                                 int ExecutePermission)
Change the permissions of the given file. [Category: Baseline] [Clients: ]

Parameters:
FileId - The Id of the file whose permisions are to be changed
ReadPermission - The read permissions
WritePermission - The write permissions
ExecutePermission - The execute permissions
Returns:
status The status of the operation
Throws:
InvalidFileId - if the FileId is not valid
FileLocked - if the file is currently locked by some other user
InsufficientPriviledges - if UserId does not have the priviledges on the file

FindFile

public list FindFile(java.lang.String FileName,
                     int StartDirId)
Change find the path of the given file. [Category: Baseline] [Clients: ]

Parameters:
FileName - The name of the file to be searched
StartDirId - Id of the directory where the search is to started
Returns:
list The list of the paths wher the file was found
Throws:
InvalidFileId - if the FileId is not valid
FileLocked - if the file is currently locked by some other user
InvalidStartDirId - if StartDirId is invalid
InsufficientPriviledges - if UserId does not have the priviledges on the StartDirId

DeleteFile

public int DeleteFile(int FileId)
Delete the given file. [Category: Baseline] [Clients: ]

Parameters:
FileId - The Id of the file to be deleted
Returns:
status The status of the operation
Throws:
InvalidFileId - if the FileId is not valid
FileLocked - if the file is currently locked by some other user
InsufficientPriviledges - if UserId does not have the priviledges on the file

CreateFile

public int CreateFile(java.lang.String FileName,
                      int ParentDirId)
Creates a new file for the user in the sub directory selected. [Category: Baseline] [Clients: ]

Parameters:
FileName - The name of the file to be created
Returns:
status The status of the operation
Throws:
InvalidFileName - if the FileName is not valid (some invalid character)
FileExists - if the file already exists in the directory
InsufficientPriviledges - if UserId does not have the priviledges in the given directory