Package com.soklet.core
package com.soklet.core
Core Soklet contracts and functionality.
Full documentation is available at https://www.soklet.com.
- Author:
- Mark Allen
-
ClassDescriptionEncapsulates non-preflight CORS HTTP request data.Contract for types that authorize CORS requests.Encapsulates CORS preflight-related HTTP request data.Response headers to send over the wire for CORS preflight requests.Builder used to construct instances of
CorsPreflightResponse
viaCorsPreflightResponse.withAccessControlAllowOrigin(String)
.Builder used to copy instances ofCorsPreflightResponse
viaCorsPreflightResponse.copy()
.Response headers to send over the wire for non-preflight CORS requests.Builder used to construct instances ofCorsResponse
viaCorsResponse.withAccessControlAllowOrigin(String)
.Builder used to copy instances ofCorsResponse
viaCorsResponse.copy()
.Typesafe representation of HTTP request methods.Contract for types that generate identifiers: sequential integers, UUIDs, etc.Contract for concrete instance generation given type information."Hook" methods for customizing behavior in response to system lifecycle events - server started, request received, response written, and so on.An informational "loggable" event that occurs during Soklet's internal processing - for example, if an error occurs while handling a request.Builder used to construct instances ofLogEvent
viaLogEvent.with(LogEventType, String)
.Builder used to copy instances ofLogEvent
viaLogEvent.copy()
.Kinds ofLogEvent
instances that Soklet can produce.A finalized representation of aResponse
, suitable for sending to clients over the wire.Builder used to construct instances ofMarshaledResponse
viaMarshaledResponse.withStatusCode(Integer)
.Builder used to copy instances ofMarshaledResponse
viaMarshaledResponse.copy()
.Encapsulates an HTML form element name, binary andString
representations of its value, and other attributes as encoded according to themultipart/form-data
specification.Builder used to construct instances ofMultipartField
viaMultipartField.withName(String)
orMultipartField.with(String, byte[])
.Builder used to copy instances ofMultipartField
viaMultipartField.copy()
.Contract for parsing HTML form fields encoded according to themultipart/form-data
specification.Typesafe representation of HTTP Redirect types (301, 302, 303, 307, 308
).Encapsulates information specified in an HTTP request.Builder used to construct instances ofRequest
viaRequest.with(HttpMethod, String)
.Builder used to copy instances ofRequest
viaRequest.copy()
.Contract for converting request body bytes into a corresponding Java type.Encapsulates the results of a request (both logical response and bytes to be sent over the wire), useful for integration testing viaSimulator.performRequest(Request)
.Builder used to construct instances ofRequestResult
viaRequestResult.withMarshaledResponse(MarshaledResponse)
.Builder used to copy instances ofRequestResult
viaRequestResult.copy()
.Represents a Resource Method, which is a JavaMethod
invoked by Soklet to handle an HTTP request.Contract for determining parameter values to inject when invoking Resource Methods.Contract for matching incoming HTTP requests with appropriate Resource Methods (Java methods to invoke to handle requests).An HTTP URL path used to resolve a Resource Method at runtime, such as/users/123
.A compile-time HTTP URL path declaration associated with an annotated Resource Method, such as/users/{userId}
.Represents a/
-delimited part of aResourcePathDeclaration
.How to interpret aResourcePathDeclaration.Component
of aResourcePathDeclaration
- is it literal text or a placeholder?Represents a logical HTTP response returned by a Resource Method.Builder used to construct instances ofResponse
viaResponse.withStatusCode(Integer)
orResponse.withRedirect(RedirectType, String)
.Builder used to copy instances ofResponse
viaResponse.copy()
.HTTP "response" Cookie representation which supportsSet-Cookie
header encoding.Builder used to construct instances ofResponseCookie
viaResponseCookie.withName(String)
orResponseCookie.with(String, String)
.Builder used to copy instances ofResponseCookie
viaResponseCookie.copy()
.Values which control whether or not a response cookie is sent with cross-site requests, providing some protection against cross-site request forgery attacks (CSRF).Prepares responses for each request scenario Soklet supports (happy path, exception, CORS preflight, etc.)Contract for HTTP server implementations that are designed to be managed by aSoklet
instance.Request/response processing contract forServer
implementations.Encapsulates a Server-Sent Event payload that can be sent across the wire to a client.Builder used to construct instances ofServerSentEvent
viaServerSentEvent.withEvent(String)
orServerSentEvent.withData(String)
.Broadcasts a Server-Sent Event payload to all clients listening on aResourcePath
.A special HTTP server whose only purpose is to provide Server-Sent Event functionality.Request/response processing contract forServerSentEventServer
implementations.Simulates server behavior of accepting a request and returning a response, useful for writing integration tests.Formal enumeration of valid HTTP status codes.A non-instantiable collection of utility methods.