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.entity;
20  
21  import java.lang.reflect.Field;
22  import java.util.Set;
23  import org.apache.syncope.common.lib.request.AnyCR;
24  import org.apache.syncope.common.lib.request.AnyUR;
25  import org.apache.syncope.common.lib.to.AnyTO;
26  import org.apache.syncope.common.lib.types.AnyTypeKind;
27  import org.apache.syncope.core.persistence.api.attrvalue.validation.PlainAttrValidationManager;
28  import org.apache.syncope.core.persistence.api.dao.AnyDAO;
29  
30  public interface AnyUtils {
31  
32      AnyTypeKind anyTypeKind();
33  
34      <T extends Any<?>> Class<T> anyClass();
35  
36      Field getField(String name);
37  
38      <T extends PlainAttr<?>> Class<T> plainAttrClass();
39  
40      <T extends PlainAttr<?>> T newPlainAttr();
41  
42      <T extends PlainAttrValue> Class<T> plainAttrValueClass();
43  
44      <T extends PlainAttrValue> T newPlainAttrValue();
45  
46      <T extends PlainAttrValue> Class<T> plainAttrUniqueValueClass();
47  
48      <T extends PlainAttrValue> T newPlainAttrUniqueValue();
49  
50      <T extends PlainAttrValue> T clonePlainAttrValue(T src);
51  
52      <T extends AnyTO> T newAnyTO();
53  
54      <C extends AnyCR> C newAnyCR();
55  
56      <U extends AnyUR> U newAnyUR(String key);
57  
58      <A extends Any<?>> AnyDAO<A> dao();
59  
60      Set<ExternalResource> getAllResources(Any<?> any);
61  
62      void addAttr(PlainAttrValidationManager validator, String key, PlainSchema schema, String value);
63  
64      void removeAttr(String key, PlainSchema schema);
65  }