2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell/**
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell *
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell *
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * The contents of this file are subject to the terms
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * of the Common Development and Distribution License
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * (the License). You may not use this file except in
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * compliance with the License.
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell *
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * You can obtain a copy of the License at
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * https://opensso.dev.java.net/public/CDDLv1.0.html or
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * opensso/legal/CDDLv1.0.txt
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * See the License for the specific language governing
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * permission and limitations under the License.
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell *
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * When distributing Covered Code, include this CDDL
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * Header Notice in each file and include the License file
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * at opensso/legal/CDDLv1.0.txt.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * If applicable, add the following below the CDDL Header,
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * with the fields enclosed by brackets [] replaced by
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * your own identifying information:
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * "Portions Copyrighted [year] [name of copyright owner]"
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell *
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * $Id: ValidValues.java,v 1.2 2008/06/25 05:43:45 qcheng Exp $
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott *
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * Portions Copyrighted 2014 ForgeRock AS.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell */
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellpackage com.sun.identity.policy;
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnellimport java.util.*;
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott/**
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * This class <code>ValidValues</code> provides search results and a error
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * code indicating if the search was successfully or time limit exceeded or
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell * search limit exceeded.
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell *
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @supported.all.api
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @deprecated since 12.0.0
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell */
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell@Deprecated
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnellpublic class ValidValues {
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell /**
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * Code used to indicate a successful search
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell */
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott public static final int SUCCESS = 0;
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott /**
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * Code used to indicate that the search was unsuccessful
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * as the size limit exceeded during the search process.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell */
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell public static final int SIZE_LIMIT_EXCEEDED = 1;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell /**
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * Code used to indicate that the search was unsuccessful
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * as the time limit exceeded during the search process.
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell */
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell public static final int TIME_LIMIT_EXCEEDED = 2;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell Set searchResults = null; // set contains the result entries
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell int errorCode;
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell /**
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * Constructs a <code>ValidValues</code> given <code>errorCode</code>
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * and a set of values
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell *
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @param errorCode error code
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @param results set of values to be included
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell *
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @see #SUCCESS
415243fbc81341293a852ff6aa14e9608d08685cCraig McDonnell * @see #SIZE_LIMIT_EXCEEDED
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott * @see #TIME_LIMIT_EXCEEDED
91f0e3cb60de3eba8cbb70c7e36cc0df22d71f5bRobert Wapshott */
2beebed98b4fc7f018fb224a1e4a3ab6103a4c0bCraig McDonnell public ValidValues(int errorCode, Set results) {
searchResults = results;
this.errorCode = errorCode;
}
/**
* Returns the search results as a set.
* @return set of entries matching the search criteria. Each element in the
* Set is a String.
*/
public Set getSearchResults() {
return searchResults;
}
/**
* Returns the error code of search.
* @return Error code of search. The possible values are
* <code>SUCCESS</code>, <code>SIZE_LIMIT_EXCEEDED</code>
* and <code>TIME_LIMIT_EXCEEDED</code>
* @see #SUCCESS
* @see #SIZE_LIMIT_EXCEEDED
* @see #TIME_LIMIT_EXCEEDED
*/
public int getErrorCode() {
return errorCode;
}
}