org.universAAL.middleware.bus.permission
Class AccessControl

Package class diagram package AccessControl
java.lang.Object
  extended by org.universAAL.middleware.bus.permission.AccessControl

public class AccessControl
extends Object

Management of permissions of bus members.

Author:
Carsten Stockloew

Nested Class Summary
static class AccessControl.AccessControlMode
           
static class AccessControl.AccessControlModeUpdate
           
 
Field Summary
static AccessControl INSTANCE
           
static String PROP_MODE
           
static String PROP_MODE_UPDATE
           
 
Method Summary
 boolean checkPermission(ModuleContext owner, String busMemberURI, Matchable m)
          Check the permissions of a BusMember for a given Matchable.
<T extends Matchable>
T[]
checkPermission(ModuleContext owner, String busMemberURI, T[] m)
          Check the permissions of a BusMember for a given array of Matchables.
 AccessControl.AccessControlMode getAccessControlMode()
          Get the current mode for access control.
 String getModeName(AccessControl.AccessControlMode mode)
           
 void init(ModuleContext mc)
           
 void registerBusMember(ModuleContext owner, BusMember m, String brokerName)
           
 void unregisterBusMember(ModuleContext owner, BusMember m)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final AccessControl INSTANCE

PROP_MODE

public static final String PROP_MODE
See Also:
Constant Field Values

PROP_MODE_UPDATE

public static final String PROP_MODE_UPDATE
See Also:
Constant Field Values
Method Detail

init

public void init(ModuleContext mc)

getModeName

public String getModeName(AccessControl.AccessControlMode mode)

getAccessControlMode

public AccessControl.AccessControlMode getAccessControlMode()
Get the current mode for access control. Values are from AccessControl.AccessControlMode. If the update policy for this mode is set to AccessControl.AccessControlModeUpdate.always then the property PROP_MODE is always updated and can be set via the container.

Returns:
the current mode for access control

checkPermission

public boolean checkPermission(ModuleContext owner,
                               String busMemberURI,
                               Matchable m)
Check the permissions of a BusMember for a given Matchable.

Parameters:
owner - the owning module.
busMemberURI - URI of the BusMember.
m - the Matchable to check
Returns:
if AccessControl.AccessControlMode is AccessControl.AccessControlMode.full the method return true if the bus member has the permission for the given matchable object. For all other AccessControl.AccessControlModes the return value will always be true (but maybe a log message is issued).
Throws:
NullPointerException - if either the owner or the Matchable is null.

checkPermission

public <T extends Matchable> T[] checkPermission(ModuleContext owner,
                                                 String busMemberURI,
                                                 T[] m)
Check the permissions of a BusMember for a given array of Matchables.

Parameters:
owner - the owning module.
busMemberURI - URI of the BusMember.
m - the Matchables to check
Returns:
if AccessControl.AccessControlMode is AccessControl.AccessControlMode.full the method returns a modified array of all Matchable for which the bus member has permissions. For all other AccessControl.AccessControlModes the return value will always be the given array (but maybe a log message is issued).
Throws:
NullPointerException - if either the owner or the array of Matchables or one of the elements in the array is null.

registerBusMember

public void registerBusMember(ModuleContext owner,
                              BusMember m,
                              String brokerName)

unregisterBusMember

public void unregisterBusMember(ModuleContext owner,
                                BusMember m)


Copyright © 2014 universAAL Consortium. All Rights Reserved.