### Server Start API Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Server%24.html APIs for starting the Xitrum web server with custom or default configurations. ```APIDOC ## POST /start ### Description Starts the Xitrum web server with a custom ChannelInitializer. ### Method POST ### Endpoint /start ### Parameters #### Request Body - **httpChannelInitializer** (ChannelInitializer[SocketChannel]) - Required - Your custom ChannelInitializer. ### Request Example ```json { "httpChannelInitializer": "xitrum.handler.DefaultHttpChannelInitializer" } ``` ### Response #### Success Response (200) - **Seq[EventLoopGroup]** - A sequence of EventLoopGroup instances representing the server's event loops. #### Response Example ```json [ "EventLoopGroup1", "EventLoopGroup2" ] ``` ``` ```APIDOC ## POST /start ### Description Starts the Xitrum web server with the default ChannelInitializer provided by Xitrum. ### Method POST ### Endpoint /start ### Response #### Success Response (200) - **Seq[EventLoopGroup]** - A sequence of EventLoopGroup instances representing the server's event loops. #### Response Example ```json [ "EventLoopGroup1", "EventLoopGroup2" ] ``` ``` -------------------------------- ### Route Tokenization Example Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/routing/index.html Demonstrates how a route string is parsed into route tokens. The example shows a route with a format specifier and how it breaks down into non-dot and dot route tokens. ```scala "articles/:id<[0-9]+>.:format" gives 2 tokens: - NonDotRouteToken("articles", false, None) - DotRouteToken(Seq(NonDotRouteToken("id", true, Some("[0-9]+.r"))), NonDotRouteToken("format", true, None))) ``` ```scala "articles/:id<[0-9]+>" gives 2 tokens: - NonDotRouteToken("articles", false, None) - NonDotRouteToken("id", true, Some("[0-9]+.r")) ``` -------------------------------- ### Actor Example with Asynchronous Response Source: https://xitrum-framework.github.io/ This example demonstrates how to create an actor that can be accessed via web. It shows inter-actor communication and handling asynchronous replies or timeouts using `context.setReceiveTimeout`. ```scala import scala.concurrent.duration._ import akka.actor.ReceiveTimeout import xitrum.ActorAction import xitrum.annotation.GET @GET("url/to/HelloActor") class HelloActor extends ActorAction { def execute() { log.info("Request received: " + request) // Communicate with another actor anotherActorRef ! "aMsg" // Wait for the above actor to reply within 5s context.setReceiveTimeout(5.seconds) context.become { case aReply => respondText(aReply) case ReceiveTimeout => respondText("Timeout") } } override def postStop() { log.info("Connection closed or response sent") super.postStop() } } ``` -------------------------------- ### Server Lifecycle Management Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Server%24.html Methods to start and stop the Xitrum server instance. ```APIDOC ## start(httpChannelInitializer: ChannelInitializer[SocketChannel]) ### Description Starts the Xitrum server using a custom ChannelInitializer. SSL codec handlers are automatically prepended for HTTPS configurations. ### Parameters #### Request Body - **httpChannelInitializer** (ChannelInitializer[SocketChannel]) - Required - The custom channel initializer to use for the server. ## start() ### Description Starts the Xitrum server using the default ChannelInitializer provided by the Xitrum framework. ## stop() ### Description Stops the Xitrum server gracefully. Note: Do not call this method within a Xitrum action thread to avoid potential deadlocks. ## stopAtShutdown() ### Description Registers a JVM shutdown hook that triggers a graceful stop of the Xitrum server. Once registered, the server can be stopped via OS signals (e.g., kill ). ``` -------------------------------- ### GET /start Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/FlashSocketPolicyServer%24.html Retrieves the sequence of EventLoopGroup objects used by the framework. ```APIDOC ## GET /start ### Description Starts the process and returns the sequence of EventLoopGroup instances. ### Method GET ### Endpoint /start ### Response #### Success Response (200) - **result** (Seq[EventLoopGroup]) - A sequence of event loop groups. ``` -------------------------------- ### GET Annotation Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/annotation/GET.html The GET annotation is used to define a route for an action that responds to HTTP GET requests. ```APIDOC ## GET Annotation ### Description Defines a route for an action that handles HTTP GET requests. ### Method GET ### Parameters #### Path Parameters - **paths** (String*) - Required - One or more path patterns that this action will respond to. ``` -------------------------------- ### Hello World Action Example Source: https://xitrum-framework.github.io/ This action runs directly on Netty's IO thread pool. Use it for simple actions. For complex actions, extend `xitrum.FutureAction` to avoid blocking. ```scala import xitrum.Action import xitrum.annotation.GET @GET("url/to/HelloAction") class HelloAction extends Action { def execute() { val urlToHelloActor = url[HelloActor] respondHtml(

Hello {remoteIp}!

Actor example
) } } ``` -------------------------------- ### GET Annotation Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/annotation/DELETE.html The GET annotation is used to define routes that handle HTTP GET requests. It can accept multiple path patterns. ```APIDOC ## GET /path ### Description Defines a route that handles HTTP GET requests. ### Method GET ### Endpoint /path ### Parameters #### Path Parameters - **paths** (String*) - Required - One or more path patterns for the GET route. ### Request Example ```json { "example": "No request body is typically sent with a GET request, but path parameters are defined by the annotation." } ``` ### Response #### Success Response (200) - **data** (any) - The requested data. #### Response Example ```json { "example": "{\"data\": \"some data\"}" } ``` ``` -------------------------------- ### Bootstrap.newBootstrap Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/handler/Bootstrap%24.html Initializes a new server bootstrap configuration with a provided channel initializer. ```APIDOC ## newBootstrap ### Description Creates a new ServerBootstrap and associated EventLoopGroups based on the provided channel initializer. ### Parameters - **channelInitializer** (ChannelInitializer[SocketChannel]) - Required - The initializer to be used for the socket channel. ### Response - **(ServerBootstrap, Seq[EventLoopGroup])** - Returns a tuple containing the configured ServerBootstrap and a sequence of EventLoopGroups. ``` -------------------------------- ### Define GET Route Annotation Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/annotation/GET.html This case class defines the GET annotation for routing HTTP GET requests. It accepts a variable number of path strings. ```scala case class GET(paths: String*) extends Annotation with Route with Product with Serializable ``` -------------------------------- ### Create New Xitrum Project Source: https://xitrum-framework.github.io/ Instructions for creating a new Xitrum project using the skeleton and starting the development server. ```Shell sbt/sbt run ``` ```Shell sbt/sbt eclipse ``` -------------------------------- ### MetricsManager - Start Collection Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/metrics/MetricsManager%24.html Starts the metrics collection process. This method is part of the MetricsManager object. ```scala def start(): Unit ``` -------------------------------- ### Min Apply Methods Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/validator/Min%24.html Demonstrates how to create Min instances using the apply methods for different numeric types. ```APIDOC ## Apply Methods for Min ### Description These methods allow for the creation of `Min` objects by applying a value of a specific numeric type. ### Methods - `apply(value: Short): Min[Short]` - `apply(value: Long): Min[Long]` - `apply(value: Int): Min[Integer]` - `apply(value: Float): Min[Float]` - `apply(value: Double): Min[Double]` - `apply(value: Byte): Min[Byte]` - `apply[T <: Comparable[T]](value: T): Min[T]` ### Example ```scala // Example for Int val minInt = Min.apply(10) // Example for a generic Comparable type val minString = Min.apply("hello") ``` ``` -------------------------------- ### Product and AnyRef Methods Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/routing/NonDotRouteToken.html Documentation for methods inherited from Product and AnyRef traits. ```APIDOC ## Object Methods ### Description Provides access to standard object methods and properties. ### Methods - **productElementNames**: Iterator[String] - **!= (arg0: Any)**: Boolean - **##**: Int - **== (arg0: Any)**: Boolean - **clone()**: AnyRef - **eq (arg0: AnyRef)**: Boolean - **finalize()**: Unit - **getClass()**: Class[_ <: AnyRef] - **ne (arg0: AnyRef)**: Boolean - **notify()**: Unit - **notifyAll()**: Unit - **synchronized[T0](arg0: => T0)**: T0 - **wait()**: Unit - **wait(arg0: Long, arg1: Int)**: Unit - **wait(arg0: Long)**: Unit ### Properties - **isPlaceholder**: Boolean - **regex**: Option[Regex] - **value**: String ### Inherited from Any - **asInstanceOf[T0]**: T0 - **isInstanceOf[T0]**: Boolean ### Inherited from AnyRef - **final def !=(arg0: Any): Boolean** - **final def ##: Int** - **final def ==(arg0: Any): Boolean** - **def clone(): AnyRef** - **final def eq(arg0: AnyRef): Boolean** - **def finalize(): Unit** - **final def getClass(): Class[_ <: AnyRef]** - **final def ne(arg0: AnyRef): Boolean** - **final def notify(): Unit** - **final def notifyAll(): Unit** - **final def synchronized[T0](arg0: => T0): T0** - **final def wait(): Unit** - **final def wait(arg0: Long, arg1: Int): Unit** - **final def wait(arg0: Long): Unit** ### Ungrouped Methods - **final def !=(arg0: Any): Boolean** - **final def ##: Int** - **final def ==(arg0: Any): Boolean** - **final def asInstanceOf[T0]: T0** - **def clone(): AnyRef** - **def decompile(forSwagger: Boolean): String** - **final def eq(arg0: AnyRef): Boolean** - **def finalize(): Unit** - **final def getClass(): Class[_ <: AnyRef]** - **final def isInstanceOf[T0]: Boolean** - **def matchToken(pathParams: Params, pathTokens: Seq[String], last: Boolean): Boolean** - **final def ne(arg0: AnyRef): Boolean** - **final def notify(): Unit** - **final def notifyAll(): Unit** - **def numPlaceholders: Int** - **def productElementNames: Iterator[String]** - **final def synchronized[T0](arg0: => T0): T0** - **def url(params: Map[String, Any]): Either[String, (Any, Map[String, Any])]** - **final def wait(): Unit** - **final def wait(arg0: Long, arg1: Int): Unit** - **final def wait(arg0: Long): Unit** ``` -------------------------------- ### Swagger Annotation Example Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/annotation/Swagger%24%24Tags.html Example of using the Swagger annotation for API documentation. This is part of the xitrum.annotation package. ```scala import xitrum.annotation.Swagger ``` -------------------------------- ### Swagger Annotation Example Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/annotation/Swagger%24%24BinaryQuery.html This example demonstrates the definition of a BinaryQuery annotation used with Swagger for API documentation. ```scala case class BinaryQuery(name: String, desc: String = "") extends SwaggerParamArg with SwaggerQueryParam with SwaggerBinaryParam with Product with Serializable ``` -------------------------------- ### Respond with Template URI and Options Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Responds by rendering a template specified by its URI, with additional options. Returns a ChannelFuture. ```Scala def respondTemplate(uri: String, options: Map[String, Any]): ChannelFuture ``` -------------------------------- ### Respond with View Action and Options Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Responds with a view defined by an Action class, with additional options. Requires an implicit Manifest for the Action type. Returns a ChannelFuture. ```Scala def respondView[T <: Action](options: Map[String, Any])(implicit arg0: Manifest[T]): ChannelFuture ``` -------------------------------- ### Swagger Annotation with DatePath Example Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/annotation/Swagger%24%24DatePath.html Example of using the `DatePath` annotation within the `Swagger` object. This annotation is used for defining path parameters with date types in Swagger specifications. ```scala new DatePath(name: String, desc: String = "") ``` -------------------------------- ### Respond with View URI and Options Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Responds by rendering a view specified by its URI, with additional options. Returns a ChannelFuture. ```Scala def respondView(uri: String, options: Map[String, Any]): ChannelFuture ``` -------------------------------- ### GET /map/keys Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/scope/request/At.html Retrieves all keys present in the HashMap. ```APIDOC ## GET /map/keys ### Description Returns an iterable collection of all keys stored in the HashMap. ### Method GET ### Response #### Success Response (200) - **keys** (Iterable[String]) - A collection of all keys in the map. ``` -------------------------------- ### GET /keys Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/handler/HandlerEnv.html Retrieves all keys present in the HashMap. ```APIDOC ## GET /keys ### Description Returns an iterable collection of all keys in the map. ### Response #### Success Response (200) - **keys** (Iterable[Any]) - A collection of all keys. ``` -------------------------------- ### Respond with View Action (No Layout) and Options Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Responds with a view defined by an Action class, without using a layout, and with additional options. Requires an implicit Manifest for the Action type. Returns a ChannelFuture. ```Scala def respondViewNoLayout[T <: Action](options: Map[String, Any])(implicit arg0: Manifest[T]): ChannelFuture ``` -------------------------------- ### Respond with View URI, Custom Layout, and Options Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Responds by rendering a view specified by its URI, using a custom layout and additional options. Returns a ChannelFuture. ```Scala def respondView(customLayout: () => Any, uri: String, options: Map[String, Any]): ChannelFuture ``` -------------------------------- ### GET /isEmpty Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/handler/HandlerEnv.html Checks if the HashMap contains no elements. ```APIDOC ## GET /isEmpty ### Description Checks if the map is empty. ### Response #### Success Response (200) - **isEmpty** (Boolean) - True if the map contains no elements, false otherwise. ``` -------------------------------- ### GET /json Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/routing/SwaggerJson%24.html Retrieves the JSON representation of the object. ```APIDOC ## GET /json ### Description Returns the JSON string representation of the current object. ### Method GET ### Endpoint /json ### Response #### Success Response (200) - **json** (String) - The JSON string representation. ``` -------------------------------- ### SockJS Options Example Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/routing/index.html Illustrates the structure of SockJS options, which are named after SockJS options. These options control WebSocket and cookie handling for SockJS connections. ```json {"websocket": true, "cookie_needed": false, "origins": ["*:*"], "entropy": 123} ``` -------------------------------- ### Respond with View URI (No Layout) and Options Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Responds by rendering a view specified by its URI, without using a layout, and with additional options. Returns a ChannelFuture. ```Scala def respondViewNoLayout(uri: String, options: Map[String, Any]): ChannelFuture ``` -------------------------------- ### Get Server Name Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/FutureAction.html Returns the name of the server. ```scala lazy val serverName: String ``` -------------------------------- ### GetActionClassDefaultsToCurrentAction Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/metrics/XitrumMetricsChannel.html Default implementation for getting the current action class. ```APIDOC ## GetActionClassDefaultsToCurrentAction ### Description Default implementation for getting the current action class. ### Methods #### `getActionClass[T <: Action]()` - **Description**: Gets the action class. - **Type Parameter**: `T` - The type of the action class. - **Implicit Parameter**: `arg0` (Manifest[T]) - Required - Manifest for the action type `T`. - **Return Type**: `Class[Action]` ``` -------------------------------- ### Configuration and Utility Methods Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Config%24.html Provides access to application configuration, route loading, and environment-specific settings. ```APIDOC ## Configuration Access ### Description Access core application settings and environment configurations. ### Properties - **application** (Config) - Represents the application.conf configuration. - **xitrum** (XitrumConfig) - Represents settings defined in xitrum.conf. - **productionMode** (Boolean) - Returns true if the system property 'xitrum.mode' is set to 'production'. - **ACTOR_SYSTEM_NAME** (String) - The name of the actor system. - **actorSystem** (ActorSystem) - The Akka ActorSystem instance initialized as 'xitrum'. ## Route Management ### Description Methods for managing and loading application routes. ### Methods - **loadRoutes(cl: ClassLoader, quiet: Boolean)**: Returns a RouteCollection. Used to load routes, potentially multiple times during development mode for hot reloading. - **routes** (RouteCollection) - Variable holding the current route collection. ## Utility Methods ### Description Helper methods for URL generation and system error handling. ### Methods - **withBaseUrl(path: String)**: Returns a String. Prepends the base URL to the provided path. - **exitOnStartupError(msg: String, e: Throwable)**: Handles fatal errors during application startup. - **exitOnStartupError(msg: String)**: Overload for handling startup errors with a message. ``` -------------------------------- ### GET /routes/all Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/routing/RouteCollection.html Retrieves all routes currently registered in the application. ```APIDOC ## GET /routes/all ### Description Returns all routes in one place. The returned elements are ArrayBuffer and can be modified. ### Method GET ### Endpoint /routes/all ### Response #### Success Response (200) - **all** (Seq[ArrayBuffer[Route]]) - A collection of all registered routes. ``` -------------------------------- ### Channel Initializer Methods Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/handler/DefaultHttpChannelInitializer.html Methods specific to initializing and configuring channels. ```APIDOC ## Channel Initializer Methods ### Description Methods for customizing the channel pipeline during initialization. ### Methods - `initChannel(ch: SocketChannel): Unit` - Description: Override this method to customize the default pipeline. Inbound direction: first handler -> last handler. Outbound direction: last handler -> first handler. ### Definition Classes - `DefaultHttpChannelInitializer` - `ChannelInitializer` ``` -------------------------------- ### Respond with View Action, Custom Layout, and Options Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Responds with a view defined by an Action class, using a custom layout and additional options. Requires an implicit Manifest for the Action type. Returns a ChannelFuture. ```Scala def respondView[T <: Action](customLayout: () => Any, options: Map[String, Any])(implicit arg0: Manifest[T]): ChannelFuture ``` -------------------------------- ### GET xitrum/xitrum-3.30.0.js Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/index.html Retrieves the Xitrum JavaScript library file. ```APIDOC ## GET xitrum/xitrum-3.30.0.js ### Description Retrieves the xitrum.js library file for use in client-side views. ### Method GET ### Endpoint xitrum/xitrum-3.30.0.js ``` -------------------------------- ### GET /registryAsJson Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/metrics/Publish.html Retrieves the registry data as a JSON string. ```APIDOC ## GET /registryAsJson ### Description Returns the current registry state serialized as a JSON string. ### Method GET ### Endpoint /registryAsJson ### Response #### Success Response (200) - **registryAsJson** (String) - The registry data in JSON format. ``` -------------------------------- ### Channel Initialization Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/handler/SslChannelInitializer.html Methods for initializing the channel pipeline. ```APIDOC ## initChannel ### Description Initializes the channel pipeline. ### Parameters #### Path Parameters - **ch** (SocketChannel) - Required - The socket channel to initialize. ``` -------------------------------- ### Action Class Retrieval Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/FutureAction.html Method to get the class of an action. ```APIDOC ## Action Class Retrieval ### Description Retrieves the `Class` object for a given action type. ### Method - `getActionClass[T <: Action]()`: Returns the `Class[Action]` for the action type specified by the type parameter `T`. ``` -------------------------------- ### Product Methods Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/annotation/Swagger%24%24DoubleQuery.html Details the methods available for Product objects. ```APIDOC ## Product Methods ### Description Provides methods for Product objects, typically used for case classes. ### Methods - `productElementNames: Iterator[String]` ### Notes This method is inherited from the standard Scala Product trait. ``` -------------------------------- ### GET /bodyTextParams Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/SockJsAction.html Accesses parameters provided in the request body. ```APIDOC ## GET /bodyTextParams ### Description Retrieves parameters sent within the request body. ### Method GET ### Response #### Success Response (200) - **params** (Map) - A collection of key-value pairs from the request body. ``` -------------------------------- ### Get Anti-CSRF Token Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/FutureAction.html Retrieves the anti-CSRF token string. ```scala def antiCsrfToken: String ``` -------------------------------- ### Render View with Options Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Renders a template at a given URI and applies the default layout. Options specific to the template engine can be provided. ```Scala def renderView(uri: String, options: Map[String, Any]): String ``` -------------------------------- ### Get WebSocket Scheme Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/FutureAction.html Returns the scheme for WebSocket connections. ```scala lazy val webSocketScheme: String ``` -------------------------------- ### Get Server Port Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/FutureAction.html Returns the port number of the server. ```scala lazy val serverPort: Int ``` -------------------------------- ### Respond with View Action (No Layout) Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Responds with a view defined by an Action class, without using a layout. Requires an implicit Manifest for the Action type. Returns a ChannelFuture. ```Scala def respondViewNoLayout[T <: Action]()(implicit arg0: Manifest[T]): ChannelFuture ``` -------------------------------- ### Respond with View Action and Custom Layout Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Responds with a view defined by an Action class, using a custom layout. Requires an implicit Manifest for the Action type. Returns a ChannelFuture. ```Scala def respondView[T <: Action](customLayout: () => Any)(implicit arg0: Manifest[T]): ChannelFuture ``` -------------------------------- ### Get CSRF token Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Retrieves the anti-CSRF token string. ```scala antiCsrfToken ``` -------------------------------- ### GET /hashmap/keySet Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/scope/request/At.html Returns a set containing all keys present in the HashMap. ```APIDOC ## GET /hashmap/keySet ### Description Returns a set containing all keys present in the HashMap. ### Response #### Success Response (200) - **keys** (Set[String]) - A set of all keys in the map. ``` -------------------------------- ### Inherited from Product Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/annotation/Swagger%24%24OptBinaryQuery.html Details methods inherited from the Product trait. ```APIDOC ## Inherited from Product ### Value Members ### `productElementNames`: Iterator[String] - **Description**: Returns an iterator over the names of the elements of this product. - **Method**: N/A (Inherited Value Member) - **Endpoint**: N/A - **Parameters**: None - **Request Body**: None ``` -------------------------------- ### Respond with View Action Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Responds with a view defined by an Action class. Requires an implicit Manifest for the Action type. Returns a ChannelFuture. ```Scala def respondView[T <: Action]()(implicit arg0: Manifest[T]): ChannelFuture ``` -------------------------------- ### GET /hashmap/get Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/scope/request/At.html Retrieves the value associated with a specific key from the HashMap. ```APIDOC ## GET /hashmap/get ### Description Retrieves the value associated with a specific key from the HashMap. ### Parameters #### Query Parameters - **key** (String) - Required - The key to look up in the map. ### Response #### Success Response (200) - **value** (Option[Any]) - The value associated with the key, if it exists. ``` -------------------------------- ### GET getActionClass Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/view/GetActionClassDefaultsToCurrentAction.html Retrieves the class object for a given Action type. ```APIDOC ## GET getActionClass ### Description Retrieves the Class object associated with a specific Action type using a manifest. ### Method GET ### Parameters #### Query Parameters - **T** (Type) - Required - The Action type to retrieve the class for. ### Response #### Success Response (200) - **Class[Action]** (Class) - The class object of the specified Action. ``` -------------------------------- ### ViewResponder: respondTemplate with options Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/SockJsAction.html Renders a template with specified options and responds with the generated content. ```APIDOC ## GET /api/respondTemplateWithOptions ### Description Renders a template with specified options and responds with the generated content. ### Method GET ### Endpoint /api/respondTemplateWithOptions ### Parameters #### Query Parameters - **uri** (String) - Required - The URI of the template to render. - **options** (Map[String, Any]) - Optional - A map of options to customize template rendering. ### Response #### Success Response (200) - **ChannelFuture** - Represents the asynchronous completion of the response. ### Response Example (Response content will be the rendered HTML or other template output) ``` -------------------------------- ### get Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/util/Mime%24.html Retrieves the MIME type for a given file or file path. ```APIDOC ## get ### Description Retrieves the MIME type associated with a specific file or file path. ### Parameters #### Query Parameters - **file** (File/String) - Required - The file object or path string to look up. ### Response #### Success Response (200) - **result** (Option[String]) - The MIME type if found, otherwise None. ``` -------------------------------- ### Any Methods Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/annotation/Swagger%24%24BinaryBody.html This section details the methods available for Any objects within the Xitrum Framework. ```APIDOC ## Any Methods ### Description Provides fundamental methods for Any objects. ### Methods - `asInstanceOf[T0]: T0` - `isInstanceOf[T0]: Boolean` ``` -------------------------------- ### GET Request Parameters Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/handler/HandlerEnv.html Accessing merged request parameters from the HandlerEnv. ```APIDOC ## GET Request Parameters ### Description Retrieves merged request parameters from the current handler environment. ### Parameters #### Properties - **textParams** (Params) - The merge of all text params (queryParams, bodyParams, and pathParams), as contrast to file upload (bodyFileParams). - **urlParams** (Params) - The merge of queryParams and pathParams, things that appear in the request URL. ``` -------------------------------- ### Respond with Template URI Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Responds by rendering a template specified by its URI. Returns a ChannelFuture. ```Scala def respondTemplate(uri: String): ChannelFuture ``` -------------------------------- ### Core Object Methods Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/view/FlashRenderer.html Documentation for core methods available on objects, including inherited methods from Any and AnyRef. ```APIDOC ## Object Methods ### Description This section details common methods available on objects within the Xitrum framework, including standard Scala methods and framework-specific ones. ### Methods - **!= (arg0: Any): Boolean** - Description: Checks for inequality. - Defined in: AnyRef - **##: Int** - Description: Returns the hash code of the object. - Defined in: AnyRef - **== (arg0: Any): Boolean** - Description: Checks for equality. - Defined in: AnyRef - **asInstanceOf[T0]: T0** - Description: Casts the object to a specified type. - Defined in: Any - **clone(): AnyRef** - Description: Creates a copy of the object. - Throws: `java.lang.CloneNotSupportedException` - Defined in: AnyRef - **eq (arg0: AnyRef): Boolean** - Description: Checks for reference equality. - Defined in: AnyRef - **equals(arg0: AnyRef): Boolean** - Description: Compares the object for equality with another object. - Defined in: AnyRef - **finalize(): Unit** - Description: Called by the garbage collector before an object is reclaimed. - Throws: `java.lang.Throwable` - Defined in: AnyRef - **getClass(): Class[_ <: AnyRef]** - Description: Returns the runtime class of this object. - Defined in: AnyRef - **hashCode(): Int** - Description: Returns the hash code value for the object. - Defined in: AnyRef - **isInstanceOf[T0]: Boolean** - Description: Checks if the object is an instance of a specified type. - Defined in: Any - **ne (arg0: AnyRef): Boolean** - Description: Checks for reference inequality. - Defined in: AnyRef - **notify(): Unit** - Description: Wakes up a single thread that is waiting on this object's monitor. - Defined in: AnyRef - **notifyAll(): Unit** - Description: Wakes up all threads that are waiting on this object's monitor. - Defined in: AnyRef - **synchronized[T0](arg0: => T0): T0** - Description: Returns the result of the given block of code synchronized on this object. - Defined in: AnyRef - **toString(): String** - Description: Returns a string representation of the object. - Defined in: AnyRef - **wait(): Unit** - Description: Causes the current thread to wait until it is awakened. - Throws: `java.lang.InterruptedException` - Defined in: AnyRef - **wait(arg0: Long, arg1: Int): Unit** - Description: Causes the current thread to wait until it is awakened, with a specified timeout and nanosecond adjustment. - Throws: `java.lang.InterruptedException` - Defined in: AnyRef - **wait(arg0: Long): Unit** - Description: Causes the current thread to wait until it is awakened, with a specified timeout. - Throws: `java.lang.InterruptedException` - Defined in: AnyRef ### Xitrum Specific Value Members - **xitrumCss: Node** - Description: Represents Xitrum CSS as a Node. - Defined in: Ungrouped ``` -------------------------------- ### GET /requestContent Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/handler/HandlerEnv.html Access the request body content in different formats. ```APIDOC ## GET /requestContent ### Description Provides access to the request body as a JSON4S JValue or a raw String. ### Method GET ### Endpoint /requestContent ### Response - **requestContentJValue** (JValue) - The whole request body parsed as JSON4S JValue. - **requestContentString** (String) - The whole request body as String. ``` -------------------------------- ### Respond with View URI and Custom Layout Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/Component.html Responds by rendering a view specified by its URI, using a custom layout. Returns a ChannelFuture. ```Scala def respondView(customLayout: () => Any, uri: String): ChannelFuture ``` -------------------------------- ### GET /get Source: https://xitrum-framework.github.io/api/3.30.0/xitrum/handler/HandlerEnv.html Retrieves the value associated with a specific key from the HashMap. ```APIDOC ## GET /get ### Description Retrieves the value associated with the provided key. ### Parameters #### Query Parameters - **key** (Any) - Required - The key to look up in the map. ### Response #### Success Response (200) - **value** (Option[Any]) - The value associated with the key, if it exists. ```