/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (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
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: IdSearchControl.java,v 1.7 2008/07/06 05:48:30 arviranga Exp $
*
*/
/*
* Portions Copyrighted [2011] [ForgeRock AS]
*/
/**
* This is a helper class which is used in the <code> AMIdentityRepository
* </code>
* search method. It is used to to modify search controls for a given search
* operation. The specific controls that can be modified are: maximum time limit
* and size limit for the search, attributes that should be returned from the
* search, simple modifications to be made to the search filter used by each
* plugin by adding attribute-values which can be either OR'ed or AND'ed to the
* basic search.
*
* @supported.all.api
*/
public final class IdSearchControl {
// Disabled by default
private boolean getAllAttributesEnabled;
boolean recursive = false;
/**
* Creates the <code>IdSearchControl</code> object
*/
public IdSearchControl() {
}
/**
* Set the return attribute names, if attributes of the entries need to be
* obtained as part of the search.
*
* NOTE: If the return attribute values are specified as part of
* <code>AMSearchControl</code>, there could be a significant performance
* overhead compared to when none are specified. When the return attributes
* are set, the return attributes can be obtained as a map with identity
* name as map-key and set of attribute values as map-value from
* <code>AMSearchResults</code> object.
*
* @param attributeNames
* Set of attribute names whose values need to be obtained as
* part of the search.
*
*/
}
}
/**
* Returns the list of attributes requested to be read when the search is
* performed.
*
* @return Set of attributes requested to be read.
*/
return returnAttributes;
}
/**
* Sets the specified boolean value to the variable. Boolean value is set to
* true, if all attributes of the entries need to be obtained as part of the
* search.
*
* When the option for getting all attributes is set to true, the search
* results will return a Map, where the Key is the DN of the search results,
* and value is another Map of attribute names for keys and Sets for values
* of those attributes.
*
* @param getAllAttributes
* Boolean value set to true as part of the
* <code>IdSearchControl</code> to obtain all attributes as
* part of the search.
*
*
*/
}
/**
* Returns true if the option for getting all attributes has been enabled.
*
* @return true if the option for getting all attributes has been enabled.
*/
public boolean isGetAllReturnAttributesEnabled() {
return getAllAttributesEnabled;
}
/**
* Sets the maximum number of milliseconds to wait for any operation for the
* search.
*
* @param timeOut
* Max number of milliseconds
*
*/
}
/**
* Returns current time out setting.
*
* @return current time out setting.
*/
public int getTimeOut() {
return timeOut;
}
/**
* Sets the maximum number of search results to return; 0 means there is no
* limit.
*
* @param maxNumber
* Max number of results
*/
}
/**
* Returns the maximum number of search results. return 0 means there is no
* limit.
*
* @return the maximum number of search results.
*/
public int getMaxResults() {
return maxResults;
}
/**
* Set the options for modifying the basic search filter in each plugin. By
* default, there are no modifications.
*
* @param mod
* One of the supported IdSearchOpModifiers
* @param avMap
* Map of attribute-value pairs to be used to modify the search
* operation.
*/
}
}
}
/**
* Returns the IdSearchOpModifier defined for this SearchControl
*
* @return One of the supported IdSearchOpModifier
*/
return modifier;
}
/**
* Returns the map set to be used to modify the search filter in each
* plugin.
*
* @return Map of attribute values pairs, if it is set. Null otherwise.
*/
return avPairs;
}
/**
* Sets the recursive flag to be true or false. It is false by default so
* plugin searches are not recursive.
*
* @deprecated This method is deprecated. The setting for recursive
* search should be configured via the data store.
*
* @param rec
* <code>true</code> if search is recursive;
* else <code>false</code>
*/
}
/**
* Returns true if recursive is enabled, false otherwise
*
* @deprecated This method is deprecated. The setting for recursive
* search should be configured via the data store.
*
* @return true if recursive search is on; else false.
*/
public boolean isRecursive() {
return recursive;
}
/**
* Return String representation of the <code>IdeSearchControl</code>
* object. It returns the search controls
*
* @return String representation of the <code>IdSearchControl</code>
* object.
*/
}
}