MatchedValuesControl.java revision 90a6ab6c63699343acf3adcd4346bce2f5665bdd
/*
* 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-2008 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* This class implements the matched values control as defined in RFC 3876. It
* may be included in a search request to indicate that only attribute values
* matching one or more filters contained in the matched values control should
* be returned to the client.
*/
public class MatchedValuesControl
extends Control
{
/**
* ControlDecoder implementation to decode this control from a ByteString.
*/
private static final class Decoder
implements ControlDecoder<MatchedValuesControl>
{
/** {@inheritDoc} */
throws DirectoryException
{
{
}
try
{
if (!reader.hasNextElement())
{
}
while(reader.hasNextElement())
{
}
}
catch (DirectoryException e)
{
throw e;
}
catch (Exception e)
{
logger.traceException(e);
getExceptionMessage(e));
}
}
{
return OID_MATCHED_VALUES;
}
}
/**
* The Control Decoder that can be used to decode this control.
*/
new Decoder();
/** The set of matched values filters for this control. */
/**
* Creates a new matched values control using the default OID and the provided
* criticality and set of filters.
*
* @param isCritical Indicates whether this control should be considered
* critical to the operation processing.
* @param filters The set of filters to use to determine which values to
* return.
*/
public MatchedValuesControl(boolean isCritical,
{
super(OID_MATCHED_VALUES, isCritical);
}
/**
* 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 output stream to write to.
* @throws IOException If a problem occurs while writing to the stream.
*/
for (MatchedValuesFilter f : filters)
{
}
}
/**
* Retrieves the set of filters associated with this matched values control.
*
* @return The set of filters associated with this matched values control.
*/
{
return filters;
}
/**
* Indicates whether any of the filters associated with this matched values
*
* @param type The attribute type with which the value is associated.
* @param value The attribute value for which to make the determination.
*
* @return <CODE>true</CODE> if at least one of the filters associated with
* this matched values control does match the provided attribute
* value, or <CODE>false</CODE> if none of the filters match.
*/
{
for (MatchedValuesFilter f : filters)
{
try
{
{
return true;
}
}
catch (Exception e)
{
logger.traceException(e);
}
}
return false;
}
/**
* Appends a string representation of this authorization identity response
* control to the provided buffer.
*
* @param buffer The buffer to which the information should be appended.
*/
{
{
}
else
{
for (MatchedValuesFilter f : filters)
{
}
}
}
}