Examining and adjusting database replication settings using Java

You examine and adjust the replication settings of a database through the Replication and ReplicationEntry classes.

Each Database object has exactly one Replication object, accessible through the ReplicationInfo property in Database. The following methods access the Replication properties:

  • getAbstract returns true if large documents are truncated and attachments removed; setAbstract truncates large documents and removes attachments if set to true.
  • getCutoffDate returns an int value containing today's date minus the cutoff interval.
  • getCutoffInterval returns a long value containing the number of days after which documents are automatically deleted; setCutoffInterval sets the cutoff interval.
  • getDontSendLocalSecurityUpdates returns true if local security (encryption) updates are not sent; setDontSendLocalSecurityUpdates does or does not send local security updates.

  • isCutoffDelete returns true if documents older than the cutoff date are deleted; setCutoffDelete deletes documents older than the cutoff date.
  • isDisabled returns true if replication is disabled; setDisabled disables replication. Unlike NeverReplicate, this property is accessible through the UI.
  • isIgnoreDeletes returns true if outgoing deletions are not replicated; setIgnoreDeletes prevents outgoing replication of deletions.
  • isIgnoreDestDeletes returns true if incoming deletions are not replicated; setIgnoreDestDeletes prevents replication of incoming deletions.
  • getPriority returns an int value containing the replication priority; setPriority sets the replication priority.

If you set replication properties, you must save them to make them permanent. You can reset the current property values back to the last saved values. You can clear the replication history with clearHistory.

A database has any number of ReplicationEntry objects, accessible through the getEntry method of Replication. A replication entry describes the replication settings for a pair of servers, of which one is the source and the other is the destination. The following methods access the ReplicationEntry properties:

  • getDestination returns a String value containing the name of the destination server.
  • getFormula returns a String value containing the replication formula; setFormula sets the formula.
  • isIncludeACL returns true if the ACL is included; setIncludeACL includes the ACL or not.
  • isIncludeAgents returns true if agents are included; setIncludeAgents includes agents or not.
  • isIncludeDocuments returns true if documents are included; setIncludeDocuments includes documents or not.
  • isIncludeForms returns true if forms are included; setIncludeForms includes forms or not.
  • isIncludeFormulas returns true if the replication formula is included; setIncludeFormulas includes the replication formula or not.
  • getSource returns a String value containing the name of the source server.
  • getViews returns a String value containing the names of the views to be included; setViews sets the names.

Use remove to remove an entry. The save method must be called to preserve any changes you make to the replication entry.