MonitorRequestMessage.java revision a395dd575518d9e5280fc5d5d5ef47c61b174647
/*
* 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
* 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
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2008 Sun Microsystems, Inc.
*/
/**
* This message is part of the replication protocol.
* RS1 sends a MonitorRequestMessage to RS2 to requests its monitoring
* informations.
* When RS2 receives a MonitorRequestMessage from RS1, RS2 responds with a
* MonitorMessage.
*/
public class MonitorRequestMessage extends RoutableMessage implements
{
private static final long serialVersionUID = -2407640479423633234L;
/**
* Creates a message.
*
* @param sender The sender server of this message.
* @param destination The server or servers targetted by this message.
*/
{
super(sender, destination);
}
/**
* Creates a new message by decoding the provided byte array.
* @param in A byte array containing the encoded information for the message,
* @throws DataFormatException If the in does not contain a properly,
* encoded message.
*/
{
super();
try
{
// First byte is the type
throw new DataFormatException("input is not a valid " +
this.getClass().getCanonicalName());
int pos = 1;
// sender
// destination
} catch (UnsupportedEncodingException e)
{
throw new DataFormatException("UTF-8 is not supported by this jvm.");
}
}
/**
* {@inheritDoc}
*/
public byte[] getBytes()
{
try
{
byte[] resultByteArray = new byte[length];
/* put the type of the operation */
int pos = 1;
/* put the sender */
/* put the destination */
return resultByteArray;
}
catch (UnsupportedEncodingException e)
{
return null;
}
}
}