Class

gnieh.sohva

Replicator

Related Doc: package sohva

Permalink

class Replicator extends Database

A replicator database that allows people to manage replications:

Linear Supertypes
Database, DocumentOps, AnyRef, Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. Replicator
  2. Database
  3. DocumentOps
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Replicator(name: String, couch: CouchDB, credit: Int, strategy: Strategy)

    Permalink

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. def allDocs(key: Option[String] = None, keys: List[String] = Nil, startkey: Option[String] = None, startkey_docid: Option[String] = None, endkey: Option[String] = None, endkey_docid: Option[String] = None, limit: Int = 1, stale: Option[String] = None, descending: Boolean = false, skip: Int = 0, inclusive_end: Boolean = true): Future[List[String]]

    Permalink

    Returns the list of identifiers of the documents in this database

    Returns the list of identifiers of the documents in this database

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

    Permalink
    Definition Classes
    Any
  6. def attachTo(docId: String, attachment: String, stream: InputStream, contentType: String): Future[Boolean]

    Permalink

    Attaches the given file (given as an input stream) to the given document id.

    Attaches the given file (given as an input stream) to the given document id. If no mime type is given, sohva tries to guess the mime type of the file itself. It it does not manage to identify the mime type, the file won't be attached... This method returns true iff the file was attached to the document.

    Definition Classes
    Database
  7. def attachTo(docId: String, file: File, contentType: String): Future[Boolean]

    Permalink

    Attaches the given file to the given document id.

    Attaches the given file to the given document id. This method returns true iff the file was attached to the document.

    Definition Classes
    Database
  8. def builtInView(view: String): View

    Permalink

    Returns a built-in view of this database, identified by its name.

    Returns a built-in view of this database, identified by its name. E.g. _all_docs.

    Definition Classes
    Database
  9. object changes extends ChangeStream

    Permalink

    Exposes the interface to change stream for this database.

    Exposes the interface to change stream for this database.

    Definition Classes
    Database
  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def compact: Future[Boolean]

    Permalink

    Requests a database compaction.

    Requests a database compaction.

    Definition Classes
    Database
  12. def copy(origin: String, target: String, originRev: Option[String] = None, targetRev: Option[String] = None): Future[Boolean]

    Permalink

    Copies the origin document to the target document.

    Copies the origin document to the target document. If the target does not exist, it is created, otherwise it is updated and the target revision must be provided

    Definition Classes
    Database
  13. val couch: CouchDB

    Permalink
    Definition Classes
    Database
  14. def create: Future[Boolean]

    Permalink

    Creates this database in the couchdb instance if it does not already exist.

    Creates this database in the couchdb instance if it does not already exist. Returns true iff the database was actually created.

    Definition Classes
    Database
  15. def createDoc[T](doc: T)(implicit arg0: JsonWriter[T]): Future[DbResult]

    Permalink

    Creates a document in the database and returns its identifier and revision.

    Creates a document in the database and returns its identifier and revision. If the json version of the object has a _id field, this identifier is used for the document, otherwise a new one is generated.

    Definition Classes
    Database
  16. def createDocs[T](docs: List[T])(implicit arg0: JsonWriter[T]): Future[List[DbResult]]

    Permalink

    Creates a set of documents in the database and returns theirs identifiers and revision.

    Creates a set of documents in the database and returns theirs identifiers and revision. If the json version of an object has a _id field, this identifier is used for the document, otherwise a new one is generated.

    Definition Classes
    Database
  17. val credit: Int

    Permalink

    The credit assigned to the conflict resolver.

    The credit assigned to the conflict resolver. It represents the number of times the client tries to save the document before giving up.

    Definition Classes
    DatabaseDocumentOps
  18. def delete: Future[Boolean]

    Permalink

    Deletes this database in the couchdb instance if it exists.

    Deletes this database in the couchdb instance if it exists. Returns true iff the database was actually deleted.

    Definition Classes
    Database
  19. def deleteAttachment(docId: String, attachment: String): Future[Boolean]

    Permalink

    Deletes the given attachment for the given docId

    Deletes the given attachment for the given docId

    Definition Classes
    Database
  20. def deleteDoc(id: String): Future[Boolean]

    Permalink

    Deletes the document identified by the given id from the database.

    Deletes the document identified by the given id from the database. If the document exists it is deleted and the method returns true, otherwise returns false.

    Definition Classes
    Database
  21. def deleteDoc[T](doc: T)(implicit arg0: CouchFormat[T]): Future[Boolean]

    Permalink

    Deletes the document from the database.

    Deletes the document from the database. The document will only be deleted if the caller provided the last revision

    Definition Classes
    DocumentOps
  22. def deleteDocs(ids: List[String], all_or_nothing: Boolean = false): Future[List[DbResult]]

    Permalink

    Deletes a bunch of documents at once returning the results for each identifier in the document list.

    Deletes a bunch of documents at once returning the results for each identifier in the document list. One can choose the update strategy by setting the parameter all_or_nothing to true or false.

    Definition Classes
    Database
  23. def design(designName: String, language: String = "javascript"): Design

    Permalink

    Returns a design object that allows user to work with views

    Returns a design object that allows user to work with views

    Definition Classes
    Database
  24. implicit val ec: ExecutionContext

    Permalink
    Definition Classes
    DatabaseDocumentOps
  25. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  27. def exists: Future[Boolean]

    Permalink

    Indicates whether this database exists

    Indicates whether this database exists

    Definition Classes
    Database
  28. def explain(query: Query): Future[Explanation]

    Permalink

    Explains how the query is run by the CouchDB server.

    Explains how the query is run by the CouchDB server.

    Definition Classes
    Database
  29. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  30. def find[T <: AnyRef](query: Query)(implicit arg0: JsonReader[T]): Future[SearchResult[T]]

    Permalink

    Finds documents using the declarative mango query syntax.

    Finds documents using the declarative mango query syntax. See sohva.mango for details.

    Definition Classes
    Database
  31. def find[T <: AnyRef](selector: Selector, fields: List[String] = Nil, sort: List[Sort], limit: Option[Int] = None, skip: Option[Int] = None, use_index: Option[UseIndex] = None)(implicit arg0: JsonReader[T]): Future[SearchResult[T]]

    Permalink

    Finds documents using the declarative mango query syntax.

    Finds documents using the declarative mango query syntax. See sohva.mango for details.

    Definition Classes
    Database
  32. def getAttachment(docId: String, attachment: String): Future[Option[(String, ByteString)]]

    Permalink

    Returns the given attachment for the given docId.

    Returns the given attachment for the given docId. It returns the mime type if any given in the response and the input stream to read the response from the server.

    Definition Classes
    Database
  33. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  34. def getDocById[T](id: String, revision: Option[String] = None)(implicit arg0: JsonReader[T]): Future[Option[T]]

    Permalink

    Returns the document identified by the given id if it exists

    Returns the document identified by the given id if it exists

    Definition Classes
    DocumentOps
  35. def getDocRevision(id: String): Future[Option[String]]

    Permalink

    Returns the current revision of the document if it exists

    Returns the current revision of the document if it exists

    Definition Classes
    Database
  36. def getDocRevisions(ids: List[String]): Future[List[(String, String)]]

    Permalink

    Returns the current revision of the documents

    Returns the current revision of the documents

    Definition Classes
    Database
  37. def getDocsById[T](ids: List[String])(implicit arg0: JsonReader[T]): Future[List[T]]

    Permalink

    Returns all the documents with given identifiers and of the given type.

    Returns all the documents with given identifiers and of the given type. If the document with an identifier exists in the database but has not the required type, it is not added to the result

    Definition Classes
    Database
  38. def getRevsLimit: Future[Int]

    Permalink

    Gets the current database revision limit.

    Gets the current database revision limit.

    Definition Classes
    Database
  39. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  40. def http(req: HttpRequest): Future[JsValue]

    Permalink
    Attributes
    protected[gnieh.sohva]
    Definition Classes
    DatabaseDocumentOps
  41. object index extends Index

    Permalink

    Exposes the interface for managing indices.

    Exposes the interface for managing indices.

    Definition Classes
    Database
  42. def info: Future[Option[InfoResult]]

    Permalink

    Returns the information about this database

    Returns the information about this database

    Definition Classes
    Database
  43. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  44. object local extends Local

    Permalink

    Exposes the interface for managing local (non-replicating) documents.

    Exposes the interface for managing local (non-replicating) documents.

    Definition Classes
    Database
  45. def missingRevs(revs: Map[String, Vector[String]]): Future[Map[String, Vector[String]]]

    Permalink

    Returns the revision for each document in the map that are not present in this node.

    Returns the revision for each document in the map that are not present in this node.

    Definition Classes
    Database
  46. val name: String

    Permalink
    Definition Classes
    Database
  47. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  50. def optHttp(req: HttpRequest): Future[Option[JsValue]]

    Permalink
    Attributes
    protected[gnieh.sohva]
    Definition Classes
    DatabaseDocumentOps
  51. def patchDoc[T](id: String, rev: String, patch: diffson.sprayJson.JsonPatch)(implicit arg0: CouchFormat[T]): Future[T]

    Permalink

    Patches the document identified by the given identifier in the given revision.

    Patches the document identified by the given identifier in the given revision. This will work if the revision is the last one, or if it is not but the automatic conflict manager manages to solve the potential conflicts. The patched revision is returned. If something went wrong, an exception is raised

    Definition Classes
    Database
  52. def revsDiff(revs: Map[String, Vector[String]]): Future[Map[String, RevDiff]]

    Permalink

    Given a list of documents and revisions, returns the revision that are missing in this node.

    Given a list of documents and revisions, returns the revision that are missing in this node.

    Definition Classes
    Database
  53. def saveDoc[T](doc: T)(implicit arg0: CouchFormat[T]): Future[T]

    Permalink

    Creates or updates the given object as a document into this database The given object must have an _id and an optional _rev fields to conform to the couchdb document structure.

    Creates or updates the given object as a document into this database The given object must have an _id and an optional _rev fields to conform to the couchdb document structure. The saved revision is returned. If something went wrong, an exception is raised

    Definition Classes
    DocumentOps
  54. def saveDocs[T](docs: List[T], all_or_nothing: Boolean = false)(implicit arg0: CouchFormat[T]): Future[List[DbResult]]

    Permalink

    Creates or updates a bunch of documents into the database.

    Creates or updates a bunch of documents into the database.

    Definition Classes
    Database
  55. def saveRawDoc(doc: JsValue): Future[JsValue]

    Permalink
    Attributes
    protected[this]
    Definition Classes
    DocumentOps
  56. def saveSecurityDoc(doc: SecurityDoc): Future[Boolean]

    Permalink

    Creates or updates the security document.

    Creates or updates the security document. Security documents are special documents with no _id nor _rev fields.

    Definition Classes
    Database
  57. def securityDoc: Future[SecurityDoc]

    Permalink

    Returns the security document of this database if any defined

    Returns the security document of this database if any defined

    Definition Classes
    Database
  58. def setRevsLimit(l: Int): Future[Boolean]

    Permalink

    Sets the current database revision limit.

    Sets the current database revision limit.

    Definition Classes
    Database
  59. def start(replication: Replication): Future[Replication]

    Permalink

    Starts a new replication from source to target.

    Starts a new replication from source to target. if a replication task already exists for the same source and target, the document is added but the replication is not started again. The result only contains the identifier of the actual replication task, not its state.

  60. def stop(id: String): Future[Boolean]

    Permalink

    Stops the replication identified by the given replication document id.

    Stops the replication identified by the given replication document id. if the identifier does not describe the document that started the replication, it is deleted from the replicator database, but the replication task is not stopped. It returns true only if the replication was actually stopped, false otherwise.

  61. val strategy: Strategy

    Permalink

    The strategy being used to resolve conflicts

    The strategy being used to resolve conflicts

    Definition Classes
    DatabaseDocumentOps
  62. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    Database → AnyRef → Any
  64. val uri: Uri

    Permalink
    Attributes
    protected[gnieh.sohva]
    Definition Classes
    DatabaseDocumentOps
  65. def viewCleanup: Future[Boolean]

    Permalink

    Cleanups old views.

    Cleanups old views.

    Definition Classes
    Database
  66. final def wait(): Unit

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

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

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

Deprecated Value Members

  1. def _all_docs(key: Option[String] = None, keys: List[String] = Nil, startkey: Option[String] = None, startkey_docid: Option[String] = None, endkey: Option[String] = None, endkey_docid: Option[String] = None, limit: Int = 1, stale: Option[String] = None, descending: Boolean = false, skip: Int = 0, inclusive_end: Boolean = true): Future[List[String]]

    Permalink
    Definition Classes
    Database
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) Use allDocs instead

  2. def ensureFullCommit: Future[Boolean]

    Permalink

    Ensures that all changes are written to disk.

    Ensures that all changes are written to disk.

    Definition Classes
    Database
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) You shouldn't need to call this if you have the recommended setting delayed_commits=false

  3. def getRawDocById(id: String, revision: Option[String] = None): Future[Option[JsValue]]

    Permalink

    Returns the raw representation of the document identified by the given id if it exists.

    Returns the raw representation of the document identified by the given id if it exists.

    Definition Classes
    Database
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) Use getDocById with return type JsValue instead

  4. def temporaryView(viewDoc: ViewDoc): View

    Permalink

    Returns a temporary view of this database, specified by the ViewDoc.

    Returns a temporary view of this database, specified by the ViewDoc.

    Definition Classes
    Database
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) Temporary view were removed in CouchDB 2.0 and should not be used

Inherited from Database

Inherited from DocumentOps

Inherited from AnyRef

Inherited from Any

CouchDB1

Operation only available in CouchDB 1

CouchDB2

Operation only available in CouchDB 2

Ungrouped

LowLevel

Low-level classes that may break compatibility even between patch and minor versions