org.mashupbots.socko

events

package events

Socko events are raised by Socko and passed into your routes for dispatching to your handlers. Socko events provides a bridge between Netty and Akka.

There are 4 types of org.mashupbots.socko.events.SockoEvent

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. events
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class CurrentHttpRequestMessage(nettyHttpRequest: HttpRequest) extends HttpRequestMessage with Product with Serializable

    HTTP request message for the current event (as opposed to an initial HTTP required to triggered a HTTP Chunk or web socket event).

    HTTP request message for the current event (as opposed to an initial HTTP required to triggered a HTTP Chunk or web socket event).

    nettyHttpRequest

    Netty HTTP request message

  2. case class DefaultHttpContent(buffer: ByteBuf, contentType: String) extends HttpContent with Product with Serializable

    Represents the contents or body of the HTTP request

    Represents the contents or body of the HTTP request

    buffer

    Request body

    contentType

    MIME type of the request body

  3. case class EndPoint(method: String, host: String, uri: String) extends Product with Serializable

    Identifies the end point associated with the firing of an event.

    Identifies the end point associated with the firing of an event. In Socko terminology, an end point comprise the request method, host, path and query string.

    method

    Web method. eg. GET.

    host

    Host name or IP address

    uri

    Request URI as per the HTTP request line. For example: /folder/file.html or /folder/file.html?param1=value1&param2=value2

  4. case class HttpChunkEvent(context: ChannelHandlerContext, initialHttpRequest: InitialHttpRequestMessage, nettyHttpChunk: NettyHttpContent, config: HttpEventConfig) extends SockoEvent with HttpEvent with Product with Serializable

    Event fired when a HTTP chunk is received

    Event fired when a HTTP chunk is received

    The org.mashupbots.socko.events.HttpChunkEvent will only be fired if:

    initialHttpRequest

    The initial HTTP request associated with this chunk

    nettyHttpChunk

    Incoming chunk of data for processing

    config

    Processing configuration

  5. case class HttpChunkMessage(nettyHttpChunk: NettyHttpContent) extends Product with Serializable

    HTTP chunk sent from client to sever

    HTTP chunk sent from client to sever

    nettyHttpChunk

    Netty representation of the HTTP Chunk

  6. trait HttpContent extends AnyRef

  7. trait HttpEvent extends SockoEvent

    Abstract event triggered on HTTP related activity

  8. case class HttpEventConfig(serverName: String, minCompressibleContentSizeInBytes: Int, maxCompressibleContentSizeInBytes: Int, compressibleContentTypes: List[String], webLogWriter: Option[ActorRef]) extends Product with Serializable

    HTTP event configuration used in the processing of org.mashupbots.socko.events.HttpEvents.

    HTTP event configuration used in the processing of org.mashupbots.socko.events.HttpEvents.

    serverName

    Name of this instance of the Socko Web Server

    minCompressibleContentSizeInBytes

    Minimum number of bytes before content will be compressed if requested by the client. Set to -1 to turn off compression.

    maxCompressibleContentSizeInBytes

    Maximum number of bytes before HTTP content will be not be compressed if requested by the client. Defaults to 1MB otherwise too much CPU maybe taken up for compression.

    compressibleContentTypes

    List of MIME types of that can be compressed.

    webLogWriter

    Actor to which web log events to be sent

  9. case class HttpHeader(name: String, value: String) extends Product with Serializable

    Represents a HTTP header field

  10. case class HttpLastChunkEvent(context: ChannelHandlerContext, initialHttpRequest: InitialHttpRequestMessage, nettyHttpLastChunk: NettyHttpLastContent, config: HttpEventConfig) extends SockoEvent with HttpEvent with Product with Serializable

    Event fired when the last HTTP chunk is received

    Event fired when the last HTTP chunk is received

    The org.mashupbots.socko.events.HttpChunkEvent will only be fired if:

    initialHttpRequest

    The initial HTTP request associated with this chunk

    config

    Processing configuration

  11. case class HttpLastChunkMessage(nettyHttpLastChunk: NettyHttpLastContent) extends Product with Serializable

    HTTP last chunk sent from client to sever

    HTTP last chunk sent from client to sever

    nettyHttpLastChunk

    Netty representation of the last HTTP Chunk

  12. case class HttpRequestEvent(context: ChannelHandlerContext, nettyHttpRequest: HttpRequest, config: HttpEventConfig) extends SockoEvent with HttpEvent with Product with Serializable

    Event fired when a HTTP request has been received

    Event fired when a HTTP request has been received

    nettyHttpRequest

    Incoming Netty request for processing

    config

    Processing configuration

  13. trait HttpRequestMessage extends AnyRef

    Encapsulates the all the data sent in a HTTP request; i.e.

    Encapsulates the all the data sent in a HTTP request; i.e. headers and content.

  14. case class HttpResponseMessage(event: HttpEvent) extends Product with Serializable

    Encapsulates all the data to be sent to the client in an HTTP response; i.e.

    Encapsulates all the data to be sent to the client in an HTTP response; i.e. headers and content.

    event

    Event associated with this response

  15. case class HttpResponseStatus(code: Int) extends Product with Serializable

    Port of Netty's HttpResponseStatus class for convenience.

    Port of Netty's HttpResponseStatus class for convenience.

    code

    HTTP response status code as per RFC 2616.

  16. case class ImmutableHttpHeaders(values: Seq[HttpHeader]) extends Iterable[HttpHeader] with Product with Serializable

    Immutable and read only collection of HTTP headers

    Immutable and read only collection of HTTP headers

    Unlike a HashMap, this collection supports multiple entries with the same field name and name matching is performed in a case insensitive manner as per RFC 2616.

  17. case class InitialHttpRequestMessage(headers: ImmutableHttpHeaders, endPoint: EndPoint, isKeepAlive: Boolean, acceptedEncodings: List[String], httpVersion: String, is100ContinueExpected: Boolean, ifModifiedSince: Option[Date], isChunked: Boolean, isWebSocketUpgrade: Boolean, contentType: String, contentLength: Long, createdOn: Date) extends HttpRequestMessage with Product with Serializable

    Details of the HTTP request that initiated the web socket connection or chunk transfer.

    Details of the HTTP request that initiated the web socket connection or chunk transfer.

    To save space, the contents is not stored

  18. case class MutableHttpHeaders() extends Iterable[HttpHeader] with Product with Serializable

    Mutable collection of HTTP headers

    Mutable collection of HTTP headers

    Unlike a HashMap, this collection supports multiple entries with the same field name and name matching is performed in a case insensitive manner as per RFC 2616.

  19. type NettyHttpContent = io.netty.handler.codec.http.HttpContent

  20. type NettyHttpLastContent = LastHttpContent

  21. type NettyHttpRequest = HttpRequest

  22. type NettyHttpResponse = HttpResponse

  23. abstract class SockoEvent extends AnyRef

    Socko Events are fired by Socko and passed to your routes for dispatching to your handlers.

  24. case class WebSocketEventConfig(serverName: String, webLogWriter: Option[ActorRef]) extends Product with Serializable

    Web Socket configuration used by org.mashupbots.socko.events.WebSocketFrameEvent in processing

    Web Socket configuration used by org.mashupbots.socko.events.WebSocketFrameEvent in processing

    serverName

    Name of this instance of the Socko Web Server

    webLogWriter

    Actor to which web log events to be sent

  25. case class WebSocketFrameEvent(context: ChannelHandlerContext, initialHttpRequest: InitialHttpRequestMessage, wsFrame: WebSocketFrame, config: WebSocketEventConfig) extends SockoEvent with Product with Serializable

    Event fired when a web socket text or binary frame is received.

    Event fired when a web socket text or binary frame is received.

    A org.mashupbots.socko.events.WebSocketFrameEvent will only be fired after an initial org.mashupbots.socko.events.WebSocketHandshakeEvent has been successfully processed.

    initialHttpRequest

    The initial HTTP request

    wsFrame

    Incoming data for processing

    config

    Web Socket configuration

  26. case class WebSocketHandshakeEvent(context: ChannelHandlerContext, nettyHttpRequest: FullHttpRequest, config: HttpEventConfig) extends SockoEvent with HttpEvent with Product with Serializable

    Event fired when performing a web socket handshake to upgrade a HTTP connection to a web socket connection.

    Event fired when performing a web socket handshake to upgrade a HTTP connection to a web socket connection.

    Socko requires this event be processed in your route and NOT passed to actors. The only action that needs to be taken is to call event.authorize().

    val routes = Routes({
      case event @ Path("/snoop/websocket/") => event match {
        case event: WebSocketHandshakeEvent => {
          event.authorize()
        }
        case event: WebSocketFrameEvent => {
          myActorSystem.actorOf(Props[MyWebSocketFrameProcessor], name) ! event
        }
      }
    })

    Calling event.authorize() authorizes Socko to perform all the necessary handshaking. If not called, Socko will reject the handshake and web sockets processing will be aborted.

    event.authorize() is a security measure to ensure that upgrades to web socket connections is only performed at explicit routes.

    nettyHttpRequest

    HTTP request associated with the upgrade to web sockets connection

    config

    Processing configuration

Value Members

  1. object EmptyHttpContent extends HttpContent

  2. object HttpResponseMessage extends Serializable

  3. object HttpResponseStatus extends Serializable

    Standard HTTP response status codes

  4. object ImmutableHttpHeaders extends Serializable

    Companion object

  5. object MutableHttpHeaders extends Serializable

    Companion object

  6. object WebSocketEventConfig extends Serializable

    Companion object

  7. object WebSocketHandshakeEvent extends Serializable

    Companion object

Inherited from AnyRef

Inherited from Any

Ungrouped