public class RouterFactoryOptions extends Object
Modifier and Type | Field and Description |
---|---|
static java.util.function.Function<RoutingContext,JsonObject> |
DEFAULT_EXTRA_OPERATION_CONTEXT_PAYLOAD_MAPPER |
static boolean |
DEFAULT_MOUNT_NOT_IMPLEMENTED_HANDLER
By default, RouterFactory mounts Not Implemented handler
|
static boolean |
DEFAULT_MOUNT_RESPONSE_CONTENT_TYPE_HANDLER
By default, RouterFactory will mount ResponseContentTypeHandler when required
|
static boolean |
DEFAULT_MOUNT_VALIDATION_FAILURE_HANDLER
By default, RouterFactory loads validation failure handler
|
static Handler<RoutingContext> |
DEFAULT_NOT_IMPLEMENTED_HANDLER
Default not implemented handler.
|
static String |
DEFAULT_OPERATION_MODEL_KEY
By default, RouterFactory will not expose operation configuration in the the routing context
|
static boolean |
DEFAULT_REQUIRE_SECURITY_HANDLERS
By default, RouterFactory requires security handlers
to be defined while calling getRouter() or it will throw an Exception
|
static Handler<RoutingContext> |
DEFAULT_VALIDATION_HANDLER
Default validation failure handler.
|
Constructor and Description |
---|
RouterFactoryOptions() |
RouterFactoryOptions(JsonObject json) |
RouterFactoryOptions(RouterFactoryOptions other) |
Modifier and Type | Method and Description |
---|---|
RouterFactoryOptions |
addGlobalHandler(Handler<RoutingContext> globalHandler)
Add global handler to be applied prior to
Router being generated. |
BodyHandler |
getBodyHandler() |
java.util.function.Function<RoutingContext,JsonObject> |
getExtraOperationContextPayloadMapper() |
List<Handler<RoutingContext>> |
getGlobalHandlers() |
Handler<RoutingContext> |
getNotImplementedFailureHandler() |
String |
getOperationModelKey() |
Handler<RoutingContext> |
getValidationFailureHandler() |
boolean |
isMountNotImplementedHandler() |
boolean |
isMountResponseContentTypeHandler() |
boolean |
isMountValidationFailureHandler() |
boolean |
isRequireSecurityHandlers() |
RouterFactoryOptions |
setBodyHandler(BodyHandler bodyHandler)
Supply your own BodyHandler if you would like to control body limit, uploads directory and deletion of uploaded files
|
RouterFactoryOptions |
setExtraOperationContextPayloadMapper(java.util.function.Function<RoutingContext,JsonObject> extraOperationContextPayloadMapper)
When set, this function is called while creating the payload of
OperationRequest |
RouterFactoryOptions |
setMountNotImplementedHandler(boolean mountOperationsWithoutHandler)
Automatic mount handlers that return HTTP 501 status code for operations where you didn't specify an handler.
|
RouterFactoryOptions |
setMountResponseContentTypeHandler(boolean mountResponseContentTypeHandler)
If true, when required, the factory will mount a
ResponseContentTypeHandler |
RouterFactoryOptions |
setMountValidationFailureHandler(boolean mountGlobalValidationFailureHandler)
Enable or disable validation failure handler.
|
RouterFactoryOptions |
setNotImplementedFailureHandler(Handler<RoutingContext> notImplementedFailureHandler)
Set not implemented failure handler.
|
RouterFactoryOptions |
setOperationModelKey(String operationModelKey)
When set, an additional handler will be created to expose the operation model in the routing
context under the given key.
|
RouterFactoryOptions |
setRequireSecurityHandlers(boolean requireSecurityHandlers)
If true, when you call
RouterFactory.getRouter() the factory will mount for every path
the required security handlers and, if a security handler is not defined, it throws an RouterFactoryException |
RouterFactoryOptions |
setValidationFailureHandler(Handler<RoutingContext> validationFailureHandler)
Set default validation failure handler.
|
JsonObject |
toJson() |
public static final Handler<RoutingContext> DEFAULT_VALIDATION_HANDLER
public static final boolean DEFAULT_MOUNT_VALIDATION_FAILURE_HANDLER
public static final Handler<RoutingContext> DEFAULT_NOT_IMPLEMENTED_HANDLER
public static final boolean DEFAULT_MOUNT_NOT_IMPLEMENTED_HANDLER
public static final boolean DEFAULT_REQUIRE_SECURITY_HANDLERS
public static final boolean DEFAULT_MOUNT_RESPONSE_CONTENT_TYPE_HANDLER
public static final String DEFAULT_OPERATION_MODEL_KEY
public static final java.util.function.Function<RoutingContext,JsonObject> DEFAULT_EXTRA_OPERATION_CONTEXT_PAYLOAD_MAPPER
public RouterFactoryOptions()
public RouterFactoryOptions(JsonObject json)
public RouterFactoryOptions(RouterFactoryOptions other)
public JsonObject toJson()
public Handler<RoutingContext> getValidationFailureHandler()
public RouterFactoryOptions setValidationFailureHandler(Handler<RoutingContext> validationFailureHandler)
setMountValidationFailureHandler(boolean)
validationFailureHandler
- public boolean isMountValidationFailureHandler()
public RouterFactoryOptions setMountValidationFailureHandler(boolean mountGlobalValidationFailureHandler)
setValidationFailureHandler(Handler)
. If failure is different from ValidationException, next failure
handler will be called.mountGlobalValidationFailureHandler
- public Handler<RoutingContext> getNotImplementedFailureHandler()
public RouterFactoryOptions setNotImplementedFailureHandler(Handler<RoutingContext> notImplementedFailureHandler)
setMountNotImplementedHandler(boolean)
notImplementedFailureHandler
- public boolean isMountNotImplementedHandler()
public RouterFactoryOptions setMountNotImplementedHandler(boolean mountOperationsWithoutHandler)
mountOperationsWithoutHandler
- public boolean isRequireSecurityHandlers()
public RouterFactoryOptions setRequireSecurityHandlers(boolean requireSecurityHandlers)
RouterFactory.getRouter()
the factory will mount for every path
the required security handlers and, if a security handler is not defined, it throws an RouterFactoryException
requireSecurityHandlers
- public boolean isMountResponseContentTypeHandler()
public RouterFactoryOptions setMountResponseContentTypeHandler(boolean mountResponseContentTypeHandler)
ResponseContentTypeHandler
mountResponseContentTypeHandler
- public BodyHandler getBodyHandler()
public RouterFactoryOptions setBodyHandler(BodyHandler bodyHandler)
bodyHandler
- public List<Handler<RoutingContext>> getGlobalHandlers()
public RouterFactoryOptions addGlobalHandler(Handler<RoutingContext> globalHandler)
Router
being generated. setBodyHandler(BodyHandler)
globalHandler
- public String getOperationModelKey()
public RouterFactoryOptions setOperationModelKey(String operationModelKey)
operationModelKey
- public java.util.function.Function<RoutingContext,JsonObject> getExtraOperationContextPayloadMapper()
public RouterFactoryOptions setExtraOperationContextPayloadMapper(java.util.function.Function<RoutingContext,JsonObject> extraOperationContextPayloadMapper)
OperationRequest
extraOperationContextPayloadMapper
- Copyright © 2018 Eclipse. All rights reserved.