org.ifeth.sehr.lib
Class AccessControl

java.lang.Object
  extended byorg.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.


Field Summary
static java.util.logging.Logger Log
           
 
Constructor Summary
AccessControl()
           
 
Method Summary
static java.util.Hashtable checkLogin2SEHRZone(java.lang.String usrname, java.lang.String passwd, java.lang.String zone, SEHRCfg cfg)
          Check username and password to login at SEHR host (zone).
static java.util.Hashtable checkLogin2SEHRZone(java.lang.String usrname, java.lang.String passwd, java.lang.String zone, SEHRDataSource fbds)
          Check username and password to login at SEHR host (zone).
static int checkLogin2Service(int usrid, 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 checkLogin2Service(int usrid, 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 checkLogin2Service(int usrid, 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 int checklogin4module(java.lang.String login, java.lang.String passwd, java.lang.String pik)
          Deprecated. Conceptional error on authentification!
static int checklogin4module(java.lang.String login, java.lang.String passwd, java.lang.String pik, SEHRCfg cfg)
          Deprecated. Conceptional error on authentification!
static int checklogin4module(java.lang.String login, java.lang.String passwd, java.lang.String pik, SEHRDataSource fbds)
          Deprecated. Conceptional error on authentification!
static java.lang.String generateRandomPassword()
          Generate a random password
static boolean LogoutFromZone(java.util.Hashtable session, SEHRDataSource fbds)
          Logout from zone...
static void main(java.lang.String[] args)
          For testing purposes
static boolean testSOAPConnection(SEHRCfg cfg)
          Static method to be called from startup to check if the required SOAP service is running (by testing the axis service 'Version')
static boolean VerifySessionByID(java.lang.String sessionid, SEHRDataSource fbds)
          This method checks if the given 'sessionid' is valid.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Log

public static java.util.logging.Logger Log
Constructor Detail

AccessControl

public AccessControl()
Method Detail

generateRandomPassword

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


testSOAPConnection

public static boolean testSOAPConnection(SEHRCfg cfg)
Static method to be called from startup to check if the required SOAP service is running (by testing the axis service 'Version')

Returns:
boolean_service_available

checkLogin2SEHRZone

public static java.util.Hashtable checkLogin2SEHRZone(java.lang.String usrname,
                                                      java.lang.String passwd,
                                                      java.lang.String zone,
                                                      SEHRCfg cfg)
Check username and password to login at SEHR host (zone).

Parameters:
usrname - Check given username against registered 'usrname' of table USR_MAIN

checkLogin2SEHRZone

public static java.util.Hashtable checkLogin2SEHRZone(java.lang.String usrname,
                                                      java.lang.String passwd,
                                                      java.lang.String zone,
                                                      SEHRDataSource fbds)
Check username and password to login at SEHR host (zone).

Parameters:
usrname - Check given username against registered 'usrname' of table USR_MAIN
Returns:
HashMao_object

HashMap object
Integer usrid: 0=Admin/root, >0 regular user, -1 error/not allowed
String sessionid


VerifySessionByID

public static boolean VerifySessionByID(java.lang.String sessionid,
                                        SEHRDataSource fbds)
This method checks if the given 'sessionid' is valid.

Returns:
boolean

LogoutFromZone

public static boolean LogoutFromZone(java.util.Hashtable session,
                                     SEHRDataSource fbds)
Logout from zone...

This method closes the current session of the user. To close the correct session the Hashtable object of the logon procedure is required.


checkLogin2Service

public static int checkLogin2Service(int usrid,
                                     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=ok, >0 or -1 not allowed

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

checkLogin2Service

public static int checkLogin2Service(int usrid,
                                     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

Returns:
status
See Also:
checkLogin2Service(int, String, String, String)

checkLogin2Service

public static int checkLogin2Service(int usrid,
                                     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

Returns:
status
See Also:
checkLogin2Service(int, String, String, String)

checklogin4module

public static int checklogin4module(java.lang.String login,
                                    java.lang.String passwd,
                                    java.lang.String pik)
Deprecated. Conceptional error on authentification!


checklogin4module

public static int checklogin4module(java.lang.String login,
                                    java.lang.String passwd,
                                    java.lang.String pik,
                                    SEHRCfg cfg)
Deprecated. Conceptional error on authentification!


checklogin4module

public static int checklogin4module(java.lang.String login,
                                    java.lang.String passwd,
                                    java.lang.String pik,
                                    SEHRDataSource fbds)
Deprecated. Conceptional error on authentification!


main

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