Bees v0.5.0 API

bees.core
Class Capability

java.lang.Object
  |
  +--bees.core.Capability
Direct Known Subclasses:
AccountSpec, AsymmetricSealer, AsymmetricSealFactory, AsymmetricUnsealer, Clock, Console, EventChannel, FlowIdentifier, FlowIdentifierFactory, bees.core.security.GuardedStringCapability, KeySpec, LoggerSpec, Meter, NeighborImpl, NetworkInterface, NetworkService, NodeOSExternalChannel, NodeSpec, PathSpec, SymmetricSeal, SymmetricSealFactory, SystemClass, SystemPackage

public abstract class Capability
extends java.lang.Object

Base class for capabilities in the system. A "capability" in the context of Bees is an object with the following attributes:


Field Summary
static Permission DELETE_PERMISSION
          Permission to delete a capability.
protected  long id
          The unique kernel object store identifier for this capability.
static long INVALID_ID
          An invalid capability identifier.
 
Constructor Summary
protected Capability()
          Construct an empty capability.
 
Method Summary
 void checkPermission(Permission what)
          Check if this capability has the permissions to do something.
protected  void clear()
          Clear the internal bits binding this capability to the kernel object.
 Permission clonePermission(Permission what)
           
 void deleteCapability()
          Delete a capability.
 boolean equals(java.lang.Object obj)
           
protected  void fromBytes(byte[] flattened)
          Bind this capability to the given object.
protected  void fromBytes(byte[] flattened, CapabilityEnvelope[] sub)
          Bind this capability to the given object.
 void revoke()
          Revoke access to the capability.
 void revokedPermission(Permission what)
          Callback...
 void revokePermission(Permission what)
           
 void revokePermissions(PermissionSet ps)
           
 java.lang.String toString()
           
protected  boolean valid()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DELETE_PERMISSION

public static final Permission DELETE_PERMISSION
Permission to delete a capability.

INVALID_ID

public static final long INVALID_ID
An invalid capability identifier.

id

protected long id
The unique kernel object store identifier for this capability.
Constructor Detail

Capability

protected Capability()
Construct an empty capability.
Method Detail

clear

protected void clear()
Clear the internal bits binding this capability to the kernel object.

valid

protected final boolean valid()
Returns:
True if this capability is still valid.

fromBytes

protected void fromBytes(byte[] flattened)
                  throws java.lang.Exception
Bind this capability to the given object.
Parameters:
flattened - The object this capability gives access too.
Throws:
java.lang.Exception - if anything goes wrong during initialization.

fromBytes

protected void fromBytes(byte[] flattened,
                         CapabilityEnvelope[] sub)
                  throws java.lang.Exception
Bind this capability to the given object.
Parameters:
flattened - The object this capability gives access too.
sub - Null or any sub-capabilities.
Throws:
java.lang.Exception - if anything goes wrong during initialization.

revoke

public void revoke()
Revoke access to the capability.

checkPermission

public final void checkPermission(Permission what)
                           throws PermissionException
Check if this capability has the permissions to do something.
Parameters:
what - The permission to check for.
Throws:
PermissionException - if the capability doesn't has the permission.

clonePermission

public final Permission clonePermission(Permission what)
                                 throws PermissionException
Parameters:
what - The permission to clone.
Returns:
A clone of the capabilities Permission that matches the given one.
Throws:
PermissionException - if the capability doesn't has the permission.

revokePermission

public final void revokePermission(Permission what)
Parameters:
what - The Permission to revoke.

revokePermissions

public final void revokePermissions(PermissionSet ps)
Parameters:
ps - The set of Permissions to revoke.

revokedPermission

public void revokedPermission(Permission what)
Callback... XXX Implement me.

deleteCapability

public final void deleteCapability()
Delete a capability.

equals

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

Bees v0.5.0 API

This documentation is Copyright (C) 2002 The University of Utah. All Rights Reserved. See the individual source files for distribution terms.
Documentation, software, and mailing lists for Bees v0.5.0 can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/