org.basex.core
Class Users

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<User>
              extended by org.basex.core.Users
All Implemented Interfaces:
Serializable, Cloneable, Iterable<User>, Collection<User>, List<User>, RandomAccess

public final class Users
extends ArrayList<User>

This class organizes all users.

Author:
Workgroup DBIS, University of Konstanz 2005-10, ISC License, Andreas Weiler
See Also:
Serialized Form

Constructor Summary
Users(boolean global)
          Global constructor.
Users(DataInput in)
          Local constructor.
 
Method Summary
 boolean alter(String usern, String pass)
          Changes the password of a user.
 boolean create(String usern, String pass)
          Stores a user and encrypted password.
 void drop(User user)
          Drops a user from the list.
 User get(String usern)
          Returns a user reference with the specified name.
 byte[] info()
          Returns information on all users.
 void write()
          Writes global permissions to disk.
 void write(DataOutput out)
          Writes permissions to disk.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

Users

public Users(boolean global)
Global constructor.

Parameters:
global - global flag

Users

public Users(DataInput in)
      throws IOException
Local constructor.

Parameters:
in - input stream
Throws:
IOException - I/O exception
Method Detail

create

public boolean create(String usern,
                      String pass)
Stores a user and encrypted password.

Parameters:
usern - user name
pass - password
Returns:
success of operation

alter

public boolean alter(String usern,
                     String pass)
Changes the password of a user.

Parameters:
usern - user name
pass - password
Returns:
success of operation

drop

public void drop(User user)
Drops a user from the list.

Parameters:
user - user reference

get

public User get(String usern)
Returns a user reference with the specified name.

Parameters:
usern - user name
Returns:
success of operation

write

public void write()
Writes global permissions to disk.


write

public void write(DataOutput out)
           throws IOException
Writes permissions to disk.

Parameters:
out - output stream; if set to null, the global rights are written
Throws:
IOException - I/O exception

info

public byte[] info()
Returns information on all users.

Returns:
user information