All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class oncore.Validator

java.lang.Object
   |
   +----oncore.Validator

public class Validator
extends Object
Generic class to authenticate users. This class doesn't support encrypted passwords for the time being. This class assumes two different tables in the databse for student and faculty.


Constructor Index

 o Validator(Connection)
this stores only database connection with the class.

Method Index

 o isValid(String, String, boolean)
Method to check if the password for a user is correct.

Constructors

 o Validator
 public Validator(Connection con)
this stores only database connection with the class.

Parameters:
con - the jdbc database connection

Methods

 o isValid
 public boolean isValid(String idno,
                        String passwd,
                        boolean isStudent) throws SQLException
Method to check if the password for a user is correct. This is called by constructor of session before they accept the user by connecting database. Could be easily modified to handle encrypted passwords as well.

Parameters:
idno - user-id for the user. typically a roll number
passwd - password of the user, ecrypted passwords not supported yet.
isStudent - Whether the user is student ( isStudent == true ) or instructor (isStudent == false ).
Throws: SQLException
thrown if we go wrong somewhere while executing database query.

All Packages  Class Hierarchy  This Package  Previous  Next  Index