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
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a HTTP CONNECT request.static classRepresents a HTTP DELETE request.static classRepresents a HTTP GET request.static classRepresents a HTTP HEAD request.static classRepresents a HTTP OPTIONS request.static classRepresents a HTTP POST request.static classRepresents a HTTP PUT request.static classRepresents a HTTP TRACE request.Nested classes/interfaces inherited from class org.jgrapes.http.events.Request
Request.In, Request.OutNested 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
Constructors -
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, tieToMethods inherited from class org.jgrapes.core.internal.EventBase
disableTracking, enqueued, firstResultAssigned, isTracked, onCompletionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jgrapes.core.Associator
associated, associated, associated, associatedGetMethods 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.Outevent 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
-