cscie160.project.security
Class SecurityImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--cscie160.project.security.SecurityImpl
All Implemented Interfaces:
java.rmi.Remote, Security, java.io.Serializable

public class SecurityImpl
extends java.rmi.server.UnicastRemoteObject
implements Security

By David Cheung

CSCIE160 Project

DUE 05-16-2001

This class Implements the Security class. This is suppose to reside on the server side. It contains a private class "authorizeClass" to encapsulate the information for different types of permissions.

Also contains a private hashtable to store account permissions and such.

See Also:
Serialized Form

Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
SecurityImpl()
          Constructor:
 
Method Summary
 void createSec(AccountInfo acct, boolean depPermission, boolean withPermission, boolean balPermission)
          this function creates an authorize class and stores it into the hash table.
 boolean getBalPermission(AccountInfo acct)
          This function returns a boolean to determine if getBalance permission of an AccountInfo is permissible.
 boolean getDepPermission(AccountInfo acct)
          This function returns a boolean to determine if deposit permission of an AccountInfo is permissible.
 boolean getWithPermission(AccountInfo acct)
          This function returns a boolean to determine if withdraw permission of an AccountInfo is permissible.
 boolean verifyAccount(AccountInfo acct)
          Returns true if an account with the accountInfo exists, otherwise return false.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SecurityImpl

public SecurityImpl()
             throws java.rmi.RemoteException
Constructor:

1) calls super

2) initialize database

3) create 3 accounts base on spec.

Method Detail

createSec

public void createSec(AccountInfo acct,
                      boolean depPermission,
                      boolean withPermission,
                      boolean balPermission)
               throws java.rmi.RemoteException
this function creates an authorize class and stores it into the hash table. Uses the accountNumber as the key of the hashtable.
Specified by:
createSec in interface Security

getDepPermission

public boolean getDepPermission(AccountInfo acct)
                         throws java.rmi.RemoteException
This function returns a boolean to determine if deposit permission of an AccountInfo is permissible.
Specified by:
getDepPermission in interface Security

getWithPermission

public boolean getWithPermission(AccountInfo acct)
                          throws java.rmi.RemoteException
This function returns a boolean to determine if withdraw permission of an AccountInfo is permissible.
Specified by:
getWithPermission in interface Security

getBalPermission

public boolean getBalPermission(AccountInfo acct)
                         throws java.rmi.RemoteException
This function returns a boolean to determine if getBalance permission of an AccountInfo is permissible.
Specified by:
getBalPermission in interface Security

verifyAccount

public boolean verifyAccount(AccountInfo acct)
                      throws java.rmi.RemoteException
Returns true if an account with the accountInfo exists, otherwise return false.

This is use to verify if the pin and the accountnumber match.

Specified by:
verifyAccount in interface Security