org.mmbase.security
Class Rank

java.lang.Object
  |
  +--org.mmbase.security.Rank

public final class Rank
extends java.lang.Object

This class defines Rank objects which are used in security implementation. Ranks can be associated with users. Every Rank has an unique integer 'height' (so every rank is higher or lower than any other rank) and a String which can be used to identify it. Possible Ranks are maintained by static methods in this class. Generally the 'anonymous', 'basic user' and 'adminstrator' ranks should always be available, and only be delete with good reason.

Version:
$Id: Rank.java,v 1.5.2.3 2003/06/30 13:29:32 michiel Exp $
Author:
Eduard Witteveen, Pierre van Rooden, Michiel Meeuwissen

Field Summary
static Rank ADMIN
          Identifier for admin rank
static int ADMIN_INT
          int value for the anonymous Rank
static Rank ANONYMOUS
          Identifier for anonymous rank
static int ANONYMOUS_INT
          int value for the anonymous Rank
static Rank BASICUSER
          Identifier for basic user rank
static int BASICUSER_INT
          int value for the basic user Rank
 
Constructor Summary
protected Rank(int rank, java.lang.String description)
          constructor
 
Method Summary
static Rank createRank(int rank, java.lang.String rankDesc)
          Creates and adds a new Rank for the security system.
static Rank deleteRank(java.lang.String rankDesc)
          Removes a rank from the security system.
 boolean equals(java.lang.Object o)
           
 int getInt()
          This method gives back the internal int value of the rank which can be used in switch statements
static Rank getRank(java.lang.String rankDesc)
           
static java.util.Set getRanks()
          Returns all ranks currently known by security implemetation.
protected static Rank registerRank(Rank rank)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ANONYMOUS_INT

public static final int ANONYMOUS_INT
int value for the anonymous Rank

BASICUSER_INT

public static final int BASICUSER_INT
int value for the basic user Rank

ADMIN_INT

public static final int ADMIN_INT
int value for the anonymous Rank

ANONYMOUS

public static final Rank ANONYMOUS
Identifier for anonymous rank

BASICUSER

public static final Rank BASICUSER
Identifier for basic user rank

ADMIN

public static final Rank ADMIN
Identifier for admin rank
Constructor Detail

Rank

protected Rank(int rank,
               java.lang.String description)
constructor
Method Detail

getInt

public int getInt()
This method gives back the internal int value of the rank which can be used in switch statements
Returns:
the internal int value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a string containing the description of the rank

getRank

public static Rank getRank(java.lang.String rankDesc)

registerRank

protected static Rank registerRank(Rank rank)
Since:
MMBase-1.6.4

createRank

public static Rank createRank(int rank,
                              java.lang.String rankDesc)
Creates and adds a new Rank for the security system.
Since:
MMBase-1.6.4

deleteRank

public static Rank deleteRank(java.lang.String rankDesc)
Removes a rank from the security system.
Since:
MMBase-1.6.4

getRanks

public static java.util.Set getRanks()
Returns all ranks currently known by security implemetation. Default and to start with there are three ranks available: 'anonymous', 'basic user' and 'administrator'. You probably should never remove them.
Since:
MMBase-1.6.4

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
Since:
MMBase-1.6.4


MMBase build 1.6.5.20030923