this.destination = reader.getInt();
}
}
ASN1Reader asn1Reader = ASN1.getReader(reader);
try
{
asn1Reader.readStartSequence();
// loop on the servers
while(asn1Reader.hasNextElement())
{
ServerState newState = new ServerState();
int serverId = 0;
Long outime = (long)0;
boolean isLDAPServer = false;
asn1Reader.readStartSequence();
// loop on the list of CN of the state
while(asn1Reader.hasNextElement())
{
String s = asn1Reader.readOctetStringAsString();
ChangeNumber cn = new ChangeNumber(s);
if ((data.replServerDbState != null) && (serverId == 0))
{
// we are on the first CN that is a fake CN to store the serverId
// and the older update time
serverId = cn.getServerId();
outime = cn.getTime();
isLDAPServer = (cn.getSeqnum()>0);
}
else
{
// we are on a normal CN
newState.update(cn);
}
}
asn1Reader.readEndSequence();
if (data.replServerDbState == null)
{
// the first state is the replication state
data.replServerDbState = newState;
}
else
{
// the next states are the server states
ServerData sd = new ServerData();
sd.state = newState;
sd.approxFirstMissingDate = outime;
if (isLDAPServer)
data.ldapStates.put(serverId, sd);
else
data.rsStates.put(serverId, sd);
}
}
asn1Reader.readEndSequence();
} catch(Exception e)
{
}
}