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.provisioning.api;
20  
21  import java.util.List;
22  import java.util.Map;
23  import org.apache.syncope.core.persistence.api.entity.Any;
24  import org.apache.syncope.core.persistence.api.entity.Membership;
25  import org.apache.syncope.core.persistence.api.entity.VirSchema;
26  import org.identityconnectors.framework.common.objects.ConnectorObject;
27  
28  public interface VirAttrHandler {
29  
30      /**
31       * Updates cache with values from external resource.
32       *
33       * @param any any object
34       * @param connObj connector object from external resource
35       */
36      void setValues(Any<?> any, ConnectorObject connObj);
37  
38      /**
39       * Query external resource (or cache, if configured) associated to the given any for values associated to the given
40       * virtual schema, not related to any membership.
41       *
42       * @param any any object
43       * @param schema virtual schema
44       * @return virtual attribute values, either for local cache or external resource, if resource is owned by the given
45       * any and associated to the given virtual schema; empty list otherwise.
46       */
47      List<String> getValues(Any<?> any, VirSchema schema);
48  
49      /**
50       * Query external resource (or cache, if configured) associated to the given any for values associated to the given
51       * virtual schema, for the given membership.
52       *
53       * @param any any object
54       * @param membership membership
55       * @param schema virtual schema
56       * @return virtual attribute values, either for local cache or external resource, if resource is owned by the given
57       * any and associated to the given virtual schema; empty list otherwise.
58       */
59      List<String> getValues(Any<?> any, Membership<?> membership, VirSchema schema);
60  
61      /**
62       * Query external resources (or cache, if configured) associated to the given any for values associated to all
63       * {@link VirSchema} instances in the {@link org.apache.syncope.core.persistence.api.entity.AnyTypeClass}
64       * associated to the given any, with no membership.
65       *
66       * @param any any object
67       * @return virtual attribute values, either for local cache or external resources
68       */
69      Map<VirSchema, List<String>> getValues(Any<?> any);
70  
71      /**
72       * Query external resources (or cache, if configured) associated to the given any for values associated to all
73       * {@link VirSchema} instances in the {@link org.apache.syncope.core.persistence.api.entity.AnyTypeClass}
74       * associated to the given any, for the given membership.
75       *
76       * @param any any object
77       * @param membership membership
78       * @return virtual attribute values, either for local cache or external resources
79       */
80      Map<VirSchema, List<String>> getValues(Any<?> any, Membership<?> membership);
81  
82  }