View Javadoc

1   /*
2    * Copyright [2007] [University Corporation for Advanced Internet Development, Inc.]
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.opensaml.xml.security;
18  
19  
20  /**
21   * Generic interface for resolvers which process specified criteria and produce some implementation-specific
22   * result information.
23   * 
24   * @param <ProductType> the type of objects produced by this resolver
25   * @param <CriteriaType> the type of criteria to process during resolution
26   */
27  public interface Resolver<ProductType, CriteriaType> {
28      
29  
30      /**
31       * Process the specified criteria and return the resulting instances the the product type
32       * which satisfy the criteria.
33       * 
34       * @param criteria the criteria to evaluate or process
35       * @return instances which satisfy the criteria
36       * @throws SecurityException thrown if there is an error processing the specified criteria
37       */
38      Iterable<ProductType> resolve(CriteriaType criteria) throws SecurityException;
39      
40      /**
41       * Process the specified criteria and return a single instance of the product type
42       * which satisfies the criteria.
43       * 
44       * If multiple items satisfy the criteria, the choice of which single item to 
45       * return is implementation-dependent.
46       * 
47       * @param criteria the criteria to evaluate or process
48       * @return instances which satisfy the criteria
49       * @throws SecurityException thrown if there is an error processing the specified criteria
50       */
51      ProductType resolveSingle(CriteriaType criteria) throws SecurityException;
52  }