com.paypal.cascade.http.resource

AbstractResourceActor

abstract class AbstractResourceActor extends HttpResourceActor

Base class for HTTP resources built with Spray.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AbstractResourceActor
  2. HttpResourceActor
  3. ServiceActor
  4. CommonActor
  5. ActorLogging
  6. Actor
  7. AnyRef
  8. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AbstractResourceActor(resourceContext: ResourceContext)

    resourceContext

    Context containing information needed to service the request, such as the parent actor

Type Members

  1. type Receive = PartialFunction[Any, Unit]

    Definition Classes
    Actor
  2. case class RequestIsParsed(parsedRequest: AnyRef) extends Product with Serializable

    Definition Classes
    HttpResourceActor

Abstract Value Members

  1. abstract def resourceReceive: akka.actor.Actor.Receive

    This method is overridden by the end-user to execute the requests served by this resource.

    This method is overridden by the end-user to execute the requests served by this resource. The ParsedRequest object will be sent to this message from ResourceActor via a tell. As an actor will be spun up for each request, it is safe to store mutable state during this receive function. When the request is finished, one of the provided complete methods must be called

    This receive should handle

    ProcessRequest(_)

    messages.

    ProcessRequest(_) }}}

    returns

    The receive function to be applied when a parsed request object or other actor message is received

    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from AbstractResourceActor to any2stringadd[AbstractResourceActor] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (AbstractResourceActor, B)

    Implicit information
    This member is added by an implicit conversion from AbstractResourceActor to ArrowAssoc[AbstractResourceActor] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  6. object BeforeExecuted extends Product with Serializable

    Definition Classes
    HttpResourceActor
  7. object ResponseContentTypeIsAcceptable extends Product with Serializable

    Definition Classes
    HttpResourceActor
  8. val acceptableContentTypes: List[ContentType]

    A list of content types that that this server can accept, by default application/json.

    A list of content types that that this server can accept, by default application/json. These will be matched against the Content-Type header of incoming requests.

    returns

    a list of content types

    Definition Classes
    HttpResourceActor
  9. def after(resp: HttpResponse): Unit

    This method will always be invoked after request processing is finished.

    This method will always be invoked after request processing is finished.

    If the method throws, the error will be logged and the given response will still be returned. As always, personally identifiable information should never be included in exception messages.

    resp

    The response to be returned to the client

    Definition Classes
    HttpResourceActor
  10. def aroundPostRestart(reason: Throwable): Unit

    Attributes
    protected[akka]
    Definition Classes
    Actor
  11. def aroundPostStop(): Unit

    Attributes
    protected[akka]
    Definition Classes
    Actor
  12. def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit

    Attributes
    protected[akka]
    Definition Classes
    Actor
  13. def aroundPreStart(): Unit

    Attributes
    protected[akka]
    Definition Classes
    Actor
  14. def aroundReceive(receive: akka.actor.Actor.Receive, msg: Any): Unit

    Attributes
    protected[akka]
    Definition Classes
    Actor
  15. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  16. def before(method: HttpMethod): Unit

    This method will always be invoked before request processing begins.

    This method will always be invoked before request processing begins. It is primarily provided for metrics tracking.

    If the method throws, an internal server error will be returned. As always, personally identifiable information should never be included in exception messages.

    method

    The Http method of the request in question

    Definition Classes
    HttpResourceActor
  17. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def complete(resp: HttpResponse, location: String): Unit

    Complete a successful request

    Complete a successful request

    resp

    The HttpResponse to be returned

    location

    Value for the HTTP location header

    Attributes
    protected
  19. final def complete(resp: HttpResponse): Unit

    Complete a successful request

    Complete a successful request

    resp

    The HttpResponse to be returned

    Attributes
    protected
  20. final def completeToJSON[T](code: StatusCode, response: T, location: String): Unit

    Complete a successful request with a JSON response

    Complete a successful request with a JSON response

    T

    Type of the object to be returned

    code

    Status code to return

    response

    Object to be serialized in the response

    location

    Value for the HTTP Location header

    Attributes
    protected
  21. final def completeToJSON[T](code: StatusCode, response: T): Unit

    Complete a successful request with a JSON response

    Complete a successful request with a JSON response

    T

    Type of the object to be returned

    code

    Status code to return

    response

    Object to be serialized in the response

    Attributes
    protected
  22. implicit val context: ActorContext

    Definition Classes
    Actor
  23. def ensuring(cond: (AbstractResourceActor) ⇒ Boolean, msg: ⇒ Any): AbstractResourceActor

    Implicit information
    This member is added by an implicit conversion from AbstractResourceActor to Ensuring[AbstractResourceActor] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  24. def ensuring(cond: (AbstractResourceActor) ⇒ Boolean): AbstractResourceActor

    Implicit information
    This member is added by an implicit conversion from AbstractResourceActor to Ensuring[AbstractResourceActor] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  25. def ensuring(cond: Boolean, msg: ⇒ Any): AbstractResourceActor

    Implicit information
    This member is added by an implicit conversion from AbstractResourceActor to Ensuring[AbstractResourceActor] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  26. def ensuring(cond: Boolean): AbstractResourceActor

    Implicit information
    This member is added by an implicit conversion from AbstractResourceActor to Ensuring[AbstractResourceActor] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  27. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  28. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  29. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  30. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from AbstractResourceActor to StringFormat[AbstractResourceActor] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  31. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  32. def handleError(exception: Exception): HttpResponse

    Exception handler for creating an http error response when Status.Failure is received.

    Exception handler for creating an http error response when Status.Failure is received.

    exception

    the exception

    returns

    a crafted HttpResponse from the error message

    Attributes
    protected
    Definition Classes
    HttpResourceActor
  33. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  34. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  35. def log: LoggingAdapter

    Definition Classes
    ActorLogging
  36. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  37. final def notify(): Unit

    Definition Classes
    AnyRef
  38. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  39. def postRestart(reason: Throwable): Unit

    Definition Classes
    CommonActor → Actor
  40. def postStop(): Unit

    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  41. def preRestart(reason: Throwable, message: Option[Any]): Unit

    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  42. def preStart(): Unit

    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  43. final def receive: akka.actor.Actor.Receive

    The receive function for this resource.

    The receive function for this resource. Should not be overridden - implement resourceReceive instead

    Definition Classes
    AbstractResourceActorHttpResourceActor → Actor
  44. val responseContentType: ContentType

    The content type that this server provides, by default application/json

    The content type that this server provides, by default application/json

    returns

    a list of content types

    Definition Classes
    HttpResourceActor
  45. val responseLanguage: Option[Language]

    The language of the data in the response, to for the Content-Language header

    The language of the data in the response, to for the Content-Language header

    returns

    a spray.http.Language value in an Option, or None, if the Content-Language header does not need to be set for this resource

    Definition Classes
    HttpResourceActor
  46. implicit final val self: ActorRef

    Definition Classes
    Actor
  47. final def sendError(f: Throwable): Unit

    Return an internal server error in response to a throwable

    Return an internal server error in response to a throwable

    f

    The error to be logged

    Attributes
    protected
  48. final def sendErrorCodeResponse(code: StatusCode): Unit

    Return an error with the specified Status code

    Return an error with the specified Status code

    code

    The error code to return

    Attributes
    protected
  49. final def sendErrorMapResponse(code: StatusCode, msg: String): Unit

    Return an error with the specified Status code

    Return an error with the specified Status code

    code

    The error code to return

    msg

    Message to be returned, will be converted to JSON

    Attributes
    protected
  50. final def sendErrorResponse[T](code: StatusCode, error: T)(implicit arg0: Manifest[T]): Unit

    Return an error with the specified status code and error object.

    Return an error with the specified status code and error object.

    T

    Type of the error

    code

    The error code to return

    error

    Error to return, will be converted to JSON

    Attributes
    protected
  51. final def sender(): ActorRef

    Definition Classes
    Actor
  52. val supervisorStrategy: OneForOneStrategy

    Definition Classes
    HttpResourceActor → Actor
  53. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  54. def toString(): String

    Definition Classes
    AnyRef → Any
  55. def unhandled(message: Any): Unit

    Definition Classes
    ServiceActor → Actor
    Annotations
    @throws( ... )
  56. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  57. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. def [B](y: B): (AbstractResourceActor, B)

    Implicit information
    This member is added by an implicit conversion from AbstractResourceActor to ArrowAssoc[AbstractResourceActor] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from HttpResourceActor

Inherited from ServiceActor

Inherited from CommonActor

Inherited from ActorLogging

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from AbstractResourceActor to any2stringadd[AbstractResourceActor]

Inherited by implicit conversion StringFormat from AbstractResourceActor to StringFormat[AbstractResourceActor]

Inherited by implicit conversion Ensuring from AbstractResourceActor to Ensuring[AbstractResourceActor]

Inherited by implicit conversion ArrowAssoc from AbstractResourceActor to ArrowAssoc[AbstractResourceActor]

Ungrouped