ca.shiftfocus.krispii.core.services

DocumentServiceDefault

Related Doc: package services

class DocumentServiceDefault extends DocumentService

Linear Supertypes
DocumentService, Service[Fail], Lifting[Fail], Serialized, FutureMonad, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DocumentServiceDefault
  2. DocumentService
  3. Service
  4. Lifting
  5. Serialized
  6. FutureMonad
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DocumentServiceDefault(db: DB, scalaCache: ScalaCachePool, userRepository: UserRepository, documentRepository: DocumentRepository, revisionRepository: RevisionRepository)

Type Members

  1. case class PushResult(document: Document, revision: Revision, serverOps: IndexedSeq[Revision]) extends Product with Serializable

    A case class encapsulating the result of a push operation.

    A case class encapsulating the result of a push operation.

    document

    the updated copy of the document

    revision

    the pushed revision that as it was actually stored in the database, transformed against more recent revisions. This can be sent to other clients to update their document.

    serverOps

    The more recent revisions that have been applied to the server since this revision's version.

    Definition Classes
    DocumentService

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. implicit def cache: ScalaCachePool

  6. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. implicit def conn: Connection

  8. def create(id: UUID = UUID.random, owner: User, title: String, initialDelta: Delta): Future[\/[Fail, Document]]

    Create a new document.

    Create a new document.

    id
    title
    initialDelta

    TODO - can have default value Delta(IndexedSeq.empty[Operation]), if it is not empty it should have record in document_revisions table

    returns

    Definition Classes
    DocumentServiceDefaultDocumentService
  9. val db: DB

    Database connection (pool).

    Database connection (pool). Services will take connections from this pool when making repository calls.

    Definition Classes
    DocumentServiceDefaultService
  10. val documentRepository: DocumentRepository

  11. implicit def eitherRunner[B](eithert: EitherT[Future, Fail, B]): Future[\/[Fail, B]]

    Definition Classes
    Lifting
  12. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def find(id: UUID, version: Option[Long] = None): Future[\/[Fail, Document]]

    Find a document.

    Find a document.

    id
    returns

    Definition Classes
    DocumentServiceDefaultDocumentService
  16. implicit val futureMonad: Monad[Future]

    Definition Classes
    FutureMonad
  17. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  18. def getHistory(documentId: UUID, granularity: Int = 10): Future[\/[Fail, IndexedSeq[Revision]]]

    Get a list of revisions spaced by "granularity"

    Get a list of revisions spaced by "granularity"

    documentId
    granularity
    returns

    Definition Classes
    DocumentServiceDefaultDocumentService
  19. def hashCode(): Int

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

    Definition Classes
    Any
  21. def lift[B]: (Future[\/[Fail, B]]) ⇒ EitherT[Future, Fail, B]

    Definition Classes
    Lifting
  22. def liftSeq[B](fIntermediate: Future[IndexedSeq[\/[Fail, B]]])(implicit ec: ExecutionContext): EitherT[Future, Fail, IndexedSeq[B]]

    Definition Classes
    Lifting
  23. def liftSeq[B](interList: IndexedSeq[Future[\/[Fail, B]]])(implicit ec: ExecutionContext): EitherT[Future, Fail, IndexedSeq[B]]

    Definition Classes
    Lifting
  24. def listRevisions(documentId: UUID, fromVersion: Long = 0): Future[\/[Fail, IndexedSeq[Revision]]]

    List a document's revisions.

    List a document's revisions.

    documentId
    fromVersion
    returns

    Definition Classes
    DocumentServiceDefaultDocumentService
  25. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  28. def predicate(fCondition: Future[Boolean])(fail: Fail)(implicit ec: ExecutionContext): EitherT[Future, Fail, Unit]

    Definition Classes
    Lifting
  29. def predicate(condition: Boolean)(fail: Fail): EitherT[Future, Fail, Unit]

    Definition Classes
    Lifting
  30. def push(documentId: UUID, version: Long, author: User, delta: Delta): Future[\/[Fail, PushResult]]

    Push a new revision.

    Push a new revision.

    This method will push a new revision onto the document's revision history, transforming the given operation against any revisions that have already been applied to the document.

    The push operation runs in a transaction so that if any one part fails, the entire operation fails and rolls back.

    documentId

    the ca.shiftfocus.uuid.UUID of the document to update

    version

    the version of the document to update from

    delta

    the operation to be performed on the document

    returns

    a PushResult object containing: document: the new version of the document revision: the newly pushed (and possibly transformed) revision serverOps: the server operations that have been applied more recently than this one, transformed against this operation so that they can be applied to the client's document. The client may need to transform them further against any additional edits they have in the clientside operation buffer.

    Definition Classes
    DocumentServiceDefaultDocumentService
  31. def revert(documentId: UUID, version: Long, authorId: UUID): Future[\/[Fail, Document]]

    Revert a document to a previous revision.

    Revert a document to a previous revision. Note that this doesn't erase anything from the document's history, rather the "reversion" will be inserted as a new revision that clears the document and inserts the reverted text.

    documentId

    the document to revert

    version

    the version of the document to revert to

    authorId

    the ID of the user who will own the new revision

    returns

    Definition Classes
    DocumentServiceDefaultDocumentService
  32. val revisionRepository: RevisionRepository

  33. val scalaCache: ScalaCachePool

  34. def serialized[E, R, L[E] <: IndexedSeq[E]](collection: L[E])(fn: (E) ⇒ Future[R])(implicit ec: ExecutionContext): Future[IndexedSeq[R]]

    Definition Classes
    Serialized
  35. def serializedT[E, R, L[E] <: IndexedSeq[E]](collection: L[E])(fn: (E) ⇒ Future[\/[Fail, R]])(implicit ec: ExecutionContext): Future[\/[Fail, IndexedSeq[R]]]

    Definition Classes
    Lifting
  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  37. def toString(): String

    Definition Classes
    AnyRef → Any
  38. def transactional[A](f: (Connection) ⇒ Future[A]): Future[A]

    Takes a function that returns a future, and runs it inside a database transaction.

    Takes a function that returns a future, and runs it inside a database transaction.

    Definition Classes
    Service
  39. def update(id: UUID, version: Long, owner: User, editors: IndexedSeq[User], title: String): Future[\/[Fail, Document]]

    Update an existing document (metadata only).

    Update an existing document (metadata only).

    id
    version
    title
    returns

    Definition Classes
    DocumentServiceDefaultDocumentService
  40. val userRepository: UserRepository

  41. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from DocumentService

Inherited from Service[Fail]

Inherited from Lifting[Fail]

Inherited from Serialized

Inherited from FutureMonad

Inherited from AnyRef

Inherited from Any

Ungrouped