All Packages Class Hierarchy This Package Previous Next Index
Class mypackage.ServerMarks
java.lang.Object
|
+----java.rmi.server.RemoteObject
|
+----java.rmi.server.RemoteServer
|
+----java.rmi.server.UnicastRemoteObject
|
+----mypackage.ServerMarks
- public class ServerMarks
- extends UnicastRemoteObject
- implements iServer
This class implements the various Functionality for the MarksServer
- Version:
- 1.0
- Author:
- Vicky Shiv
-
administratorid
- String for administratorid
-
administratorpassword
- String for administrator password
-
clientTable
- Hashtable to stores the active Clients
-
student
- Hashtable to stores student
-
ServerMarks()
- default Constructor for the ServerMarks
It Searches for the file "data.dat" to load the object ,if the file is not found it creates some default data
-
addCourses(String, String)
- to Add a new Courses to a student
-
addMarks(String, String, String)
- to Add a new marks for a particular student and for a particular course
-
addStudent(String, String)
- to Add a new Student
-
deleteCourses(String, String)
- to Delete a Course for a particular studentid
-
deleteMarks(String, String, String)
- to delete marks for a particular student and for a particular course
-
deleteStudent(String)
- to Delete a existing Student
-
main(String[])
-
-
modifyMarks(String, String, String, String)
- to modify a mark for a particular student and for a particular course
-
registerClient(String, iClient)
- this will keep track for all the register client currently active
It add the active client in to the hashtable and update the client with
its current data
-
removeClient(iClient)
- Remove the vanishing client
-
setPassword(String, String)
- To set the password of the Student
-
updateClient()
- update all the Existing ,active Client.this function is called at the destroy event of the administrator.
-
validateAdministrator(String, String)
- to Validate the authentic administrator
-
validateUser(String, String)
- to Validate the authentic student
clientTable
private Hashtable clientTable
- Hashtable to stores the active Clients
student
private static Hashtable student
- Hashtable to stores student
administratorid
private String administratorid
- String for administratorid
administratorpassword
private String administratorpassword
- String for administrator password
ServerMarks
public ServerMarks() throws RemoteException
- default Constructor for the ServerMarks
It Searches for the file "data.dat" to load the object ,if the file is not found it creates some default data
registerClient
public synchronized void registerClient(String s,
iClient client) throws RemoteException
- this will keep track for all the register client currently active
It add the active client in to the hashtable and update the client with
its current data
- Parameters:
- String - the Studentid which want to get registered
- iClient - the reference to the Remote Client
removeClient
public synchronized void removeClient(iClient client) throws RemoteException
- Remove the vanishing client
- Parameters:
- iClient - reference to the Client
updateClient
public synchronized void updateClient() throws RemoteException
- update all the Existing ,active Client.this function is called at the destroy event of the administrator. It will update all the active client with the latest information
main
public static void main(String args[])
setPassword
public synchronized boolean setPassword(String userid,
String password) throws RemoteException
- To set the password of the Student
- Parameters:
- String - the student id whose password is to be changed
- String - the new password
- Returns:
- boolean True if changes sucessfully else false
addStudent
public synchronized boolean addStudent(String userid,
String password) throws RemoteException
- to Add a new Student
- Parameters:
- String - the student id that is to be added
- String - the password of the student
- Returns:
- boolean True if added sucessfully else false
deleteStudent
public synchronized boolean deleteStudent(String userid) throws RemoteException
- to Delete a existing Student
- Parameters:
- String - the student id which is to be delete
- Returns:
- boolean True if deleted sucessfully else false
addCourses
public synchronized boolean addCourses(String userid,
String courseid) throws RemoteException
- to Add a new Courses to a student
- Parameters:
- String - the studentID in which new course to be added
- String - the Course id
- Returns:
- boolean True if added sucessfully else false
deleteCourses
public synchronized boolean deleteCourses(String userid,
String courseid) throws RemoteException
- to Delete a Course for a particular studentid
- Parameters:
- String - the student id from which course is to be deleted
- String - the courseid to be deleted
- Returns:
- boolean True if deleted sucessfully else false
addMarks
public synchronized boolean addMarks(String userid,
String courseid,
String marks) throws RemoteException
- to Add a new marks for a particular student and for a particular course
- Parameters:
- String - the student id for which new mark is to be added
- String - the course id for which new marks is to be added
- String - the new testid and marks to be added
- Returns:
- boolean True if added sucessfully else false
deleteMarks
public synchronized boolean deleteMarks(String userid,
String courseid,
String marks) throws RemoteException
- to delete marks for a particular student and for a particular course
- Parameters:
- String - the student id for which mark is to be deleted
- String - the course id for which marks is to be deleted
- String - the testid and marks to be deleted
- Returns:
- boolean True if deleted sucessfully else false
modifyMarks
public synchronized boolean modifyMarks(String userid,
String courseid,
String marks,
String newmarks) throws RemoteException
- to modify a mark for a particular student and for a particular course
- Parameters:
- String - the student id for which mark is to be modified
- String - the course id for which marks is to be modified
- String - the testid and marks to be modified
- String - the new testid and marks
- Returns:
- boolean True if modified sucessfully else false
validateUser
public synchronized boolean validateUser(String userid,
String password) throws RemoteException
- to Validate the authentic student
- Parameters:
- String - the student id
- String - the password
- Returns:
- boolean True if an authentic user else false
validateAdministrator
public synchronized boolean validateAdministrator(String userid,
String password) throws RemoteException
- to Validate the authentic administrator
- Parameters:
- String - the Administrator id
- String - the password
- Returns:
- boolean True if an authentic administrator else false
All Packages Class Hierarchy This Package Previous Next Index