org.knopflerfish.framework.permissions
Class PermissionsHandle

java.lang.Object
  extended by org.knopflerfish.framework.permissions.PermissionsHandle

public class PermissionsHandle
extends java.lang.Object


Constructor Summary
PermissionsHandle(Framework fw)
           
 
Method Summary
 java.security.PermissionCollection createPermissionCollection(java.lang.String loc, Bundle b, java.io.InputStream localPerms)
          Create the permissionCollection assigned to the bundle.
 ConditionalPermissionAdminImpl getConditionalPermissionAdminService()
          Get ConditionalPermissionAdmin service.
 PermissionAdminImpl getPermissionAdminService()
          Get PermissionAdmin service.
 java.security.PermissionCollection getPermissionCollection(java.lang.Long bid)
          Gets the permissionCollection assigned to the bundle with the specified id.
 boolean purgePermissionCollection(java.lang.Long bid, java.security.PermissionCollection pc)
          Remove cached information about specified bundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionsHandle

public PermissionsHandle(Framework fw)
Method Detail

getPermissionAdminService

public PermissionAdminImpl getPermissionAdminService()
Get PermissionAdmin service.

Returns:
PermissionAdmin service object.

getConditionalPermissionAdminService

public ConditionalPermissionAdminImpl getConditionalPermissionAdminService()
Get ConditionalPermissionAdmin service.

Returns:
ConditionalPermissionAdmin service object.

getPermissionCollection

public java.security.PermissionCollection getPermissionCollection(java.lang.Long bid)
Gets the permissionCollection assigned to the bundle with the specified id. The collection contains the configured permissions for the bundle location plus implict gratnet permissions (i.e FilePermission for the data area).

Parameters:
bid - The bundle id whose permissions are to be returned.
Returns:
The permissions assigned to the bundle with the specified location, or the default permissions if that bundle has not been assigned any permissions or does not yet exist.

createPermissionCollection

public java.security.PermissionCollection createPermissionCollection(java.lang.String loc,
                                                                     Bundle b,
                                                                     java.io.InputStream localPerms)
Create the permissionCollection assigned to the bundle. We return a permission wrapper so that we can change it dynamically.

Parameters:
loc - Location of bundle whose permissions are to be created.
b - Bundle whose permissions are to be created.
localPerms - New local permissions for the bundle.
Returns:
The permissions assigned to the bundle with the specified location

purgePermissionCollection

public boolean purgePermissionCollection(java.lang.Long bid,
                                         java.security.PermissionCollection pc)
Remove cached information about specified bundle.

Parameters:
bid - Bundle ID for bundle to be purged.
Returns:
True if we purged something, which means that we purged the last permissionCollection not a zombie.