au.com.onegeek.respite.actors

DatabaseRestActor

class DatabaseRestActor[ModelType <: Model[ObjectIDType], ObjectIDType] extends Actor with LoggingSupport

Created by mfellows on 24/04/2014.

Bound to a case class of type ModelType, and receives the MongoCollection object that should be used instantiate a data access object (using the com.novus.salat lib), which is in turn used to manage database transactions.

Inspects the sender's message and returns a serializable object or List.

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

Instance Constructors

  1. new DatabaseRestActor(repository: Repository[ModelType, ObjectIDType])(implicit format: Format[ModelType], stringToId: (String) ⇒ ObjectIDType)

Type Members

  1. type Receive = PartialFunction[Any, Unit]

    Definition Classes
    Actor

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

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

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

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

    Definition Classes
    Actor
  9. def createEntity(obj: ModelType): Future[ModelType]

  10. def deleteEntity(obj: ModelType): Future[Option[ModelType]]

    Deletes an entity from the Database

    Deletes an entity from the Database

    returns

  11. def deleteEntity(id: String): Future[Option[ModelType]]

    Deletes an entity from the755147

    Deletes an entity from the755147

    id
    returns

  12. def deleteEntityFromDB(id: String): Future[Option[ModelType]]

  13. def deleteEntityFromDB(obj: ModelType): Future[Option[ModelType]]

    TODO: Wouldn't it be nice if I could do this.

    TODO: Wouldn't it be nice if I could do this....?

  14. def doAll(): Unit

    List ALL objects

    List ALL objects

    TODO: Consider use of BSONDocuments instead of the case classes when dealing with DB Interactions. Either that, or look at reflection / Manifest. Possibly even both.

    What's the performance impact of Reflection vs Reactive DB connections I wonder?

    returns

  15. def doCreate(modelInstance: ModelType): Unit

  16. def doDeleteEntity(obj: ModelType): Unit

  17. def doDeleteEntity(id: String): Unit

  18. def doGet(id: String): Unit

  19. def doGetSingle(id: ObjectIDType): Future[Option[ModelType]]

  20. def doGetSingle(id: String): Future[Option[ModelType]]

  21. def doList: Future[List[ModelType]]

    List ALL objects

    List ALL objects

    returns

  22. def doUpdate(modelInstance: ModelType): Unit

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

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

    Definition Classes
    AnyRef → Any
  25. implicit def executor: ExecutionContext

    Attributes
    protected
  26. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  27. implicit val format: Format[ModelType]

  28. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  31. val logger: Logger

    Definition Classes
    LoggingSupport
  32. final def ne(arg0: AnyRef): Boolean

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

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

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

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

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

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

    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  39. def receive: PartialFunction[Any, Unit]

    Definition Classes
    DatabaseRestActor → Actor
  40. implicit final val self: ActorRef

    Definition Classes
    Actor
  41. final def sender: ActorRef

    Definition Classes
    Actor
  42. implicit val stringToId: (String) ⇒ ObjectIDType

  43. def supervisorStrategy: SupervisorStrategy

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

    Definition Classes
    AnyRef
  45. def toString(): String

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

    Definition Classes
    Actor
  47. def updateEntity(obj: ModelType): Future[ModelType]

  48. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from LoggingSupport

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Ungrouped