org.ifeth.sehr.lib
Class AccessControl

java.lang.Object
  |
  +--org.ifeth.sehr.lib.AccessControl

public class AccessControl
extends java.lang.Object

Security class for access control of users to SEHR services (modules).

Some methods are static to be used as a 'simple function call' by other modules.


Constructor Summary
AccessControl()
           
 
Method Summary
static int checklogin4module(java.lang.String login, java.lang.String passwd, java.lang.String pik)
          Check username and password to login for a module of SEHR.
static int checklogin4module(java.lang.String login, java.lang.String passwd, java.lang.String pik, SEHRCfg cfg)
          Check username and password to login for a module of SEHR.
static int checklogin4module(java.lang.String login, java.lang.String passwd, java.lang.String pik, SEHRDataSource fbds)
          Check username and password to login for a module of SEHR.
static java.lang.String generateRandomPassword()
          Generate a random password
static void main(java.lang.String[] args)
          For testing purposes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessControl

public AccessControl()
Method Detail

generateRandomPassword

public static java.lang.String generateRandomPassword()
Generate a random password


checklogin4module

public static int checklogin4module(java.lang.String login,
                                    java.lang.String passwd,
                                    java.lang.String pik)
Check username and password to login for a module of SEHR.

Important note:
The login procedure requires the module ID of the service application, defined as "PIK".

The service to login may reside on another server connected to the healthnet. The 'link' to the other location is defined in table USR_SERVICES. But in any case the user has to be registered locally (in table USR_MAIN) for performing any login due to security aspects. This method calls a stored procedure that is handling this all.

Return Code Description:
≥0 on successfull login; <0 on failures; 0 Administrator/root if username/password passes

Returns:
usrid
See Also:
SEHR Homepage: Information management concept for health services

checklogin4module

public static int checklogin4module(java.lang.String login,
                                    java.lang.String passwd,
                                    java.lang.String pik,
                                    SEHRCfg cfg)
Check username and password to login for a module of SEHR.

In this call the SEHRCfg is given as parameter to prevent recurrent reconfigurations

See Also:
checklogin4module(String, String, String)

checklogin4module

public static int checklogin4module(java.lang.String login,
                                    java.lang.String passwd,
                                    java.lang.String pik,
                                    SEHRDataSource fbds)
Check username and password to login for a module of SEHR.

In this call the SEHRDataSource itself is given as parameter to get the connection by this basic level object

See Also:
checklogin4module(String, String, String)

main

public static void main(java.lang.String[] args)
For testing purposes