View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.core.persistence.api.dao;
20  
21  import java.util.List;
22  import java.util.Set;
23  import org.apache.syncope.common.lib.types.AnyTypeKind;
24  import org.apache.syncope.core.persistence.api.dao.search.OrderByClause;
25  import org.apache.syncope.core.persistence.api.dao.search.SearchCond;
26  import org.apache.syncope.core.persistence.api.entity.Any;
27  import org.apache.syncope.core.persistence.api.entity.Realm;
28  
29  public interface AnySearchDAO extends DAO<Any<?>> {
30  
31      /**
32       * @param base Realm to start searching from
33       * @param recursive whether search should recursively include results from child Realms
34       * @param adminRealms realms for which the caller owns the proper entitlement(s)
35       * @param searchCondition the search condition
36       * @param kind any object
37       * @return size of search result
38       */
39      int count(
40              Realm base,
41              boolean recursive,
42              Set<String> adminRealms,
43              SearchCond searchCondition,
44              AnyTypeKind kind);
45  
46      /**
47       * @param searchCondition the search condition
48       * @param kind any object
49       * @param <T> any
50       * @return the list of any objects matching the given search condition
51       */
52      <T extends Any<?>> List<T> search(SearchCond searchCondition, AnyTypeKind kind);
53  
54      /**
55       * @param searchCondition the search condition
56       * @param orderBy list of ordering clauses
57       * @param kind any object
58       * @param <T> any
59       * @return the list of any objects matching the given search condition
60       */
61      <T extends Any<?>> List<T> search(SearchCond searchCondition, List<OrderByClause> orderBy, AnyTypeKind kind);
62  
63      /**
64       * @param base Realm to start searching from
65       * @param recursive whether search should recursively include results from child Realms
66       * @param adminRealms realms for which the caller owns the proper entitlement(s)
67       * @param searchCondition the search condition
68       * @param page position of the first result, start from 1
69       * @param itemsPerPage number of results per page
70       * @param orderBy list of ordering clauses
71       * @param kind any object
72       * @param <T> any
73       * @return the list of any objects matching the given search condition (in the given page)
74       */
75      <T extends Any<?>> List<T> search(
76              Realm base,
77              boolean recursive,
78              Set<String> adminRealms,
79              SearchCond searchCondition,
80              int page,
81              int itemsPerPage,
82              List<OrderByClause> orderBy,
83              AnyTypeKind kind);
84  }