java.lang.Object
io.helidon.graphql.server.InvocationHandler.Builder
- All Implemented Interfaces:
Builder<InvocationHandler.Builder,
,InvocationHandler> Supplier<InvocationHandler>
- Enclosing interface:
- InvocationHandler
public static class InvocationHandler.Builder
extends Object
implements Builder<InvocationHandler.Builder,InvocationHandler>
Fluent API builder to configure the invocation handler.
-
Method Summary
Modifier and TypeMethodDescriptionaddBlacklistedException
(String exceptionClass) Add an exception to the blacklist.addWhitelistedException
(String exceptionClass) Add an exception to the whitelist.build()
Build the instance from this builder.Update builder from configuration.defaultErrorMessage
(String defaultErrorMessage) Default error message to return when an internal server error occurs.exceptionBlacklist
(String[] classNames) Blacklisted error classes that will not return error message back to caller.exceptionWhitelist
(String[] classNames) Whitelisted error classes that will return error message back to caller.schema
(graphql.schema.GraphQLSchema schema) Configure the GraphQL schema to be used.
-
Method Details
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<InvocationHandler.Builder,
InvocationHandler> - Returns:
- instance of the built type
-
config
Update builder from configuration. Configuration options:Optional configuration parameters key default value description default-error-message "Server Error" Error message used for internal errors that are not whitelisted. exception-white-list Array of exceptions classes. If an Error
or aRuntimeException
of this type is caught, its message will be propagated to the caller.exception-black-list Array of exception classes. If a checked Exception
is called, its message is propagated to the caller, unless it is in the blacklist.- Parameters:
config
- configuration to use- Returns:
- updated builder instance
-
schema
Configure the GraphQL schema to be used.- Parameters:
schema
- schema to handle by this support- Returns:
- updated builder instance
-
defaultErrorMessage
Default error message to return when an internal server error occurs.- Parameters:
defaultErrorMessage
- default error message- Returns:
- updated builder instance
-
exceptionBlacklist
Blacklisted error classes that will not return error message back to caller.- Parameters:
classNames
- names of classes to deny for checked exceptions- Returns:
- updated builder instance
-
addBlacklistedException
Add an exception to the blacklist. If a blacklisted exception is thrown,defaultErrorMessage(String)
is returned instead.- Parameters:
exceptionClass
- exception to blacklist- Returns:
- updated builder instance
-
exceptionWhitelist
Whitelisted error classes that will return error message back to caller.- Parameters:
classNames
- names of classes to allow for runtime exceptions and errors- Returns:
- updated builder instance
-
addWhitelistedException
Add an exception to the whitelist. If a whitelisted exception is thrown, its message is returned, otherwisedefaultErrorMessage(String)
is returned.- Parameters:
exceptionClass
- exception to whitelist- Returns:
- updated builder instance
-