/*
* 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 2008-2009 Sun Microsystems, Inc.
*/
/**
* This class implements the virtual list view response controls as defined in
* draft-ietf-ldapext-ldapv3-vlv. The ASN.1 description for the control value
* is:
* <BR><BR>
* <PRE>
* VirtualListViewResponse ::= SEQUENCE {
* targetPosition INTEGER (0 .. maxInt),
* contentCount INTEGER (0 .. maxInt),
* virtualListViewResult ENUMERATED {
* success (0),
* operationsError (1),
* protocolError (3),
* unwillingToPerform (53),
* insufficientAccessRights (50),
* timeLimitExceeded (3),
* adminLimitExceeded (11),
* innapropriateMatching (18),
* sortControlMissing (60),
* offsetRangeError (61),
* other(80),
* ... },
* contextID OCTET STRING OPTIONAL }
* </PRE>
*/
public class VLVResponseControl
extends Control
{
/**
* ControlDecoder implentation to decode this control from a ByteString.
*/
private final static class Decoder
implements ControlDecoder<VLVResponseControl>
{
/**
* {@inheritDoc}
*/
throws DirectoryException
{
{
}
try
{
if (reader.hasNextElement())
{
}
}
catch (Exception e)
{
}
}
/**
* {@inheritDoc}
*/
{
return OID_VLV_RESPONSE_CONTROL;
}
}
/**
* The Control Decoder that can be used to decode this control.
*/
new Decoder();
// The context ID for this VLV response control.
// The content count estimating the total number of entries in the result set.
private int contentCount;
// The offset of the target entry in the result set.
private int targetPosition;
// The result code for the VLV operation.
private int vlvResultCode;
/**
* Creates a new VLV response control with the provided information.
*
* @param targetPosition The position of the target entry in the result set.
* @param contentCount The content count estimating the total number of
* entries in the result set.
* @param vlvResultCode The result code for the VLV operation.
*/
int vlvResultCode)
{
}
/**
* Creates a new VLV response control with the provided information.
*
* @param isCritical Indicates whether the control should be considered
* critical.
* @param targetPosition The position of the target entry in the result set.
* @param contentCount The content count estimating the total number of
* entries in the result set.
* @param vlvResultCode The result code for the VLV operation.
* @param contextID The context ID for this VLV response control.
*/
int contentCount, int vlvResultCode,
{
super(OID_VLV_RESPONSE_CONTROL, isCritical);
this.targetPosition = targetPosition;
this.contentCount = contentCount;
this.vlvResultCode = vlvResultCode;
}
/**
* Retrieves the position of the target entry in the result set.
*
* @return The position of the target entry in the result set.
*/
public int getTargetPosition()
{
return targetPosition;
}
/**
* Retrieves the estimated total number of entries in the result set.
*
* @return The estimated total number of entries in the result set.
*/
public int getContentCount()
{
return contentCount;
}
/**
* Retrieves the result code for the VLV operation.
*
* @return The result code for the VLV operation.
*/
public int getVLVResultCode()
{
return vlvResultCode;
}
/**
* Retrieves a context ID value that should be included in the next request
* to retrieve a page of the same result set.
*
* @return A context ID value that should be included in the next request to
* retrieve a page of the same result set, or {@code null} if there
* is no context ID.
*/
{
return contextID;
}
/**
* Writes this control's value to an ASN.1 writer. The value (if any) must be
* written as an ASN1OctetString.
*
* @param writer The ASN.1 writer to use.
* @throws IOException If a problem occurs while writing to the stream.
*/
{
}
}
/**
* Appends a string representation of this VLV request control to the provided
* buffer.
*
* @param buffer The buffer to which the information should be appended.
*/
{
{
}
}
}