Module org.shredzone.acme4j
Package org.shredzone.acme4j.connector
Class ResourceIterator<T extends AcmeResource>
java.lang.Object
org.shredzone.acme4j.connector.ResourceIterator<T>
- Type Parameters:
T-AcmeResourcetype to iterate over
- All Implemented Interfaces:
Iterator<T>
An
Iterator that fetches a batch of URLs from the ACME server, and generates
AcmeResource instances.-
Constructor Summary
ConstructorsConstructorDescriptionResourceIterator(Login login, String field, URL start, BiFunction<Login, URL, T> creator) Creates a newResourceIterator. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
ResourceIterator
public ResourceIterator(Login login, String field, @Nullable URL start, BiFunction<Login, URL, T> creator) Creates a newResourceIterator.- Parameters:
login-Loginto bind this iterator tofield- Field name to be used in the JSON responsestart- URL of the first JSON array, may benullfor an empty iteratorcreator- Creator for anAcmeResourcethat is bound to the givenLoginandURL.
-
-
Method Details
-
hasNext
Checks if there is another object in the result.- Specified by:
hasNextin interfaceIterator<T extends AcmeResource>- Throws:
AcmeProtocolException- if the next batch of URLs could not be fetched from the server
-
next
Returns the next object of the result.- Specified by:
nextin interfaceIterator<T extends AcmeResource>- Throws:
AcmeProtocolException- if the next batch of URLs could not be fetched from the serverNoSuchElementException- if there are no more entries
-
remove
Unsupported operation, only here to satisfy theIteratorinterface.- Specified by:
removein interfaceIterator<T extends AcmeResource>
-