surf.service

CRUDService

Related Docs: object CRUDService | package service

abstract class CRUDService[IdType, EntityType] extends Service

Base class for services providing CRUD operations on data entities.

IdType

type of entity IDs

EntityType

type of entities handled by this service

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CRUDService
  2. Service
  3. MessageProcessor
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CRUDService()

Abstract Value Members

  1. abstract def checkEntity(entity: Any): EntityType

    Checks and casts the specified entity to the defined EntityType.

    Checks and casts the specified entity to the defined EntityType.

    entity

    Entity to be checked

    Exceptions thrown

    InvalidEntity if the entity is invalid

  2. abstract def checkId(id: Any): IdType

    Checks and casts the specified entity ID to the defined IdType

    Checks and casts the specified entity ID to the defined IdType

    id

    ID to be checked

    Exceptions thrown

    InvalidId if the id is invalid

  3. abstract def wrapListResponse(response: Iterable[EntityType]): Any

    Called whenever the result of an operation is a collection of entities.

    Called whenever the result of an operation is a collection of entities. The return value of this method is used as the response to the request. Wrapping a generic collection is often useful, since the type parameter is erased at runtime.

    response

    The collection to be wrapped

Concrete 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. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def createEntity(entity: EntityType): Option[EntityType]

    Creates (persists) the specified entity.

    Creates (persists) the specified entity. Returns the updated entity, if the operation was successful. Returns None or throws an Exception if the Entity could not be created.

    entity

    Entity to be created

    Exceptions thrown

    CRUDServiceError if the request could not be processed

    OperationNotSupported if this operation is not supported by the service implementation

  7. def deleteEntity(id: IdType): Option[IdType]

    Deletes the entity with the specified ID.

    Deletes the entity with the specified ID. Returns the ID of the deleted entity, or None if the entity does not exist.

    id

    ID of the entity to be deleted

    Exceptions thrown

    CRUDServiceError if the request could not be processed

    OperationNotSupported if this operation is not supported by the service implementation

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

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

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

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

    Definition Classes
    AnyRef → Any
  12. final def handle(req: Request, data: Any): Unit

    Definition Classes
    Service
  13. def handleException(ex: Throwable): Unit

    Definition Classes
    Service
  14. def hashCode(): Int

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

    Definition Classes
    Any
  16. final def isRequest: Boolean

    Returns true iff the currently processed message is a Request

    Returns true iff the currently processed message is a Request

    Definition Classes
    ServiceMessageProcessor
  17. def listEntities(): Iterable[EntityType]

    Returns an Iterable with all defined entities.

    Returns an Iterable with all defined entities.

    Exceptions thrown

    CRUDServiceError if the request could not be processed

    OperationNotSupported if this operation is not supported by the service implementation

  18. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  21. def otherMessage(msg: Any): Unit

    Called for non-CRUD messages, ie messages not listed in CRUDService.

    Called for non-CRUD messages, ie messages not listed in CRUDService.

    msg

    the message to be handled

    Exceptions thrown

    CRUDServiceError if the request could not be processed

    OperationNotSupported if this operation is not supported by the service implementation

  22. def process: PartialFunction[Any, Unit]

    Processes incoming flow requests

    Processes incoming flow requests

    Definition Classes
    CRUDServiceMessageProcessor
  23. def readEntities(ids: Seq[IdType]): Seq[EntityType]

  24. def readEntity(id: IdType): Option[EntityType]

    Returns the entity with the specified ID, or None if the entity does not exist.

    Returns the entity with the specified ID, or None if the entity does not exist.

    id

    The ID of the requested entity

    Exceptions thrown

    CRUDServiceError if the request could not be processed

    OperationNotSupported if this operation is not supported by the service implementation

  25. final def request: Request

    Returns the Request currently in processing (if any).

    Returns the Request currently in processing (if any).

    Definition Classes
    ServiceMessageProcessor
  26. def self: ServiceRef

    Definition Classes
    Service
  27. def self_=(ref: ServiceRef): Unit

    Attributes
    protected[surf]
    Definition Classes
    Service
  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. def toString(): String

    Definition Classes
    AnyRef → Any
  30. def updateEntity(entity: EntityType): Option[EntityType]

    Saves the specified Entity and returns the updated entity.

    Saves the specified Entity and returns the updated entity. Returns None, if the entity does not exist.

    entity

    Entity to be saved (updated)

    Exceptions thrown

    CRUDServiceError if the request could not be processed

    OperationNotSupported if this operation is not supported by the service implementation

  31. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Service

Inherited from MessageProcessor

Inherited from AnyRef

Inherited from Any

Ungrouped