/*
* 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 2006-2010 Sun Microsystems, Inc.
* Portions Copyright 2011-2015 ForgeRock AS
*/
/**
* Message used to send Modify information.
*/
{
/**
* Creates a new Modify message from a ModifyOperation.
*
* @param op The operation to use for building the message
*/
{
op.getEntryDN());
}
/**
* Creates a new Modify message using the provided information.
*
* @param csn The CSN for the operation.
* @param dn The baseDN of the operation.
* @param mods The mod of the operation.
* @param entryUUID The unique id of the entry on which the modification
* needs to apply.
*/
{
}
/**
* Creates a new Modify message from a byte[].
*
* @param in The byte[] from which the operation must be read.
* @throws DataFormatException If the input byte[] is not a valid ModifyMsg
*/
{
if (protocolVersion <= 3)
{
}
else
{
}
{
}
}
/**
* Creates a new Modify message from a V1 byte[].
*
* @param in The byte[] from which the operation must be read.
* @return The created ModifyMsg.
* @throws DataFormatException If the input byte[] is not a valid ModifyMsg
*/
{
// bytes is only for current version (of the protocol) bytes !
return msg;
}
/** {@inheritDoc} */
{
{
}
return mod;
}
/** {@inheritDoc} */
{
{
return "ModifyMsg content: " +
" protocolVersion: " + protocolVersion +
" dn: " + dn +
" csn: " + csn +
" uniqueId: " + entryUUID +
" assuredFlag: " + assuredFlag +
" assuredMode: " + assuredMode +
" safeDataLevel: " + safeDataLevel +
: "");
/* Do not append mods, they can be too long */
}
}
/** {@inheritDoc} */
public int size()
{
// The ModifyMsg can be very large when added or deleted attribute
// values are very large.
// We therefore need to count the whole encoded msg.
}
// ============
// Msg Encoding
// ============
/** {@inheritDoc} */
public byte[] getBytes_V1()
{
return builder.toByteArray();
}
/** {@inheritDoc} */
public byte[] getBytes_V23()
{
final ByteArrayBuilder builder =
return builder.toByteArray();
}
/** {@inheritDoc} */
{
final ByteArrayBuilder builder =
return builder.toByteArray();
}
// ============
// Msg decoding
// ============
throws DataFormatException
{
}
throws DataFormatException
{
}
}