arlut.csd.ganymede
Class PermEntry

java.lang.Object
  |
  +--arlut.csd.ganymede.PermEntry
All Implemented Interfaces:
java.io.Serializable

public class PermEntry
extends java.lang.Object
implements java.io.Serializable

Serializable and immutable permissions entry object, used to store and transmit permissions for a specific DBObjectBase and DBObjectBaseField.

Used in conjunction with PermissionMatrixDBField and PermMatrix to handle Permissions in a Role object in the Ganymede server.

See Also:
Serialized Form

Field Summary
private  boolean create
           
private  boolean delete
           
private  boolean editable
           
static arlut.csd.ganymede.PermEntry fullPerms
           
private  byte index
           
private  boolean indexSet
           
static arlut.csd.ganymede.PermEntry noPerms
           
private static arlut.csd.ganymede.PermEntry[] permObs
           
(package private) static long serialVersionUID
           
static arlut.csd.ganymede.PermEntry viewPerms
           
private  boolean visible
           
 
Constructor Summary
PermEntry(boolean visible, boolean editable, boolean create, boolean delete)
           
PermEntry(java.io.DataInput in)
           
PermEntry(arlut.csd.ganymede.PermEntry orig)
           
 
Method Summary
private  void addString(java.lang.StringBuffer x, java.lang.String y)
           
private  void calcIndex()
           
 java.lang.String difference(arlut.csd.ganymede.PermEntry p)
          This method returns a textual description of the changes between this PermEntry and <p>
(package private)  void emit(java.io.DataOutput out)
           
 boolean equals(java.lang.Object obj)
           
static arlut.csd.ganymede.PermEntry getPermEntry(boolean visible, boolean editable, boolean create, boolean delete)
          This static method returns a reference to an immutable PermEntry object with the requested privilege bits set.
static arlut.csd.ganymede.PermEntry getPermEntry(byte index)
          This static method returns a reference to an immutable PermEntry object with the requested privilege bits set.
static arlut.csd.ganymede.PermEntry getPermEntry(java.io.DataInput in)
          This static method reads a PermEntry object from the given DataInput stream and returns an immutable PermEntry with the appropriate bits set.
 java.lang.String getXMLCode()
           
 byte indexNum()
          This method returns a bit coded byte value representing the permission bits set in this PermEntry object.
 arlut.csd.ganymede.PermEntry intersection(arlut.csd.ganymede.PermEntry p)
          This method returns an immutable PermEntry that allows all permissions allowed by the logical intersection of this PermEntry and p.
 boolean isCreatable()
          This method returns true if the this entry in a PermMatrix is granted creation privilege.
 boolean isDeletable()
          This method returns true if the this entry in a PermMatrix is granted deletion privilege.
 boolean isEditable()
          This method returns true if the this entry in a PermMatrix is granted editing privilege.
 boolean isVisible()
          This method returns true if the this entry in a PermMatrix is granted visibility privilege.
static void main(java.lang.String[] argv)
           
(package private)  void receive(java.io.DataInput in)
           
 java.lang.String toString()
          Diagnostic aid.
 arlut.csd.ganymede.PermEntry union(arlut.csd.ganymede.PermEntry p)
          This method returns an immutable PermEntry that allows all permissions allowed by the logical union of this PermEntry and p.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

permObs

private static arlut.csd.ganymede.PermEntry[] permObs

fullPerms

public static final arlut.csd.ganymede.PermEntry fullPerms

noPerms

public static final arlut.csd.ganymede.PermEntry noPerms

viewPerms

public static final arlut.csd.ganymede.PermEntry viewPerms

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

visible

private boolean visible

editable

private boolean editable

create

private boolean create

delete

private boolean delete

index

private transient byte index

indexSet

private transient boolean indexSet
Constructor Detail

PermEntry

public PermEntry(boolean visible,
                 boolean editable,
                 boolean create,
                 boolean delete)

PermEntry

public PermEntry(java.io.DataInput in)
          throws java.io.IOException

PermEntry

public PermEntry(arlut.csd.ganymede.PermEntry orig)
Method Detail

main

public static void main(java.lang.String[] argv)

getPermEntry

public static arlut.csd.ganymede.PermEntry getPermEntry(boolean visible,
                                                        boolean editable,
                                                        boolean create,
                                                        boolean delete)

This static method returns a reference to an immutable PermEntry object with the requested privilege bits set.


getPermEntry

public static arlut.csd.ganymede.PermEntry getPermEntry(byte index)

This static method returns a reference to an immutable PermEntry object with the requested privilege bits set.


getPermEntry

public static arlut.csd.ganymede.PermEntry getPermEntry(java.io.DataInput in)
                                                 throws java.io.IOException

This static method reads a PermEntry object from the given DataInput stream and returns an immutable PermEntry with the appropriate bits set.

java.io.IOException

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

emit

void emit(java.io.DataOutput out)
    throws java.io.IOException
java.io.IOException

receive

void receive(java.io.DataInput in)
       throws java.io.IOException
java.io.IOException

isVisible

public boolean isVisible()
This method returns true if the this entry in a PermMatrix is granted visibility privilege.


isEditable

public boolean isEditable()
This method returns true if the this entry in a PermMatrix is granted editing privilege.


isCreatable

public boolean isCreatable()
This method returns true if the this entry in a PermMatrix is granted creation privilege.


isDeletable

public boolean isDeletable()
This method returns true if the this entry in a PermMatrix is granted deletion privilege.


indexNum

public byte indexNum()

This method returns a bit coded byte value representing the permission bits set in this PermEntry object. This byte may be used to access a pre-allocated PermEntry object using the static getPermEntry() method.


union

public final arlut.csd.ganymede.PermEntry union(arlut.csd.ganymede.PermEntry p)

This method returns an immutable PermEntry that allows all permissions allowed by the logical union of this PermEntry and p.


intersection

public final arlut.csd.ganymede.PermEntry intersection(arlut.csd.ganymede.PermEntry p)

This method returns an immutable PermEntry that allows all permissions allowed by the logical intersection of this PermEntry and p.


difference

public final java.lang.String difference(arlut.csd.ganymede.PermEntry p)

This method returns a textual description of the changes between this PermEntry and <p>


addString

private void addString(java.lang.StringBuffer x,
                       java.lang.String y)

toString

public java.lang.String toString()
Diagnostic aid.

Overrides:
toString in class java.lang.Object

getXMLCode

public java.lang.String getXMLCode()

calcIndex

private void calcIndex()