All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jp.co.cyberagent.aeromock.server.http.HttpRequestProcessor.scala Maven / Gradle / Ivy

There is a newer version: 0.2.5
Show newest version
package jp.co.cyberagent.aeromock.server.http

import io.netty.channel.ChannelHandlerContext
import io.netty.handler.codec.http.{FullHttpRequest, HttpResponse}
import org.slf4j.LoggerFactory
import scaldi.Injectable

/**
 * Base class of request processing.
 * @author stormcat24
 */
trait HttpRequestProcessor extends AnyRef with Injectable {

  val LOG = LoggerFactory.getLogger(this.getClass)

  /**
   *
   * @param request [[io.netty.handler.codec.http.FullHttpRequest]]
   * @param context [[io.netty.channel.ChannelHandlerContext]]
   * @return [[io.netty.handler.codec.http.HttpResponse]]
   */
  def delegate(request: FullHttpRequest)(implicit context: ChannelHandlerContext): HttpResponse = process(request)

  /**
   *
   * @param request [[io.netty.handler.codec.http.FullHttpRequest]]
   * @param context [[io.netty.channel.ChannelHandlerContext]]
   * @return [[io.netty.handler.codec.http.HttpResponse]]
   */
  def process(request: FullHttpRequest)(implicit context: ChannelHandlerContext): HttpResponse

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy