@Extensible @BrokerExtension @ThreadSafety(level=INTERFACE_THREADSAFE) public abstract class PolicyObligation extends java.lang.Object implements UnboundIDExtension, ExampleUsageProvider
dsconfig create-policy-obligation \ --obligation-name "{name}" \ --type third-party \ --policy-name "{policy-name}" \ --rule-name "{rule-name}" \ --set "extension-class:{class-name}" \ --set "extension-argument:{name=value}" \ --set "obligation-arguments:{name=jexlExpression}" \ --set "evaluation-order-index:{index}where "{name}" is the name to use for the policy obligation instance, "{class-name}" is the fully-qualified name of the Java class that extends
com.unboundid.directory.sdk.broker.api.PolicyObligation
,
"{policy-name}" and {rule-name}" identify the policy and
policy rule, respectively, that will contain this obligation expression.
{name=jexlExpression} pairs specified using obligation-arguments
identify arguments whose value may be specified or computed during policy
evaluation before being passed into this obligation implementation.
"{index}" is an integer from 1 to 9999 that is used to determine the
order in which this type of obligation should be invoked relative to other
obligations that may be returned from the same policy evaluation.
"{name=value}" pairs specified using extension-arguments are
constant-valued arguments that are provided to the obligation implementation
at initialization time.
If multiple obligation arguments should be provided at each invocation, then
the "--set obligation-argument:{name=jexlExpression}
"
option should be provided multiple times.
If multiple initialization arguments should be provided to the extension,
then the "--set extension-argument:{name=value}
"
option should be provided multiple times.Constructor and Description |
---|
PolicyObligation()
No-args constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
defineConfigArguments(com.unboundid.util.args.ArgumentParser parser)
Updates the provided argument parser to define any configuration arguments
which may be used by this extension.
|
void |
finalizePolicyObligation()
Performs any cleanup which may be necessary when this policy obligation
is to be taken out of service.
|
java.util.Map<java.util.List<java.lang.String>,java.lang.String> |
getExamplesArgumentSets()
Retrieves a map containing examples of configurations that may be used for
this extension.
|
abstract java.lang.String[] |
getExtensionDescription()
Retrieves a human-readable description for this extension.
|
abstract java.lang.String |
getExtensionName()
Retrieves a human-readable name for this extension.
|
void |
initializePolicyObligation(BrokerContext serverContext,
PolicyObligationConfig config,
com.unboundid.util.args.ArgumentParser parser)
Initializes this Policy Obligation implementation.
|
com.unboundid.scim2.common.GenericScimResource |
onScimCreate(ObligationContext context,
com.unboundid.scim2.common.GenericScimResource resource)
This method is invoked if this obligation is returned from policy during a
SCIM create operation.
|
void |
onScimDelete(ObligationContext context)
This method is invoked if this obligation is returned from policy during
a SCIM delete operation.
|
com.unboundid.scim2.common.messages.PatchRequest |
onScimModify(ObligationContext context,
com.unboundid.scim2.common.messages.PatchRequest patchRequest)
This method is invoked if this obligation is returned from policy during a
SCIM PATCH or PUT operation.
|
com.unboundid.scim2.common.GenericScimResource |
onScimRetrieve(ObligationContext context,
com.unboundid.scim2.common.GenericScimResource resource)
This method is invoked if this obligation is returned from policy during a
SCIM retrieve operation.
|
java.lang.String |
onScimSearch(ObligationContext context,
java.lang.String filter)
This method is invoked if this obligation is returned from policy prior to
a SCIM search operation.
|
public PolicyObligation()
public abstract java.lang.String getExtensionName()
getExtensionName
in interface UnboundIDExtension
public abstract java.lang.String[] getExtensionDescription()
getExtensionDescription
in interface UnboundIDExtension
null
or an empty array if no description should be available.public java.util.Map<java.util.List<java.lang.String>,java.lang.String> getExamplesArgumentSets()
getExamplesArgumentSets
in interface ExampleUsageProvider
null
or empty if there should
not be any example argument sets.public void defineConfigArguments(com.unboundid.util.args.ArgumentParser parser) throws com.unboundid.util.args.ArgumentException
defineConfigArguments
in interface Configurable
parser
- The argument parser to be updated with the configuration
arguments which may be used by this extension.com.unboundid.util.args.ArgumentException
- If a problem is encountered while updating the
provided argument parser.public void initializePolicyObligation(BrokerContext serverContext, PolicyObligationConfig config, com.unboundid.util.args.ArgumentParser parser) throws java.lang.Exception
serverContext
- A handle to the server context for the server in
which this extension is running.config
- The general configuration for this policy
obligation.parser
- The argument parser which has been initialized from
the configuration for this policy obligation.java.lang.Exception
- If a problem occurs while initializing this
policy obligation.public void finalizePolicyObligation()
public com.unboundid.scim2.common.GenericScimResource onScimCreate(ObligationContext context, com.unboundid.scim2.common.GenericScimResource resource) throws NotFulfilledException, com.unboundid.scim2.common.exceptions.ScimException
context
- ObligationContext containing any arguments passed
from policy.resource
- The resource to be created.NotFulfilledException
- thrown if the obligation cannot be
fulfilled. Will abort the SCIM create operation and
will cause an unauthorized response to be returned to
the caller.com.unboundid.scim2.common.exceptions.ScimException
- thrown if an internal error occurs.public void onScimDelete(ObligationContext context) throws NotFulfilledException, com.unboundid.scim2.common.exceptions.ScimException
context
- ObligationContext containing any arguments passed
from policy.NotFulfilledException
- thrown if the obligation cannot be
fulfilled. Will abort the SCIM delete operation and
will cause an unauthorized response to be returned to
the caller.com.unboundid.scim2.common.exceptions.ScimException
- thrown if an internal error occurs.public com.unboundid.scim2.common.messages.PatchRequest onScimModify(ObligationContext context, com.unboundid.scim2.common.messages.PatchRequest patchRequest) throws NotFulfilledException, com.unboundid.scim2.common.exceptions.ScimException
context
- ObligationContext containing any arguments passed
from policy.patchRequest
- A normalized SCIM patch request describing the
requested modifications. A "normalized" patch request
in this context means that the patch will have the
following characteristics:
For add and remove operations, sub-attributes will
always appear in the value portion rather than in the
path.
Paths referencing core attributes will not contain the
schema URN.
Operations without a path will be broken down into
separate operations for each attribute originally
referenced in the value portion.NotFulfilledException
- thrown if the obligation cannot be
fulfilled. Will abort the SCIM modify operation and
will cause an unauthorized response to be returned to
the caller.com.unboundid.scim2.common.exceptions.ScimException
- thrown if an internal error occurs.public com.unboundid.scim2.common.GenericScimResource onScimRetrieve(ObligationContext context, com.unboundid.scim2.common.GenericScimResource resource) throws NotFulfilledException, com.unboundid.scim2.common.exceptions.ScimException
context
- ObligationContext containing any arguments passed
from policy.resource
- The resource to be returned to the client.NotFulfilledException
- thrown if the obligation cannot be
fulfilled. Will abort the SCIM retrieve operation and
will cause an unauthorized response to be returned to
the caller.com.unboundid.scim2.common.exceptions.ScimException
- thrown if an internal error occurs.public java.lang.String onScimSearch(ObligationContext context, java.lang.String filter) throws NotFulfilledException, com.unboundid.scim2.common.exceptions.ScimException
context
- ObligationContext containing any arguments passed
from policy.filter
- The SCIM search filter requested by the client, or
null if no filter was specified.NotFulfilledException
- thrown if the obligation cannot be
fulfilled. Will abort the SCIM search operation and
will cause an unauthorized response to be returned to
the caller.com.unboundid.scim2.common.exceptions.ScimException
- thrown if an internal error occurs.