new Replica(dataopt)
Create a Replica instance.
Parameters:
| Name |
Type |
Attributes |
Description |
data |
object
|
<optional>
|
Initial replica values.
Properties
| Name |
Type |
Attributes |
Description |
replicaMemberNode |
string
|
null
|
<optional>
|
Replica member node
identifier. |
replicationStatus |
string
|
null
|
<optional>
|
Replica replication status. |
replicaVerified |
string
|
Date
|
null
|
<optional>
|
Replica verification
timestamp. |
|
- Source:
Methods
toElement(doc) → {Element|null}
Serialize the replica to XML.
Parameters:
| Name |
Type |
Description |
doc |
XMLDocument
|
XML document used to create elements. |
- Source:
Returns:
Serialized XML element, or `null` when empty.
-
Type
-
Element
|
null
toJSON() → {object}
Return a JSON-serializable representation of the replica.
- Source:
Returns:
Plain replica data.
-
Type
-
object
validate(pathopt) → {Array.<object>}
Validate the replica state.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
path |
string
|
<optional>
|
replica
|
Base path used in validation errors. Defaults to
`replica`. |
- Source:
Returns:
Validation errors for invalid fields.
-
Type
-
Array.<object>
fromElement(element) → {Replica}
Create a Replica from a `replica` XML element.
Parameters:
| Name |
Type |
Description |
element |
Element
|
XML element to parse. |
- Source:
Returns:
Parsed replica instance.
-
Type
-
Replica
parse(element, parseWarningsopt, pathopt) → {Replica|null}
Parse a `replica` XML element, dropping it when invalid.
Unknown child nodes and ordering issues are ignored silently.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
element |
Element
|
null
|
|
|
XML element to parse. |
parseWarnings |
Array.<object>
|
<optional>
|
|
Lossy parse warnings. |
path |
string
|
<optional>
|
replica
|
Field path used in warnings and validation. |
- Source:
Returns:
Parsed replica or null when invalid.
-
Type
-
Replica
|
null