ca.shiftfocus.krispii.core.services

SchoolServiceDefault

Related Doc: package services

class SchoolServiceDefault extends SchoolService

Linear Supertypes
SchoolService, Service[Fail], Lifting[Fail], Serialized, FutureMonad, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SchoolServiceDefault
  2. SchoolService
  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 SchoolServiceDefault(db: DB, scalaCache: ScalaCache, authService: AuthService, userRepository: UserRepository, courseRepository: CourseRepository, chatRepository: ChatRepository)

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. def addUsers(course: Course, userIds: IndexedSeq[UUID]): Future[\/[Fail, IndexedSeq[User]]]

    Add students to a course.

    Add students to a course.

    course

    the course to add users to

    userIds

    an IndexedSeq of UUID representing the users to be added.

    returns

    a boolean indicating success or failure.

    Definition Classes
    SchoolServiceDefaultSchoolService
  5. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  6. val authService: AuthService

    Definition Classes
    SchoolServiceDefaultSchoolService
  7. implicit def cache: ScalaCache

  8. val chatRepository: ChatRepository

    Definition Classes
    SchoolServiceDefaultSchoolService
  9. def clone(): AnyRef

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

  11. val courseRepository: CourseRepository

    Definition Classes
    SchoolServiceDefaultSchoolService
  12. def createCourse(teacherId: UUID, name: String, color: Color, slug: String): Future[\/[Fail, Course]]

    Create a new course.

    Create a new course.

    teacherId

    the optional UUID of the user teaching this course

    name

    the name of this course

    returns

    the newly created course

    Definition Classes
    SchoolServiceDefaultSchoolService
  13. val db: DB

    Database connection (pool).

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

    Definition Classes
    SchoolServiceDefaultService
  14. def deleteCourse(id: UUID, version: Long): Future[\/[Fail, Course]]

    Delete a course from the system.

    Delete a course from the system.

    id

    the unique ID of the course to update

    version

    the latest version of the course for O.O.L.

    returns

    a boolean indicating success or failure

    Definition Classes
    SchoolServiceDefaultSchoolService
  15. implicit def eitherRunner[B](eithert: EitherT[Future, Fail, B]): Future[\/[Fail, B]]

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def findChat(courseId: UUID, messageNum: Long): Future[\/[Fail, Chat]]

    Find a specific chat message.

    Find a specific chat message.

    courseId
    messageNum
    returns

    Definition Classes
    SchoolServiceDefaultSchoolService
  20. def findCourse(slug: String): Future[\/[Fail, Course]]

    Find a specific course by slug.

    Find a specific course by slug.

    slug

    the string of the course to find.

    returns

    an optional course

    Definition Classes
    SchoolServiceDefaultSchoolService
  21. def findCourse(id: UUID): Future[\/[Fail, Course]]

    Find a specific course by id.

    Find a specific course by id.

    id

    the UUID of the course to find.

    returns

    an optional course

    Definition Classes
    SchoolServiceDefaultSchoolService
  22. def findUserForTeacher(userId: UUID, teacherId: UUID): Future[\/[Fail, User]]

    Given a user and teacher, finds whether this user belongs to any of that teacher's courses.

    Given a user and teacher, finds whether this user belongs to any of that teacher's courses.

    userId
    teacherId
    returns

    Definition Classes
    SchoolServiceDefaultSchoolService
  23. implicit val futureMonad: Monad[Future]

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

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

    Definition Classes
    AnyRef → Any
  26. def insertChat(courseId: UUID, userId: UUID, message: String): Future[\/[Fail, Chat]]

    Insert a new chat message.

    Insert a new chat message.

    courseId
    userId
    message
    returns

    Definition Classes
    SchoolServiceDefaultSchoolService
  27. final def isInstanceOf[T0]: Boolean

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

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

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

    Definition Classes
    Lifting
  31. def listChats(courseId: UUID, userId: UUID, num: Long, offset: Long): Future[\/[Fail, IndexedSeq[Chat]]]

    List a slice of one user's chats in a course.

    List a slice of one user's chats in a course.

    courseId
    userId
    num
    offset
    returns

    Definition Classes
    SchoolServiceDefaultSchoolService
  32. def listChats(courseId: UUID, userId: UUID): Future[\/[Fail, IndexedSeq[Chat]]]

    List all of one user's chats in a course.

    List all of one user's chats in a course.

    courseId
    userId
    returns

    Definition Classes
    SchoolServiceDefaultSchoolService
  33. def listChats(courseId: UUID, num: Long, offset: Long): Future[\/[Fail, IndexedSeq[Chat]]]

    List a slice of chats for a course.

    List a slice of chats for a course.

    courseId
    num
    offset
    returns

    Definition Classes
    SchoolServiceDefaultSchoolService
  34. def listChats(courseId: UUID): Future[\/[Fail, IndexedSeq[Chat]]]

    List all chats for a course.

    List all chats for a course.

    courseId
    returns

    Definition Classes
    SchoolServiceDefaultSchoolService
  35. def listCourses: Future[\/[Fail, IndexedSeq[Course]]]

    List all courses.

    List all courses.

    returns

    an IndexedSeq of course

    Definition Classes
    SchoolServiceDefaultSchoolService
  36. def listCoursesByTeacher(userId: UUID): Future[\/[Fail, IndexedSeq[Course]]]

    List all courses taught by a specific user.

    List all courses taught by a specific user.

    This finds courses for which the given id is set as the teacherID parameter.

    userId

    the UUID of the user to search for.

    returns

    an IndexedSeq of course

    Definition Classes
    SchoolServiceDefaultSchoolService
  37. def listCoursesByUser(userId: UUID): Future[\/[Fail, IndexedSeq[Course]]]

    List all courses associated with a specific user.

    List all courses associated with a specific user.

    This finds courses for which the given id is set as a student of the course via an association table.

    userId

    the UUID of the user to search for.

    returns

    an IndexedSeq of course

    Definition Classes
    SchoolServiceDefaultSchoolService
  38. def listStudents(course: Course): Future[\/[Fail, IndexedSeq[User]]]

    Definition Classes
    SchoolServiceDefaultSchoolService
  39. def listStudents(courseId: UUID): Future[\/[Fail, IndexedSeq[User]]]

    List all students registered to a course.

    List all students registered to a course.

    Definition Classes
    SchoolServiceDefaultSchoolService
  40. final def ne(arg0: AnyRef): Boolean

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

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

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

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

    Definition Classes
    Lifting
  45. def removeUsers(course: Course, userIds: IndexedSeq[UUID]): Future[\/[Fail, IndexedSeq[User]]]

    Remove students from a course.

    Remove students from a course.

    course

    the course to remove users from

    userIds

    an IndexedSeq of UUID representing the users to be removed.

    returns

    boolean indicating success or failure.

    Definition Classes
    SchoolServiceDefaultSchoolService
  46. val scalaCache: ScalaCache

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

    Definition Classes
    Serialized
  48. 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
  49. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  50. def toString(): String

    Definition Classes
    AnyRef → Any
  51. 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
  52. def updateChat(courseId: UUID, messageNum: Long, hidden: Boolean): Future[\/[Fail, Chat]]

    Update an existing chat message's hidden status.

    Update an existing chat message's hidden status.

    courseId
    messageNum
    hidden
    returns

    Definition Classes
    SchoolServiceDefaultSchoolService
  53. def updateCourse(id: UUID, version: Long, teacherId: Option[UUID], name: Option[String], color: Option[Color], chatEnabled: Option[Boolean]): Future[\/[Fail, Course]]

    Create a new course.

    Create a new course.

    id

    the UUID of the course this course belongs to

    teacherId

    the optional UUID of the user teaching this course

    name

    the name of this course

    returns

    the newly created course

    Definition Classes
    SchoolServiceDefaultSchoolService
  54. val userRepository: UserRepository

    Definition Classes
    SchoolServiceDefaultSchoolService
  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( ... )

Inherited from SchoolService

Inherited from Service[Fail]

Inherited from Lifting[Fail]

Inherited from Serialized

Inherited from FutureMonad

Inherited from AnyRef

Inherited from Any

Ungrouped