/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2009 Sun Microsystems, Inc.
* Portions Copyright 2013-2015 ForgeRock AS.
*/
/**
* This message is part of the replication protocol.
* RS1 sends a MonitorRequestMessage to RS2 to requests its monitoring
* information.
* When RS2 receives a MonitorRequestMessage from RS1, RS2 responds with a
* MonitorMsg.
*/
{
/**
* The destination server or servers of this message.
*/
private final int destination;
/**
* The serverID of the server that sends this message.
*/
private final int senderID;
/**
* Data structure to manage the state and the approximation of the data of the
* first missing change for each LDAP server connected to a Replication
* Server.
*/
private static class ServerData
{
private long approxFirstMissingDate;
}
/**
* Data structure to manage the state of this replication server
* and the state information for the servers connected to it.
*/
private static class SubTopoMonitorData
{
/** This replication server DbState. */
/** The data related to the LDAP servers connected to this RS. */
/** The data related to the RS servers connected to this RS. */
}
/**
* Creates a new MonitorMsg.
*
* @param sender The sender of this message.
* @param destination The destination of this message.
*/
{
this.destination = destination;
}
/**
* Sets the state of the replication server.
* @param state The state.
*/
{
}
/**
* Sets the information of an LDAP server.
* @param serverId The serverID.
* @param state The server state.
* @param approxFirstMissingDate The approximation of the date
* of the older missing change. null when none.
* @param isLDAPServer Specifies whether the server is a DS or a RS
*/
long approxFirstMissingDate, boolean isLDAPServer)
{
if (isLDAPServer)
{
}
else
{
}
}
/**
* Get the server state for the LDAP server with the provided serverId.
* @param serverId The provided serverId.
* @return The state.
*/
{
}
/**
* Get the server state for the RS server with the provided serverId.
* @param serverId The provided serverId.
* @return The state.
*/
{
}
/**
* Get the approximation of the date of the older missing change for the
* LDAP Server with the provided server Id.
* @param serverId The provided serverId.
* @return The approximated state.
*/
{
}
/**
* Get the approximation of the date of the older missing change for the
* RS Server with the provided server Id.
* @param serverId The provided serverId.
* @return The approximated state.
*/
{
}
/**
* Creates a new EntryMessage from its encoded form.
*
* @param in The byte array containing the encoded form of the message.
* @param version The version of the protocol to use to decode the msg.
* @throws DataFormatException If the byte array does not contain a valid
* encoded form of the ServerStartMessage.
*/
{
{
throw new DataFormatException("input is not a valid "
+ getClass().getCanonicalName());
}
{
}
{
}
else
{
}
try
{
// loop on the servers
while(asn1Reader.hasNextElement())
{
int serverId = 0;
long outime = 0;
boolean isLDAPServer = false;
// loop on the list of CSN of the state
while(asn1Reader.hasNextElement())
{
{
}
else
{
}
{
// we are on the first CSN that is a fake CSN to store the serverId
// and the older update time
}
else
{
// we are on a normal CSN
}
}
{
// the first state is the replication state
}
else
{
// the next states are the server states
}
}
} catch(Exception e)
{ /* do nothing */
}
}
/** {@inheritDoc} */
{
try
{
/* Put the serverStates ... */
{
/* first put the Replication Server state */
{
}
// then the DS + RS server data
}
{
// legacy coding mistake
}
return builder.toByteArray();
}
catch (Exception e)
{
return null;
}
}
short protocolVersion)
{
{
}
{
}
else // protocolVersion >= ProtocolVersion.REPLICATION_PROTOCOL_V4
{
}
}
boolean writeRSStates) throws IOException
{
{
{
/*
* A fake CSN helps storing the LDAP server ID. The sequence number will
* be used to differentiate between an LDAP server (1) or an RS (0).
*/
{
}
else
{
}
// the CSNs that make the state
}
}
}
/**
* Get the state of the replication server that sent this message.
* @return The state.
*/
{
return data.replServerDbState;
}
/**
* Returns an iterator on the serverId of the connected LDAP servers.
* @return The iterator.
*/
{
}
/**
* Returns an iterator on the serverId of the connected RS servers.
* @return The iterator.
*/
{
}
/**
* Get the destination.
*
* @return the destination
*/
public int getDestination()
{
return destination;
}
/**
* Get the server ID of the server that sent this message.
*
* @return the server id
*/
public int getSenderID()
{
return senderID;
}
/** {@inheritDoc} */
{
{
}
{
}
return getClass().getCanonicalName() +
"[ sender=" + this.senderID +
" destination=" + this.destination +
"]";
}
}