/** * Create an error handler using defaults * * @return the handler */ static ErrorHandler create() { return new ErrorHandlerImpl(DEFAULT_ERROR_HANDLER_TEMPLATE, DEFAULT_DISPLAY_EXCEPTION_DETAILS); }
/** * Create a handler * * @param authProvider the auth service to use * @param loginRedirectURL the url to redirect the user to * @param returnURLParam the name of param used to store return url information in session * @return the handler */ static AuthHandler create(AuthProvider authProvider, String loginRedirectURL, String returnURLParam) { return new RedirectAuthHandlerImpl(authProvider, loginRedirectURL, returnURLParam); } }
@Override public synchronized StaticHandler setEnableFSTuning(boolean enableFSTuning) { this.tuning = enableFSTuning; if (!tuning) { resetTuning(); } return this; }
/** * Create a handler * * @param engine the template engine * @param templateDirectory the template directory where templates will be looked for * @param contentType the content type header to be used in the response * @return the handler */ static TemplateHandler create(TemplateEngine engine, String templateDirectory, String contentType) { return new TemplateHandlerImpl(engine, templateDirectory, contentType); }
/** * Create a handler with he specified format * * @param format the format * @return the handler */ static LoggerHandler create(LoggerFormat format) { return new LoggerHandlerImpl(format); }
/** * Create a CORS handler * * @param allowedOriginPattern the allowed origin pattern * @return the handler */ static CorsHandler create(String allowedOriginPattern) { return new CorsHandlerImpl(allowedOriginPattern); }
/** * Create a new handler * * @param authProvider The auth provider to use * @return the handler */ static UserSessionHandler create(AuthProvider authProvider) { return new UserSessionHandlerImpl(authProvider); }
/** * Create a handler attempting to load favicon file from the specified path * * @param path the path * @return the handler */ static FaviconHandler create(String path) { return new FaviconHandlerImpl(path); }
/** * Create a response content type handler with a custom disable flag. * * @return the response content type handler */ static ResponseContentTypeHandler create(String disableFlag) { return new ResponseContentTypeHandlerImpl(disableFlag); } }
/** * Create a handler * * @return the handler */ static TimeoutHandler create() { return new TimeoutHandlerImpl(DEFAULT_TIMEOUT, DEFAULT_ERRORCODE); }
/** * Create a handler * * @return the handler */ static ResponseTimeHandler create() { return new ResponseTimeHandlerImpl(); }
/** * Create a digest auth handler, specifying the expire timeout for nonces. * * @param authProvider the auth service to use * @param nonceExpireTimeout the nonce expire timeout in milliseconds. * @return the auth handler */ static DigestAuthHandler create(HtdigestAuth authProvider, long nonceExpireTimeout) { return new DigestAuthHandlerImpl(authProvider, nonceExpireTimeout); } }
/** * Create a OAuth2 auth handler without host pinning. * Most providers will not look to the redirect url but always redirect to * the preconfigured callback. So this factory does not provide a callback url. * * @param authProvider the auth provider to use * @return the auth handler */ static OAuth2AuthHandler create(OAuth2Auth authProvider) { return new OAuth2AuthHandlerImpl(authProvider, null); }
/** * Instantiate a new CSRFHandlerImpl with a secret * <p> * <pre> * CSRFHandler.create("s3cr37") * </pre> * * @param secret server secret to sign the token. */ static CSRFHandler create(String secret) { return new CSRFHandlerImpl(secret); }
/** * Create a handler * * @param engine the template engine * @return the handler */ static TemplateHandler create(TemplateEngine engine) { return new TemplateHandlerImpl(engine, DEFAULT_TEMPLATE_DIRECTORY, DEFAULT_CONTENT_TYPE); }
/** * Create an error handler * * @param errorTemplateName the error template name - will be looked up from the classpath * @param displayExceptionDetails true if exception details should be displayed * @return the handler */ static ErrorHandler create(String errorTemplateName, boolean displayExceptionDetails) { return new ErrorHandlerImpl(errorTemplateName, displayExceptionDetails); }
/** * Create a handler * * @param authProvider the auth service to use * @param loginRedirectURL the url to redirect the user to * @return the handler */ static AuthHandler create(AuthProvider authProvider, String loginRedirectURL) { return new RedirectAuthHandlerImpl(authProvider, loginRedirectURL, DEFAULT_RETURN_URL_PARAM); }
/** * Create a handler with he specified format * * @param immediate true if logging should occur as soon as request arrives * @param format the format * @return the handler */ static LoggerHandler create(boolean immediate, LoggerFormat format) { return new LoggerHandlerImpl(immediate, format); } }
/** * Create an error handler * * @param errorTemplateName the error template name - will be looked up from the classpath * @return the handler */ static ErrorHandler create(String errorTemplateName) { return new ErrorHandlerImpl(errorTemplateName, DEFAULT_DISPLAY_EXCEPTION_DETAILS); }
/** * Create an error handler * * @param displayExceptionDetails true if exception details should be displayed * @return the handler */ static ErrorHandler create(boolean displayExceptionDetails) { return new ErrorHandlerImpl(DEFAULT_ERROR_HANDLER_TEMPLATE, displayExceptionDetails); }