org.janux.bus.security
Interface PermissionBit


public interface PermissionBit

Class representing an individual PermissionBit within a specific PermissionContext; a PermissionBit is only meaningful in the context of the PermissionContext that defines it: for example, a PermissionContext named 'PERSON' may define Permissions with names 'CREATE', 'READ', 'UPDATE', 'DISABLE', 'PURGE', that define the kind of operations on Persons that may be restricted by the security system; see the javadoc of PermissionContext for a more detailed discussion.

The PermissionBit interface provides for defining the bit position of the PermissionBit within a bit mask (0, 1, 2, 3, etc...), and a convenience method for returning the long value of that bit position (that is 2 taken to the power of the bitPosition, e.g. 1, 2, 4, 8...)

Since:
0.1
Author:
Philippe Paravicini

Method Summary
 String getDescription()
          Human readable description of this PermissionBit
 String getName()
          Short-hand name for this PermissionBit (e.g.: READ), unique in the context of the containing PermissionContext
 PermissionContext getPermissionContext()
          the PermissionContext that contains/uses this PermissionBit
 short getPosition()
          The position of the PermissionBit within the bit mask defined by the PermissionContext, should be a sequential integer relative to the sequence defined by the PermissionContext; so if a PermissionContext defines 5 permissions, this should be a number between 0 and 4 that is not used by any of the other Permissions in the PermissionContext
 Integer getSortOrder()
          used to display the sort order independently from the Bit's Position, defaults to the getPosition if not set explicitly
 long getValue()
          A convenience method that returns 2 to the power of the bitPosition
 void setDescription(String description)
           
 void setName(String name)
           
 void setPermissionContext(PermissionContext permContext)
           
 void setPosition(short pos)
           
 void setSortOrder(Integer i)
           
 

Method Detail

getName

String getName()
Short-hand name for this PermissionBit (e.g.: READ), unique in the context of the containing PermissionContext


setName

void setName(String name)

getPosition

short getPosition()
The position of the PermissionBit within the bit mask defined by the PermissionContext, should be a sequential integer relative to the sequence defined by the PermissionContext; so if a PermissionContext defines 5 permissions, this should be a number between 0 and 4 that is not used by any of the other Permissions in the PermissionContext


setPosition

void setPosition(short pos)

getValue

long getValue()
A convenience method that returns 2 to the power of the bitPosition


getPermissionContext

PermissionContext getPermissionContext()
the PermissionContext that contains/uses this PermissionBit


setPermissionContext

void setPermissionContext(PermissionContext permContext)

getDescription

String getDescription()
Human readable description of this PermissionBit


setDescription

void setDescription(String description)

getSortOrder

Integer getSortOrder()
used to display the sort order independently from the Bit's Position, defaults to the getPosition if not set explicitly


setSortOrder

void setSortOrder(Integer i)


Copyright © 2005-2013 Janux. All Rights Reserved.