Class WebClientSession
- All Implemented Interfaces:
MutinyDelegate
WebClientSession.
This client wraps a WebClient and makes it session aware adding features to it:
- Per client headers, to be send with every request
- Per client cookies, to be send with every request
- Automatic storage and sending of cookies received from the server(s)
The client honors the cookies attributes:
- domain
- path
- secure
- max-age and expires
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Tommaso Nolli
- See Also:
-
WebClientSession
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWebClientSession(io.vertx.ext.web.client.WebClientSession delegate) Create a new instance ofWebClientSessiondelegating to the given (non-null) instance ofWebClientSession.WebClientSession(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionaddHeader(CharSequence name, CharSequence value) Configure the client to add an HTTP header to every request.addHeader(CharSequence name, Iterable<CharSequence> values) Configure the client to add an HTTP header to every request.Configure the client to add an HTTP header to every request.Configure the client to add an HTTP header to every request.io.vertx.ext.web.client.spi.CookieStoreReturns this client'sCookieStorestatic WebClientSessionCreate a session aware web client using the providedwebClientinstance.static WebClientSessionCreate a session aware web client using the providedwebClientinstance.booleanio.vertx.ext.web.client.WebClientSessionGet the delegate instance.inthashCode()static WebClientSessionnewInstance(io.vertx.ext.web.client.WebClientSession delegate) Creates a new instance of theWebClientSession.removeHeader(CharSequence name) Removes a previously added header.removeHeader(String name) Removes a previously added header.toString()io.smallrye.mutiny.Uni<Boolean>updateSSLOptions(io.vertx.core.net.ClientSSLOptions arg0) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.io.smallrye.mutiny.Uni<Boolean>updateSSLOptions(io.vertx.core.net.ClientSSLOptions arg0, boolean arg1) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndAwait(io.vertx.core.net.ClientSSLOptions arg0) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndAwait(io.vertx.core.net.ClientSSLOptions arg0, boolean arg1) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndForget(io.vertx.core.net.ClientSSLOptions arg0) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndForget(io.vertx.core.net.ClientSSLOptions arg0, boolean arg1) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.Methods inherited from class io.vertx.mutiny.ext.web.client.WebClient
close, create, create, create, create, create, create, create, delete, delete, delete, delete, delete, delete, deleteAbs, deleteAbs, get, get, get, get, get, get, getAbs, getAbs, head, head, head, head, head, head, headAbs, headAbs, newInstance, patch, patch, patch, patch, patch, patch, patchAbs, patchAbs, post, post, post, post, post, post, postAbs, postAbs, put, put, put, put, put, put, putAbs, putAbs, request, request, request, request, request, request, request, request, request, request, request, request, request, request, request, requestAbs, requestAbs, requestAbs, requestAbs, wrap, wrap
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
WebClientSession
public WebClientSession(io.vertx.ext.web.client.WebClientSession delegate) Create a new instance ofWebClientSessiondelegating to the given (non-null) instance ofWebClientSession. -
WebClientSession
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.client.WebClientSession getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Overrides:
getDelegatein classWebClient- Returns:
- the delegate instance
-
updateSSLOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.ClientSSLOptions arg0, boolean arg1) Update the client with new SSL
options, the update happens if the options object is valid and different from the existing options object.The
optionsobject is compared using itsequalsmethod against the existing options to prevent an update when the objects are equals since loading options can be costly, this can happen for share TCP servers. When object are equals, settingforcetotrueforces the update.The boolean succeeded uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Overrides:
updateSSLOptionsin classWebClient- Parameters:
options- the new SSL optionsforce- force the update when options are equals- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
WebClient.updateSSLOptions(ClientSSLOptions, boolean)
-
updateSSLOptionsAndAwait
Update the client with new SSL
options, the update happens if the options object is valid and different from the existing options object.The
optionsobject is compared using itsequalsmethod against the existing options to prevent an update when the objects are equals since loading options can be costly, this can happen for share TCP servers. When object are equals, settingforcetotrueforces the update.The boolean succeeded underlying uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method returns a
Boolean. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Overrides:
updateSSLOptionsAndAwaitin classWebClient- Parameters:
options- the new SSL optionsforce- force the update when options are equals- Returns:
- The operation result
- See Also:
-
WebClient.updateSSLOptions(ClientSSLOptions, boolean)
-
updateSSLOptionsAndForget
public WebClientSession updateSSLOptionsAndForget(io.vertx.core.net.ClientSSLOptions arg0, boolean arg1) Update the client with new SSL
options, the update happens if the options object is valid and different from the existing options object.The
optionsobject is compared using itsequalsmethod against the existing options to prevent an update when the objects are equals since loading options can be costly, this can happen for share TCP servers. When object are equals, settingforcetotrueforces the update.The boolean succeeded underlying uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method ignores the
Booleanresult or any failure.- Overrides:
updateSSLOptionsAndForgetin classWebClient- Parameters:
options- the new SSL optionsforce- force the update when options are equals- Returns:
- The current instance to chain operations if needed.
- See Also:
-
WebClient.updateSSLOptions(ClientSSLOptions, boolean)
-
updateSSLOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.ClientSSLOptions arg0) Update the client with new SSL
options, the update happens if the options object is valid and different from the existing options object.The boolean succeeded uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Overrides:
updateSSLOptionsin classWebClient- Parameters:
options- the new SSL options- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
WebClient.updateSSLOptions(ClientSSLOptions)
-
updateSSLOptionsAndAwait
Update the client with new SSL
options, the update happens if the options object is valid and different from the existing options object.The boolean succeeded underlying uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method returns a
Boolean. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Overrides:
updateSSLOptionsAndAwaitin classWebClient- Parameters:
options- the new SSL options- Returns:
- The operation result
- See Also:
-
WebClient.updateSSLOptions(ClientSSLOptions)
-
updateSSLOptionsAndForget
Update the client with new SSL
options, the update happens if the options object is valid and different from the existing options object.The boolean succeeded underlying uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method ignores the
Booleanresult or any failure.- Overrides:
updateSSLOptionsAndForgetin classWebClient- Parameters:
options- the new SSL options- Returns:
- The current instance to chain operations if needed.
- See Also:
-
WebClient.updateSSLOptions(ClientSSLOptions)
-
create
Create a session aware web client using the providedwebClientinstance.- Parameters:
webClient- the web client instance- Returns:
- the created client
-
create
public static WebClientSession create(WebClient webClient, io.vertx.ext.web.client.spi.CookieStore cookieStore) Create a session aware web client using the providedwebClientinstance.- Parameters:
webClient- the web client instance- Returns:
- the created client
-
addHeader
Configure the client to add an HTTP header to every request.- Parameters:
name- the header namevalue- the header value- Returns:
- a reference to this, so the API can be used fluently
-
addHeader
Configure the client to add an HTTP header to every request.- Parameters:
name- the header namevalue- the header value- Returns:
- a reference to this, so the API can be used fluently
-
addHeader
Configure the client to add an HTTP header to every request.- Parameters:
name- the header namevalues- the header value- Returns:
- a reference to this, so the API can be used fluently
-
addHeader
Configure the client to add an HTTP header to every request.- Parameters:
name- the header namevalues- the header value- Returns:
- a reference to this, so the API can be used fluently
-
removeHeader
Removes a previously added header.- Parameters:
name- the header name- Returns:
- a reference to this, so the API can be used fluently
-
removeHeader
Removes a previously added header.- Parameters:
name- the header name- Returns:
- a reference to this, so the API can be used fluently
-
cookieStore
public io.vertx.ext.web.client.spi.CookieStore cookieStore()Returns this client'sCookieStoreAll cookies added to this store will be sent with every request. The CookieStore honors the domain, path, secure and max-age properties of received cookies and is automatically updated with cookies present in responses received by this client.
- Returns:
- this client's cookie store
-
newInstance
Creates a new instance of theWebClientSession. -
hashCode
public int hashCode() -
equals
-
toString
-