@ConfigurationDescription(properties=) public abstract class AbstractOrgModelExtension extends java.lang.Object implements OrgModelExtension
OrgModelExtensions.
Implementors at least need to implement
authenticate_(String, String, byte[], AFCallbackHandler) for a
simple extension delegating authentication.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONF_AUTH_PRIORITY
Configuration key for the priority to use this org model extension for
authentication compared to other org model extensions.
|
protected java.lang.String |
extensionId
The ID of this extension.
|
protected java.util.logging.Logger |
logger
The logger for this extension.
|
| Constructor and Description |
|---|
AbstractOrgModelExtension(java.lang.String extensionId,
Configuration conf,
LogService logService,
Registry registry)
Creates a new org model extension.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
authenticate_(java.lang.String agentName,
java.lang.String method,
byte[] authenticationData,
AFCallbackHandler callbackHandler)
As documented in
OrgModelExtension.authenticate(String, String, byte[], AFCallbackHandler)
. |
boolean |
authenticate(java.lang.String agentName,
java.lang.String method,
byte[] authenticationData,
AFCallbackHandler callbackHandler)
Authenticates the designated agent by the corresponding name with the
designated authentication method providing the authentication
method-specific data.
|
int |
getAuthenticationPriority()
Gets the priority this org model extension has relative to the other org
model extensions regarding authentication.
|
java.util.Map<java.lang.String,java.lang.String> |
getEntityAttributes(java.lang.String uid,
java.lang.String... attributes)
Gets the designated attributes for the entity uniquely identified via the
designated
uid. |
java.lang.String |
getId()
Gets the unique ID of the org model extension.
|
void |
setEntityAttributes(java.lang.String uid,
java.util.Map<java.lang.String,java.lang.String> attributes)
Sets the designated attributes for the entity uniquely identified via the
designated
uid. |
void |
shutdown()
Shuts the org model extension down, for instance a synchronisation service.
|
void |
start()
Starts the org model extension, for instance a synchronisation service.
|
java.util.concurrent.Future<java.lang.Boolean> |
startSynchronisation(SessionToken session)
Starts a synchronisation manually for the org model data of this extension.
|
public static final java.lang.String CONF_AUTH_PRIORITY
protected final java.util.logging.Logger logger
protected final java.lang.String extensionId
public AbstractOrgModelExtension(java.lang.String extensionId,
Configuration conf,
LogService logService,
Registry registry)
extensionId - The ID of this org model extension. Note that this is
used within the corresponding database table. So it has to be
unique and it should only be changed if the database does not
contain relevant data.conf - The configuration for this org model extension providing the
priority.logService - The log service to retrieve the logger from.registry - The registry which instantiates this extension.public final boolean authenticate(java.lang.String agentName,
java.lang.String method,
byte[] authenticationData,
AFCallbackHandler callbackHandler)
throws AuthenticationException
OrgModelExtensionAuthMethod. The designated callback handler allows the used
authentication method to request additional data while authenticating. For
how to use this refer to
CallbackHandler. For
the used method refer to the corresponding authentication method.
If the authentication with the designated data at this org model extension
is successful, true will be returned. If the data is wrong,
the user is unknown or generally the user cannot be authenticated,
false will be returned. If there are problems authenticating,
e.g. the authentication method is not supported, an
AuthenticationException will be thrown.
authenticate in interface OrgModelExtensionagentName - The unique name of the agent to authenticate. This must
not be null nor the empty string.method - The authentication method to use for authentication. This
must not be null nor the empty string.authenticationData - The data required by the designated
authentication method. Depending on the authentication method this
may be null or empty.callbackHandler - A handler for callbacks allowing the used
authentication method to request further data. This may be
null in case no callbacks are required.AuthenticationException - If there are problems authenticating, e.g.
the authentication method is not supported, an
AuthenticationException will be thrown.protected abstract boolean authenticate_(java.lang.String agentName,
java.lang.String method,
byte[] authenticationData,
AFCallbackHandler callbackHandler)
throws AuthenticationException
OrgModelExtension.authenticate(String, String, byte[], AFCallbackHandler)
. The abstract implementation simply checks if authentication is enabled at
all and throws an appropriate exception if not.AuthenticationExceptionpublic java.lang.String getId()
OrgModelExtensiongetId in interface OrgModelExtensionpublic int getAuthenticationPriority()
OrgModelExtensionPriorities below 0 will be ignored.
getAuthenticationPriority in interface OrgModelExtensionpublic void start()
throws AbortServiceException
OrgModelExtensionstart in interface OrgModelExtensionAbortServiceException - If there are problems starting the org model
extension, an AbortServiceException will be thrown.public void shutdown()
OrgModelExtensionshutdown in interface OrgModelExtensionpublic java.util.Map<java.lang.String,java.lang.String> getEntityAttributes(java.lang.String uid,
java.lang.String... attributes)
OrgModelExtensionuid. If the entity cannot be determined, an empty
map will be returned. If one of the designated attributes does not exist,
it will not be in the returned map. All of the designated attributes that
exist in the external org model will be in the returned map whereas the
attribute name is the key and the attribute value the corresponding map
entry value.getEntityAttributes in interface OrgModelExtensionuid - The ID uniquely identifying an entity in the external org model.attributes - The name of the attributes of the entity identified by
the designated ID. Use null to retrieve all
attributes of the designated entity.null if the designated entity does not exist,
otherwise the values of the designated attributes indexed by the
attribute names. Attributes which do not exist will not be in this
map.public void setEntityAttributes(java.lang.String uid,
java.util.Map<java.lang.String,java.lang.String> attributes)
OrgModelExtensionuid. If the entity cannot be determined, one of the
attributes does not exist or one of the designated attributes has a wrong
value, an OrgModelException will be thrown. The designated
attributes (map key) have to be set to the corresponding values (map entry
value). If a value in the map is null, the corresponding attribute will be
removed.setEntityAttributes in interface OrgModelExtensionuid - The ID uniquely identifying an entity in the external org model.attributes - The names of the attributes which to set and the
corresponding new values.public java.util.concurrent.Future<java.lang.Boolean> startSynchronisation(SessionToken session)
OrgModelExtensionstartSynchronisation in interface OrgModelExtensionsession - The session which is used to check for access rights on this
method.null
shall be returned.