Package net.shibboleth.idp.saml.metadata.impl

# Class MetadataProviderContainer

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.shared.spring.service.AbstractServiceableComponent<MetadataResolver>
net.shibboleth.idp.saml.metadata.impl.MetadataProviderContainer

All Implemented Interfaces:
  `AutoCloseable`, `Comparable<MetadataProviderContainer>`, `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`, `ServiceableComponent<MetadataResolver>`, `Aware`, `ApplicationContextAware`

public class MetadataProviderContainer extends AbstractServiceableComponent<MetadataResolver> implements Comparable<MetadataProviderContainer>
This class is a sortable container for `MetadataResolver`s, wrapped into a serviceable component.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Class logger.
`private MetadataResolver`
`resolver`
The embedded resolver.
`private Integer`
`sortKey`
The key by which we sort the provider.
`private static int`
`sortKeyValue`
If we autogenerate a sort key it comes from this count.

## Constructor Summary

Constructors
Constructor
Description
`MetadataProviderContainer()`

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(MetadataProviderContainer other)`
`protected void`
`doInitialize()`
`boolean`
`equals(Object other)`
.
`MetadataResolver`
`getComponent()`
`MetadataResolver`
`getEmbeddedResolver()`
Return what we are build around.
`int`
`hashCode()`
`void`
`setEmbeddedResolver(MetadataResolver theResolver)`
Set the `MetadataResolver` to embed.
`void`
`setSortKey(int key)`
Set the sort key.

### Methods inherited from class net.shibboleth.shared.spring.service.AbstractServiceableComponent

`close, doDestroy, getApplicationContext, pinComponent, setApplicationContext, unloadComponent, unpinComponent`

### 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.IdentifiedComponent

`getId`

## Field Details

### sortKeyValue

private static int sortKeyValue
If we autogenerate a sort key it comes from this count.

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### resolver

@NonnullAfterInit private MetadataResolver resolver
The embedded resolver.

### sortKey

@NonnullAfterInit private Integer sortKey
The key by which we sort the provider.

## Constructor Details

### MetadataProviderContainer

public MetadataProviderContainer()

## Method Details

### setSortKey

public void setSortKey(int key)
Set the sort key.

Parameters:
  `key` - what to set

### setEmbeddedResolver

public void setEmbeddedResolver(@Nonnull MetadataResolver theResolver)
Set the `MetadataResolver` to embed.

Parameters:
  `theResolver` - The `MetadataResolver` to embed.

### getEmbeddedResolver

@NonnullAfterInit public MetadataResolver getEmbeddedResolver()
Return what we are build around. Used for testing.

Returns:
  the contained resolver.

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractServiceableComponent<MetadataResolver>`
Throws:
  `ComponentInitializationException`

### compareTo

public int compareTo(MetadataProviderContainer other)

Specified by:
  `compareTo` in interface `Comparable<MetadataProviderContainer>`

### equals

public boolean equals(Object other)
. We are within a spring context and so equality can be determined by ID, however we also test by sortKey just in case.

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### getComponent

@Nonnull public MetadataResolver getComponent()

Specified by:
  `getComponent` in interface `ServiceableComponent<MetadataResolver>`
Specified by:
  `getComponent` in class `AbstractServiceableComponent<MetadataResolver>`