Interface Policy

All Superinterfaces:
BasePolicy, HttpPolicy
All Known Subinterfaces:
SecurityPolicy

@Deprecated(forRemoval=true) public interface Policy extends HttpPolicy
Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • onRequest

      default io.reactivex.rxjava3.core.Completable onRequest(HttpExecutionContext ctx)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • onResponse

      default io.reactivex.rxjava3.core.Completable onResponse(HttpExecutionContext ctx)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • onMessageRequest

      default io.reactivex.rxjava3.core.Completable onMessageRequest(MessageExecutionContext ctx)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • onMessageResponse

      default io.reactivex.rxjava3.core.Completable onMessageResponse(MessageExecutionContext ctx)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • onRequest

      default io.reactivex.rxjava3.core.Completable onRequest(HttpPlainExecutionContext ctx)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: HttpPolicy
      Define the actions to perform during the ExecutionPhase.REQUEST phase. The onRequest(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:
      onRequest in interface HttpPolicy
      Parameters:
      ctx - the current request execution context allowing to access the request, response and attributes.
      Returns:
      a Completable that must complete when all the actions have been performed.
    • onResponse

      default io.reactivex.rxjava3.core.Completable onResponse(HttpPlainExecutionContext ctx)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: HttpPolicy
      Define the actions to perform during the ExecutionPhase.RESPONSE phase. The onResponse(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:
      onResponse in interface HttpPolicy
      Parameters:
      ctx - the current request execution context allowing to access the request, response and attributes.
      Returns:
      a Completable that must complete when all the actions have been performed.
    • onMessageRequest

      default io.reactivex.rxjava3.core.Completable onMessageRequest(HttpMessageExecutionContext ctx)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: HttpPolicy
      Define the actions to perform during the ExecutionPhase.MESSAGE_REQUEST phase. The onMessageRequest(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:
      onMessageRequest in interface HttpPolicy
      Parameters:
      ctx - the current request execution context allowing to access the request, response and attributes.
      Returns:
      a Completable that must complete when all the actions have been performed.
    • onMessageResponse

      default io.reactivex.rxjava3.core.Completable onMessageResponse(HttpMessageExecutionContext ctx)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: HttpPolicy
      Define the actions to perform during the ExecutionPhase.MESSAGE_RESPONSE phase. The onMessageResponse(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:
      onMessageResponse in interface HttpPolicy
      Parameters:
      ctx - the current request execution context allowing to access the request, response and attributes.
      Returns:
      a Completable that must complete when all the actions have been performed.