Package org.opensaml.security.credential.impl

# Class AbstractChainingCredentialResolver.CredentialIterator

java.lang.Object
org.opensaml.security.credential.impl.AbstractChainingCredentialResolver.CredentialIterator

All Implemented Interfaces:
  `Iterator<Credential>`

Enclosing class:
  AbstractChainingCredentialResolver<ResolverType extends CredentialResolver>

public class AbstractChainingCredentialResolver.CredentialIterator extends Object implements Iterator<Credential>
Implementation of `Iterator` to be returned (indirectly) by `ChainingCredentialResolver`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Iterator<Credential>`
`credentialIterator`
The iterator over Credential instances from the current resolver.
`private CriteriaSet`
`critSet`
The criteria set on which to base resolution.
`private CredentialResolver`
`currentResolver`
The current resolver which is returning credentials.
`private final org.slf4j.Logger`
`log`
Logger.
`private Credential`
`nextCredential`
The next credential that is safe to return.
`private AbstractChainingCredentialResolver<ResolverType>`
`parent`
The chaining credential resolver which owns this instance.
`private final Iterator<ResolverType>`
`resolverIterator`
The iterator over resolvers in the chain.

## Constructor Summary

Constructors
Constructor
Description
`CredentialIterator(AbstractChainingCredentialResolver<ResolverType> resolver, CriteriaSet criteriaSet)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`private Credential`
`getNextCredential()`
Get the next credential that will be returned by this iterator.
`private Iterator<Credential>`
`getNextCredentialIterator()`
Get the iterator from the next resolver in the chain.
`boolean`
`hasNext()`
`Credential`
`next()`
`void`
`remove()`

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

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

### Methods inherited from interface java.util.Iterator

`forEachRemaining`

## Field Details

### log

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

### parent

@Nonnull private AbstractChainingCredentialResolver<ResolverType extends CredentialResolver> parent
The chaining credential resolver which owns this instance.

### critSet

@Nullable private CriteriaSet critSet
The criteria set on which to base resolution.

### resolverIterator

@Nonnull private final Iterator<ResolverType extends CredentialResolver> resolverIterator
The iterator over resolvers in the chain.

### credentialIterator

private Iterator<Credential> credentialIterator
The iterator over Credential instances from the current resolver.

### currentResolver

private CredentialResolver currentResolver
The current resolver which is returning credentials.

### nextCredential

@Nullable private Credential nextCredential
The next credential that is safe to return.

## Constructor Details

### CredentialIterator

public CredentialIterator(@Nonnull AbstractChainingCredentialResolver<ResolverType> resolver, @Nullable CriteriaSet criteriaSet)
Constructor.

Parameters:
  `resolver` - the chaining parent of this iterable
  `criteriaSet` - the set of criteria which is input to the underyling resolvers

## Method Details

### hasNext

public boolean hasNext()

Specified by:
  `hasNext` in interface `Iterator<Credential>`

### next

public Credential next()

Specified by:
  `next` in interface `Iterator<Credential>`

### remove

public void remove()

Specified by:
  `remove` in interface `Iterator<Credential>`

### getNextCredentialIterator

@Nullable private Iterator<Credential> getNextCredentialIterator()
Get the iterator from the next resolver in the chain.

Returns:
  an iterator of credentials, or null if none is available

### getNextCredential

@Nullable private Credential getNextCredential()
Get the next credential that will be returned by this iterator.

Returns:
  the next credential to return, or null if none is available