Class StoreAdapterPlugin
- java.lang.Object
-
- com.unboundid.directory.sdk.broker.api.StoreAdapterPlugin
-
- All Implemented Interfaces:
Configurable
,ExampleUsageProvider
,UnboundIDExtension
@Extensible @BrokerExtension @ThreadSafety(level=INTERFACE_THREADSAFE) public abstract class StoreAdapterPlugin extends java.lang.Object implements UnboundIDExtension, Configurable, ExampleUsageProvider
This class defines an API that must be implemented by extensions that need to intercept operations processed by a Store Adapter. The API has pre-request methods to intercept and make changes to store adapter requests before they are processed by the Store Adapter, and corresponding post-request methods to intercept and make changes to the results returned by the Store Adapter. All SCIM attributes in this API refer to native Store Adapter attributes, not attributes in the external client SCIM schema.The Store Adapter Plugin is defined in the configuration and then referenced by a Store Adapter configuration object.
-
-
Constructor Summary
Constructors Constructor Description StoreAdapterPlugin()
Creates a new instance of this store adapter plugin.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
defineConfigArguments(ArgumentParser parser)
Updates the provided argument parser to define any configuration arguments which may be used by this extension.void
finalizeStoreAdapterPlugin()
This hook is called when the store adapter plugin is disabled or the PingAuthorize Server shuts down.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
initializeStoreAdapterPlugin(BrokerContext serverContext, StoreAdapterPluginConfig config, ArgumentParser parser)
Initializes this store adapter plugin.void
postCreate(StorePostCreateRequestContext context)
This method is called after an entry is created in the native data store.void
postDelete(StorePostDeleteRequestContext context)
This method is called after an entry is deleted in the native data store.void
postRetrieve(StorePostRetrieveRequestContext context)
This method is called after an entry is retrieved from the native data store.void
postSearchEntry(StorePostSearchEntryContext context)
This method is called for each entry found during a search in the native data store.void
postUpdate(StorePostUpdateRequestContext context)
This method is called after an entry is updated in the native data store.void
preCreate(StorePreCreateRequestContext context)
This method is called before an entry is created in the native data store.void
preDelete(StorePreDeleteRequestContext context)
This method is called before an entry is deleted in the native data store.void
preRetrieve(StorePreRetrieveRequestContext context)
This method is called before an entry is retrieved from the native data store in the following cases: To fetch an entry for a SCIM retrieve operation.void
preSearch(StorePreSearchRequestContext context)
This method is called before searching for entries in the native data store.void
preUpdate(StorePreUpdateRequestContext context)
This method is called before an entry is updated in the native data store.
-
-
-
Constructor Detail
-
StoreAdapterPlugin
public StoreAdapterPlugin()
Creates a new instance of this store adapter plugin. All implementations must include a default constructor, but any initialization should generally be done in theinitializeStoreAdapterPlugin(com.unboundid.directory.sdk.broker.types.BrokerContext, com.unboundid.directory.sdk.broker.config.StoreAdapterPluginConfig, com.unboundid.util.args.ArgumentParser)
method.
-
-
Method Detail
-
getExtensionName
public abstract java.lang.String getExtensionName()
Retrieves a human-readable name for this extension.- Specified by:
getExtensionName
in interfaceUnboundIDExtension
- Returns:
- A human-readable name for this extension.
-
getExtensionDescription
public abstract java.lang.String[] getExtensionDescription()
Retrieves a human-readable description for this extension. Each element of the array that is returned will be considered a separate paragraph in generated documentation.- Specified by:
getExtensionDescription
in interfaceUnboundIDExtension
- Returns:
- A human-readable description for this extension, or
null
or an empty array if no description should be available.
-
getExamplesArgumentSets
public 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. The map key should be a list of sample arguments, and the corresponding value should be a description of the behavior that will be exhibited by the extension when used with that configuration.- Specified by:
getExamplesArgumentSets
in interfaceExampleUsageProvider
- Returns:
- A map containing examples of configurations that may be used for
this extension. It may be
null
or empty if there should not be any example argument sets.
-
defineConfigArguments
public void defineConfigArguments(ArgumentParser parser) throws ArgumentException
Updates the provided argument parser to define any configuration arguments which may be used by this extension. The argument parser may also be updated to define relationships between arguments (e.g., to specify required, exclusive, or dependent argument sets).- Specified by:
defineConfigArguments
in interfaceConfigurable
- Parameters:
parser
- The argument parser to be updated with the configuration arguments which may be used by this extension.- Throws:
ArgumentException
- If a problem is encountered while updating the provided argument parser.
-
initializeStoreAdapterPlugin
public void initializeStoreAdapterPlugin(BrokerContext serverContext, StoreAdapterPluginConfig config, ArgumentParser parser) throws java.lang.Exception
Initializes this store adapter plugin. Any initialization should be performed here. This method should generally store theBrokerContext
in a class member so that it can be used elsewhere in the implementation.The default implementation is empty.
- Parameters:
serverContext
- A handle to the server context for the server in which this extension is running. Extensions should typically store this in a class member.config
- The general configuration for this object.parser
- The argument parser which has been initialized from the configuration for this store adapter plugin.- Throws:
java.lang.Exception
- If a problem occurs while initializing this store adapter plugin.
-
finalizeStoreAdapterPlugin
public void finalizeStoreAdapterPlugin()
This hook is called when the store adapter plugin is disabled or the PingAuthorize Server shuts down. Any clean-up of this store adapter plugin should be performed here.The default implementation is empty.
-
preCreate
public void preCreate(StorePreCreateRequestContext context) throws com.unboundid.scim2.common.exceptions.ScimException
This method is called before an entry is created in the native data store.- Parameters:
context
- The store adapter request context.- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- If thrown, the operation will be aborted and a corresponding SCIM ErrorResponse will be returned to the client.
-
postCreate
public void postCreate(StorePostCreateRequestContext context) throws com.unboundid.scim2.common.exceptions.ScimException
This method is called after an entry is created in the native data store. This method will not be called if the create fails.- Parameters:
context
- The store adapter request context.- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- If thrown, a corresponding SCIM ErrorResponse will be returned to the client. No attempt is made to roll back the committed create operation.
-
preRetrieve
public void preRetrieve(StorePreRetrieveRequestContext context) throws com.unboundid.scim2.common.exceptions.ScimException
This method is called before an entry is retrieved from the native data store in the following cases:- To fetch an entry for a SCIM retrieve operation.
- To fetch an entry from a secondary store adapter for each primary store adapter entry obtained during a SCIM search.
- To fetch an entry from the primary store adapter for each secondary store adapter entry obtained when a SCIM search filter is processed by a secondary store adapter.
- Parameters:
context
- The store adapter request context.- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- If thrown, the operation will be aborted and a corresponding SCIM ErrorResponse will be returned to the client.
-
postRetrieve
public void postRetrieve(StorePostRetrieveRequestContext context) throws com.unboundid.scim2.common.exceptions.ScimException
This method is called after an entry is retrieved from the native data store. This method will not be called if the retrieve fails.- Parameters:
context
- The store adapter request context.- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- If thrown, a corresponding SCIM ErrorResponse will be returned to the client.
-
preUpdate
public void preUpdate(StorePreUpdateRequestContext context) throws com.unboundid.scim2.common.exceptions.ScimException
This method is called before an entry is updated in the native data store.- Parameters:
context
- The store adapter request context.- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- If thrown, the operation will be aborted and a corresponding SCIM ErrorResponse will be returned to the client.
-
postUpdate
public void postUpdate(StorePostUpdateRequestContext context) throws com.unboundid.scim2.common.exceptions.ScimException
This method is called after an entry is updated in the native data store. This method will not be called if the update fails.- Parameters:
context
- The store adapter request context.- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- If thrown, a corresponding SCIM ErrorResponse will be returned to the client. No attempt is made to roll back the committed update operation.
-
preDelete
public void preDelete(StorePreDeleteRequestContext context) throws com.unboundid.scim2.common.exceptions.ScimException
This method is called before an entry is deleted in the native data store.- Parameters:
context
- The store adapter request context.- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- If thrown, the operation will be aborted and a corresponding SCIM ErrorResponse will be returned to the client.
-
postDelete
public void postDelete(StorePostDeleteRequestContext context) throws com.unboundid.scim2.common.exceptions.ScimException
This method is called after an entry is deleted in the native data store. This method will not be called if the delete fails.- Parameters:
context
- The store adapter request context.- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- If thrown, a corresponding SCIM ErrorResponse will be returned to the client. No attempt is made to roll back the committed delete operation.
-
preSearch
public void preSearch(StorePreSearchRequestContext context) throws com.unboundid.scim2.common.exceptions.ScimException
This method is called before searching for entries in the native data store.Note that the contract for store adapter searches allows the store adapter to return a superset of entries matching the original search filter. The results from the store adapter are subsequently filtered by the PingAuthorize Server.
- Parameters:
context
- The store adapter request context.- Throws:
com.unboundid.scim2.common.exceptions.ScimException
- If thrown, the operation will be aborted and a corresponding SCIM ErrorResponse will be returned to the client.
-
postSearchEntry
public void postSearchEntry(StorePostSearchEntryContext context)
This method is called for each entry found during a search in the native data store. This method will not be called if the search fails.Note that the contract for store adapter searches allows the store adapter to return a superset of entries matching the original search filter. The results from the store adapter are subsequently filtered by the PingAuthorize Server.
- Parameters:
context
- The store adapter request context.
-
-