/*
 * Copyright 2014 Red Hat, Inc.
 *
 * Red Hat licenses this file to you under the Apache License, version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License.  You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package io.vertx.reactivex.ext.web.api.contract;

import java.util.Map;
import io.reactivex.Observable;
import io.reactivex.Flowable;
import io.reactivex.Single;
import io.reactivex.Completable;
import io.reactivex.Maybe;
import io.vertx.core.json.JsonObject;
import io.vertx.core.Handler;
import java.util.function.Function;
import io.vertx.ext.web.api.contract.RouterFactoryOptions;

Main interface for Design Driven Router factory Author: Francesco Guardiani @slinkydeveloper

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
/** * Main interface for Design Driven Router factory * Author: Francesco Guardiani @slinkydeveloper * * <p/> * NOTE: This class has been automatically generated from the {@link io.vertx.ext.web.api.contract.RouterFactory original} non RX-ified interface using Vert.x codegen. */
@io.vertx.lang.rx.RxGen(io.vertx.ext.web.api.contract.RouterFactory.class) public interface RouterFactory<Specification> { io.vertx.ext.web.api.contract.RouterFactory getDelegate();
Mount to paths that have to follow a security schema a security handler
Params:
  • securitySchemaName –
  • handler –
Returns:
/** * Mount to paths that have to follow a security schema a security handler * @param securitySchemaName * @param handler * @return */
public io.vertx.reactivex.ext.web.api.contract.RouterFactory addSecurityHandler(String securitySchemaName, Handler<io.vertx.reactivex.ext.web.RoutingContext> handler);
Set options of router factory. For more info RouterFactoryOptions
Params:
  • options –
Returns:
/** * Set options of router factory. For more info {@link io.vertx.ext.web.api.contract.RouterFactoryOptions} * @param options * @return */
public io.vertx.reactivex.ext.web.api.contract.RouterFactory setOptions(RouterFactoryOptions options);
Get options of router factory. For more info RouterFactoryOptions
Returns:
/** * Get options of router factory. For more info {@link io.vertx.ext.web.api.contract.RouterFactoryOptions} * @return */
public RouterFactoryOptions getOptions();
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.
Returns:
/** * Construct a new router based on spec. It will fail if you are trying to mount a spec with security schemes * without assigned handlers<br/> * <b>Note:</b> Router is constructed in this function, so it will be respected the path definition ordering. * @return */
public io.vertx.reactivex.ext.web.Router getRouter();
Returns:
/** * @return */
@Deprecated() public Handler<io.vertx.reactivex.ext.web.RoutingContext> getValidationFailureHandler();
Set default validation failure handler. You can enable/disable this feature from RouterFactoryOptions
Params:
  • validationFailureHandler –
Returns:this object
/** * Set default validation failure handler. You can enable/disable this feature from * {@link io.vertx.ext.web.api.contract.RouterFactoryOptions} * @param validationFailureHandler * @return this object */
@Deprecated() public io.vertx.reactivex.ext.web.api.contract.RouterFactory setValidationFailureHandler(Handler<io.vertx.reactivex.ext.web.RoutingContext> validationFailureHandler);
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 RouterFactoryOptions
Params:
  • notImplementedFailureHandler –
Returns:this object
/** * 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 * {@link io.vertx.ext.web.api.contract.RouterFactoryOptions} * @param notImplementedFailureHandler * @return this object */
@Deprecated() public io.vertx.reactivex.ext.web.api.contract.RouterFactory setNotImplementedFailureHandler(Handler<io.vertx.reactivex.ext.web.RoutingContext> notImplementedFailureHandler);
Supply your own BodyHandler if you would like to control body limit, uploads directory and deletion of uploaded files
Params:
  • bodyHandler –
Returns:self
/** * Supply your own BodyHandler if you would like to control body limit, uploads directory and deletion of uploaded files * @param bodyHandler * @return self */
public io.vertx.reactivex.ext.web.api.contract.RouterFactory setBodyHandler(io.vertx.reactivex.ext.web.handler.BodyHandler bodyHandler);
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 setBodyHandler
Params:
  • globalHandler –
Returns:this object
/** * Add global handler to be applied prior to {@link io.vertx.reactivex.ext.web.Router} being generated. <br/> * Please note that you should not add a body handler inside that list. If you want to modify the body handler, please use {@link io.vertx.reactivex.ext.web.api.contract.RouterFactory#setBodyHandler} * @param globalHandler * @return this object */
public io.vertx.reactivex.ext.web.api.contract.RouterFactory addGlobalHandler(Handler<io.vertx.reactivex.ext.web.RoutingContext> globalHandler);
When set, this function is called while creating the payload of OperationRequest
Params:
  • extraOperationContextPayloadMapper –
Returns:
/** * When set, this function is called while creating the payload of {@link io.vertx.ext.web.api.OperationRequest} * @param extraOperationContextPayloadMapper * @return */
public io.vertx.reactivex.ext.web.api.contract.RouterFactory setExtraOperationContextPayloadMapper(Function<io.vertx.reactivex.ext.web.RoutingContext, JsonObject> extraOperationContextPayloadMapper); public static <Specification>RouterFactory<Specification> newInstance(io.vertx.ext.web.api.contract.RouterFactory arg) { return arg != null ? new RouterFactoryImpl<Specification>(arg) : null; } public static <Specification>RouterFactory<Specification> newInstance(io.vertx.ext.web.api.contract.RouterFactory arg, io.vertx.lang.rx.TypeArg<Specification> __typeArg_Specification) { return arg != null ? new RouterFactoryImpl<Specification>(arg, __typeArg_Specification) : null; } } class RouterFactoryImpl<Specification> implements RouterFactory<Specification> { private final io.vertx.ext.web.api.contract.RouterFactory<Specification> delegate; public final io.vertx.lang.rx.TypeArg<Specification> __typeArg_0; public RouterFactoryImpl(io.vertx.ext.web.api.contract.RouterFactory delegate) { this.delegate = delegate; this.__typeArg_0 = io.vertx.lang.rx.TypeArg.unknown(); } public RouterFactoryImpl(io.vertx.ext.web.api.contract.RouterFactory delegate, io.vertx.lang.rx.TypeArg<Specification> typeArg_0) { this.delegate = delegate; this.__typeArg_0 = typeArg_0; } public io.vertx.ext.web.api.contract.RouterFactory getDelegate() { return delegate; }
Mount to paths that have to follow a security schema a security handler
Params:
  • securitySchemaName –
  • handler –
Returns:
/** * Mount to paths that have to follow a security schema a security handler * @param securitySchemaName * @param handler * @return */
public io.vertx.reactivex.ext.web.api.contract.RouterFactory addSecurityHandler(String securitySchemaName, Handler<io.vertx.reactivex.ext.web.RoutingContext> handler) { delegate.addSecurityHandler(securitySchemaName, new Handler<io.vertx.ext.web.RoutingContext>() { public void handle(io.vertx.ext.web.RoutingContext event) { handler.handle(io.vertx.reactivex.ext.web.RoutingContext.newInstance(event)); } }); return this; }
Set options of router factory. For more info RouterFactoryOptions
Params:
  • options –
Returns:
/** * Set options of router factory. For more info {@link io.vertx.ext.web.api.contract.RouterFactoryOptions} * @param options * @return */
public io.vertx.reactivex.ext.web.api.contract.RouterFactory setOptions(RouterFactoryOptions options) { delegate.setOptions(options); return this; }
Get options of router factory. For more info RouterFactoryOptions
Returns:
/** * Get options of router factory. For more info {@link io.vertx.ext.web.api.contract.RouterFactoryOptions} * @return */
public RouterFactoryOptions getOptions() { RouterFactoryOptions ret = delegate.getOptions(); return ret; }
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.
Returns:
/** * Construct a new router based on spec. It will fail if you are trying to mount a spec with security schemes * without assigned handlers<br/> * <b>Note:</b> Router is constructed in this function, so it will be respected the path definition ordering. * @return */
public io.vertx.reactivex.ext.web.Router getRouter() { io.vertx.reactivex.ext.web.Router ret = io.vertx.reactivex.ext.web.Router.newInstance(delegate.getRouter()); return ret; }
Returns:
/** * @return */
@Deprecated() public Handler<io.vertx.reactivex.ext.web.RoutingContext> getValidationFailureHandler() { Handler<io.vertx.reactivex.ext.web.RoutingContext> ret = new Handler<io.vertx.reactivex.ext.web.RoutingContext>() { public void handle(io.vertx.reactivex.ext.web.RoutingContext event) { delegate.getValidationFailureHandler().handle(event.getDelegate()); } }; return ret; }
Set default validation failure handler. You can enable/disable this feature from RouterFactoryOptions
Params:
  • validationFailureHandler –
Returns:this object
/** * Set default validation failure handler. You can enable/disable this feature from * {@link io.vertx.ext.web.api.contract.RouterFactoryOptions} * @param validationFailureHandler * @return this object */
@Deprecated() public io.vertx.reactivex.ext.web.api.contract.RouterFactory setValidationFailureHandler(Handler<io.vertx.reactivex.ext.web.RoutingContext> validationFailureHandler) { delegate.setValidationFailureHandler(new Handler<io.vertx.ext.web.RoutingContext>() { public void handle(io.vertx.ext.web.RoutingContext event) { validationFailureHandler.handle(io.vertx.reactivex.ext.web.RoutingContext.newInstance(event)); } }); return this; }
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 RouterFactoryOptions
Params:
  • notImplementedFailureHandler –
Returns:this object
/** * 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 * {@link io.vertx.ext.web.api.contract.RouterFactoryOptions} * @param notImplementedFailureHandler * @return this object */
@Deprecated() public io.vertx.reactivex.ext.web.api.contract.RouterFactory setNotImplementedFailureHandler(Handler<io.vertx.reactivex.ext.web.RoutingContext> notImplementedFailureHandler) { delegate.setNotImplementedFailureHandler(new Handler<io.vertx.ext.web.RoutingContext>() { public void handle(io.vertx.ext.web.RoutingContext event) { notImplementedFailureHandler.handle(io.vertx.reactivex.ext.web.RoutingContext.newInstance(event)); } }); return this; }
Supply your own BodyHandler if you would like to control body limit, uploads directory and deletion of uploaded files
Params:
  • bodyHandler –
Returns:self
/** * Supply your own BodyHandler if you would like to control body limit, uploads directory and deletion of uploaded files * @param bodyHandler * @return self */
public io.vertx.reactivex.ext.web.api.contract.RouterFactory setBodyHandler(io.vertx.reactivex.ext.web.handler.BodyHandler bodyHandler) { delegate.setBodyHandler(bodyHandler.getDelegate()); return this; }
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 RouterFactory.setBodyHandler
Params:
  • globalHandler –
Returns:this object
/** * Add global handler to be applied prior to {@link io.vertx.reactivex.ext.web.Router} being generated. <br/> * Please note that you should not add a body handler inside that list. If you want to modify the body handler, please use {@link io.vertx.reactivex.ext.web.api.contract.RouterFactory#setBodyHandler} * @param globalHandler * @return this object */
public io.vertx.reactivex.ext.web.api.contract.RouterFactory addGlobalHandler(Handler<io.vertx.reactivex.ext.web.RoutingContext> globalHandler) { delegate.addGlobalHandler(new Handler<io.vertx.ext.web.RoutingContext>() { public void handle(io.vertx.ext.web.RoutingContext event) { globalHandler.handle(io.vertx.reactivex.ext.web.RoutingContext.newInstance(event)); } }); return this; }
When set, this function is called while creating the payload of OperationRequest
Params:
  • extraOperationContextPayloadMapper –
Returns:
/** * When set, this function is called while creating the payload of {@link io.vertx.ext.web.api.OperationRequest} * @param extraOperationContextPayloadMapper * @return */
public io.vertx.reactivex.ext.web.api.contract.RouterFactory setExtraOperationContextPayloadMapper(Function<io.vertx.reactivex.ext.web.RoutingContext, JsonObject> extraOperationContextPayloadMapper) { delegate.setExtraOperationContextPayloadMapper(new java.util.function.Function<io.vertx.ext.web.RoutingContext,io.vertx.core.json.JsonObject>() { public io.vertx.core.json.JsonObject apply(io.vertx.ext.web.RoutingContext arg) { JsonObject ret = extraOperationContextPayloadMapper.apply(io.vertx.reactivex.ext.web.RoutingContext.newInstance(arg)); return ret; } }); return this; } }