InitializeRequestMessage.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 2006-2008 Sun Microsystems, Inc.
*/
/**
* This message is part of the replication protocol.
* This message is sent by a server to another server in order to
* request this other server to do an export to the server sender
* of this message.
*/
public class InitializeRequestMessage extends RoutableMessage implements
{
private static final long serialVersionUID = 8303271162942249215L;
/**
* Creates a InitializeRequestMessage message.
*
* @param baseDn The base DN of the replication domain.
* @param destination destination of this message
* @param senderID serverID of the server that will send this message
*/
{
super(senderID, destination);
}
/**
* Creates a new InitializeRequestMessage 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 InitializeMessage.
*/
{
super();
try
{
/* first byte is the type */
throw new DataFormatException(
"input is not a valid InitializeRequestMessage");
int pos = 1;
// baseDn
// sender
// destination
} catch (UnsupportedEncodingException e)
{
throw new DataFormatException("UTF-8 is not supported by this jvm.");
}
}
/**
* Get the base DN from this InitializeRequestMessage.
*
* @return the base DN from this InitializeRequestMessage.
*/
{
return null;
try
{
} catch (DirectoryException e)
{
return null;
}
}
/**
* {@inheritDoc}
*/
public byte[] getBytes()
{
try {
getBytes("UTF-8");
byte[] resultByteArray = new byte[length];
// type of the operation
int pos = 1;
// baseDN
// sender
// destination
return resultByteArray;
}
catch (UnsupportedEncodingException e)
{
return null;
}
}
/**
* Get a string representation of this object.
* @return A string representation of this object.
*/
{
" destination=" + destination;
}
}