GATE
Version 3.1-2270

gate.security
Class UserImpl

java.lang.Object
  extended by gate.security.UserImpl
All Implemented Interfaces:
GateListener, ObjectModificationListener, User, EventListener

public class UserImpl
extends Object
implements User, ObjectModificationListener


Field Summary
 
Fields inherited from interface gate.security.User
OBJECT_CHANGE_NAME
 
Constructor Summary
UserImpl(Long id, String name, List groups, AccessControllerImpl ac, Connection conn)
          ---
 
Method Summary
 boolean equals(Object obj)
          this one is necessary for the contains() operations in Lists It is possible that two users have two different UserImpl that refer to the very same user in the DB, because they got it fromt he security factory at different times.
 List getGroups()
          returns a list with the groups that the user is member of
 Long getID()
          returns the ID of the user user IDs are uniques in the same data store
 String getName()
          returns the name of the user user names are unique in the same data store
 void objectCreated(ObjectModificationEvent e)
          callback that is invoked from objects that were created and this user object is interested in NOTE that this events are just ignored
 void objectDeleted(ObjectModificationEvent e)
          callback that is invoked from objects that were deleted and this user object is interested in Useful when a group is deleted from the security factory and this user should be notified so that it will remove the reference to the group from its internal collections (the user is no longer member of the group)
 void objectModified(ObjectModificationEvent e)
          callback that is invoked from objects that were modified and this user object is interested in Useful when a group drops the user as member and this user should be notified so that it will remove the reference to the group from its internal collections (the user is no longer member of the group)
 void processGateEvent(GateEvent e)
          huh?
 void registerObjectModificationListener(ObjectModificationListener l, int eventType)
          registers an object fore receiving ObjectModificationEvent-s send by this object the only types of events sent by a user object are OBJECT_DELETED and OBJECT_MODIFIED, so any attempt for registering for other events is invalid
 void setName(String newName, Session s)
          changes user name Only members of the ADMIN group have sufficient privileges.
 void setPassword(String newPass, Session s)
          changes user password Only members of the ADMIN group and the user himself have sufficient privileges
 void unregisterObjectModificationListener(ObjectModificationListener l, int eventType)
          unregisters an object fore receiving ObjectModificationEvent-s send by this object the only types of events sent by a user object are OBJECT_DELETED and OBJECT_MODIFIED, so any attempt for unregistering for other events is invalid
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserImpl

public UserImpl(Long id,
                String name,
                List groups,
                AccessControllerImpl ac,
                Connection conn)
---

Method Detail

getID

public Long getID()
returns the ID of the user user IDs are uniques in the same data store

Specified by:
getID in interface User

getName

public String getName()
returns the name of the user user names are unique in the same data store

Specified by:
getName in interface User

getGroups

public List getGroups()
returns a list with the groups that the user is member of

Specified by:
getGroups in interface User

setName

public void setName(String newName,
                    Session s)
             throws PersistenceException,
                    SecurityException
changes user name Only members of the ADMIN group have sufficient privileges. fires ObjectModificationEvent

Specified by:
setName in interface User
Throws:
PersistenceException
SecurityException
See Also:
ObjectModificationEvent

setPassword

public void setPassword(String newPass,
                        Session s)
                 throws PersistenceException,
                        SecurityException
changes user password Only members of the ADMIN group and the user himself have sufficient privileges

Specified by:
setPassword in interface User
Throws:
PersistenceException
SecurityException

equals

public boolean equals(Object obj)
this one is necessary for the contains() operations in Lists It is possible that two users have two different UserImpl that refer to the very same user in the DB, because they got it fromt he security factory at different times. So we assume that two instances refer the same GATE user if ID1==ID2 && NAME1==NAME2

Overrides:
equals in class Object

registerObjectModificationListener

public void registerObjectModificationListener(ObjectModificationListener l,
                                               int eventType)
registers an object fore receiving ObjectModificationEvent-s send by this object the only types of events sent by a user object are OBJECT_DELETED and OBJECT_MODIFIED, so any attempt for registering for other events is invalid


unregisterObjectModificationListener

public void unregisterObjectModificationListener(ObjectModificationListener l,
                                                 int eventType)
unregisters an object fore receiving ObjectModificationEvent-s send by this object the only types of events sent by a user object are OBJECT_DELETED and OBJECT_MODIFIED, so any attempt for unregistering for other events is invalid


objectCreated

public void objectCreated(ObjectModificationEvent e)
callback that is invoked from objects that were created and this user object is interested in NOTE that this events are just ignored

Specified by:
objectCreated in interface ObjectModificationListener

objectModified

public void objectModified(ObjectModificationEvent e)
callback that is invoked from objects that were modified and this user object is interested in Useful when a group drops the user as member and this user should be notified so that it will remove the reference to the group from its internal collections (the user is no longer member of the group)

Specified by:
objectModified in interface ObjectModificationListener

objectDeleted

public void objectDeleted(ObjectModificationEvent e)
callback that is invoked from objects that were deleted and this user object is interested in Useful when a group is deleted from the security factory and this user should be notified so that it will remove the reference to the group from its internal collections (the user is no longer member of the group)

Specified by:
objectDeleted in interface ObjectModificationListener

processGateEvent

public void processGateEvent(GateEvent e)
huh?

Specified by:
processGateEvent in interface GateListener

GATE
Version 3.1-2270