org.knopflerfish.framework.permissions
Class PermissionAdminImpl

java.lang.Object
  extended by org.knopflerfish.framework.permissions.PermissionAdminImpl
All Implemented Interfaces:
PermissionAdmin

public class PermissionAdminImpl
extends java.lang.Object
implements PermissionAdmin

Implementation of the PermissionAdmin service.

See Also:
PermissionAdmin

Field Summary
static java.lang.String SPEC_VERSION
           
 
Constructor Summary
PermissionAdminImpl(org.knopflerfish.framework.permissions.PermissionInfoStorage pis)
           
 
Method Summary
 PermissionInfo[] getDefaultPermissions()
          Gets the default permissions.
 java.lang.String[] getLocations()
          Returns the bundle locations that have permissions assigned to them, that is, bundle locations for which an entry exists in the permission table.
 PermissionInfo[] getPermissions(java.lang.String location)
          Gets the permissions assigned to the bundle with the specified location.
 void setDefaultPermissions(PermissionInfo[] perms)
          Sets the default permissions.
 void setPermissions(java.lang.String location, PermissionInfo[] perms)
          Assigns the specified permissions to the bundle with the specified location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPEC_VERSION

public static final java.lang.String SPEC_VERSION
See Also:
Constant Field Values
Constructor Detail

PermissionAdminImpl

public PermissionAdminImpl(org.knopflerfish.framework.permissions.PermissionInfoStorage pis)
Method Detail

getPermissions

public PermissionInfo[] getPermissions(java.lang.String location)
Gets the permissions assigned to the bundle with the specified location.

Specified by:
getPermissions in interface PermissionAdmin
Parameters:
location - The location of the bundle whose permissions are to be returned.
Returns:
The permissions assigned to the bundle with the specified location, or null if that bundle has not been assigned any permissions.

setPermissions

public void setPermissions(java.lang.String location,
                           PermissionInfo[] perms)
Assigns the specified permissions to the bundle with the specified location.

Specified by:
setPermissions in interface PermissionAdmin
Parameters:
location - The location of the bundle that will be assigned the permissions.
permissions - The permissions to be assigned, or null if the specified location is to be removed from the permission table.
Throws:
java.lang.SecurityException - If the caller does not have AllPermission.

getLocations

public java.lang.String[] getLocations()
Returns the bundle locations that have permissions assigned to them, that is, bundle locations for which an entry exists in the permission table.

Specified by:
getLocations in interface PermissionAdmin
Returns:
The locations of bundles that have been assigned any permissions, or null if the permission table is empty.

getDefaultPermissions

public PermissionInfo[] getDefaultPermissions()
Gets the default permissions.

These are the permissions granted to any bundle that does not have permissions assigned to its location.

Specified by:
getDefaultPermissions in interface PermissionAdmin
Returns:
The default permissions, or null if default permissions have not been defined.

setDefaultPermissions

public void setDefaultPermissions(PermissionInfo[] perms)
Sets the default permissions.

These are the permissions granted to any bundle that does not have permissions assigned to its location.

Specified by:
setDefaultPermissions in interface PermissionAdmin
Parameters:
permissions - The default permissions, or null if the default permissions are to be removed from the permission table.
Throws:
java.lang.SecurityException - If the caller does not have AllPermission.