Packages

c

gnieh.sohva

Replicator

class Replicator extends Database

A replicator database that allows people to manage replications:

  • start replication
  • cancel or stop replications
  • list current 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)

Value Members

  1. object changes extends ChangeStream

    Exposes the interface to change stream for this database.

    Exposes the interface to change stream for this database.

    Definition Classes
    Database
  2. object index extends Index

    Exposes the interface for managing indices.

    Exposes the interface for managing indices.

    Definition Classes
    Database
  3. object local extends Local

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

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

    Definition Classes
    Database
  4. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def ##(): Int
    Definition Classes
    AnyRef → Any
  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. def allDocs(key: Option[String] = None, keys: Iterable[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]]

    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
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def attachTo(docId: String, attachment: String, stream: InputStream, contentType: String): Future[Boolean]

    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
  10. def attachTo(docId: String, file: File, contentType: String): Future[Boolean]

    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
  11. def builtInView(view: String): View

    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
  12. def bulkDocs[T](operations: Iterable[BulkOp[T]])(implicit arg0: CouchFormat[T]): Future[List[DbResult]]

    Performs bulk document update.

    Performs bulk document update.

    Definition Classes
    Database
  13. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. def compact: Future[Boolean]

    Requests a database compaction.

    Requests a database compaction.

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

    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
  16. val couch: CouchDB
    Definition Classes
    Database
  17. def create: Future[Boolean]

    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
  18. def createDoc[T](doc: T)(implicit arg0: JsonWriter[T]): Future[DbResult]

    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
  19. def createDocs[T](docs: Iterable[T])(implicit arg0: JsonWriter[T]): Future[List[DbResult]]

    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
  20. val credit: Int
    Definition Classes
    DatabaseDocumentOps
  21. def delete: Future[Boolean]

    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
  22. def deleteAttachment(docId: String, attachment: String): Future[Boolean]

    Deletes the given attachment for the given docId

    Deletes the given attachment for the given docId

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

    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
  24. def deleteDoc[T](doc: T)(implicit arg0: CouchFormat[T]): Future[Boolean]

    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
  25. def deleteDocRevs(docs: List[(String, String)]): Future[List[DbResult]]

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

    Deletes a bunch of document revisions 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
  26. def deleteDocs(ids: Iterable[String]): Future[List[DbResult]]

    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
  27. def design(designName: String, language: String = "javascript"): Design

    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
  28. implicit val ec: ExecutionContext
    Definition Classes
    DatabaseDocumentOps
  29. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  30. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  31. def exists: Future[Boolean]

    Indicates whether this database exists

    Indicates whether this database exists

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

    Explains how the query is run by the CouchDB server.

    Explains how the query is run by the CouchDB server.

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

    Finds documents using the declarative mango query syntax.

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

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

    Finds documents using the declarative mango query syntax.

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

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

    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
  37. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  38. def getDocById[T](id: String, revision: Option[String] = None)(implicit arg0: JsonReader[T]): Future[Option[T]]

    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
  39. def getDocRevision(id: String): Future[Option[String]]

    Returns the current revision of the document if it exists

    Returns the current revision of the document if it exists

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

    Returns the current revision of the documents

    Returns the current revision of the documents

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

    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
  42. def getRevsLimit: Future[Int]

    Gets the current database revision limit.

    Gets the current database revision limit.

    Definition Classes
    Database
  43. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  44. def http(req: HttpRequest): Future[JsValue]
    Attributes
    protected[gnieh.sohva]
    Definition Classes
    DatabaseDocumentOps
  45. def info: Future[Option[InfoResult]]

    Returns the information about this database

    Returns the information about this database

    Definition Classes
    Database
  46. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  47. def missingRevs(revs: Map[String, Iterable[String]]): Future[Map[String, Vector[String]]]

    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
  48. val name: String
    Definition Classes
    Database
  49. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  50. final def notify(): Unit
    Definition Classes
    AnyRef
  51. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  52. def optHttp(req: HttpRequest): Future[Option[JsValue]]
    Attributes
    protected[gnieh.sohva]
    Definition Classes
    DatabaseDocumentOps
  53. def patchDoc[T](id: String, rev: String, patch: diffson.sprayJson.JsonPatch)(implicit arg0: CouchFormat[T]): Future[T]

    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
  54. def revsDiff(revs: Map[String, Iterable[String]]): Future[Map[String, RevDiff]]

    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
  55. def saveDoc[T](doc: T)(implicit arg0: CouchFormat[T]): Future[T]

    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
  56. def saveDocs[T](docs: Iterable[T])(implicit arg0: CouchFormat[T]): Future[List[DbResult]]

    Creates or updates a bunch of documents into the database.

    Creates or updates a bunch of documents into the database.

    Definition Classes
    Database
  57. def saveRawDoc(doc: JsValue): Future[JsValue]
    Attributes
    protected[this]
    Definition Classes
    DocumentOps
  58. def saveSecurityDoc(doc: SecurityDoc): Future[Boolean]

    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
  59. def securityDoc: Future[SecurityDoc]

    Returns the security document of this database if any defined

    Returns the security document of this database if any defined

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

    Sets the current database revision limit.

    Sets the current database revision limit.

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

    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.

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

    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.

  63. val strategy: Strategy
    Definition Classes
    DatabaseDocumentOps
  64. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  65. def toString(): String
    Definition Classes
    Database → AnyRef → Any
  66. val uri: Uri
    Attributes
    protected[gnieh.sohva]
    Definition Classes
    DatabaseDocumentOps
  67. def viewCleanup: Future[Boolean]

    Cleanups old views.

    Cleanups old views.

    Definition Classes
    Database
  68. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  69. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  70. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def _all_docs(key: Option[String] = None, keys: Iterable[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]]
    Definition Classes
    Database
    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) Use allDocs instead

  2. def bulkDocs[T](operations: Iterable[BulkOp[T]], all_or_nothing: Boolean)(implicit arg0: CouchFormat[T]): Future[List[DbResult]]

    Performs bulk document update.

    Performs bulk document update.

    Definition Classes
    Database
    Annotations
    @deprecated
    Deprecated

    (Since version Sohva 2.2.0) all_or_nothing was removed in CouchDB 2.0 and will have no effect

  3. def deleteDocRevs(docs: List[(String, String)], all_or_nothing: Boolean = false): Future[List[DbResult]]

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

    Deletes a bunch of document revisions 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
    Annotations
    @deprecated
    Deprecated

    (Since version Sohva 2.2.0) all_or_nothing was removed in CouchDB 2.0 and will have no effect

  4. def deleteDocs(ids: Iterable[String], all_or_nothing: Boolean): Future[List[DbResult]]

    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
    Annotations
    @deprecated
    Deprecated

    (Since version Sohva 2.2.0) all_or_nothing was removed in CouchDB 2.0 and will have no effect

  5. def ensureFullCommit: Future[Boolean]

    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

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

    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

  7. def saveDocs[T](docs: Iterable[T], all_or_nothing: Boolean)(implicit arg0: CouchFormat[T]): Future[List[DbResult]]

    Creates or updates a bunch of documents into the database.

    Creates or updates a bunch of documents into the database.

    Definition Classes
    Database
    Annotations
    @deprecated
    Deprecated

    (Since version Sohva 2.2.0) all_or_nothing was removed in CouchDB 2.0 and will have no effect

  8. def temporaryView(viewDoc: ViewDoc): View

    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