private static final class SslEndpointImpl.ExceptionOutboundRequestIterator extends Object implements OutboundRequestIterator
Modifier and Type | Field and Description |
---|---|
private boolean |
done |
private Exception |
exception |
Constructor and Description |
---|
ExceptionOutboundRequestIterator(Exception exception) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Returns
true if this iterator supports making at
least one more attempt to communicate the request, and
false otherwise. |
OutboundRequest |
next()
Initiates an attempt to communicate the request to the remote
endpoint.
|
private final Exception exception
private boolean done
ExceptionOutboundRequestIterator(Exception exception)
public boolean hasNext()
OutboundRequestIterator
true
if this iterator supports making at
least one more attempt to communicate the request, and
false
otherwise.
If this method returns true
, then it is
guaranteed that the next invocation of next
on
this iterator will not throw a NoSuchElementException
.
If next
has been invoked on this iterator and
the previous invocation of next
returned an
OutboundRequest
, then this method should not be
invoked until that OutboundRequest
has been used
to attempt to communicate the request and a failure has
occurred.
The security context in which this method is invoked may be
used for subsequent verification of security permissions; see
the next
method specification for more details.
hasNext
in interface OutboundRequestIterator
true
if this iterator supports making
another attempt to communicate the request, and
false
otherwisepublic OutboundRequest next() throws IOException
OutboundRequestIterator
After an invocation of hasNext
returns
true
, it is guaranteed that the next invocation of
this method will not throw a NoSuchElementException
.
If successful, this method returns an
OutboundRequest
to use to write the request data
and read the response. Even if this method throws an IOException
or a SecurityException
, the iteration of
attempts to communicate the request may continue with another
invocation of hasNext
.
The implementation verifies that the user's security context
has all of the security permissions necessary to communicate
the current request attempt with the remote endpoint and to
satisfy any required constraints, as appropriate to the
implementation of this interface. The implementation is
allowed, however, to indicate failure of such a permission
check by either throwing a SecurityException
from
this method or, after returning an OutboundRequest
from this method, throwing a SecurityException
from some subsequent operation on the
OutboundRequest
or its streams. If such a
SecurityException
is thrown, request data must not
have been transmitted to the server (that is, if an
OutboundRequest
has been returned, its getDeliveryStatus
method
must return false
), and the client's identity must
not have been revealed to the server.
Also, the implementation of this method or the returned
OutboundRequest
must eventually verify that the
client and server have the requisite principals and credentials
to satisfy any required constraints and if not, throw an
IOException
. If such an IOException
is thrown, request data must not have been transmitted to the
server.
In verifying any such permission requirement or credential,
the implementation is allowed to use the security context in
effect for this or any previous invocation of a method on this
iterator or the security context in effect for any operation on
the OutboundRequest
returned by this or any
previous invocation of this method on this iterator.
Therefore, this iterator and the OutboundRequest
instances that it produces should be used in a uniform security
context.
next
in interface OutboundRequestIterator
OutboundRequest
to use to write the
request data and read the responseIOException
- if an I/O exception occurs while performing
this operation; in this event, the recipient may have received
an indication of the request initiation attemptCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.