public final class AccessControl extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AccessControl.AccessControlMode |
static class |
AccessControl.AccessControlModeUpdate |
Modifier and Type | Field and Description |
---|---|
static AccessControl |
INSTANCE |
static String |
PROP_MODE |
static String |
PROP_MODE_UPDATE |
Modifier and Type | Method and Description |
---|---|
boolean |
checkPermission(ModuleContext owner,
String busMemberURI,
Matchable m)
|
<T extends Matchable> |
checkPermission(ModuleContext owner,
String busMemberURI,
T[] m)
|
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) |
public static final AccessControl INSTANCE
public static final String PROP_MODE
public static final String PROP_MODE_UPDATE
public void init(ModuleContext mc)
public String getModeName(AccessControl.AccessControlMode mode)
public AccessControl.AccessControlMode getAccessControlMode()
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.public boolean checkPermission(ModuleContext owner, String busMemberURI, Matchable m)
owner
- the owning module.busMemberURI
- URI of the BusMember
.m
- the Matchable
to checkAccessControl.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).NullPointerException
- if either the owner or the Matchable is null.public <T extends Matchable> T[] checkPermission(ModuleContext owner, String busMemberURI, T[] m)
owner
- the owning module.busMemberURI
- URI of the BusMember
.m
- the Matchable
s to checkAccessControl.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).NullPointerException
- if either the owner or the array of Matchables or one of the
elements in the array is null.public void registerBusMember(ModuleContext owner, BusMember m, String brokerName)
public void unregisterBusMember(ModuleContext owner, BusMember m)
Copyright © 2018 universAAL Consortium. All rights reserved.