|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.xmlserv.security.SecurityManager | +--com.xmlserv.security.RoleSecurityManager | +--com.xmlserv.app.AppSecurityManager
The basic Securitymanager used by the Applications.
This implements the abstract methods of RoleSecurityManager by
utilizing a PostgreSQL backend. A PGConnectionPool is used to keep the
number of connections reasonable.
The usertable has the following fields:
ConnectionPool
,
PGConnectionPool
Inner classes inherited from class com.xmlserv.security.SecurityManager |
SecurityManager.AccessRight, SecurityManager.Authorization, SecurityManager.Resource, SecurityManager.Role, SecurityManager.User |
Fields inherited from class com.xmlserv.security.SecurityManager |
DELETE, INSERT, SELECT, UPDATE |
Constructor Summary | |
AppSecurityManager()
Create empty object. init() must be called before the SecurityManager is usable. |
Method Summary | |
protected void |
checkAuth(SecurityManager.User user,
SecurityManager.Resource resource,
java.lang.String access)
This routine checks an access method against the ACL table as defined in the class description. |
protected java.sql.Connection |
checkoutConn()
Aggregation method delegated to PGConnectionPool. |
protected java.lang.String |
checkUser(java.lang.String user,
java.lang.String password)
Implementation of the abstract method defined in RoleSecurityManager. |
void |
destroy()
Destroy ConnectionPool. |
protected java.lang.String |
getEmail(java.lang.String username)
Return the users email address. |
protected int |
getId(java.lang.String username)
Return the users numeric id. |
protected java.lang.String |
getRoleGroup(java.lang.String username)
Get the RoleGroup the given user belongs to. |
protected int |
getRoleGroupId(java.lang.String username)
Get the numerical RoleGroup id the given user belongs to. |
SecurityManager.User |
getUserById(int id)
Load a user object identified by its numeric ID. |
java.lang.String |
getUserID(javax.servlet.http.HttpServletRequest req)
Return the numeric user id of the authenticated user. |
org.jdom.Element |
getUserStatus(javax.servlet.http.HttpServletRequest req)
Get an org.jdom.Element describing the user status. |
void |
init()
Initialize SecurityManager. |
protected void |
returnConn(java.sql.Connection conn)
Aggregation method delegated to PGConnectionPool. |
Methods inherited from class com.xmlserv.security.RoleSecurityManager |
authenticate, authorize, doLogin, errorPage, getUser, getUserObj, getUserRoleGroup, getUserRoleGroupId, loginPage, loginPage, logout, signout, validate, validate |
Methods inherited from class com.xmlserv.security.SecurityManager |
addACL, getResource, hasAuth, isAnon, toUserStatus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AppSecurityManager()
init()
Method Detail |
public void init() throws SecurityManagerException
init
in class RoleSecurityManager
SecurityManagerException
- Upon any error.public void destroy()
destroy
in class RoleSecurityManager
protected java.lang.String checkUser(java.lang.String user, java.lang.String password) throws SecurityManagerException
checkUser
in class RoleSecurityManager
user
- The username to check.password
- The password for the given username.SecurityManagerException
- In case the account is not valid (it either does not exist or the password is not correct).protected void checkAuth(SecurityManager.User user, SecurityManager.Resource resource, java.lang.String access) throws SecurityManagerException
checkAuth
in class RoleSecurityManager
user
- The SecurityManager.User object providing login data.resource
- The named resource.access
- One of the defined access strings from SecurityManager.In
- case access cannot be granted.SecurityManager
protected int getRoleGroupId(java.lang.String username) throws SecurityManagerException
getRoleGroupId
in class RoleSecurityManager
protected java.lang.String getRoleGroup(java.lang.String username) throws SecurityManagerException
getRoleGroup
in class RoleSecurityManager
public java.lang.String getUserID(javax.servlet.http.HttpServletRequest req) throws SecurityManagerException
getUserID
in class SecurityManager
req
- The HTTP request.protected java.lang.String getEmail(java.lang.String username) throws SecurityManagerException
getEmail
in class RoleSecurityManager
username
- The username to search for.protected int getId(java.lang.String username) throws SecurityManagerException
getId
in class RoleSecurityManager
username
- The username to search for.public org.jdom.Element getUserStatus(javax.servlet.http.HttpServletRequest req)
getUserStatus
in class SecurityManager
req
- The servlet request object.User.toElement()
public SecurityManager.User getUserById(int id) throws SecurityManagerException
getUserById
in class SecurityManager
protected java.sql.Connection checkoutConn() throws java.sql.SQLException
java.sql.SQLException
- Error checking out Connection.protected void returnConn(java.sql.Connection conn) throws java.sql.SQLException
conn
- The Connection object to return to the pool.java.sql.SQLException
- Error returning Connection.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |