Package net.shibboleth.idp.attribute.resolver.dc.storage.impl

# Class StorageServiceDataConnector

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin<Map<String,IdPAttribute>>
net.shibboleth.idp.attribute.resolver.AbstractDataConnector
net.shibboleth.idp.attribute.resolver.dc.impl.AbstractSearchDataConnector<StorageServiceSearch,StorageMappingStrategy>
net.shibboleth.idp.attribute.resolver.dc.storage.impl.StorageServiceDataConnector

All Implemented Interfaces:
  `DataConnector`, `ResolverPlugin<Map<String,IdPAttribute>>`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`, `UnmodifiableComponent`, `DisposableBean`

public class StorageServiceDataConnector extends AbstractSearchDataConnector<StorageServiceSearch,StorageMappingStrategy>
This class implements a `DataConnector` that obtains data from a `StorageService`.

Since:
  4.1.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`generatedAttributeID`
ID of the attribute generated by this data connector if simple result mapping used.
`private boolean`
`noResultAnError`
Whether no record is an error.
`private StorageService`
`storageService`
The `StorageService` to use.

## Constructor Summary

Constructors
Constructor
Description
`StorageServiceDataConnector()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`doInitialize()`
`String`
`getGeneratedAttributeID()`
Get the ID of the attribute generated by this connector if simple result mapping used.
`protected Map<String,IdPAttribute>`
`retrieveAttributes(StorageServiceSearch executable)`
Attempts to retrieve attributes from the data source.
`void`
`setGeneratedAttributeID(String id)`
Set the ID of the attribute generated by this connector if simple result mapping used.
`void`
`setNoResultAnError(boolean flag)`
Sets whether the lack of a returned record constitutes an error.
`void`
`setStorageService(StorageService service)`
Set the `StorageService` to use.

### Methods inherited from class net.shibboleth.idp.attribute.resolver.dc.impl.AbstractSearchDataConnector

`doDataConnectorResolve, getExecutableSearchBuilder, getMappingStrategy, getResultsCache, getValidator, isFailFastInitialize, retrieveAttributes, setExecutableSearchBuilder, setFailFastInitialize, setMappingStrategy, setResultsCache, setValidator`

### Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractDataConnector

`doResolve, getExportAttributes, getFailoverDataConnectorId, getLastFail, getLastSuccess, getLogPrefix, getNoRetryDelay, setExportAttributes, setFailoverDataConnectorId, setLastFail, setLastSuccess, setNoRetryDelay`

### Methods inherited from class net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin

`doDestroy, equals, getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, hashCode, isPropagateResolutionExceptions, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setPropagateResolutionExceptions`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.shibboleth.shared.component.DestructableComponent

`destroy, isDestroyed`

### Methods inherited from interface org.springframework.beans.factory.DisposableBean

`destroy`

### Methods inherited from interface net.shibboleth.shared.component.IdentifiedComponent

`getId`

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

### Methods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin

`getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, isPropagateResolutionExceptions, resolve`

## Field Details

### storageService

@NonnullAfterInit private StorageService storageService
The `StorageService` to use.

### generatedAttributeID

@Nullable private String generatedAttributeID
ID of the attribute generated by this data connector if simple result mapping used.

### noResultAnError

private boolean noResultAnError
Whether no record is an error.

## Constructor Details

### StorageServiceDataConnector

public StorageServiceDataConnector()
Constructor.

## Method Details

### setStorageService

public void setStorageService(@Nonnull StorageService service)
Set the `StorageService` to use.

Parameters:
  `service` - storage service to use

### setNoResultAnError

public void setNoResultAnError(boolean flag)
Sets whether the lack of a returned record constitutes an error.

Parameters:
  `flag` - flag to set

### getGeneratedAttributeID

@Nullable public String getGeneratedAttributeID()
Get the ID of the attribute generated by this connector if simple result mapping used.

Returns:
  ID of the attribute generated by this connector

### setGeneratedAttributeID

public void setGeneratedAttributeID(@Nullable String id)
Set the ID of the attribute generated by this connector if simple result mapping used.

Parameters:
  `id` - what to set.

### doInitialize

public void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractSearchDataConnector<StorageServiceSearch,StorageMappingStrategy>`
Throws:
  `ComponentInitializationException`

### retrieveAttributes

@Nullable protected Map<String,IdPAttribute> retrieveAttributes(@Nonnull StorageServiceSearch executable) throws ResolutionException
Attempts to retrieve attributes from the data source.

Specified by:
  `retrieveAttributes` in class `AbstractSearchDataConnector<StorageServiceSearch,StorageMappingStrategy>`
Parameters:
  `executable` - used to retrieve data from the data source
Returns:
  attributes
Throws:
  `ResolutionException` - thrown if there is a problem retrieving data from the data source