ozone core API

org.ozoneDB.core
Class UserManager

java.lang.Object
  |
  +--org.ozoneDB.core.ServerComponent
        |
        +--org.ozoneDB.core.UserManager

public final class UserManager
extends ServerComponent

The UserManager holds all information about users and groups.

Version:
$Revision: 1.2 $Date: 2002/06/08 00:49:38 $
Author:
SMB
See Also:
User, Group

Field Summary
protected  Env env
           
protected static User garbageCollectorUser
          The User object of the GarbageCollector.
static java.lang.String GROUP_TABLE
           
protected  DxMap groupTable
          All currently known groups.
protected  DxMap idGroupTable
          All currently known groups.
protected  DxMap idUserTable
          All currently known users.
protected static long serialVersionUID
           
protected static byte subSerialVersionUID
           
protected static int SYSTEM_USER_ID
          This is the userID of the system.
static java.lang.String USER_TABLE
           
protected  DxMap userTable
          All currently known users.
 
Fields inherited from class org.ozoneDB.core.ServerComponent
 
Constructor Summary
UserManager(Env _env)
           
 
Method Summary
 void addUserToGroup(java.lang.String userName, java.lang.String groupName)
           
 DxCollection allGroups()
           
 DxCollection allUsers()
           
 boolean checkPermission(User user, ObjectContainer container, int lockLevel)
           
protected  boolean checkReadPermission(User reader, ObjectContainer container)
           
protected  boolean checkWritePermission(User locker, ObjectContainer container)
           
protected  User getGarbageCollectorUser()
          Returns the User object of the GarbageCollector.
 Group groupForID(int id)
           
 Group groupForName(java.lang.String name)
           
protected  DxBag groupsOfUser(User user)
           
 void newGroup(java.lang.String name, int id)
           
 void newUser(java.lang.String name, int id)
           
 void removeGroup(java.lang.String name)
          Delete the group for the given name.
 void removeUser(java.lang.String name)
           
 void removeUserFromGroup(java.lang.String userName, java.lang.String groupName)
           
 void save()
          Save the internal state in the state to the server state properties.
 void shutdown()
           
 void startup()
          Start up and load the internal state from the server state properties.
 User userForID(int id)
           
 User userForName(java.lang.String name)
           
 
Methods inherited from class org.ozoneDB.core.ServerComponent
clearChanged, hasChanged, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
See Also:
Constant Field Values

subSerialVersionUID

protected static final byte subSerialVersionUID
See Also:
Constant Field Values

GROUP_TABLE

public static final java.lang.String GROUP_TABLE
See Also:
Constant Field Values

USER_TABLE

public static final java.lang.String USER_TABLE
See Also:
Constant Field Values

env

protected transient Env env

userTable

protected DxMap userTable
All currently known users. Maps String into User.


idUserTable

protected DxMap idUserTable
All currently known users. Maps IDs into User.


groupTable

protected DxMap groupTable
All currently known groups. Maps String into Group.


idGroupTable

protected DxMap idGroupTable
All currently known groups. Maps IDs into Group.


SYSTEM_USER_ID

protected static final int SYSTEM_USER_ID
This is the userID of the system. The system has all rights and is comparable to root in UNIX systems.

See Also:
Constant Field Values

garbageCollectorUser

protected static final User garbageCollectorUser
The User object of the GarbageCollector.

Constructor Detail

UserManager

public UserManager(Env _env)
Method Detail

getGarbageCollectorUser

protected User getGarbageCollectorUser()
Returns the User object of the GarbageCollector.


startup

public void startup()
             throws java.lang.Exception
Description copied from class: ServerComponent
Start up and load the internal state from the server state properties.

Specified by:
startup in class ServerComponent
java.lang.Exception

shutdown

public void shutdown()
              throws java.lang.Exception
Specified by:
shutdown in class ServerComponent
java.lang.Exception

save

public void save()
          throws java.lang.Exception
Description copied from class: ServerComponent
Save the internal state in the state to the server state properties.

Specified by:
save in class ServerComponent
java.lang.Exception

checkPermission

public boolean checkPermission(User user,
                               ObjectContainer container,
                               int lockLevel)

checkReadPermission

protected boolean checkReadPermission(User reader,
                                      ObjectContainer container)

checkWritePermission

protected boolean checkWritePermission(User locker,
                                       ObjectContainer container)

newGroup

public void newGroup(java.lang.String name,
                     int id)
              throws UserManagerExc
UserManagerExc

removeGroup

public void removeGroup(java.lang.String name)
                 throws UserManagerExc
Delete the group for the given name.

UserManagerExc

groupsOfUser

protected DxBag groupsOfUser(User user)

newUser

public void newUser(java.lang.String name,
                    int id)
             throws UserManagerExc
UserManagerExc

addUserToGroup

public void addUserToGroup(java.lang.String userName,
                           java.lang.String groupName)
                    throws UserManagerExc
UserManagerExc

removeUserFromGroup

public void removeUserFromGroup(java.lang.String userName,
                                java.lang.String groupName)
                         throws UserManagerExc
UserManagerExc

removeUser

public void removeUser(java.lang.String name)
                throws UserManagerExc
UserManagerExc

groupForName

public Group groupForName(java.lang.String name)
                   throws UserManagerExc
UserManagerExc

groupForID

public Group groupForID(int id)

userForName

public User userForName(java.lang.String name)
                 throws UserManagerExc
UserManagerExc

userForID

public User userForID(int id)

allGroups

public DxCollection allGroups()

allUsers

public DxCollection allUsers()

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.