@Extensible @BrokerExtension @ThreadSafety(level=INTERFACE_THREADSAFE) public abstract class StoreAdapter extends java.lang.Object implements UnboundIDExtension, Configurable, ExampleUsageProvider
After the Store Adapter is initialized (via the initializeStoreAdapter()
method), all methods will be guarded by a call to isAvailable() to
make sure that the adapter is currently connected and ready to service
requests. If this returns false, the SCIMResourceType will return an
appropriate 503 response code to clients until the adapter becomes available
again.
dsconfig create-store-adapter \
---adapter-name "{name}" \
--type third-party \
--set "extension-class:{class-name}" \
--set "extension-argument:{name=value}"
where "{name}" is the name to use for the store adapter
instance, "{class-name}" is the fully-qualified name of the Java class
that extends
com.unboundid.directory.sdk.broker.api.StoreAdapter,
and "{name=value}" represents name-value pairs for any arguments to
provide to the store adapter. If multiple arguments should be
provided to the extension, then the
"--set extension-argument:{name=value}" option should be
provided multiple times.| Constructor and Description |
|---|
StoreAdapter()
Creates a new instance of this store adapter.
|
| Modifier and Type | Method and Description |
|---|---|
abstract java.lang.String |
create(StoreCreateRequest request)
Create the specified entry in the native data store.
|
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.
|
abstract void |
delete(StoreDeleteRequest request)
Delete the specified entry from the native data store.
|
void |
finalizeStoreAdapter()
This hook is called when the SCIMResourceType is disabled or the Broker
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.
|
java.util.Collection<StoreAttributeDefinition> |
getNativeSchema()
Retrieves a collection of attribute definitions describing the schema
for objects supported by this Store Adapter.
|
void |
initializeStoreAdapter(BrokerContext serverContext,
StoreAdapterConfig config,
com.unboundid.util.args.ArgumentParser parser)
Initializes this store adapter.
|
abstract boolean |
isAvailable()
Determines whether this Store Adapter is currently available and
in-service.
|
abstract java.lang.String |
retrieve(StoreRetrieveRequest request)
Fetches the specified entry.
|
abstract void |
search(StoreSearchRequest request)
Search for entries in the native store which could match the
specified criteria.
|
abstract java.lang.String |
update(StoreUpdateRequest request)
Update the specified entry in the native data store.
|
public StoreAdapter()
initializeStoreAdapter(com.unboundid.directory.sdk.broker.types.BrokerContext, com.unboundid.directory.sdk.broker.config.StoreAdapterConfig, com.unboundid.util.args.ArgumentParser) method.public abstract java.lang.String getExtensionName()
getExtensionName in interface UnboundIDExtensionpublic abstract java.lang.String[] getExtensionDescription()
getExtensionDescription in interface UnboundIDExtensionnull
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 ExampleUsageProvidernull 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 Configurableparser - 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 initializeStoreAdapter(BrokerContext serverContext, StoreAdapterConfig config, com.unboundid.util.args.ArgumentParser parser) throws java.lang.Exception
BrokerContext in
a class member so that it can be used elsewhere in the implementation.
The default implementation is empty.
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.java.lang.Exception - If a problem occurs while initializing this store
adapter.public void finalizeStoreAdapter()
The default implementation is empty.
public java.util.Collection<StoreAttributeDefinition> getNativeSchema()
public abstract boolean isAvailable()
false in the case that all
backend servers are down, for example; during this time the
SCIMResourceType will return an appropriate 503 response code to clients.true if the Store Adapter initialized and connected;
false otherwise.public abstract java.lang.String retrieve(StoreRetrieveRequest request) throws com.unboundid.scim2.common.exceptions.ScimException
request - The retrieve request.com.unboundid.scim2.common.exceptions.ScimException - If there is a problem fulfilling the request.public abstract void search(StoreSearchRequest request) throws com.unboundid.scim2.common.exceptions.ScimException
request - The search request.com.unboundid.scim2.common.exceptions.ScimException - If there is a problem fulfilling the search request.public abstract java.lang.String create(StoreCreateRequest request) throws com.unboundid.scim2.common.exceptions.ScimException
request - The create request.com.unboundid.scim2.common.exceptions.ScimException - If there is a problem creating the entry.public abstract java.lang.String update(StoreUpdateRequest request) throws com.unboundid.scim2.common.exceptions.ScimException
request - The update request.com.unboundid.scim2.common.exceptions.ScimException - If there is a problem modifying the entry.public abstract void delete(StoreDeleteRequest request) throws com.unboundid.scim2.common.exceptions.ScimException
request - The delete request.com.unboundid.scim2.common.exceptions.ScimException - If there is a problem deleting the entry.