- java.lang.Object
-
- io.helidon.graphql.server.InvocationHandler.Builder
-
- All Implemented Interfaces:
Builder<InvocationHandler>,Supplier<InvocationHandler>
- Enclosing interface:
- InvocationHandler
public static class InvocationHandler.Builder extends Object implements Builder<InvocationHandler>
Fluent API builder to configure the invocation handler.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvocationHandler.BuilderaddBlacklistedException(String exceptionClass)Add an exception to the blacklist.InvocationHandler.BuilderaddWhitelistedException(String exceptionClass)Add an exception to the whitelist.InvocationHandlerbuild()Build the instance from this builder.InvocationHandler.Builderconfig(Config config)Update builder from configuration.InvocationHandler.BuilderdefaultErrorMessage(String defaultErrorMessage)Default error message to return when an internal server error occurs.InvocationHandler.BuilderexceptionBlacklist(String[] classNames)Blacklisted error classes that will not return error message back to caller.InvocationHandler.BuilderexceptionWhitelist(String[] classNames)Whitelisted error classes that will return error message back to caller.InvocationHandler.Builderschema(graphql.schema.GraphQLSchema schema)Configure the GraphQL schema to be used.
-
-
-
Method Detail
-
build
public InvocationHandler build()
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<InvocationHandler>- Returns:
- instance of the built type
-
config
public InvocationHandler.Builder config(Config 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 Erroror aRuntimeExceptionof this type is caught, its message will be propagated to the caller.exception-black-list Array of exception classes. If a checked Exceptionis called, its message is propagated to the caller, unless it is in the blacklist.- Parameters:
config- configuration to use- Returns:
- updated builder instance
-
schema
public InvocationHandler.Builder schema(graphql.schema.GraphQLSchema schema)
Configure the GraphQL schema to be used.- Parameters:
schema- schema to handle by this support- Returns:
- updated builder instance
-
defaultErrorMessage
public InvocationHandler.Builder defaultErrorMessage(String defaultErrorMessage)
Default error message to return when an internal server error occurs.- Parameters:
defaultErrorMessage- default error message- Returns:
- updated builder instance
-
exceptionBlacklist
public InvocationHandler.Builder exceptionBlacklist(String[] classNames)
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
public InvocationHandler.Builder addBlacklistedException(String exceptionClass)
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
public InvocationHandler.Builder exceptionWhitelist(String[] classNames)
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
public InvocationHandler.Builder addWhitelistedException(String exceptionClass)
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
-
-