org.talares.api.actors

Fetcher

class Fetcher[T] extends BaseActor

Holds all functionality to compose an URL that designates where Json representations of 'T' might be found.

Passes these locations to instances of Executor to receive the Json representations. Is able to parse the Json into an instance of 'T' and send this to it's parent.

Since

0.1.0

Linear Supertypes
BaseActor, ActorLogging, Actor, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Fetcher
  2. BaseActor
  3. ActorLogging
  4. Actor
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Fetcher(app: Talares)(implicit jsonReadable: JsonReadable[T], classTag: ClassTag[T])

Type Members

  1. type ID = (String, Any)

  2. type Receive = PartialFunction[Any, Unit]

    Definition Classes
    Actor
  3. type SearchParam = (String, Any)

Value Members

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

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

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. val Settings: Settings

    Definition Classes
    BaseActor
  5. val app: Talares

    Definition Classes
    FetcherBaseActor
  6. def aroundPostRestart(reason: Throwable): Unit

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

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

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

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

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

    Definition Classes
    Any
  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. implicit val context: ActorContext

    Definition Classes
    Actor
  14. def createIDQuery(IDs: Seq[ID]): Query

    Creates a org.talares.api.queries.Query consisting of the endpoint for type 'T' and the ID's given.

    Creates a org.talares.api.queries.Query consisting of the endpoint for type 'T' and the ID's given.

    IDs

    the ID's to include in the query

    returns

    an instance of org.talares.api.queries.Query

  15. def createIDTask(task: Task[T], webserviceLocation: String, IDs: ID*): Execute[T]

    Creates a org.talares.api.actors.messages.ExecutorMessages.Execute with a complete URL in String form by using the createUrl() method to compose said URL from a webservice location and Query composed of the given ID's.

    Creates a org.talares.api.actors.messages.ExecutorMessages.Execute with a complete URL in String form by using the createUrl() method to compose said URL from a webservice location and Query composed of the given ID's.

    task

    the active task

    webserviceLocation

    the URL on which the webservice can be reached

    IDs

    the ID's to include in the query

    returns

    an org.talares.api.actors.messages.ExecutorMessages.Execute

  16. def createQueryTask(task: Task[T], webserviceLocation: String, query: Query): Execute[T]

    Creates a org.talares.api.actors.messages.ExecutorMessages with a complete URL in String form by using the createUrl() method to compose said URL from a webservice location and a query.

    Creates a org.talares.api.actors.messages.ExecutorMessages with a complete URL in String form by using the createUrl() method to compose said URL from a webservice location and a query.

    task

    the active task

    webserviceLocation

    the URL on which the webservice can be reached

    query

    the query to have the webservice execute

    returns

    an org.talares.api.actors.messages.ExecutorMessages.Execute

  17. def createSearchQuery(searchParams: Seq[SearchParam]): Query

    Creates a org.talares.api.queries.Query consisting of the endpoint for type 'T' as well as a specific filter composed of the given search parameters.

    Creates a org.talares.api.queries.Query consisting of the endpoint for type 'T' as well as a specific filter composed of the given search parameters.

    searchParams

    a arbitrary number of key/value pairs to be 'and'ed into a filter

    returns

    an instance of org.talares.api.queries.

  18. def createSearchTask(task: Task[T], webserviceLocation: String, searchParams: SearchParam*): Execute[T]

    Creates a org.talares.api.actors.messages.ExecutorMessages.Execute with a complete URL in String form by using the createUrl() method to compose said URL from a webservice location and Query consisting of a filter composed of the given search parameters.

    Creates a org.talares.api.actors.messages.ExecutorMessages.Execute with a complete URL in String form by using the createUrl() method to compose said URL from a webservice location and Query consisting of a filter composed of the given search parameters.

    task

    the active task

    webserviceLocation

    the URL on which the webservice can be reached

    searchParams

    the search parameters with which a filter should be constructed

    returns

    an org.talares.api.actors.messages.ExecutorMessages.Execute

  19. def createURLTask(task: Task[T], url: String): Execute[T]

    Creates a org.talares.api.actors.messages.ExecutorMessages.Execute with a complete URL in String form from the given completeURL.

    Creates a org.talares.api.actors.messages.ExecutorMessages.Execute with a complete URL in String form from the given completeURL.

    url

    a complete URL

    returns

    an org.talares.api.actors.messages.ExecutorMessages.Execute

  20. def createUrl(webserviceLocation: String, query: Query): String

    Composes a complete URL consisting of a webservice URL and a org.talares.api.queries.Query's value.

    Composes a complete URL consisting of a webservice URL and a org.talares.api.queries.Query's value.

    webserviceLocation

    the URL on which the webservice can be reached

    query

    the query to have the webservice execute

    returns

    a complete URL in String form

  21. val endpoint: String

    Endpoint from which the Json representations of 'T' can be found within the webservice.

    Endpoint from which the Json representations of 'T' can be found within the webservice.

    The plural of the runtime class name of 'T' is used to find the endpoint. For instance a Fetcher[Page] will have endpoint Pages.

  22. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  24. implicit lazy val executionContext: ExecutionContextExecutor

    Definition Classes
    BaseActor
  25. lazy val executor: ActorRef

    Executor for use within this Fetcher.

    Executor for use within this Fetcher. *

  26. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  27. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  28. def handleExecutorResult(result: Result[T]): Unit

    Handles messages of the type org.talares.api.actors.messages.ExecutorMessages.Result.

    Handles messages of the type org.talares.api.actors.messages.ExecutorMessages.Result.

    This function handles four different situations, all of which result in a org.talares.api.actors.messages.FetcherMessages.Result sent to the parent.

    1. The result contains a JsArray; it is parsed as a Seq of 'T' 2. The result contains a JsObject; it is parsed as a 'T' 3. The result contains an unknown element; a UnexpectedResultException is propagated 4. The result contains an Throwable; the Throwable is propagated

    result

    the org.talares.api.actors.messages.ExecutorMessages.Result to handle

    See also

    play.api.libs.json.JsObject

    play.api.libs.json.JsArray

    play.api.libs.json.JsValue

    Executor

  29. def handleTask(task: Task[T]): Unit

    Handles messages of the type org.talares.api.actors.messages.FetcherMessages.Task.

    Handles messages of the type org.talares.api.actors.messages.FetcherMessages.Task.

    Depending on the type of task a function is used to turn this task into a complete URL where Json representations of 'T' might be found. This URL is then wrapped in a org.talares.api.actors.messages.ExecutorMessages.Execute message and passed to an Executor for execution.

    task

    the task to handle

    See also

    Executor

  30. def hashCode(): Int

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

    Definition Classes
    Any
  32. def log: LoggingAdapter

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

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

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

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

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

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

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

    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  40. implicit val reads: Reads[T]

  41. def receive: Receive

    Definition Classes
    Fetcher → Actor
  42. implicit final val self: ActorRef

    Definition Classes
    Actor
  43. final def sender(): ActorRef

    Definition Classes
    Actor
  44. def supervisorStrategy: SupervisorStrategy

    Definition Classes
    Actor
  45. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  46. implicit lazy val system: ActorSystem

    Definition Classes
    BaseActor
  47. implicit lazy val timeout: Timeout

    Definition Classes
    BaseActor
  48. def toString(): String

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

    Definition Classes
    Actor
  50. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from BaseActor

Inherited from ActorLogging

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Ungrouped