edu.internet2.middleware.grouper.privs
Class NamingPrivilege

java.lang.Object
  extended by edu.internet2.middleware.grouper.privs.NamingPrivilege
All Implemented Interfaces:
GrouperPrivilege, Comparable

public class NamingPrivilege
extends Object
implements GrouperPrivilege, Comparable

An instance of a granted naming privilege.

Version:
$Id: NamingPrivilege.java,v 1.8 2009-04-13 20:24:29 mchyzer Exp $
Author:
blair christensen.

Field Summary
static Privilege CREATE
          can create objects in this stem
static Set<Privilege> CREATE_PRIVILEGES
          any of these constitutes CREATE on a stem note, keep most common/likely privs toward the front
static Privilege STEM
          can create stems in this stem
 
Constructor Summary
NamingPrivilege(Stem stem, Subject subj, Subject owner, Privilege priv, String klass, boolean isRevokable, String contextId1)
           
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object other)
           
 String getContextId()
          optionally link the audit id with the low level action
 GrouperAPI getGrouperApi()
          get the object this privilege is assigned to (e.g.
 String getImplementationName()
          Get name of implementation class for this privilege type.
 String getName()
          Get name of privilege.
 Subject getOwner()
          Get subject which was granted privilege on this object.
 Stem getStem()
          Get object Stem that the privilege was granted on.
 Subject getSubject()
          Get subject which has this privilege.
 String getType()
          get type of privilege (e.g.
 int hashCode()
           
 boolean isRevokable()
          Returns true if privilege can be revoked.
static Privilege listToPriv(String list)
          convert a list to a privilege
static String privToList(Privilege privilege)
          convert a privilege to a list
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CREATE

public static final Privilege CREATE
can create objects in this stem


STEM

public static final Privilege STEM
can create stems in this stem


CREATE_PRIVILEGES

public static Set<Privilege> CREATE_PRIVILEGES
any of these constitutes CREATE on a stem note, keep most common/likely privs toward the front

Constructor Detail

NamingPrivilege

public NamingPrivilege(Stem stem,
                       Subject subj,
                       Subject owner,
                       Privilege priv,
                       String klass,
                       boolean isRevokable,
                       String contextId1)
Method Detail

privToList

public static String privToList(Privilege privilege)
convert a privilege to a list

Parameters:
privilege -
Returns:
the list name

listToPriv

public static Privilege listToPriv(String list)
convert a list to a privilege

Parameters:
list -
Returns:
the privilege

equals

public boolean equals(Object other)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable
See Also:
Comparable.compareTo(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Returns:
hashcode
Since:
1.2.0

getImplementationName

public String getImplementationName()
Get name of implementation class for this privilege type.

Specified by:
getImplementationName in interface GrouperPrivilege
Returns:
Class name of implementing class.

isRevokable

public boolean isRevokable()
Returns true if privilege can be revoked.

Specified by:
isRevokable in interface GrouperPrivilege
Returns:
Boolean true if privilege can be revoked.

getName

public String getName()
Get name of privilege.

Specified by:
getName in interface GrouperPrivilege
Returns:
Name of privilege.

getOwner

public Subject getOwner()
Get subject which was granted privilege on this object.

Specified by:
getOwner in interface GrouperPrivilege
Returns:
Subject that was granted privilege.

getStem

public Stem getStem()
Get object Stem that the privilege was granted on.

Returns:
Stem object.

getSubject

public Subject getSubject()
Get subject which has this privilege.

Specified by:
getSubject in interface GrouperPrivilege
Returns:
Subject that has this privilege.

toString

public String toString()
Overrides:
toString in class Object

getGrouperApi

public GrouperAPI getGrouperApi()
Description copied from interface: GrouperPrivilege
get the object this privilege is assigned to (e.g. group or stem object)

Specified by:
getGrouperApi in interface GrouperPrivilege
Returns:
the group or stem
See Also:
GrouperPrivilege.getGrouperApi()

getType

public String getType()
Description copied from interface: GrouperPrivilege
get type of privilege (e.g. access or naming)

Specified by:
getType in interface GrouperPrivilege
Returns:
the type
See Also:
GrouperPrivilege.getType()

getContextId

public String getContextId()
optionally link the audit id with the low level action

Returns:
context id