Class ChainingEncryptedKeyResolver.ChainingIterator

java.lang.Object
org.opensaml.xmlsec.encryption.support.ChainingEncryptedKeyResolver.ChainingIterator
All Implemented Interfaces:
Iterator<EncryptedKey>
Enclosing class:
ChainingEncryptedKeyResolver

public class ChainingEncryptedKeyResolver.ChainingIterator extends Object implements Iterator<EncryptedKey>
Implementation of Iterator to be (indirectly) returned by ChainingEncryptedKeyResolver.
  • Field Details

    • log

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

      @Nonnull private final ChainingEncryptedKeyResolver parent
      The chaining encrypted key resolver which owns this instance.
    • encryptedData

      @Nonnull private final EncryptedData encryptedData
      The EncryptedData context for resolution.
    • validRecipients

      @Nonnull @Unmodifiable @NotLive private final Set<String> validRecipients
      The recipients for resolution.
    • resolverIterator

      @Nonnull private final Iterator<EncryptedKeyResolver> resolverIterator
      The iterator over resolvers in the chain.
    • keyIterator

      private Iterator<EncryptedKey> keyIterator
      The iterator over EncryptedKey instances from the current resolver.
    • currentResolver

      private EncryptedKeyResolver currentResolver
      The current resolver which is returning encrypted keys.
    • nextKey

      @Nullable private EncryptedKey nextKey
      The next encrypted key that is safe to return.
  • Constructor Details

    • ChainingIterator

      public ChainingIterator(@Nonnull ChainingEncryptedKeyResolver resolver, @Nonnull EncryptedData encData, @Nullable Set<String> recipientIDs)
      Constructor.
      Parameters:
      resolver - the ChainingEncryptedKeyResolver parent
      encData - the EncryptedData context for resolution
      recipientIDs - the recipients for resolution
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<EncryptedKey>
    • next

      public EncryptedKey next()
      Specified by:
      next in interface Iterator<EncryptedKey>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<EncryptedKey>
    • getNextKeyIterator

      @Nullable private Iterator<EncryptedKey> getNextKeyIterator()
      Get the iterator from the next resolver in the chain.
      Returns:
      an iterator of encrypted keys, or null if none remain
    • getNextKey

      @Nullable private EncryptedKey getNextKey()
      Get the next encrypted key that will be returned by this iterator.
      Returns:
      the next encrypted key to return, or null if none remain