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
-AcmeResource
type 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
ConstructorDescriptionResourceIterator
(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, wait
Methods 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
-Login
to bind this iterator tofield
- Field name to be used in the JSON responsestart
- URL of the first JSON array, may benull
for an empty iteratorcreator
- Creator for anAcmeResource
that is bound to the givenLogin
andURL
.
-
-
Method Details
-
hasNext
Checks if there is another object in the result.- Specified by:
hasNext
in 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:
next
in 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 theIterator
interface.- Specified by:
remove
in interfaceIterator<T extends AcmeResource>
-