com.paypal.cascade.http.resource

AbstractResourceActor

Related Doc: package resource

abstract class AbstractResourceActor extends HttpResourceActor

Base class for HTTP resources built with Spray.

Linear Supertypes
HttpResourceActor, ServiceActor, CommonActor, ActorLogging, Actor, AnyRef, Any
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

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. 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
  7. 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
  8. def aroundPostRestart(reason: Throwable): Unit

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

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

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

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

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

    Definition Classes
    Any
  14. 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 error response will be returned. The response will be determined by createErrorResponse. As always, personally identifiable information should never be included in exception messages.

    method

    The Http method of the request in question

    Definition Classes
    HttpResourceActor
  15. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. 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
  17. final def complete(resp: HttpResponse): Unit

    Complete a successful request

    Complete a successful request

    resp

    The HttpResponse to be returned

    Attributes
    protected
  18. 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
  19. 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
  20. implicit val context: ActorContext

    Definition Classes
    Actor
  21. def createErrorResponse(exception: Exception): HttpResponse

    Creates an appropriate HttpResponse for a given exception.

    Creates an appropriate HttpResponse for a given exception.

    exception

    the exception

    returns

    a crafted HttpResponse from the error message

    Attributes
    protected
    Definition Classes
    HttpResourceActor
  22. 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
  23. 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
  24. 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
  25. 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
  26. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. 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()
  30. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  31. def hashCode(): Int

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

    Definition Classes
    Any
  33. def log: LoggingAdapter

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

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

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

    Definition Classes
    AnyRef
  37. def parseErrorMessage(t: Throwable): String

    Creates an appropriate error message for when a request could not be parsed.

    Creates an appropriate error message for when a request could not be parsed.

    t

    the throwable which caused the error

    returns

    a message describing the parsing error

    Attributes
    protected
    Definition Classes
    HttpResourceActor
  38. def postRestart(reason: Throwable): Unit

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

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

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

    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  42. 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
    AbstractResourceActor → HttpResourceActor → Actor
  43. 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
  44. 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
  45. implicit final val self: ActorRef

    Definition Classes
    Actor
  46. 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. The type of the throwable should have a case in createErrorResponse.

    f

    The error to be used for server response.

    Attributes
    protected
  47. 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
  48. 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
  49. final def sender(): ActorRef

    Definition Classes
    Actor
  50. val supervisorStrategy: OneForOneStrategy

    crash on unhandled exceptions

    crash on unhandled exceptions

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

    Definition Classes
    AnyRef
  52. final lazy val timeoutCancellable: Cancellable

    A scheduled task which times the request out after the resourceTimeout.

    A scheduled task which times the request out after the resourceTimeout. See the Akka Scheduler documentation.

    returns

    a Cancellable which will run after the context timeout unless it is cancelled via its cancel method.

    Attributes
    protected
    Definition Classes
    HttpResourceActor
  53. def toString(): String

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

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. 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