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

Variable Index

 o administratorid
String for administratorid
 o administratorpassword
String for administrator password
 o clientTable
Hashtable to stores the active Clients
 o student
Hashtable to stores student

Constructor Index

 o 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

Method Index

 o addCourses(String, String)
to Add a new Courses to a student
 o addMarks(String, String, String)
to Add a new marks for a particular student and for a particular course
 o addStudent(String, String)
to Add a new Student
 o deleteCourses(String, String)
to Delete a Course for a particular studentid
 o deleteMarks(String, String, String)
to delete marks for a particular student and for a particular course
 o deleteStudent(String)
to Delete a existing Student
 o main(String[])
 o modifyMarks(String, String, String, String)
to modify a mark for a particular student and for a particular course
 o 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
 o removeClient(iClient)
Remove the vanishing client
 o setPassword(String, String)
To set the password of the Student
 o updateClient()
update all the Existing ,active Client.this function is called at the destroy event of the administrator.
 o validateAdministrator(String, String)
to Validate the authentic administrator
 o validateUser(String, String)
to Validate the authentic student

Variables

 o clientTable
 private Hashtable clientTable
Hashtable to stores the active Clients

 o student
 private static Hashtable student
Hashtable to stores student

 o administratorid
 private String administratorid
String for administratorid

 o administratorpassword
 private String administratorpassword
String for administrator password

Constructors

 o 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

Methods

 o 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
 o removeClient
 public synchronized void removeClient(iClient client) throws RemoteException
Remove the vanishing client

Parameters:
iClient - reference to the Client
 o 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

 o main
 public static void main(String args[])
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
1