io.vertx.rxjava.ext.web.api.contract.openapi3

## Class OpenAPI3RouterFactory

- java.lang.Object
- - io.vertx.rxjava.ext.web.api.contract.openapi3.OpenAPI3RouterFactory

- All Implemented Interfaces:
    RouterFactory

      public class OpenAPI3RouterFactory
      extends Object
      implements RouterFactory

  Interface for OpenAPI3RouterFactory.
  To add an handler, use `addHandlerByOperationId(java.lang.String, io.vertx.core.Handler<io.vertx.rxjava.ext.web.RoutingContext>)`
  Usage example:

       OpenAPI3RouterFactory.create(vertx, "src/resources/spec.yaml", asyncResult -> {
        if (!asyncResult.succeeded()) {
           // IO failure or spec invalid else {
           OpenAPI3RouterFactory routerFactory = asyncResult.result();
           routerFactory.addHandlerByOperationId("operation_id", routingContext -> {
              // Do something
           }, routingContext -> {
              // Do something with failure handler
           });
           Router router = routerFactory.getRouter();
        }
       });
       }

  Handlers are loaded in this order:
  1. Body handler (Customizable with
  2. Custom global handlers configurable with
  3. Global security handlers defined in upper spec level
  4. Operation specific security handlers
  5. Generated validation handler
  6. User handlers or "Not implemented" handler

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<OpenAPI3RouterFactory>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OpenAPI3RouterFactory(Object delegate)`
    `OpenAPI3RouterFactory(OpenAPI3RouterFactory delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `OpenAPI3RouterFactory` | `addFailureHandlerByOperationId(String operationId, Handler<RoutingContext> failureHandler)` Deprecated.
    `RouterFactory` | `addGlobalHandler(Handler<RoutingContext> globalHandler)` Deprecated.
    `OpenAPI3RouterFactory` | `addHandlerByOperationId(String operationId, Handler<RoutingContext> handler)` Deprecated.
    `RouterFactory` | `addSecurityHandler(String securitySchemaName, Handler<RoutingContext> handler)` Deprecated.
    `OpenAPI3RouterFactory` | `addSecuritySchemaScopeValidator(String securitySchemaName, String scopeName, Handler<RoutingContext> handler)` Deprecated.
    `static void` | `create(Vertx vertx, String url)` Deprecated.
    `static void` | `create(Vertx vertx, String url, Handler<AsyncResult<OpenAPI3RouterFactory>> handler)` Deprecated.
    `static void` | `create(Vertx vertx, String url, List<JsonObject> auth)` Deprecated.
    `static void` | `create(Vertx vertx, String url, List<JsonObject> auth, Handler<AsyncResult<OpenAPI3RouterFactory>> handler)` Deprecated.
    `boolean` | `equals(Object o)`
    `OpenAPI3RouterFactory` | `getDelegate()`
    `RouterFactoryOptions` | `getOptions()` Deprecated.
    `Router` | `getRouter()` Deprecated.
    `Handler<RoutingContext>` | `getValidationFailureHandler()` Deprecated.
    `int` | `hashCode()`
    `OpenAPI3RouterFactory` | `mountOperationToEventBus(String operationId, String address)` Deprecated.
    `OpenAPI3RouterFactory` | `mountServiceFromTag(String tag, String address)` Deprecated.
    `OpenAPI3RouterFactory` | `mountServicesFromExtensions()` Deprecated.
    `static OpenAPI3RouterFactory` | `newInstance(OpenAPI3RouterFactory arg)`
    `static Single<OpenAPI3RouterFactory>` | `rxCreate(Vertx vertx, String url)` Deprecated.
    `static Single<OpenAPI3RouterFactory>` | `rxCreate(Vertx vertx, String url, List<JsonObject> auth)` Deprecated.
    `RouterFactory` | `setBodyHandler(BodyHandler bodyHandler)` Deprecated.
    `RouterFactory` | `setExtraOperationContextPayloadMapper(java.util.function.Function<RoutingContext,JsonObject> extraOperationContextPayloadMapper)` Deprecated.
    `RouterFactory` | `setNotImplementedFailureHandler(Handler<RoutingContext> notImplementedFailureHandler)` Deprecated.
    `RouterFactory` | `setOptions(RouterFactoryOptions options)` Deprecated.
    `RouterFactory` | `setValidationFailureHandler(Handler<RoutingContext> validationFailureHandler)` Deprecated.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface io.vertx.rxjava.ext.web.api.contract.RouterFactory

      `newInstance`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<OpenAPI3RouterFactory> __TYPE_ARG

  - ### Constructor Detail

    - #### OpenAPI3RouterFactory

          public OpenAPI3RouterFactory(OpenAPI3RouterFactory delegate)

    - #### OpenAPI3RouterFactory

          public OpenAPI3RouterFactory(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public OpenAPI3RouterFactory getDelegate()

      Specified by:
        `getDelegate` in interface `RouterFactory`

    - #### addSecurityHandler

          @Deprecated
          public RouterFactory addSecurityHandler(String securitySchemaName,
                                                              Handler<RoutingContext> handler)

      Deprecated.
      Mount to paths that have to follow a security schema a security handler
      Specified by:
        `addSecurityHandler` in interface `RouterFactory`
      Parameters:
        `securitySchemaName` -
        `handler` -
      Returns:

    - #### setOptions

          @Deprecated
          public RouterFactory setOptions(RouterFactoryOptions options)

      Deprecated.
      Set options of router factory. For more info
      Specified by:
        `setOptions` in interface `RouterFactory`
      Parameters:
        `options` -
      Returns:

    - #### getOptions

          @Deprecated
          public RouterFactoryOptions getOptions()

      Deprecated.
      Get options of router factory. For more info
      Specified by:
        `getOptions` in interface `RouterFactory`
      Returns:

    - #### getRouter

          @Deprecated
          public Router getRouter()

      Deprecated.
      Construct a new router based on spec. It will fail if you are trying to mount a spec with security schemes without assigned handlers
      Note: Router is constructed in this function, so it will be respected the path definition ordering.
      Specified by:
        `getRouter` in interface `RouterFactory`
      Returns:

    - #### getValidationFailureHandler

          @Deprecated
          public Handler<RoutingContext> getValidationFailureHandler()

      Deprecated.
      Specified by:
        `getValidationFailureHandler` in interface `RouterFactory`
      Returns:

    - #### setValidationFailureHandler

          @Deprecated
          public RouterFactory setValidationFailureHandler(Handler<RoutingContext> validationFailureHandler)

      Deprecated.
      Set default validation failure handler. You can enable/disable this feature from
      Specified by:
        `setValidationFailureHandler` in interface `RouterFactory`
      Parameters:
        `validationFailureHandler` -
      Returns:
        this object

    - #### setNotImplementedFailureHandler

          @Deprecated
          public RouterFactory setNotImplementedFailureHandler(Handler<RoutingContext> notImplementedFailureHandler)

      Deprecated.
      Set not implemented failure handler. It's called when you don't define an handler for a specific operation. You can enable/disable this feature from
      Specified by:
        `setNotImplementedFailureHandler` in interface `RouterFactory`
      Parameters:
        `notImplementedFailureHandler` -
      Returns:
        this object

    - #### setBodyHandler

          @Deprecated
          public RouterFactory setBodyHandler(BodyHandler bodyHandler)

      Deprecated.
      Supply your own BodyHandler if you would like to control body limit, uploads directory and deletion of uploaded files
      Specified by:
        `setBodyHandler` in interface `RouterFactory`
      Parameters:
        `bodyHandler` -
      Returns:
        self

    - #### addGlobalHandler

          @Deprecated
          public RouterFactory addGlobalHandler(Handler<RoutingContext> globalHandler)

      Deprecated.
      Add global handler to be applied prior to `Router` being generated.
      Please note that you should not add a body handler inside that list. If you want to modify the body handler, please use
      Specified by:
        `addGlobalHandler` in interface `RouterFactory`
      Parameters:
        `globalHandler` -
      Returns:
        this object

    - #### setExtraOperationContextPayloadMapper

          @Deprecated
          public RouterFactory setExtraOperationContextPayloadMapper(java.util.function.Function<RoutingContext,JsonObject> extraOperationContextPayloadMapper)

      Deprecated.
      When set, this function is called while creating the payload of `OperationRequest`
      Specified by:
        `setExtraOperationContextPayloadMapper` in interface `RouterFactory`
      Parameters:
        `extraOperationContextPayloadMapper` -
      Returns:

    - #### addSecuritySchemaScopeValidator

          @Deprecated
          public OpenAPI3RouterFactory addSecuritySchemaScopeValidator(String securitySchemaName,
                                                                                   String scopeName,
                                                                                   Handler<RoutingContext> handler)

      Deprecated.
      Add a particular scope validator. The main security schema will not be called if a specific scope validator is configured
      Parameters:
        `securitySchemaName` -
        `scopeName` -
        `handler` -
      Returns:
        this factory

    - #### addHandlerByOperationId

          @Deprecated
          public OpenAPI3RouterFactory addHandlerByOperationId(String operationId,
                                                                           Handler<RoutingContext> handler)

      Deprecated.
      Add an handler by operation_id field in Operation object
      Parameters:
        `operationId` -
        `handler` -
      Returns:
        this factory

    - #### addFailureHandlerByOperationId

          @Deprecated
          public OpenAPI3RouterFactory addFailureHandlerByOperationId(String operationId,
                                                                                  Handler<RoutingContext> failureHandler)

      Deprecated.
      Add a failure handler by operation_id field in Operation object
      Parameters:
        `operationId` -
        `failureHandler` -
      Returns:
        this factory

    - #### mountOperationToEventBus

          @Deprecated
          public OpenAPI3RouterFactory mountOperationToEventBus(String operationId,
                                                                            String address)

      Deprecated.
      Specify to route an incoming request for specified operation id to a Web Api Service mounted at the specified address on event bus. Please give a look at vertx-web-api-service documentation for more informations
      Parameters:
        `operationId` -
        `address` -
      Returns:
        this factory

    - #### mountServiceFromTag

          @Deprecated
          public OpenAPI3RouterFactory mountServiceFromTag(String tag,
                                                                       String address)

      Deprecated.
      Specify to route an incoming request for all operations that contains the specified tag to a Web Api Service mounted at the specified address on event bus. The request is handled by the method that matches the operation id. Please give a look at vertx-web-api-service documentation for more informations
      Parameters:
        `tag` -
        `address` -
      Returns:
        this factory

    - #### mountServicesFromExtensions

          @Deprecated
          public OpenAPI3RouterFactory mountServicesFromExtensions()

      Deprecated.
      Introspect the OpenAPI spec to mount handlers for all operations that specifies a x-vertx-event-bus annotation. Please give a look at vertx-web-api-service documentation for more informations
      Returns:
        this factory

    - #### create

          @Deprecated
          public static void create(Vertx vertx,
                                                String url,
                                                Handler<AsyncResult<OpenAPI3RouterFactory>> handler)

      Deprecated.
      Create a new OpenAPI3RouterFactory
      Parameters:
        `vertx` -
        `url` - location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)
        `handler` - When specification is loaded, this handler will be called with AsyncResult

    - #### create

          @Deprecated
          public static void create(Vertx vertx,
                                                String url)

      Deprecated.
      Create a new OpenAPI3RouterFactory
      Parameters:
        `vertx` -
        `url` - location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)

    - #### rxCreate

          @Deprecated
          public static Single<OpenAPI3RouterFactory> rxCreate(Vertx vertx,
                                                                           String url)

      Deprecated.
      Create a new OpenAPI3RouterFactory
      Parameters:
        `vertx` -
        `url` - location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)
      Returns:

    - #### create

          @Deprecated
          public static void create(Vertx vertx,
                                                String url,
                                                List<JsonObject> auth,
                                                Handler<AsyncResult<OpenAPI3RouterFactory>> handler)

      Deprecated.
      Create a new OpenAPI3RouterFactory
      Parameters:
        `vertx` -
        `url` - location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)
        `auth` - list of authorization values needed to access the remote url. Each item should be json representation of an `AuthorizationValue`
        `handler` - When specification is loaded, this handler will be called with AsyncResult

    - #### create

          @Deprecated
          public static void create(Vertx vertx,
                                                String url,
                                                List<JsonObject> auth)

      Deprecated.
      Create a new OpenAPI3RouterFactory
      Parameters:
        `vertx` -
        `url` - location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)
        `auth` - list of authorization values needed to access the remote url. Each item should be json representation of an `AuthorizationValue`

    - #### rxCreate

          @Deprecated
          public static Single<OpenAPI3RouterFactory> rxCreate(Vertx vertx,
                                                                           String url,
                                                                           List<JsonObject> auth)

      Deprecated.
      Create a new OpenAPI3RouterFactory
      Parameters:
        `vertx` -
        `url` - location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)
        `auth` - list of authorization values needed to access the remote url. Each item should be json representation of an `AuthorizationValue`
      Returns:

    - #### newInstance

          public static OpenAPI3RouterFactory newInstance(OpenAPI3RouterFactory arg)

Copyright © 2023 Eclipse. All rights reserved.