wt.workflow.definer
Class PermissionSet

java.lang.Object
  extended bywt.workflow.definer.PermissionSet
All Implemented Interfaces:
Externalizable, Serializable

public class PermissionSet
extends Object
implements Externalizable

PermissionSet class stores a set of permissions. Permissions are represented as bits in a permission mask: 1 means permission is granted; 0 that it is not granted. Up to 64 permissions may be stored.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private  long permissionMask
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
 
Constructor Summary
PermissionSet()
          No-arg constructor: empty lisat of permissions.
PermissionSet(long mask)
          Constructs a permission set given a "permission mask."

Supported API: false
 
Method Summary
 void addPermission(String permission)
          Adds a permission to the set of permissions of the variable.
 Enumeration getPermissions()
          Returns an enumeration with all permissions contained in the set.
 boolean hasPermission(String permission)
          Returns true if permission passed as argument is amongst the set of permissions of the variable.
 boolean isEmpty()
          Returns 'true' if there is no permission in the set; 'false' otherwise.
 long longValue()
          

Supported API: false
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(PermissionSet thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 void removePermission(String permission)
          Removes a permission from the set of permissions of the variable.
 void resetPermissions()
          Sets all permissions to 'false.'

Supported API: false
 String toString()
          Returnsa a string representation of the permission set.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

permissionMask

private long permissionMask

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values
Constructor Detail

PermissionSet

public PermissionSet(long mask)
Constructs a permission set given a "permission mask."

Supported API: false

Parameters:
mask -

PermissionSet

public PermissionSet()
No-arg constructor: empty lisat of permissions.

Supported API: false

Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(PermissionSet thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

addPermission

public void addPermission(String permission)
                   throws InvalidPermissionException
Adds a permission to the set of permissions of the variable.

Supported API: false

Parameters:
permission -
Throws:
InvalidPermissionException

removePermission

public void removePermission(String permission)
                      throws InvalidPermissionException
Removes a permission from the set of permissions of the variable.

Supported API: false

Parameters:
permission -
Throws:
InvalidPermissionException

hasPermission

public boolean hasPermission(String permission)
                      throws InvalidPermissionException
Returns true if permission passed as argument is amongst the set of permissions of the variable.

Supported API: false

Parameters:
permission -
Returns:
boolean
Throws:
InvalidPermissionException

resetPermissions

public void resetPermissions()
Sets all permissions to 'false.'

Supported API: false


getPermissions

public Enumeration getPermissions()
                           throws InvalidPermissionException
Returns an enumeration with all permissions contained in the set.

Supported API: false

Returns:
Enumeration
Throws:
InvalidPermissionException

longValue

public long longValue()


Supported API: false

Returns:
long

isEmpty

public boolean isEmpty()
Returns 'true' if there is no permission in the set; 'false' otherwise.

Supported API: false

Returns:
boolean

toString

public String toString()
Returnsa a string representation of the permission set. The representation is basically a list of the permissions in the set.

Supported API: false

Returns:
String