Interface Policy
- All Superinterfaces:
BasePolicy,HttpPolicy
- All Known Subinterfaces:
SecurityPolicy
Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Summary
Modifier and TypeMethodDescriptiondefault io.reactivex.rxjava3.core.CompletableDeprecated, for removal: This API element is subject to removal in a future version.Define the actions to perform during theExecutionPhase.MESSAGE_REQUESTphase.default io.reactivex.rxjava3.core.CompletableDeprecated, for removal: This API element is subject to removal in a future version.default io.reactivex.rxjava3.core.CompletableDeprecated, for removal: This API element is subject to removal in a future version.Define the actions to perform during theExecutionPhase.MESSAGE_RESPONSEphase.default io.reactivex.rxjava3.core.CompletableDeprecated, for removal: This API element is subject to removal in a future version.default io.reactivex.rxjava3.core.CompletableDeprecated, for removal: This API element is subject to removal in a future version.Define the actions to perform during theExecutionPhase.REQUESTphase.default io.reactivex.rxjava3.core.CompletableDeprecated, for removal: This API element is subject to removal in a future version.default io.reactivex.rxjava3.core.CompletableDeprecated, for removal: This API element is subject to removal in a future version.Define the actions to perform during theExecutionPhase.RESPONSEphase.default io.reactivex.rxjava3.core.CompletableDeprecated, for removal: This API element is subject to removal in a future version.Methods inherited from interface io.gravitee.gateway.reactive.api.policy.base.BasePolicy
id
-
Method Details
-
onRequest
Deprecated, for removal: This API element is subject to removal in a future version. -
onResponse
Deprecated, for removal: This API element is subject to removal in a future version. -
onMessageRequest
Deprecated, for removal: This API element is subject to removal in a future version. -
onMessageResponse
Deprecated, for removal: This API element is subject to removal in a future version. -
onRequest
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:HttpPolicyDefine the actions to perform during theExecutionPhase.REQUESTphase. TheonRequest(HttpSimpleExecutionContext)method will be called during the policy chain construction. Once built, the subscription occurs and the execution is triggered. It is important that nothing must be executed before the subscription occurs as it could lead to important side effects. GOOD, the header is added during the execution, at subscription time.Completable onRequest(final HttpSimpleExecutionContext ctx) { return Completable.fromRunnable(() -> request.headers().set("X-DummyHeader", "dummy")); }BAD, the header is added during the build of the policy chain.Completable onRequest(final HttpSimpleExecutionContext ctx) { request.headers().set("X-DummyHeader", "dummy"); return Completable.complete(); }- Specified by:
onRequestin interfaceHttpPolicy- Parameters:
ctx- the current request execution context allowing to access the request, response and attributes.- Returns:
- a
Completablethat must complete when all the actions have been performed.
-
onResponse
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:HttpPolicyDefine the actions to perform during theExecutionPhase.RESPONSEphase. TheonResponse(HttpSimpleExecutionContext)method will be called during the policy chain construction. Once built, the subscription occurs and the execution is triggered. It is important that nothing must be executed before the subscription occurs as it could lead to important side effects. GOOD, the header is added during the execution, at subscription time.Completable onResponse(final HttpSimpleExecutionContext ctx) { return Completable.fromRunnable(() -> response.headers().set("X-DummyHeader", "dummy")); }BAD, the header is added during the build of the policy chain.Completable onResponse(final HttpSimpleExecutionContext ctx) { response.headers().set("X-DummyHeader", "dummy"); return Completable.complete(); }- Specified by:
onResponsein interfaceHttpPolicy- Parameters:
ctx- the current request execution context allowing to access the request, response and attributes.- Returns:
- a
Completablethat must complete when all the actions have been performed.
-
onMessageRequest
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:HttpPolicyDefine the actions to perform during theExecutionPhase.MESSAGE_REQUESTphase. TheonMessageRequest(HttpMessageExecutionContext)method will be called during the policy chain construction. Once built, the subscription occurs and the execution is triggered. It is important that nothing must be executed before the subscription occurs as it could lead to important side effects. GOOD, the header is added during the execution, at subscription time.Completable onMessageRequest(final HttpMessageExecutionContext ctx) { return Completable.fromRunnable(() -> request.headers().set("X-DummyHeader", "dummy")); }BAD, the header is added during the build of the policy chain.Completable onMessageRequest(final HttpMessageExecutionContext ctx) { request.headers().set("X-DummyHeader", "dummy"); return Completable.complete(); }- Specified by:
onMessageRequestin interfaceHttpPolicy- Parameters:
ctx- the current request execution context allowing to access the request, response and attributes.- Returns:
- a
Completablethat must complete when all the actions have been performed.
-
onMessageResponse
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:HttpPolicyDefine the actions to perform during theExecutionPhase.MESSAGE_RESPONSEphase. TheonMessageResponse(HttpMessageExecutionContext)method will be called during the policy chain construction. Once built, the subscription occurs and the execution is triggered. It is important that nothing must be executed before the subscription occurs as it could lead to important side effects. GOOD, the header is added during the execution, at subscription time.Completable onMessageResponse(final HttpMessageExecutionContext ctx) { return Completable.fromRunnable(() -> response.headers().set("X-DummyHeader", "dummy")); }BAD, the header is added during the build of the policy chain.Completable onMessageResponse(final HttpMessageExecutionContext ctx) { response.headers().set("X-DummyHeader", "dummy"); return Completable.complete(); }- Specified by:
onMessageResponsein interfaceHttpPolicy- Parameters:
ctx- the current request execution context allowing to access the request, response and attributes.- Returns:
- a
Completablethat must complete when all the actions have been performed.
-
HttpPolicy