Package org.jgrapes.http.events
Class Request.Out
java.lang.Object
- All Implemented Interfaces:
Future<Void>
,Associator
,Eligible
- Direct Known Subclasses:
Request.Out.Connect
,Request.Out.Delete
,Request.Out.Get
,Request.Out.Head
,Request.Out.Options
,Request.Out.Post
,Request.Out.Put
,Request.Out.Trace
The base class for all outgoing HTTP requests.
Outgoing request flow upstream and are served externally.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents a HTTP CONNECT request.static class
Represents a HTTP DELETE request.static class
Represents a HTTP GET request.static class
Represents a HTTP HEAD request.static class
Represents a HTTP OPTIONS request.static class
Represents a HTTP POST request.static class
Represents a HTTP PUT request.static class
Represents a HTTP TRACE request.Nested classes/interfaces inherited from class org.jgrapes.http.events.Request
Request.In, Request.Out
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Field Summary
Fields inherited from class org.jgrapes.core.internal.EventBase
completed, completionEvents, invokedFor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the connected callback.The HTTP request that will be sent by the event.Returns an absolute URI of the request.setConnectedCallback
(BiConsumer<Request.Out, SocketIOChannel> connectedCallback) Sets a “connected callback”.toString()
Methods inherited from class org.jgrapes.core.Event
addCompletionEvent, associated, cancel, channels, channels, completionEvents, currentResults, defaultCriterion, forChannels, get, get, handled, handlingError, isCancelled, isDone, isEligibleFor, isStopped, processedBy, results, results, resumeHandling, setAssociated, setChannels, setRequiresResult, setResult, stop, suspendHandling, suspendHandling, tieTo
Methods inherited from class org.jgrapes.core.internal.EventBase
disableTracking, enqueued, firstResultAssigned, isTracked, onCompletion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jgrapes.core.Associator
associated, associated, associated, associatedGet
Methods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Constructor Details
-
Out
Instantiates a new request.- Parameters:
method
- the methodurl
- the url
-
-
Method Details
-
setConnectedCallback
Sets a “connected callback”.When the
Request.Out
event is created, the network connection is not yet known. Some header fields’ values, however, need e.g. the port information from the connection. Therefore a callback may be set which is invoked when the connection has been obtained that will be used to send the request.- Parameters:
connectedCallback
- the connected callback- Returns:
- the out
-
connectedCallback
Returns the connected callback.- Returns:
- the connected callback, if set
-
httpRequest
The HTTP request that will be sent by the event.- Returns:
- the http request
-
requestUri
Returns an absolute URI of the request.- Returns:
- the URI
-
toString
-