@Extensible @BrokerExtension @ThreadSafety(level=INTERFACE_THREADSAFE) public abstract class PolicyAdvice extends java.lang.Object implements UnboundIDExtension, ExampleUsageProvider
dsconfig create-policy-advice \ --advice-name "{name}" \ --type third-party \ --policy-name "{policy-name}" \ --rule-name "{rule-name}" \ --set "extension-class:{class-name}" \ --set "extension-argument:{name=value}" \ --set "advice-arguments:{name=jexlExpression}" \ --set "evaluation-order-index:{index}where "{name}" is the name to use for the policy advice instance, "{class-name}" is the fully-qualified name of the Java class that extends
com.unboundid.directory.sdk.broker.api.PolicyAdvice
,
"{policy-name}" and {rule-name}" identify the policy and
policy rule, respectively, that will contain this advice expression.
{name=jexlExpression} pairs specified using advice-arguments identify
arguments whose value may be specified or computed during policy evaluation
before being passed into this advice implementation.
"{index}" is an integer from 1 to 9999 that is used to determine the
order in which this type of advice should be invoked relative to other advice
that may be returned from the same policy evaluation.
"{name=value}" pairs specified using extension-arguments are values
that are provided to the advice implementation at initialization time.
If multiple advice arguments should be provided at each invocation, then the
"--set advice-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 |
---|
PolicyAdvice()
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 |
finalizePolicyAdvice()
Performs any cleanup which may be necessary when this policy advice
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 |
initializePolicyAdvice(BrokerContext serverContext,
PolicyAdviceConfig adviceCfg,
com.unboundid.util.args.ArgumentParser parser)
Initializes this Policy Advice implementation.
|
com.unboundid.scim2.common.messages.ErrorResponse |
onScimDeny(AdviceContext context,
com.unboundid.scim2.common.messages.ErrorResponse errorInfo)
This method is called if this advice is returned by policy when a SCIM
request is denied.
|
public PolicyAdvice()
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 initializePolicyAdvice(BrokerContext serverContext, PolicyAdviceConfig adviceCfg, 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.adviceCfg
- The general configuration for this policy advice.parser
- The argument parser which has been initialized from
the configuration for this policy advice.java.lang.Exception
- If a problem occurs while initializing this
policy advice.public void finalizePolicyAdvice()
public com.unboundid.scim2.common.messages.ErrorResponse onScimDeny(AdviceContext context, com.unboundid.scim2.common.messages.ErrorResponse errorInfo) throws com.unboundid.scim2.common.exceptions.ScimException
context
- AdviceContext containing any arguments passed
from policy.errorInfo
- the default error information that will be
returned if nothing is done by the advice
implementation.com.unboundid.scim2.common.exceptions.ScimException
- if an internal error occurs trying to generate
the advice.