org.universAAL.middleware.bus.permission
Class AccessControl
java.lang.Object
org.universAAL.middleware.bus.permission.AccessControl
public class AccessControl
- extends Object
Management of permissions of bus members.
- Author:
- Carsten Stockloew
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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.AccessControlMode
s 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
Matchable
s.
- Parameters:
owner
- the owning module.busMemberURI
- URI of the BusMember
.m
- the Matchable
s 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.AccessControlMode
s 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.