Gets replication information and returns an information object.
If your current Rational ClearQuest release supports Rational® ClearQuest® MultiSite, then this method returns an Entity object of type ratl_replicas.
You can use the returned object to determine whether your local Rational ClearQuest database has been replicated with Rational ClearQuest MultiSite. You can also use this method to find information about current replication, such as the names and locations of replica databases.
The Replica object that this method returns is like any Entity object returned by the GetEntity method on the Session object. This means that you can use any of the methods associated with an Entity object to query the Replica object.
VBScript
set replicaObj = session.GetLocalReplica
Perl
$replicaObj = session->GetLocalReplica();
You can create a query against the "ratl_replicas" Entity (which contains the list of replicas known to this database) and compare the "Name" field against replicaName (see example following) to determine if the information applies to the local database or one of the other replicas. Or you can compare the "Host" field to localReplicaHost to determine how you might have to communicate with other programs dealing with the particular replica. For example, if the replica is not local, you might have to use e-mail.
VBScript
set session = GetSession set replicaObj = session.GetLocalReplica fieldNameList = replicaObj.GetFieldNames For Each fieldName in fieldNameList set fieldInfoObj = GetFieldValue(fieldName) fieldType = fieldInfoObj.GetType fieldValue = fieldInfoObj.GetValue If fieldName = "Name" Then 'replica db name If fieldValue = "<local>" Then 'Database has not been replicated else localReplicaName = fieldValue End If ElseIf fieldName = "Host" Then 'db host name 'host name of replica database: replicaHost = fieldValue End If Next Perl use CQPerlExt; my $sess; my $entity; $sess = CQSession::Build(); $sess->UserLogon("admin", "", "MULTI", "CQMS.MS_ACCESS.SITEA"); if ($sess->IsReplicated()) { # print out the local replica name $entity = $sess->GetLocalReplica(); printf "Local replica is %s.\n", $entity->GetDisplayName(); } CQSession::Unbuild($sess);