new ReplicaList(replicasopt)
Create a ReplicaList instance.
Parameters:
| Name |
Type |
Attributes |
Description |
replicas |
Array.<(Replica|object)>
|
<optional>
|
Replica entries to normalize. |
- Source:
Methods
Append one replica entry.
Parameters:
| Name |
Type |
Description |
replica |
Replica
|
object
|
Replica entry to append. |
- Source:
Returns:
The same list instance.
-
Type
-
ReplicaList
Remove all replicas.
- Source:
Returns:
The same list instance.
-
Type
-
ReplicaList
Normalize the replica list in place.
- Source:
Returns:
The same list instance.
-
Type
-
ReplicaList
push(…replicas) → {number}
Append one or more replicas to the list.
Parameters:
| Name |
Type |
Attributes |
Description |
replicas |
Replica
|
object
|
<repeatable>
|
Replica entries to append. |
- Source:
Returns:
The new array length.
-
Type
-
number
Remove one replica entry.
Parameters:
| Name |
Type |
Description |
index |
number
|
Replica index to remove. |
- Source:
Throws:
-
When index is invalid or does not identify a replica
-
-
Type
-
Error
Returns:
The same list instance.
-
Type
-
ReplicaList
replace(index, replica) → {ReplicaList}
Replace one replica entry.
Parameters:
| Name |
Type |
Description |
index |
number
|
Replica index to replace. |
replica |
Replica
|
object
|
Replacement replica. |
- Source:
Throws:
-
When index is invalid or does not identify a replica
-
-
Type
-
Error
Returns:
The same list instance.
-
Type
-
ReplicaList
toJSON() → {Array.<object>}
Return a JSON-serializable representation of the replica list.
- Source:
Returns:
Plain replica data.
-
Type
-
Array.<object>
validate(pathopt) → {Array.<object>}
Validate each replica in the list.
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 replicas.
-
Type
-
Array.<object>
Coerce unknown input into a ReplicaList instance.
Parameters:
- Source:
Returns:
Normalized replica list instance.
-
Type
-
ReplicaList
parse(elements, parseWarningsopt, pathopt) → {ReplicaList}
Parse replica elements while salvaging valid entries.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
elements |
Array.<Element>
|
null
|
undefined
|
|
|
Replica XML elements. |
parseWarnings |
Array.<object>
|
<optional>
|
|
Lossy parse warnings. |
path |
string
|
<optional>
|
replica
|
Field path used in warnings and validation. |
- Source:
Returns:
Parsed replica list instance.
-
Type
-
ReplicaList