Class ReplicationConfig
java.lang.Object
com.sonyericsson.hudson.plugins.gerrit.trigger.config.ReplicationConfig
Each instance of this class holds data needed to trigger builds on replication events,
and is associated to one specific GerritServer.
A GerritServer can have at most one ReplicationConfig in its Config object.
- Author:
- Mathieu Wang <mathieu.wang@ericsson.com>
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ReplicationConfig(ReplicationConfig config) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic ReplicationConfigcreateReplicationConfigFromJSON(net.sf.json.JSONObject formData) Create a ReplicationConfig object from JSON.The id of the default replica to be selected in job config.The id of the default slave to be selected in job config.getGerritSlave(String id, boolean defaultSlave) Get a specific Gerrit slave using its id.Get the list of GerritSlave objects.Get the list of replication servers to use.booleanWhether replica selection in enabled in job config.booleanIf we enable waiting on replication events.booleanWhether slave selection in enabled in job config.voidsetDefaultReplicaId(String replicaId) Set default replica id.voidsetEnableReplicaSelectionInJobs(boolean enableReplicaSelectionInJobs) Set replica selection in enabled in job config.voidsetEnableReplication(boolean enableReplication) Enable replication of events.voidsetReplicas(List<GerritSlave> replicas) Set list of configured replicas to use.
-
Constructor Details
-
ReplicationConfig
Copy constructor.- Parameters:
config- the ReplicationConfig object to be copied, never null.
-
ReplicationConfig
@DataBoundConstructor public ReplicationConfig()Default constructor.
-
-
Method Details
-
isEnableReplication
public boolean isEnableReplication()If we enable waiting on replication events.- Returns:
- true if so.
-
setEnableReplication
public void setEnableReplication(boolean enableReplication) Enable replication of events.- Parameters:
enableReplication- enable
-
getGerritSlaves
Get the list of GerritSlave objects.- Returns:
- the list.
-
getReplicas
Get the list of replication servers to use.- Returns:
- the list.
-
setReplicas
Set list of configured replicas to use.- Parameters:
replicas- replicas.
-
isEnableSlaveSelectionInJobs
public boolean isEnableSlaveSelectionInJobs()Whether slave selection in enabled in job config.- Returns:
- true if so.
-
isEnableReplicaSelectionInJobs
public boolean isEnableReplicaSelectionInJobs()Whether replica selection in enabled in job config.- Returns:
- true if so.
-
setEnableReplicaSelectionInJobs
public void setEnableReplicaSelectionInJobs(boolean enableReplicaSelectionInJobs) Set replica selection in enabled in job config.- Parameters:
enableReplicaSelectionInJobs- true if so.
-
getDefaultSlaveId
The id of the default slave to be selected in job config.- Returns:
- the id of default slave.
-
getDefaultReplicaId
The id of the default replica to be selected in job config.- Returns:
- the id of default replica.
-
setDefaultReplicaId
Set default replica id.- Parameters:
replicaId- default id
-
getGerritSlave
Get a specific Gerrit slave using its id.- Parameters:
id- the id of the slave.defaultSlave- if true, will return the default slave when specified id do not exists.- Returns:
- the Gerrit slave that has the given id, otherwise return null.
-
createReplicationConfigFromJSON
Create a ReplicationConfig object from JSON.- Parameters:
formData- the JSON data.- Returns:
- the ReplicationConfig object.
-