gate.security
Class AccessControllerImpl
java.lang.Object
|
+--gate.security.AccessControllerImpl
- All Implemented Interfaces:
- AccessController, EventListener, GateListener, ObjectModificationListener
- public class AccessControllerImpl
- extends Object
- implements AccessController, ObjectModificationListener
Method Summary |
(package private) static void |
()
|
private boolean |
canDeleteGroup(Group grp)
|
private boolean |
canDeleteUser(User usr)
|
void |
close()
--- |
Group |
createGroup(String name,
Session s)
--- |
private Long |
createSessionID()
|
User |
createUser(String name,
String passwd,
Session s)
--- |
void |
deleteGroup(Group grp,
Session s)
--- |
void |
deleteGroup(Long id,
Session s)
--- |
void |
deleteUser(Long id,
Session s)
--- |
void |
deleteUser(User usr,
Session s)
--- |
void |
finalize()
|
Group |
findGroup(Long id)
--- |
Group |
findGroup(String name)
--- |
Session |
findSession(Long id)
--- |
User |
findUser(Long id)
--- |
User |
findUser(String name)
--- |
private void |
fireObjectCreatedEvent(ObjectModificationEvent e)
|
private void |
fireObjectDeletedEvent(ObjectModificationEvent e)
|
private void |
fireObjectModifiedEvent(ObjectModificationEvent e)
|
private void |
init()
|
boolean |
isValidSecurityInfo(SecurityInfo si)
-- |
boolean |
isValidSession(Session s)
--- |
List |
listGroups()
-- |
List |
listUsers()
-- |
Session |
login(String usr_name,
String passwd,
Long prefGroupID)
--- |
void |
logout(Session s)
--- |
void |
objectCreated(ObjectModificationEvent e)
|
void |
objectDeleted(ObjectModificationEvent e)
|
void |
objectModified(ObjectModificationEvent e)
|
void |
open()
--- |
void |
processGateEvent(GateEvent e)
Called when a Gate event has occured |
void |
registerObjectModificationListener(ObjectModificationListener l,
int eventType)
|
void |
setSessionTimeout(Session s,
int timeoutMins)
--- |
private void |
touchSession(Session s)
|
void |
unregisterObjectModificationListener(ObjectModificationListener l,
int eventType)
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
DEFAULT_SESSION_TIMEOUT_MIN
public static final int DEFAULT_SESSION_TIMEOUT_MIN
LOGIN_OK
public static final int LOGIN_OK
LOGIN_FAILED
public static final int LOGIN_FAILED
MY_VERY_SECRET_CONSTANT
private static long MY_VERY_SECRET_CONSTANT
RANDOM_MAX
private static final int RANDOM_MAX
sessions
private HashMap sessions
sessionLastUsed
private HashMap sessionLastUsed
sessionTimeouts
private HashMap sessionTimeouts
jdbcConn
private Connection jdbcConn
jdbcURL
private String jdbcURL
jdbcSchema
private String jdbcSchema
dbType
protected int dbType
usersByID
private HashMap usersByID
usersByName
private HashMap usersByName
groupsByID
private HashMap groupsByID
groupsByName
private HashMap groupsByName
r
private static Random r
isPooled
private boolean isPooled
refCnt
private int refCnt
omModificationListeners
private Vector omModificationListeners
- ---
omCreationListeners
private Vector omCreationListeners
- ---
omDeletionListeners
private Vector omDeletionListeners
- ---
AccessControllerImpl
public AccessControllerImpl(String jdbcURL)
- ---
static void ()
open
public void open()
throws PersistenceException
- ---
- Specified by:
open
in interface AccessController
close
public void close()
throws PersistenceException
- ---
- Specified by:
close
in interface AccessController
findGroup
public Group findGroup(String name)
throws PersistenceException,
SecurityException
- ---
- Specified by:
findGroup
in interface AccessController
findGroup
public Group findGroup(Long id)
throws PersistenceException,
SecurityException
- ---
- Specified by:
findGroup
in interface AccessController
findUser
public User findUser(String name)
throws PersistenceException,
SecurityException
- ---
- Specified by:
findUser
in interface AccessController
findUser
public User findUser(Long id)
throws PersistenceException,
SecurityException
- ---
- Specified by:
findUser
in interface AccessController
findSession
public Session findSession(Long id)
throws SecurityException
- ---
- Specified by:
findSession
in interface AccessController
createGroup
public Group createGroup(String name,
Session s)
throws PersistenceException,
SecurityException
- ---
- Specified by:
createGroup
in interface AccessController
deleteGroup
public void deleteGroup(Long id,
Session s)
throws PersistenceException,
SecurityException
- ---
- Specified by:
deleteGroup
in interface AccessController
deleteGroup
public void deleteGroup(Group grp,
Session s)
throws PersistenceException,
SecurityException
- ---
- Specified by:
deleteGroup
in interface AccessController
createUser
public User createUser(String name,
String passwd,
Session s)
throws PersistenceException,
SecurityException
- ---
- Specified by:
createUser
in interface AccessController
deleteUser
public void deleteUser(User usr,
Session s)
throws PersistenceException,
SecurityException
- ---
- Specified by:
deleteUser
in interface AccessController
deleteUser
public void deleteUser(Long id,
Session s)
throws PersistenceException,
SecurityException
- ---
- Specified by:
deleteUser
in interface AccessController
login
public Session login(String usr_name,
String passwd,
Long prefGroupID)
throws PersistenceException,
SecurityException
- ---
- Specified by:
login
in interface AccessController
logout
public void logout(Session s)
throws SecurityException
- ---
- Specified by:
logout
in interface AccessController
setSessionTimeout
public void setSessionTimeout(Session s,
int timeoutMins)
throws SecurityException
- ---
- Specified by:
setSessionTimeout
in interface AccessController
isValidSession
public boolean isValidSession(Session s)
- ---
- Specified by:
isValidSession
in interface AccessController
listGroups
public List listGroups()
throws PersistenceException
- --
- Specified by:
listGroups
in interface AccessController
listUsers
public List listUsers()
throws PersistenceException
- --
- Specified by:
listUsers
in interface AccessController
touchSession
private void touchSession(Session s)
createSessionID
private Long createSessionID()
canDeleteGroup
private boolean canDeleteGroup(Group grp)
throws PersistenceException,
SecurityException
canDeleteUser
private boolean canDeleteUser(User usr)
throws PersistenceException,
SecurityException
init
private void init()
throws PersistenceException
fireObjectCreatedEvent
private void fireObjectCreatedEvent(ObjectModificationEvent e)
fireObjectDeletedEvent
private void fireObjectDeletedEvent(ObjectModificationEvent e)
fireObjectModifiedEvent
private void fireObjectModifiedEvent(ObjectModificationEvent e)
registerObjectModificationListener
public void registerObjectModificationListener(ObjectModificationListener l,
int eventType)
unregisterObjectModificationListener
public void unregisterObjectModificationListener(ObjectModificationListener l,
int eventType)
objectCreated
public void objectCreated(ObjectModificationEvent e)
- Specified by:
objectCreated
in interface ObjectModificationListener
objectModified
public void objectModified(ObjectModificationEvent e)
- Specified by:
objectModified
in interface ObjectModificationListener
objectDeleted
public void objectDeleted(ObjectModificationEvent e)
- Specified by:
objectDeleted
in interface ObjectModificationListener
processGateEvent
public void processGateEvent(GateEvent e)
- Description copied from interface:
GateListener
- Called when a Gate event has occured
- Specified by:
processGateEvent
in interface GateListener
isValidSecurityInfo
public boolean isValidSecurityInfo(SecurityInfo si)
- --
- Specified by:
isValidSecurityInfo
in interface AccessController
finalize
public void finalize()
- Overrides:
finalize
in class Object