| Modifier and Type | Method and Description |
|---|---|
Windward |
delete(String relativePath,
Consumer<SimpleWindwardContext> consumer)
Register function with delete method
|
<C extends EnhancedWindwardContext & HttpKind> |
delete(String relativePath,
EnhancedFunction<C,?> function)
Register function with delete method
|
<R> Windward |
delete(String relativePath,
Supplier<R> supplier)
Register function with delete method
|
static List<ExceptionHandler> |
exceptionHandlers()
Get exception handlers
|
static List<Filter> |
filters()
Get filters
|
static <I> FunctionMetaInfo<I> |
findRouter(String relativePath,
String method)
Find out registered function or resource by specific path
|
Windward |
get(String relativePath,
Consumer<SimpleWindwardContext> consumer)
Register function with get method
|
<C extends EnhancedWindwardContext & HttpKind> |
get(String relativePath,
EnhancedFunction<C,?> function)
Register function with get method
|
<R> Windward |
get(String relativePath,
Supplier<R> supplier)
Register function with get method
|
String |
getContextPath() |
String |
getStaticResourceLocation() |
String |
getTemplateRoot() |
RouterGroup<Windward> |
group(String relativePath)
Define new router with specific relativePath
|
Windward |
http(HttpMethod httpMethod,
String relativePath,
Consumer<SimpleWindwardContext> consumer)
Register function with specific method
|
<C extends EnhancedWindwardContext & HttpKind> |
http(HttpMethod httpMethod,
String relativePath,
EnhancedFunction<C,?> function)
Register function with specific method
|
<R> Windward |
http(HttpMethod httpMethod,
String relativePath,
Supplier<R> supplier)
Register function with specific method
|
static <T extends Plugin> |
plugin(Class<T> clazz)
Get plugin
|
static <T extends Plugin> |
plugins(Class<T> clazz)
Get plugins by super or self
|
Windward |
post(String relativePath,
Consumer<SimpleWindwardContext> consumer)
Register function with post method
|
<C extends EnhancedWindwardContext & HttpKind> |
post(String relativePath,
EnhancedFunction<C,?> function)
Register function with post method
|
<R> Windward |
post(String relativePath,
Supplier<R> supplier)
Register function with post method
|
Windward |
publishEvent(Event... events)
Publish event
|
Windward |
put(String relativePath,
Consumer<SimpleWindwardContext> consumer)
Register function with put method
|
<C extends EnhancedWindwardContext & HttpKind> |
put(String relativePath,
EnhancedFunction<C,?> function)
Register function with put method
|
<R> Windward |
put(String relativePath,
Supplier<R> supplier)
Register function with put method
|
Windward |
registerExceptionHandler(ExceptionHandler... exceptionHandlers)
Register exception handler
|
Windward |
registerFilter(Filter... filters)
Register filter
|
Windward |
registerListener(Listener... listeners)
Register listener
|
Windward |
registerPlugin(PluginSlot pluginSlot,
Plugin plugin)
Register plugin or overwrite existed
|
Windward |
resource(String... pathPatterns)
Register resources path pattern
|
Windward |
resources(String staticResourceLocation,
String... pathPatterns)
Register resources path pattern for specific resource location
|
void |
run()
Run server
|
static Windward |
setup() |
static Windward |
setup(int port,
Filter... filters)
Prepare core engine of Windward
|
static Windward |
setup(int port,
String contextPath,
Filter... filters)
Prepare core engine of Windward
|
static Windward |
setup(int port,
String contextPath,
String templateRoot,
String staticResourceLocation,
Filter... filters)
Prepare core engine of Windward
|
Windward |
sse(HttpMethod httpMethod,
String relativePath,
EnhancedFunction<SseWindwardContext,SseEjector> function)
Register SSE (server send event)
|
Windward |
sse(String relativePath,
EnhancedFunction<SseWindwardContext,SseEjector> function)
Register SSE (server send event)
|
Windward |
then() |
Windward |
ws(String relativePath,
Consumer<WebSocketWindwardContext> consumer,
AuthorizationProvider... authorizationProviders)
Register websocket function
|
public static Windward setup()
public static Windward setup(int port, Filter... filters)
port - server portfilters - request filterspublic static Windward setup(int port, String contextPath, Filter... filters)
port - server portcontextPath - path of rootfilters - request filterspublic static Windward setup(int port, String contextPath, String templateRoot, String staticResourceLocation, Filter... filters)
port - server portcontextPath - path of roottemplateRoot - root for template filesstaticResourceLocation - location of static resourcefilters - request filterspublic void run()
throws ServerException
ServerException - exceptionpublic RouterGroup<Windward> group(String relativePath)
relativePath - relativePathpublic Windward registerFilter(Filter... filters)
filters - filterpublic Windward registerExceptionHandler(ExceptionHandler... exceptionHandlers)
exceptionHandlers - exception handlerpublic Windward registerListener(Listener... listeners)
listeners - event listenerspublic Windward registerPlugin(PluginSlot pluginSlot, Plugin plugin)
pluginSlot - slotplugin - pluginpublic Windward publishEvent(Event... events)
events - eventspublic static <I> FunctionMetaInfo<I> findRouter(String relativePath, String method)
I - routers metadatarelativePath - relativePathmethod - http methods namepublic static List<ExceptionHandler> exceptionHandlers()
public static <T extends Plugin> T plugin(Class<T> clazz)
T - plugin typeclazz - class of pluginpublic static <T extends Plugin> List<T> plugins(Class<T> clazz)
T - class typeclazz - super or self classpublic String getContextPath()
public String getTemplateRoot()
public String getStaticResourceLocation()
public Windward then()
public <R> Windward http(HttpMethod httpMethod, String relativePath, Supplier<R> supplier)
public Windward http(HttpMethod httpMethod, String relativePath, Consumer<SimpleWindwardContext> consumer)
public <C extends EnhancedWindwardContext & HttpKind> Windward http(HttpMethod httpMethod, String relativePath, EnhancedFunction<C,?> function)
public <R> Windward get(String relativePath, Supplier<R> supplier)
public Windward get(String relativePath, Consumer<SimpleWindwardContext> consumer)
public <C extends EnhancedWindwardContext & HttpKind> Windward get(String relativePath, EnhancedFunction<C,?> function)
public <R> Windward put(String relativePath, Supplier<R> supplier)
public Windward put(String relativePath, Consumer<SimpleWindwardContext> consumer)
public <C extends EnhancedWindwardContext & HttpKind> Windward put(String relativePath, EnhancedFunction<C,?> function)
public <R> Windward post(String relativePath, Supplier<R> supplier)
public Windward post(String relativePath, Consumer<SimpleWindwardContext> consumer)
public <C extends EnhancedWindwardContext & HttpKind> Windward post(String relativePath, EnhancedFunction<C,?> function)
public <R> Windward delete(String relativePath, Supplier<R> supplier)
public Windward delete(String relativePath, Consumer<SimpleWindwardContext> consumer)
public <C extends EnhancedWindwardContext & HttpKind> Windward delete(String relativePath, EnhancedFunction<C,?> function)
public Windward sse(String relativePath, EnhancedFunction<SseWindwardContext,SseEjector> function)
public Windward sse(HttpMethod httpMethod, String relativePath, EnhancedFunction<SseWindwardContext,SseEjector> function)
public Windward ws(String relativePath, Consumer<WebSocketWindwardContext> consumer, AuthorizationProvider... authorizationProviders)
ws in interface Router<Windward>relativePath - relative pathconsumer - function to consumeauthorizationProviders - authorizationProvidersExtensionalWebSocketPluginCopyright © 2024 flmelody. All rights reserved.