Class

io.fsq.rogue.connection

MongoClientManager

Related Doc: package connection

Permalink

abstract class MongoClientManager[MongoClient, MongoDatabase, MongoCollection[_]] extends AnyRef

Manages mongo connections and provides access to the client objects. This class is modeled after lift's MongoDB singleton, but in a way that abstracts out the type of client used (async vs blocking). Users must implement closeClient, getCodecRegistry, getDatabase, and getCollection.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MongoClientManager
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new MongoClientManager()

    Permalink

Abstract Value Members

  1. abstract def closeClient(client: MongoClient): Unit

    Permalink

    Close a client connection, without removing it from the internal map.

    Close a client connection, without removing it from the internal map.

    Attributes
    protected
  2. abstract def getCodecRegistry(db: MongoDatabase): CodecRegistry

    Permalink

    Get a CodecRegistry from a MongoDatabase.

    Get a CodecRegistry from a MongoDatabase.

    Attributes
    protected
  3. abstract def getCollection[Document](db: MongoDatabase, name: String, documentClass: Class[Document], readPreferenceOpt: Option[ReadPreference], writeConcernOpt: Option[WriteConcern]): MongoCollection[Document]

    Permalink

    Get a MongoCollection from a MongoDatabase.

    Get a MongoCollection from a MongoDatabase. TODO(jacob): We should get rid of the option to send down a read preference here and just use the one on the query.

    Attributes
    protected
  4. abstract def getDatabase(client: MongoClient, name: String): MongoDatabase

    Permalink

    Get a MongoDatabase from a MongoClient.

    Get a MongoDatabase from a MongoClient.

    Attributes
    protected

Concrete Value Members

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def closeAll(): Unit

    Permalink

    Close all clients and clear the internal map.

  7. def defineDb(name: MongoIdentifier, client: MongoClient, dbName: String): Option[(MongoClient, String)]

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def getClient(name: MongoIdentifier): Option[(MongoClient, String)]

    Permalink
  13. def getClientOrThrow(name: MongoIdentifier): (MongoClient, String)

    Permalink
  14. def getCodecRegistryOrThrow(name: MongoIdentifier): CodecRegistry

    Permalink
  15. def getConnectionIds: Set[MongoIdentifier]

    Permalink

    Get a set of all connection ids handled by this client manager.

  16. def getDb(name: MongoIdentifier): Option[MongoDatabase]

    Permalink
  17. def getDbOrThrow(name: MongoIdentifier): MongoDatabase

    Permalink
  18. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  25. def use[T](name: MongoIdentifier)(f: (MongoDatabase) ⇒ T): T

    Permalink

    Executes the given function with the specified database.

    Executes the given function with the specified database. Throws if the database does not exist.

  26. def useCollection[Document, T](name: MongoIdentifier, collectionName: String, documentClass: Class[Document], readPreferenceOpt: Option[ReadPreference] = None, writeConcernOpt: Option[WriteConcern] = None)(f: (MongoCollection[Document]) ⇒ T): T

    Permalink

    Executes the given function with the specified database and collection.

    Executes the given function with the specified database and collection. Throws if the database does not exist.

  27. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped