Index
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form
A
- addErrorHandler(int, Route) - Method in class de.joshicodes.webapi.WebserverBuilder
-
Adds an error route to the webserver
- addRoute(String, Route) - Method in class de.joshicodes.webapi.router.Router
- addRoute(String, Route) - Method in class de.joshicodes.webapi.WebserverBuilder
-
Adds a route to the webserver
- addRouter(String, Router) - Method in class de.joshicodes.webapi.WebserverBuilder
-
Adds a router to the webserver
- addRoutes(HashMap<String, Route>) - Method in class de.joshicodes.webapi.router.Router
- Authentication - Annotation Interface in de.joshicodes.webapi.auth
- AuthenticationHandler - Class in de.joshicodes.webapi.auth.handler
- AuthenticationHandler(String...) - Constructor for class de.joshicodes.webapi.auth.handler.AuthenticationHandler
- AuthenticationHandler(String, String) - Constructor for class de.joshicodes.webapi.auth.handler.AuthenticationHandler
- AuthenticationHandler(String, String...) - Constructor for class de.joshicodes.webapi.auth.handler.AuthenticationHandler
B
- BAD_REQUEST - Static variable in class de.joshicodes.webapi.HttpErrorCode
- BasicAuthenticationHandler - Class in de.joshicodes.webapi.auth.handler
- BasicAuthenticationHandler(String) - Constructor for class de.joshicodes.webapi.auth.handler.BasicAuthenticationHandler
- BearerAuthenticationHandler - Class in de.joshicodes.webapi.auth.handler
- BearerAuthenticationHandler(String) - Constructor for class de.joshicodes.webapi.auth.handler.BearerAuthenticationHandler
- build() - Method in class de.joshicodes.webapi.request.ResponseData.Builder
- build() - Method in class de.joshicodes.webapi.WebserverBuilder
-
Creates a new webserver instance
- Builder() - Constructor for class de.joshicodes.webapi.request.ResponseData.Builder
- buildFrom(int, String) - Static method in class de.joshicodes.webapi.request.ResponseData
-
Creates a new ResponseData object with the given body
If you want to alter the ResponseData object, useResponseData.from(int, String)
instead
C
- callEvent(Event) - Method in class de.joshicodes.webapi.event.EventManager
- canBeCancelled() - Method in class de.joshicodes.webapi.event.events.Event
D
- de.joshicodes.webapi - package de.joshicodes.webapi
- de.joshicodes.webapi.auth - package de.joshicodes.webapi.auth
- de.joshicodes.webapi.auth.handler - package de.joshicodes.webapi.auth.handler
- de.joshicodes.webapi.event - package de.joshicodes.webapi.event
- de.joshicodes.webapi.event.events - package de.joshicodes.webapi.event.events
- de.joshicodes.webapi.exceptions - package de.joshicodes.webapi.exceptions
- de.joshicodes.webapi.request - package de.joshicodes.webapi.request
- de.joshicodes.webapi.router - package de.joshicodes.webapi.router
- de.joshicodes.webapi.router.route - package de.joshicodes.webapi.router.route
- DELETE - Enum constant in enum class de.joshicodes.webapi.request.HttpMethodType
E
- equals(Object) - Method in record class de.joshicodes.webapi.request.RequestData
-
Indicates whether some other object is "equal to" this one.
- Event - Class in de.joshicodes.webapi.event.events
- Event(Webserver) - Constructor for class de.joshicodes.webapi.event.events.Event
- Event(Webserver, boolean) - Constructor for class de.joshicodes.webapi.event.events.Event
- EventHandler - Annotation Interface in de.joshicodes.webapi.event
- EventHandler.EventPriority - Enum Class in de.joshicodes.webapi.event
- EventManager - Class in de.joshicodes.webapi.event
- EventManager(Webserver, HttpServer) - Constructor for class de.joshicodes.webapi.event.EventManager
- exchange() - Method in record class de.joshicodes.webapi.request.RequestData
-
Returns the value of the
exchange
record component.
F
- FileRoute - Class in de.joshicodes.webapi.router.route
-
Future Implementation
- FileRoute() - Constructor for class de.joshicodes.webapi.router.route.FileRoute
- FORBIDDEN - Static variable in class de.joshicodes.webapi.HttpErrorCode
- from(int, String) - Static method in class de.joshicodes.webapi.request.ResponseData
-
Creates a new ResponseData object with the given body
If you want a built ResponseData object, useResponseData.buildFrom(int, String)
instead - fromFile(File) - Static method in class de.joshicodes.webapi.request.ResponseData
-
Creates a new ResponseData object from a file
This does not set the content type, you have to do that yourself usingResponseData.Builder.setContentType(String)
G
- GET - Enum constant in enum class de.joshicodes.webapi.request.HttpMethodType
- getAllowedTypes() - Method in class de.joshicodes.webapi.auth.handler.AuthenticationHandler
- getBody() - Method in record class de.joshicodes.webapi.request.RequestData
- getBody() - Method in class de.joshicodes.webapi.request.ResponseData
- getBody() - Method in class de.joshicodes.webapi.request.ResponseModificationData
- getCancelResponse() - Method in class de.joshicodes.webapi.event.events.RouteRequestEvent
- getContentType() - Method in record class de.joshicodes.webapi.request.RequestData
-
Returns the first value of the provided "Content-Type" header
- getContentType() - Method in class de.joshicodes.webapi.request.ResponseData
- getContentType() - Method in class de.joshicodes.webapi.request.ResponseModificationData
- getErrorHandlers() - Method in class de.joshicodes.webapi.Webserver
- getErrorHandlers() - Method in class de.joshicodes.webapi.WebserverBuilder
- getEventManager() - Method in class de.joshicodes.webapi.Webserver
- getHeader(String) - Method in record class de.joshicodes.webapi.request.RequestData
- getHeader(String) - Method in class de.joshicodes.webapi.request.ResponseData
- getHeader(String) - Method in class de.joshicodes.webapi.request.ResponseModificationData
- getHeaders() - Method in record class de.joshicodes.webapi.request.RequestData
- getHeaders() - Method in class de.joshicodes.webapi.request.ResponseData
- getHeaders() - Method in class de.joshicodes.webapi.request.ResponseModificationData
- getHost() - Method in class de.joshicodes.webapi.Webserver
- getHost() - Method in class de.joshicodes.webapi.WebserverBuilder
- getHttpServer() - Method in class de.joshicodes.webapi.Webserver
- getLogger() - Method in class de.joshicodes.webapi.Webserver
- getLogLevel() - Method in class de.joshicodes.webapi.WebserverBuilder
- getMethod() - Method in record class de.joshicodes.webapi.request.RequestData
-
Returns the request method provided by the exchange
- getParameter(String) - Method in record class de.joshicodes.webapi.request.RequestData
-
Returns the value of the provided parameter key
Works for both GET and POST requests - getParameter(String, String) - Method in record class de.joshicodes.webapi.request.RequestData
-
Returns the value of the provided parameter key
Works for both GET and POST requests - getParameters() - Method in record class de.joshicodes.webapi.request.RequestData
-
Returns the GET parameters of the request query
(e.g. - getPath() - Method in record class de.joshicodes.webapi.request.RequestData
- getPath() - Method in class de.joshicodes.webapi.Webserver
- getPath() - Method in class de.joshicodes.webapi.WebserverBuilder
- getPort() - Method in class de.joshicodes.webapi.Webserver
- getPort() - Method in class de.joshicodes.webapi.WebserverBuilder
- getPostParameters() - Method in record class de.joshicodes.webapi.request.RequestData
-
Returns the post parameters of the request
- getProtocol() - Method in record class de.joshicodes.webapi.request.RequestData
-
Returns the protocol string from the request in the form protocol/majorVersion.minorVersion.
- getQuery() - Method in record class de.joshicodes.webapi.request.RequestData
-
Returns the provided Query String
- getRedirectLocation() - Method in class de.joshicodes.webapi.request.ResponseModificationData
-
Returns the location to redirect to or null if the response should not be redirected Has to be a valid URL
- getRequestData() - Method in class de.joshicodes.webapi.event.events.RouteRequestEvent
- getRoute() - Method in class de.joshicodes.webapi.event.events.RouteRequestEvent
- getRoute(String) - Method in class de.joshicodes.webapi.router.Router
- getRouters() - Method in class de.joshicodes.webapi.Webserver
- getRouters() - Method in class de.joshicodes.webapi.WebserverBuilder
- getRoutes() - Method in class de.joshicodes.webapi.router.Router
- getServer() - Method in class de.joshicodes.webapi.event.events.Event
- getStatusCode() - Method in class de.joshicodes.webapi.request.ResponseData
- getStatusCode() - Method in class de.joshicodes.webapi.request.ResponseModificationData
- getUriParts() - Method in record class de.joshicodes.webapi.request.RequestData
-
Returns the uri parts of the request path
Returns all parts, even the one(s) for the route. - getValue() - Method in class de.joshicodes.webapi.auth.handler.AuthenticationHandler
- getValue() - Method in enum class de.joshicodes.webapi.event.EventHandler.EventPriority
H
- handle(RequestData) - Method in class de.joshicodes.webapi.router.route.FileRoute
- handle(RequestData) - Method in interface de.joshicodes.webapi.router.route.Route
- handle(String, String, HttpExchange) - Method in class de.joshicodes.webapi.auth.handler.AuthenticationHandler
-
Replaces the old handle method and is used to handle the authentication process.
- handle(String, String, HttpExchange) - Method in class de.joshicodes.webapi.auth.handler.BasicAuthenticationHandler
- handle(String, String, HttpExchange) - Method in class de.joshicodes.webapi.auth.handler.BearerAuthenticationHandler
- handler() - Element in annotation interface de.joshicodes.webapi.auth.Authentication
-
The authentication handler to use for authentication
Can be a custom handler or one of the default handlers
To create a custom handler, implement theAuthenticationHandler
class - hasCancelResponse() - Method in class de.joshicodes.webapi.event.events.RouteRequestEvent
- hashCode() - Method in record class de.joshicodes.webapi.request.RequestData
-
Returns a hash code value for this object.
- hasParameter(String) - Method in record class de.joshicodes.webapi.request.RequestData
-
Checks if the request has a parameter with the provided key
Works for both GET and POST requests - hasRoute(String) - Method in class de.joshicodes.webapi.router.Router
- HEAD - Enum constant in enum class de.joshicodes.webapi.request.HttpMethodType
- HIGH - Enum constant in enum class de.joshicodes.webapi.event.EventHandler.EventPriority
- HIGHEST - Enum constant in enum class de.joshicodes.webapi.event.EventHandler.EventPriority
- HttpErrorCode - Class in de.joshicodes.webapi
- HttpErrorCode() - Constructor for class de.joshicodes.webapi.HttpErrorCode
- HttpMethod - Annotation Interface in de.joshicodes.webapi.request
- HttpMethodType - Enum Class in de.joshicodes.webapi.request
I
- INTERNAL_SERVER_ERROR - Static variable in class de.joshicodes.webapi.HttpErrorCode
- isCancelled() - Method in class de.joshicodes.webapi.event.events.Event
L
- ListenerAdapter - Interface in de.joshicodes.webapi.event
-
This interface is just to handle the events.
- LOW - Enum constant in enum class de.joshicodes.webapi.event.EventHandler.EventPriority
- LOWEST - Enum constant in enum class de.joshicodes.webapi.event.EventHandler.EventPriority
M
- METHOD_NOT_ALLOWED - Static variable in class de.joshicodes.webapi.HttpErrorCode
- MissingPostDataException - Exception in de.joshicodes.webapi.exceptions
- MissingPostDataException(RequestData) - Constructor for exception de.joshicodes.webapi.exceptions.MissingPostDataException
N
- NO_AUTH - Static variable in class de.joshicodes.webapi.auth.handler.AuthenticationHandler
- NORMAL - Enum constant in enum class de.joshicodes.webapi.event.EventHandler.EventPriority
- NOT_FOUND - Static variable in class de.joshicodes.webapi.HttpErrorCode
O
- OK - Static variable in class de.joshicodes.webapi.HttpErrorCode
- OPTIONS - Enum constant in enum class de.joshicodes.webapi.request.HttpMethodType
P
- PATCH - Enum constant in enum class de.joshicodes.webapi.request.HttpMethodType
- POST - Enum constant in enum class de.joshicodes.webapi.request.HttpMethodType
- priority() - Element in annotation interface de.joshicodes.webapi.event.EventHandler
- PUT - Enum constant in enum class de.joshicodes.webapi.request.HttpMethodType
R
- redirect(String) - Static method in class de.joshicodes.webapi.request.ResponseData
-
Creates a new
ResponseModificationData
object that redirects to the given URL - registerListener(ListenerAdapter) - Method in class de.joshicodes.webapi.event.EventManager
- RequestData - Record Class in de.joshicodes.webapi.request
- RequestData(HttpExchange) - Constructor for record class de.joshicodes.webapi.request.RequestData
-
Creates an instance of a
RequestData
record class. - ResponseData - Class in de.joshicodes.webapi.request
- ResponseData() - Constructor for class de.joshicodes.webapi.request.ResponseData
- ResponseData.Builder - Class in de.joshicodes.webapi.request
- ResponseModificationData - Class in de.joshicodes.webapi.request
-
This class is used when the Response returned by the server should end up being modified.
- ResponseModificationData() - Constructor for class de.joshicodes.webapi.request.ResponseModificationData
- Route - Interface in de.joshicodes.webapi.router.route
- Router - Class in de.joshicodes.webapi.router
- Router() - Constructor for class de.joshicodes.webapi.router.Router
- RouteRequestEvent - Class in de.joshicodes.webapi.event.events
- RouteRequestEvent(Webserver, Route, RequestData) - Constructor for class de.joshicodes.webapi.event.events.RouteRequestEvent
-
Is called every time a route is requested and contains some data about the request.
S
- search(String) - Method in class de.joshicodes.webapi.router.Router
-
Searches for a route that matches the given uri
- setBody(String) - Method in class de.joshicodes.webapi.request.ResponseData.Builder
-
Sets the body of the response
- setCancelled(boolean) - Method in class de.joshicodes.webapi.event.events.Event
- setCancelled(boolean, ResponseData) - Method in class de.joshicodes.webapi.event.events.RouteRequestEvent
- setCancelResponse(ResponseData) - Method in class de.joshicodes.webapi.event.events.RouteRequestEvent
- setContentType(String) - Method in class de.joshicodes.webapi.request.ResponseData.Builder
-
Sets the content type of the response
This overrides the "Content-Type" header if it is set usingResponseData.Builder.setHeader(String, String)
- setHeader(String, String) - Method in class de.joshicodes.webapi.request.ResponseData.Builder
-
Sets a header of the response To set multiple headers, split the key and value with a
,
- setHost(String) - Method in class de.joshicodes.webapi.WebserverBuilder
-
Sets the host of the webserver (default: 0.0.0.0)
- setLogLevel(Level) - Method in class de.joshicodes.webapi.WebserverBuilder
-
Set the log level specifying which message levels will be logged by this logger.
- setPath(String) - Method in class de.joshicodes.webapi.WebserverBuilder
-
Sets the path of the webserver (default: /)
- setPort(int) - Method in class de.joshicodes.webapi.WebserverBuilder
-
Sets the port of the webserver
- setStatusCode(int) - Method in class de.joshicodes.webapi.request.ResponseData.Builder
-
Sets the status code of the response
- start() - Method in class de.joshicodes.webapi.Webserver
-
Starts the server
- stop() - Method in class de.joshicodes.webapi.Webserver
-
Stops the server
T
- toString() - Method in record class de.joshicodes.webapi.request.RequestData
-
Returns a string representation of this record class.
- TRACE - Enum constant in enum class de.joshicodes.webapi.request.HttpMethodType
U
- UNAUTHORIZED - Static variable in class de.joshicodes.webapi.HttpErrorCode
- UnknownContentTypeException - Exception in de.joshicodes.webapi.exceptions
- UnknownContentTypeException(String) - Constructor for exception de.joshicodes.webapi.exceptions.UnknownContentTypeException
- unregisterListener(ListenerAdapter) - Method in class de.joshicodes.webapi.event.EventManager
V
- value() - Element in annotation interface de.joshicodes.webapi.auth.Authentication
-
The value to use for authentication
If the authentication handler does not require a value, this can be left empty or null - value() - Element in annotation interface de.joshicodes.webapi.request.HttpMethod
- valueOf(String) - Static method in enum class de.joshicodes.webapi.event.EventHandler.EventPriority
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class de.joshicodes.webapi.request.HttpMethodType
-
Returns the enum constant of this class with the specified name.
- values() - Static method in enum class de.joshicodes.webapi.event.EventHandler.EventPriority
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class de.joshicodes.webapi.request.HttpMethodType
-
Returns an array containing the constants of this enum class, in the order they are declared.
W
- Webserver - Class in de.joshicodes.webapi
- WebserverBuilder - Class in de.joshicodes.webapi
- WebserverBuilder() - Constructor for class de.joshicodes.webapi.WebserverBuilder
-
Creates a new WebserverBuilder
Use this to build a webserver
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form