org.jboss.security.acl
Class CompositeACLPermission

java.lang.Object
  extended by org.jboss.security.acl.CompositeACLPermission
All Implemented Interfaces:
org.jboss.security.acl.ACLPermission, BitMaskPermission, org.jboss.security.authorization.Permission

public class CompositeACLPermission
extends Object
implements BitMaskPermission

This class represents a composite permission - a permission that contains one or more basic permissions. The bitmask value of this permission is calculated by combining (logical or) the bitmask values of the basic permissions it contains. Thus, a composite permission's bitmask can have more than one bit on, and each bit corresponds to one of the basic permissions that are part of the composite permission.

Author:
Stefan Guilhen

Constructor Summary
CompositeACLPermission(BasicACLPermission... permissions)
           Builds an instance of CompositeACLPermission with the given basic permissions.
CompositeACLPermission(int mask)
           Builds an instance of CompositeACLPermission with the specified bitmask value.
 
Method Summary
 boolean equals(Object obj)
           
 int getMaskValue()
           Obtains the bitmask value of the permission.
 int hashCode()
           
 String toBinaryString()
           Returns the binary representation of this permission.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeACLPermission

public CompositeACLPermission(int mask)

Builds an instance of CompositeACLPermission with the specified bitmask value.

Parameters:
mask - an int representing the bitmask value of the permission being created.

CompositeACLPermission

public CompositeACLPermission(BasicACLPermission... permissions)

Builds an instance of CompositeACLPermission with the given basic permissions.

Parameters:
permissions - a comma-separated list of BasicACLPermissions.
Method Detail

getMaskValue

public int getMaskValue()
Description copied from interface: BitMaskPermission

Obtains the bitmask value of the permission.

Specified by:
getMaskValue in interface BitMaskPermission
Returns:
an int representing the value of the bitmask.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

toBinaryString

public String toBinaryString()

Returns the binary representation of this permission.

Returns:
a String containing this permission's binary representation.


Copyright © 2009 JBoss Inc.. All Rights Reserved.