You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2015/06/11 16:16:59 UTC
[09/70] syncope git commit: [SYNCOPE-666] Initial commit,
Travis CI builds disabled
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/AnyTransformer.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/AnyTransformer.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/AnyTransformer.java
new file mode 100644
index 0000000..d6ff876
--- /dev/null
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/AnyTransformer.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.provisioning.api;
+
+import org.apache.syncope.common.lib.mod.AnyMod;
+import org.apache.syncope.common.lib.to.AnyTO;
+
+/**
+ * Provides logic for transforming any object, received as input by RESTful methods, before any internal
+ * processing logic takes place.
+ */
+public interface AnyTransformer {
+
+ <T extends AnyTO> T transform(T input);
+
+ <T extends AnyMod> T transform(T input);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/AttributableTransformer.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/AttributableTransformer.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/AttributableTransformer.java
deleted file mode 100644
index 5e8b9e7..0000000
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/AttributableTransformer.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.provisioning.api;
-
-import org.apache.syncope.common.lib.mod.AbstractAttributableMod;
-import org.apache.syncope.common.lib.to.AbstractAttributableTO;
-
-/**
- * Provides logic for transforming user or group, received as input by RESTful methods, before any internal
- * processing logic takes place.
- */
-public interface AttributableTransformer {
-
- <T extends AbstractAttributableTO> T transform(T input);
-
- <T extends AbstractAttributableMod> T transform(T input);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/Connector.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/Connector.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/Connector.java
index 61ff143..53cae3e 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/Connector.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/Connector.java
@@ -24,7 +24,7 @@ import java.util.Set;
import org.apache.syncope.common.lib.types.PropagationMode;
import org.apache.syncope.common.lib.types.ResourceOperation;
import org.apache.syncope.core.persistence.api.entity.ConnInstance;
-import org.apache.syncope.core.persistence.api.entity.MappingItem;
+import org.apache.syncope.core.persistence.api.entity.resource.MappingItem;
import org.identityconnectors.framework.common.objects.Attribute;
import org.identityconnectors.framework.common.objects.ConnectorObject;
import org.identityconnectors.framework.common.objects.ObjectClass;
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnectorFactory.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnectorFactory.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnectorFactory.java
index e4c6392..6d2d0c8 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnectorFactory.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnectorFactory.java
@@ -22,7 +22,7 @@ import java.util.Set;
import org.apache.syncope.common.lib.types.ConnConfProperty;
import org.apache.syncope.core.persistence.api.SyncopeLoader;
import org.apache.syncope.core.persistence.api.entity.ConnInstance;
-import org.apache.syncope.core.persistence.api.entity.ExternalResource;
+import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
/**
* Entry point for creating and destroying connectors for external resources.
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnectorRegistry.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnectorRegistry.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnectorRegistry.java
index ce5f837..1bcbcbc 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnectorRegistry.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ConnectorRegistry.java
@@ -21,7 +21,7 @@ package org.apache.syncope.core.provisioning.api;
import java.util.Set;
import org.apache.syncope.common.lib.types.ConnConfProperty;
import org.apache.syncope.core.persistence.api.entity.ConnInstance;
-import org.apache.syncope.core.persistence.api.entity.ExternalResource;
+import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
/**
* Manage Spring beans lifecycle for connectors.
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/GroupProvisioningManager.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/GroupProvisioningManager.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/GroupProvisioningManager.java
index 6989f8c..0913405 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/GroupProvisioningManager.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/GroupProvisioningManager.java
@@ -33,6 +33,6 @@ public interface GroupProvisioningManager extends ProvisioningManager<GroupTO, G
Pair<Long, List<PropagationStatus>> create(
GroupTO groupTO, Map<Long, String> groupOwnerMap, Set<String> excludedResources);
- Pair<Long, List<PropagationStatus>> update(GroupMod subjectMod, Set<String> excludedResources);
+ Pair<Long, List<PropagationStatus>> update(GroupMod groupMod, Set<String> excludedResources);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ProvisioningManager.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ProvisioningManager.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ProvisioningManager.java
index 95450e2..28b2663 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ProvisioningManager.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ProvisioningManager.java
@@ -21,22 +21,22 @@ package org.apache.syncope.core.provisioning.api;
import java.util.Collection;
import java.util.List;
import org.apache.commons.lang3.tuple.Pair;
-import org.apache.syncope.common.lib.mod.AbstractAttributableMod;
-import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.mod.AnyMod;
+import org.apache.syncope.common.lib.to.AnyTO;
import org.apache.syncope.common.lib.to.PropagationStatus;
-public interface ProvisioningManager<T extends AbstractAttributableTO, M extends AbstractAttributableMod> {
+public interface ProvisioningManager<T extends AnyTO, M extends AnyMod> {
- Pair<Long, List<PropagationStatus>> create(T subject);
+ Pair<Long, List<PropagationStatus>> create(T anyTO);
- Pair<Long, List<PropagationStatus>> update(M subjectMod);
+ Pair<Long, List<PropagationStatus>> update(M anyMod);
- List<PropagationStatus> delete(Long subjectId);
+ List<PropagationStatus> delete(Long anyKey);
- Long unlink(M subjectMod);
+ Long unlink(M anyMod);
- Long link(M subjectMod);
+ Long link(M anyMod);
- List<PropagationStatus> deprovision(Long user, Collection<String> resources);
+ List<PropagationStatus> deprovision(Long anyKey, Collection<String> resources);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/UserProvisioningManager.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/UserProvisioningManager.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/UserProvisioningManager.java
index 19a1aed..ad7a01e 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/UserProvisioningManager.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/UserProvisioningManager.java
@@ -43,12 +43,10 @@ public interface UserProvisioningManager extends ProvisioningManager<UserTO, Use
Pair<Long, List<PropagationStatus>> create(UserTO userTO, boolean storePassword,
boolean disablePwdPolicyCheck, Boolean enabled, Set<String> excludedResources);
- Pair<Long, List<PropagationStatus>> update(UserMod userMod, boolean removeMemberships);
-
Pair<Long, List<PropagationStatus>> update(UserMod userMod, Long key,
ProvisioningResult result, Boolean enabled, Set<String> excludedResources);
- List<PropagationStatus> delete(Long subjectKey, Set<String> excludedResources);
+ List<PropagationStatus> delete(Long key, Set<String> excludedResources);
void requestPasswordReset(Long key);
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCache.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCache.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCache.java
index 45256e5..7ab5d9b 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCache.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCache.java
@@ -18,8 +18,6 @@
*/
package org.apache.syncope.core.provisioning.api.cache;
-import org.apache.syncope.common.lib.types.AttributableType;
-
/**
* Virtual Attribute Value cache.
*/
@@ -28,21 +26,21 @@ public interface VirAttrCache {
/**
* Force entry expiring.
*
- * @param type user or group
- * @param id user or group id
+ * @param type any object
+ * @param key any object key
* @param schemaName virtual attribute schema name
*/
- void expire(AttributableType type, Long id, String schemaName);
+ void expire(String type, Long key, String schemaName);
/**
* Retrieve cached value. Return null in case of virtual attribute not cached.
*
- * @param type user or group
- * @param id user or group id
+ * @param type any object
+ * @param key any object key
* @param schemaName virtual attribute schema name.
* @return cached values or null if virtual attribute is not cached.
*/
- VirAttrCacheValue get(AttributableType type, Long id, String schemaName);
+ VirAttrCacheValue get(String type, Long key, String schemaName);
/**
* Cache entry is valid if and only if value exist and it is not expired.
@@ -55,11 +53,11 @@ public interface VirAttrCache {
/**
* Cache virtual attribute values.
*
- * @param type user or group
- * @param id user or group id
+ * @param type any object
+ * @param key any object key
* @param schemaName virtual attribute name
* @param value virtual attribute values
*/
- void put(AttributableType type, Long id, String schemaName, VirAttrCacheValue value);
+ void put(String type, Long key, String schemaName, VirAttrCacheValue value);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCacheKey.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCacheKey.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCacheKey.java
index a33a740..da74000 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCacheKey.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/cache/VirAttrCacheKey.java
@@ -22,7 +22,6 @@ import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
-import org.apache.syncope.common.lib.types.AttributableType;
/**
* Cache entry key.
@@ -30,12 +29,12 @@ import org.apache.syncope.common.lib.types.AttributableType;
public class VirAttrCacheKey {
/**
- * Subject type.
+ * Any type name.
*/
- private final AttributableType type;
+ private final String type;
/**
- * Subject key.
+ * Any object key.
*/
private final transient Long key;
@@ -44,13 +43,13 @@ public class VirAttrCacheKey {
*/
private final transient String virSchema;
- public VirAttrCacheKey(final AttributableType type, final Long key, final String virSchema) {
+ public VirAttrCacheKey(final String type, final Long key, final String virSchema) {
this.type = type;
this.key = key;
this.virSchema = virSchema;
}
- public AttributableType getType() {
+ public String getKind() {
return type;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/AnyObjectDataBinder.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/AnyObjectDataBinder.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/AnyObjectDataBinder.java
new file mode 100644
index 0000000..b503365
--- /dev/null
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/AnyObjectDataBinder.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.provisioning.api.data;
+
+import org.apache.syncope.common.lib.mod.AnyObjectMod;
+import org.apache.syncope.common.lib.to.AnyObjectTO;
+import org.apache.syncope.common.lib.types.PropagationByResource;
+import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
+
+public interface AnyObjectDataBinder {
+
+ AnyObjectTO getAnyObjectTO(Long key);
+
+ AnyObjectTO getAnyObjectTO(AnyObject anyObject);
+
+ void create(AnyObject anyObject, AnyObjectTO anyObjectTO);
+
+ PropagationByResource update(AnyObject toBeUpdated, AnyObjectMod anyObjectMod);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ResourceDataBinder.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ResourceDataBinder.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ResourceDataBinder.java
index babfb5e..2d96d71 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ResourceDataBinder.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ResourceDataBinder.java
@@ -20,7 +20,7 @@ package org.apache.syncope.core.provisioning.api.data;
import org.apache.syncope.common.lib.to.ResourceTO;
import org.apache.syncope.core.persistence.api.entity.ConnInstance;
-import org.apache.syncope.core.persistence.api.entity.ExternalResource;
+import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
public interface ResourceDataBinder {
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/SchemaDataBinder.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/SchemaDataBinder.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/SchemaDataBinder.java
index cb1525e..dcb8f9f 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/SchemaDataBinder.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/SchemaDataBinder.java
@@ -21,7 +21,6 @@ package org.apache.syncope.core.provisioning.api.data;
import org.apache.syncope.common.lib.to.DerSchemaTO;
import org.apache.syncope.common.lib.to.PlainSchemaTO;
import org.apache.syncope.common.lib.to.VirSchemaTO;
-import org.apache.syncope.core.persistence.api.entity.AttributableUtils;
import org.apache.syncope.core.persistence.api.entity.DerSchema;
import org.apache.syncope.core.persistence.api.entity.PlainSchema;
import org.apache.syncope.core.persistence.api.entity.VirSchema;
@@ -36,11 +35,11 @@ public interface SchemaDataBinder {
<T extends DerSchema> DerSchemaTO getDerSchemaTO(T derSchema);
- <T extends PlainSchema> PlainSchemaTO getPlainSchemaTO(T schema, AttributableUtils attributableUtil);
+ <T extends PlainSchema> PlainSchemaTO getPlainSchemaTO(T schema);
<T extends VirSchema> VirSchemaTO getVirSchemaTO(T virSchema);
- <T extends PlainSchema> void update(PlainSchemaTO schemaTO, T schema, AttributableUtils attributableUtil);
+ <T extends PlainSchema> void update(PlainSchemaTO schemaTO, T schema);
<T extends DerSchema> T update(DerSchemaTO derSchemaTO, T derSchema);
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/propagation/PropagationManager.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/propagation/PropagationManager.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/propagation/PropagationManager.java
index db76ca1..36821c3 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/propagation/PropagationManager.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/propagation/PropagationManager.java
@@ -23,14 +23,12 @@ import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.syncope.common.lib.mod.AttrMod;
-import org.apache.syncope.common.lib.mod.MembershipMod;
import org.apache.syncope.common.lib.mod.UserMod;
import org.apache.syncope.common.lib.to.AttrTO;
-import org.apache.syncope.common.lib.to.MembershipTO;
import org.apache.syncope.common.lib.types.PropagationByResource;
-import org.apache.syncope.core.persistence.api.entity.Subject;
-import org.apache.syncope.core.persistence.api.entity.task.PropagationTask;
+import org.apache.syncope.core.persistence.api.entity.Any;
import org.apache.syncope.core.persistence.api.entity.user.User;
+import org.apache.syncope.core.persistence.api.entity.task.PropagationTask;
import org.apache.syncope.core.provisioning.api.WorkflowResult;
public interface PropagationManager {
@@ -92,7 +90,7 @@ public interface PropagationManager {
List<PropagationTask> getGroupDeleteTasks(Long groupKey, String noPropResourceName);
/**
- * Perform delete on each resource associated to the user. It is possible to ask for a mandatory provisioning for
+ * Perform delete on each resource associated to the group. It is possible to ask for a mandatory provisioning for
* some resources specifying a set of resource names. Exceptions won't be ignored and the process will be stopped if
* the creation fails onto a mandatory resource.
*
@@ -103,7 +101,7 @@ public interface PropagationManager {
List<PropagationTask> getGroupDeleteTasks(Long groupKey, Collection<String> noPropResourceNames);
/**
- * Perform delete on each resource associated to the user. It is possible to ask for a mandatory provisioning for
+ * Perform delete on each resource associated to the group. It is possible to ask for a mandatory provisioning for
* some resources specifying a set of resource names. Exceptions won't be ignored and the process will be stopped if
* the creation fails onto a mandatory resource.
*
@@ -115,6 +113,13 @@ public interface PropagationManager {
List<PropagationTask> getGroupDeleteTasks(
Long groupKey, Set<String> resourceNames, Collection<String> noPropResourceNames);
+ List<PropagationTask> getAnyObjectCreateTasks(Long anyObjectKey, Collection<AttrTO> vAttrs,
+ PropagationByResource propByRes, List<String> noPropResourceNames);
+
+ List<PropagationTask> getAnyObjectDeleteTasks(Long anyObjectKey, String noPropResourceName);
+
+ List<PropagationTask> getAnyObjectDeleteTasks(Long anyObjectKey, Collection<String> noPropResourceNames);
+
/**
* Create the user on every associated resource.
*
@@ -124,12 +129,11 @@ public interface PropagationManager {
* @param password to be set
* @param vAttrs virtual attributes to be set
* @param noPropResourceNames external resources not to be considered for propagation
- * @param membershipTOs user memberships
* @return list of propagation tasks
*/
List<PropagationTask> getUserCreateTasks(Long key, Boolean enable,
PropagationByResource propByRes, String password, Collection<AttrTO> vAttrs,
- Collection<MembershipTO> membershipTOs, Collection<String> noPropResourceNames);
+ Collection<String> noPropResourceNames);
/**
* Performs update on each resource associated to the user excluding the specified into 'resourceNames' parameter.
@@ -154,10 +158,9 @@ public interface PropagationManager {
List<PropagationTask> getUserUpdateTasks(WorkflowResult<Pair<UserMod, Boolean>> wfResult);
- List<PropagationTask> getUpdateTasks(Subject<?, ?, ?> subject, String password, boolean changePwd,
+ List<PropagationTask> getUpdateTasks(Any<?, ?, ?> any, String password, boolean changePwd,
Boolean enable, Set<String> vAttrsToBeRemoved, Set<AttrMod> vAttrsToBeUpdated,
- PropagationByResource propByRes, Collection<String> noPropResourceNames,
- Set<MembershipMod> membershipsToAdd);
+ PropagationByResource propByRes, Collection<String> noPropResourceNames);
/**
* Perform delete on each resource associated to the user. It is possible to ask for a mandatory provisioning for
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/AnyObjectPushResultHandler.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/AnyObjectPushResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/AnyObjectPushResultHandler.java
new file mode 100644
index 0000000..6691db3
--- /dev/null
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/AnyObjectPushResultHandler.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.provisioning.api.sync;
+
+public interface AnyObjectPushResultHandler extends SyncopePushResultHandler {
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/AnyObjectSyncResultHandler.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/AnyObjectSyncResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/AnyObjectSyncResultHandler.java
new file mode 100644
index 0000000..e0ad1d8
--- /dev/null
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/AnyObjectSyncResultHandler.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.provisioning.api.sync;
+
+public interface AnyObjectSyncResultHandler extends SyncopeSyncResultHandler {
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/IgnoreProvisionException.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/IgnoreProvisionException.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/IgnoreProvisionException.java
index 5bebeb9..8bc9da5 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/IgnoreProvisionException.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/IgnoreProvisionException.java
@@ -19,7 +19,7 @@
package org.apache.syncope.core.provisioning.api.sync;
/**
- * Raised by {@link SyncActions} or {@link PushActions} methods when the given subject is to be ignored for
+ * Raised by {@link SyncActions} or {@link PushActions} methods when the given any object is to be ignored for
* synchronization / push.
*/
public class IgnoreProvisionException extends RuntimeException {
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/ProvisioningResult.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/ProvisioningResult.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/ProvisioningResult.java
index 3253bc3..23af92d 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/ProvisioningResult.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/ProvisioningResult.java
@@ -23,7 +23,6 @@ import java.util.Collection;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
-import org.apache.syncope.common.lib.types.AttributableType;
import org.apache.syncope.common.lib.types.ResourceOperation;
import org.apache.syncope.common.lib.types.TraceLevel;
@@ -41,7 +40,7 @@ public class ProvisioningResult {
private Status status;
- private AttributableType subjectType;
+ private String anyType;
private ResourceOperation operation;
@@ -81,12 +80,12 @@ public class ProvisioningResult {
this.status = status;
}
- public AttributableType getSubjectType() {
- return subjectType;
+ public String getAnyType() {
+ return anyType;
}
- public void setSubjectType(final AttributableType subjectType) {
- this.subjectType = subjectType;
+ public void setAnyType(final String anyType) {
+ this.anyType = anyType;
}
public ResourceOperation getOperation() {
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/PushActions.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/PushActions.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/PushActions.java
index f66acde..e5ce13b 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/PushActions.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/PushActions.java
@@ -18,137 +18,137 @@
*/
package org.apache.syncope.core.provisioning.api.sync;
-import org.apache.syncope.core.persistence.api.entity.Subject;
+import org.apache.syncope.core.persistence.api.entity.Any;
import org.quartz.JobExecutionException;
/**
* Interface for actions to be performed during PushJob execution.
* <br/>
- * All methods can throw {@link IgnoreProvisionException} to make the current subject ignored by the push process.
+ * All methods can throw {@link IgnoreProvisionException} to make the current any ignored by the push process.
*/
public interface PushActions extends ProvisioningActions {
/**
- * Action to be executed before to assign (link & provision) a synchronized user / group to the resource.
+ * Action to be executed before to assign (link & provision) a synchronized any object to the resource.
*
* @param profile profile of the push being executed.
- * @param subject user / group to be created.
- * @return subject.
+ * @param any any object to be created.
+ * @return any.
* @throws JobExecutionException in case of generic failure
*/
- <T extends Subject<?, ?, ?>> T beforeAssign(
+ <T extends Any<?, ?, ?>> T beforeAssign(
ProvisioningProfile<?, ?> profile,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
- * Action to be executed before to provision a synchronized user / group to the resource.
+ * Action to be executed before to provision a synchronized any object to the resource.
*
* @param profile profile of the push being executed.
- * @param subject user / group to be created.
- * @return subject.
+ * @param any any object to be created.
+ * @return any.
* @throws JobExecutionException in case of generic failure
*/
- <T extends Subject<?, ?, ?>> T beforeProvision(
+ <T extends Any<?, ?, ?>> T beforeProvision(
ProvisioningProfile<?, ?> profile,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
- * Action to be executed before to update a synchronized user / group on the resource.
+ * Action to be executed before to update a synchronized any object on the resource.
*
* @param profile profile of the push being executed.
- * @param subject user / group to be updated.
- * @return subject.
+ * @param any any object to be updated.
+ * @return any.
* @throws JobExecutionException in case of generic failure
*/
- <T extends Subject<?, ?, ?>> T beforeUpdate(
+ <T extends Any<?, ?, ?>> T beforeUpdate(
ProvisioningProfile<?, ?> profile,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
- * Action to be executed before to link a synchronized user / group to the resource.
+ * Action to be executed before to link a synchronized any object to the resource.
*
* @param profile profile of the push being executed.
- * @param subject user / group to be created.
- * @return subject.
+ * @param any any object to be created.
+ * @return any.
* @throws JobExecutionException in case of generic failure
*/
- <T extends Subject<?, ?, ?>> T beforeLink(
+ <T extends Any<?, ?, ?>> T beforeLink(
ProvisioningProfile<?, ?> profile,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
- * Action to be executed before to unlink a synchronized user / group from the resource.
+ * Action to be executed before to unlink a synchronized any object from the resource.
*
* @param profile profile of the push being executed.
- * @param subject user / group to be created.
- * @return subject.
+ * @param any any object to be created.
+ * @return any.
* @throws JobExecutionException in case of generic failure
*/
- <T extends Subject<?, ?, ?>> T beforeUnlink(
+ <T extends Any<?, ?, ?>> T beforeUnlink(
ProvisioningProfile<?, ?> profile,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
- * Action to be executed before to unassign a synchronized user / group from the resource.
+ * Action to be executed before to unassign a synchronized any object from the resource.
*
* @param profile profile of the push being executed.
- * @param subject user / group to be created.
- * @return subject.
+ * @param any any object to be created.
+ * @return any.
* @throws JobExecutionException in case of generic failure
*/
- <T extends Subject<?, ?, ?>> T beforeUnassign(
+ <T extends Any<?, ?, ?>> T beforeUnassign(
ProvisioningProfile<?, ?> profile,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
- * Action to be executed before to unassign a synchronized user / group from the resource.
+ * Action to be executed before to unassign a synchronized any object from the resource.
*
* @param profile profile of the push being executed.
- * @param subject user / group to be created.
- * @return subject.
+ * @param any any object to be created.
+ * @return any.
* @throws JobExecutionException in case of generic failure
*/
- <T extends Subject<?, ?, ?>> T beforeDeprovision(
+ <T extends Any<?, ?, ?>> T beforeDeprovision(
ProvisioningProfile<?, ?> profile,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
- * Action to be executed before delete a synchronized user / group locally and from the resource.
+ * Action to be executed before delete a synchronized any object locally and from the resource.
*
* @param profile profile of the push being executed.
- * @param subject user / group to be created.
- * @return subject.
+ * @param any any object to be created.
+ * @return any.
* @throws JobExecutionException in case of generic failure
*/
- <T extends Subject<?, ?, ?>> T beforeDelete(
+ <T extends Any<?, ?, ?>> T beforeDelete(
ProvisioningProfile<?, ?> profile,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
- * Action to be executed after user / group push goes on error.
+ * Action to be executed after any object push goes on error.
*
* @param profile profile of the push being executed.
- * @param subject synchronized user / group.
+ * @param any synchronized any object.
* @param result operation result.
* @param error error being reported
* @throws JobExecutionException in case of generic failure
*/
- <T extends Subject<?, ?, ?>> void onError(
+ <T extends Any<?, ?, ?>> void onError(
ProvisioningProfile<?, ?> profile,
- T subject,
+ T any,
ProvisioningResult result,
Exception error) throws JobExecutionException;
/**
- * Action to be executed after each local user / group push.
+ * Action to be executed after each local any object push.
*
* @param profile profile of the push being executed.
- * @param subject synchronized user / group.
+ * @param any synchronized any object.
* @param result operation result.
* @throws JobExecutionException in case of generic failure
*/
- <T extends Subject<?, ?, ?>> void after(
+ <T extends Any<?, ?, ?>> void after(
ProvisioningProfile<?, ?> profile,
- T subject,
+ T any,
ProvisioningResult result) throws JobExecutionException;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/SyncActions.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/SyncActions.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/SyncActions.java
index ba577de..82dd9d4 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/SyncActions.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/SyncActions.java
@@ -18,15 +18,15 @@
*/
package org.apache.syncope.core.provisioning.api.sync;
-import org.apache.syncope.common.lib.mod.AbstractSubjectMod;
-import org.apache.syncope.common.lib.to.AbstractSubjectTO;
+import org.apache.syncope.common.lib.mod.AnyMod;
+import org.apache.syncope.common.lib.to.AnyTO;
import org.identityconnectors.framework.common.objects.SyncDelta;
import org.quartz.JobExecutionException;
/**
* Interface for actions to be performed during SyncJob execution.
* <br/>
- * All methods can throw {@link IgnoreProvisionException} to make the current subject ignored by the synchronization
+ * All methods can throw {@link IgnoreProvisionException} to make the current any object ignored by the synchronization
* process.
*/
public interface SyncActions extends ProvisioningActions {
@@ -38,14 +38,14 @@ public interface SyncActions extends ProvisioningActions {
*
* @param profile profile of the synchronization being executed.
* @param delta retrieved synchronization information
- * @param subject user / group to be created
+ * @param any any object
* @return synchronization information used for user status evaluation and to be passed to the 'after' method.
* @throws JobExecutionException in case of generic failure
*/
- <T extends AbstractSubjectTO> SyncDelta beforeProvision(
+ <T extends AnyTO> SyncDelta beforeProvision(
ProvisioningProfile<?, ?> profile,
SyncDelta delta,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
* Action to be executed before creating (and linking to the resource) a synchronized user / group locally.
@@ -54,14 +54,14 @@ public interface SyncActions extends ProvisioningActions {
*
* @param profile profile of the synchronization being executed.
* @param delta retrieved synchronization information
- * @param subject user / group to be created
+ * @param any any object
* @return synchronization information used for user status evaluation and to be passed to the 'after' method.
* @throws JobExecutionException in case of generic failure
*/
- <T extends AbstractSubjectTO> SyncDelta beforeAssign(
+ <T extends AnyTO> SyncDelta beforeAssign(
ProvisioningProfile<?, ?> profile,
SyncDelta delta,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
* Action to be executed before unlinking resource from the synchronized user / group and de-provisioning.
@@ -70,14 +70,14 @@ public interface SyncActions extends ProvisioningActions {
*
* @param profile profile of the synchronization being executed.
* @param delta retrieved synchronization information
- * @param subject user / group to be created
+ * @param any any object
* @return synchronization information used for user status evaluation and to be passed to the 'after' method.
* @throws JobExecutionException in case of generic failure
*/
- <T extends AbstractSubjectTO> SyncDelta beforeUnassign(
+ <T extends AnyTO> SyncDelta beforeUnassign(
ProvisioningProfile<?, ?> profile,
SyncDelta delta,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
* Action to be executed before de-provisioning action only.
@@ -86,14 +86,14 @@ public interface SyncActions extends ProvisioningActions {
*
* @param profile profile of the synchronization being executed.
* @param delta retrieved synchronization information
- * @param subject user / group to be created
+ * @param any any object
* @return synchronization information used for user status evaluation and to be passed to the 'after' method.
* @throws JobExecutionException in case of generic failure
*/
- <T extends AbstractSubjectTO> SyncDelta beforeDeprovision(
+ <T extends AnyTO> SyncDelta beforeDeprovision(
ProvisioningProfile<?, ?> profile,
SyncDelta delta,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
* Action to be executed before unlinking resource from the synchronized user / group.
@@ -102,14 +102,14 @@ public interface SyncActions extends ProvisioningActions {
*
* @param profile profile of the synchronization being executed.
* @param delta retrieved synchronization information
- * @param subject user / group to be created
+ * @param any any object
* @return synchronization information used for user status evaluation and to be passed to the 'after' method.
* @throws JobExecutionException in case of generic failure
*/
- <T extends AbstractSubjectTO> SyncDelta beforeUnlink(
+ <T extends AnyTO> SyncDelta beforeUnlink(
ProvisioningProfile<?, ?> profile,
SyncDelta delta,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
* Action to be executed before linking resource to the synchronized user / group.
@@ -118,14 +118,14 @@ public interface SyncActions extends ProvisioningActions {
*
* @param profile profile of the synchronization being executed.
* @param delta retrieved synchronization information
- * @param subject user / group to be created
+ * @param any any object
* @return synchronization information used for user status evaluation and to be passed to the 'after' method.
* @throws JobExecutionException in case of generic failure
*/
- <T extends AbstractSubjectTO> SyncDelta beforeLink(
+ <T extends AnyTO> SyncDelta beforeLink(
ProvisioningProfile<?, ?> profile,
SyncDelta delta,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
* Action to be executed before to update a synchronized user / group locally.
@@ -134,16 +134,16 @@ public interface SyncActions extends ProvisioningActions {
*
* @param profile profile of the synchronization being executed.
* @param delta retrieved synchronization information
- * @param subject local user / group information
- * @param subjectMod modification
+ * @param any any object
+ * @param anyMod modification
* @return synchronization information used for logging and to be passed to the 'after' method.
* @throws JobExecutionException in case of generic failure.
*/
- <T extends AbstractSubjectTO, K extends AbstractSubjectMod> SyncDelta beforeUpdate(
+ <T extends AnyTO, K extends AnyMod> SyncDelta beforeUpdate(
ProvisioningProfile<?, ?> profile,
SyncDelta delta,
- T subject,
- K subjectMod)
+ T any,
+ K anyMod)
throws JobExecutionException;
/**
@@ -151,14 +151,14 @@ public interface SyncActions extends ProvisioningActions {
*
* @param profile profile of the synchronization being executed.
* @param delta retrieved synchronization information
- * @param subject local user / group to be deleted
+ * @param any any object to be deleted
* @return synchronization information used for logging and to be passed to the 'after' method.
* @throws JobExecutionException in case of generic failure
*/
- <T extends AbstractSubjectTO> SyncDelta beforeDelete(
+ <T extends AnyTO> SyncDelta beforeDelete(
ProvisioningProfile<?, ?> profile,
SyncDelta delta,
- T subject) throws JobExecutionException;
+ T any) throws JobExecutionException;
/**
* Action to be executed when user / group synchronization goes on error.
@@ -182,13 +182,13 @@ public interface SyncActions extends ProvisioningActions {
* @param profile profile of the synchronization being executed.
* @param delta retrieved synchronization information (may be modified by
* 'beforeProvision/beforeUpdate/beforeDelete')
- * @param subject synchronized local user / group
+ * @param any any object
* @param result global synchronization results at the current synchronization step
* @throws JobExecutionException in case of generic failure
*/
- <T extends AbstractSubjectTO> void after(
+ <T extends AnyTO> void after(
ProvisioningProfile<?, ?> profile,
SyncDelta delta,
- T subject,
+ T any,
ProvisioningResult result) throws JobExecutionException;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/SyncopePushResultHandler.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/SyncopePushResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/SyncopePushResultHandler.java
index 6ac156f..e77af9a 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/SyncopePushResultHandler.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/sync/SyncopePushResultHandler.java
@@ -22,5 +22,5 @@ import org.apache.syncope.core.persistence.api.entity.task.PushTask;
public interface SyncopePushResultHandler extends SyncopeResultHandler<PushTask, PushActions> {
- boolean handle(long subjectId);
+ boolean handle(long anyKey);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorFacadeProxy.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorFacadeProxy.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorFacadeProxy.java
index 3c76b82..cc49d62 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorFacadeProxy.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorFacadeProxy.java
@@ -33,12 +33,12 @@ import org.apache.syncope.common.lib.types.ConnectorCapability;
import org.apache.syncope.common.lib.types.PropagationMode;
import org.apache.syncope.common.lib.types.ResourceOperation;
import org.apache.syncope.core.persistence.api.entity.ConnInstance;
-import org.apache.syncope.core.persistence.api.entity.MappingItem;
import org.apache.syncope.core.provisioning.api.ConnIdBundleManager;
import org.apache.syncope.core.provisioning.api.ConnPoolConfUtils;
import org.apache.syncope.core.provisioning.api.Connector;
import org.apache.syncope.core.provisioning.api.TimeoutException;
import org.apache.syncope.core.misc.spring.ApplicationContextProvider;
+import org.apache.syncope.core.persistence.api.entity.resource.MappingItem;
import org.identityconnectors.common.security.GuardedByteArray;
import org.identityconnectors.common.security.GuardedString;
import org.identityconnectors.framework.api.APIConfiguration;
@@ -536,7 +536,7 @@ public class ConnectorFacadeProxy implements Connector {
// -------------------------------------
final OperationOptionsBuilder oob = new OperationOptionsBuilder();
- final Set<String> attrsToGet = new HashSet<String>();
+ final Set<String> attrsToGet = new HashSet<>();
attrsToGet.add(Name.NAME);
attrsToGet.add(Uid.NAME);
attrsToGet.add(OperationalAttributes.ENABLE_NAME);
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorManager.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorManager.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorManager.java
index e9041fe..7d0cf2f 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorManager.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/ConnectorManager.java
@@ -27,12 +27,12 @@ import org.apache.commons.lang3.SerializationUtils;
import org.apache.syncope.common.lib.types.ConnConfProperty;
import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO;
import org.apache.syncope.core.persistence.api.entity.ConnInstance;
-import org.apache.syncope.core.persistence.api.entity.ExternalResource;
import org.apache.syncope.core.provisioning.api.ConnIdBundleManager;
import org.apache.syncope.core.provisioning.api.Connector;
import org.apache.syncope.core.provisioning.api.ConnectorFactory;
import org.apache.syncope.core.provisioning.api.ConnectorRegistry;
import org.apache.syncope.core.misc.spring.ApplicationContextProvider;
+import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
import org.identityconnectors.common.l10n.CurrentLocale;
import org.identityconnectors.framework.api.ConnectorFacadeFactory;
import org.slf4j.Logger;
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultAnyTransformer.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultAnyTransformer.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultAnyTransformer.java
new file mode 100644
index 0000000..f7f6bfb
--- /dev/null
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultAnyTransformer.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.provisioning.java;
+
+import org.apache.syncope.common.lib.mod.AnyMod;
+import org.apache.syncope.common.lib.to.AnyTO;
+import org.apache.syncope.core.provisioning.api.AnyTransformer;
+
+/**
+ * Default empty implementation returning received input as result.
+ */
+public class DefaultAnyTransformer implements AnyTransformer {
+
+ @Override
+ public <T extends AnyTO> T transform(final T input) {
+ return input;
+ }
+
+ @Override
+ public <T extends AnyMod> T transform(final T input) {
+ return input;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultAttributableTransformer.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultAttributableTransformer.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultAttributableTransformer.java
deleted file mode 100644
index d1a14f0..0000000
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultAttributableTransformer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.provisioning.java;
-
-import org.apache.syncope.common.lib.mod.AbstractAttributableMod;
-import org.apache.syncope.common.lib.to.AbstractAttributableTO;
-import org.apache.syncope.core.provisioning.api.AttributableTransformer;
-
-/**
- * Default empty implementation returning received input as result.
- */
-public class DefaultAttributableTransformer implements AttributableTransformer {
-
- @Override
- public <T extends AbstractAttributableTO> T transform(final T input) {
- return input;
- }
-
- @Override
- public <T extends AbstractAttributableMod> T transform(final T input) {
- return input;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultGroupProvisioningManager.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultGroupProvisioningManager.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultGroupProvisioningManager.java
index bf16b8d..f0344b4 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultGroupProvisioningManager.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultGroupProvisioningManager.java
@@ -137,12 +137,12 @@ public class DefaultGroupProvisioningManager implements GroupProvisioningManager
public List<PropagationStatus> delete(final Long subjectKey) {
final List<PropagationTask> tasks = new ArrayList<>();
- Group group = groupDAO.authFetch(subjectKey);
+ Group group = groupDAO.authFind(subjectKey);
if (group != null) {
// Generate propagation tasks for deleting users from group resources, if they are on those resources only
// because of the reason being deleted (see SYNCOPE-357)
for (Map.Entry<Long, PropagationByResource> entry
- : groupDAO.findUsersWithIndirectResources(group.getKey()).entrySet()) {
+ : groupDAO.findAnyObjectsWithTransitiveResources(group.getKey()).entrySet()) {
WorkflowResult<Long> wfResult =
new WorkflowResult<>(entry.getKey(), entry.getValue(), Collections.<String>emptySet());
@@ -179,7 +179,7 @@ public class DefaultGroupProvisioningManager implements GroupProvisioningManager
@Override
public List<PropagationStatus> deprovision(final Long groupKey, final Collection<String> resources) {
- Group group = groupDAO.authFetch(groupKey);
+ Group group = groupDAO.authFind(groupKey);
Collection<String> noPropResourceName = CollectionUtils.removeAll(group.getResourceNames(), resources);
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultUserProvisioningManager.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultUserProvisioningManager.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultUserProvisioningManager.java
index 2f959b5..5826786 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultUserProvisioningManager.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/DefaultUserProvisioningManager.java
@@ -26,7 +26,6 @@ import java.util.Set;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
-import org.apache.syncope.common.lib.mod.MembershipMod;
import org.apache.syncope.common.lib.mod.StatusMod;
import org.apache.syncope.common.lib.mod.UserMod;
import org.apache.syncope.common.lib.to.PropagationStatus;
@@ -94,7 +93,6 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
created.getPropByRes(),
userTO.getPassword(),
userTO.getVirAttrs(),
- userTO.getMemberships(),
excludedResources);
PropagationReporter propagationReporter =
ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class);
@@ -110,35 +108,16 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
@Override
public Pair<Long, List<PropagationStatus>> update(final UserMod userMod) {
- return update(userMod, false);
- }
-
- @Override
- public Pair<Long, List<PropagationStatus>> update(final UserMod userMod, final boolean removeMemberships) {
WorkflowResult<Pair<UserMod, Boolean>> updated = uwfAdapter.update(userMod);
List<PropagationTask> tasks = propagationManager.getUserUpdateTasks(updated);
if (tasks.isEmpty()) {
// SYNCOPE-459: take care of user virtual attributes ...
- final PropagationByResource propByResVirAttr = virtAttrHandler.fillVirtual(
+ PropagationByResource propByResVirAttr = virtAttrHandler.fillVirtual(
updated.getResult().getKey().getKey(),
userMod.getVirAttrsToRemove(),
userMod.getVirAttrsToUpdate());
- // SYNCOPE-501: update only virtual attributes (if any of them changed), password propagation is
- // not required, take care also of membership virtual attributes
- boolean addOrUpdateMemberships = false;
- for (MembershipMod membershipMod : userMod.getMembershipsToAdd()) {
- if (!virtAttrHandler.fillMembershipVirtual(
- updated.getResult().getKey().getKey(),
- membershipMod.getGroup(),
- null,
- membershipMod.getVirAttrsToRemove(),
- membershipMod.getVirAttrsToUpdate(),
- false).isEmpty()) {
- addOrUpdateMemberships = true;
- }
- }
- tasks.addAll(!propByResVirAttr.isEmpty() || addOrUpdateMemberships || removeMemberships
+ tasks.addAll(!propByResVirAttr.isEmpty()
? propagationManager.getUserUpdateTasks(updated, false, null)
: Collections.<PropagationTask>emptyList());
}
@@ -267,7 +246,7 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager {
@Override
public List<PropagationStatus> deprovision(final Long userKey, final Collection<String> resources) {
- final User user = userDAO.authFetch(userKey);
+ final User user = userDAO.authFind(userKey);
List<PropagationTask> tasks = propagationManager.getUserDeleteTasks(
userKey,
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/VirAttrHandler.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/VirAttrHandler.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/VirAttrHandler.java
index 58202b7..3ffc1c3 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/VirAttrHandler.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/VirAttrHandler.java
@@ -26,31 +26,24 @@ import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.common.lib.mod.AttrMod;
import org.apache.syncope.common.lib.to.AttrTO;
-import org.apache.syncope.common.lib.types.AttributableType;
+import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.IntMappingType;
import org.apache.syncope.common.lib.types.MappingPurpose;
import org.apache.syncope.common.lib.types.PropagationByResource;
import org.apache.syncope.common.lib.types.ResourceOperation;
-import org.apache.syncope.core.persistence.api.dao.MembershipDAO;
+import org.apache.syncope.core.persistence.api.dao.AnyObjectDAO;
import org.apache.syncope.core.persistence.api.dao.UserDAO;
import org.apache.syncope.core.persistence.api.dao.VirAttrDAO;
import org.apache.syncope.core.persistence.api.dao.VirSchemaDAO;
-import org.apache.syncope.core.persistence.api.entity.Attributable;
-import org.apache.syncope.core.persistence.api.entity.AttributableUtils;
-import org.apache.syncope.core.persistence.api.entity.AttributableUtilsFactory;
-import org.apache.syncope.core.persistence.api.entity.ExternalResource;
-import org.apache.syncope.core.persistence.api.entity.MappingItem;
-import org.apache.syncope.core.persistence.api.entity.Subject;
+import org.apache.syncope.core.persistence.api.entity.Any;
+import org.apache.syncope.core.persistence.api.entity.AnyUtils;
+import org.apache.syncope.core.persistence.api.entity.AnyUtilsFactory;
import org.apache.syncope.core.persistence.api.entity.VirAttr;
import org.apache.syncope.core.persistence.api.entity.VirSchema;
-import org.apache.syncope.core.persistence.api.entity.membership.MVirAttr;
-import org.apache.syncope.core.persistence.api.entity.membership.MVirAttrTemplate;
-import org.apache.syncope.core.persistence.api.entity.membership.Membership;
-import org.apache.syncope.core.persistence.api.entity.group.GVirAttr;
-import org.apache.syncope.core.persistence.api.entity.group.GVirAttrTemplate;
+import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
import org.apache.syncope.core.persistence.api.entity.group.Group;
-import org.apache.syncope.core.persistence.api.entity.user.UVirAttr;
-import org.apache.syncope.core.persistence.api.entity.user.UVirSchema;
+import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
+import org.apache.syncope.core.persistence.api.entity.resource.MappingItem;
import org.apache.syncope.core.persistence.api.entity.user.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -71,18 +64,18 @@ public class VirAttrHandler {
private VirAttrDAO virAttrDAO;
@Autowired
- private UserDAO userDAO;
+ private AnyObjectDAO anyObjectDAO;
@Autowired
- private MembershipDAO membershipDAO;
+ private UserDAO userDAO;
@Autowired
- private AttributableUtilsFactory attrUtilsFactory;
+ private AnyUtilsFactory anyUtilsFactory;
- public <T extends VirSchema> T getVirSchema(final String virSchemaName, final Class<T> reference) {
- T virtualSchema = null;
+ public VirSchema getVirSchema(final String virSchemaName) {
+ VirSchema virtualSchema = null;
if (StringUtils.isNotBlank(virSchemaName)) {
- virtualSchema = virSchemaDAO.find(virSchemaName, reference);
+ virtualSchema = virSchemaDAO.find(virSchemaName);
if (virtualSchema == null) {
LOG.debug("Ignoring invalid virtual schema {}", virSchemaName);
@@ -92,33 +85,14 @@ public class VirAttrHandler {
return virtualSchema;
}
- public void setVirAttrSchema(final Attributable<?, ?, ?> attributable,
- final VirAttr virAttr, final VirSchema virSchema) {
-
- if (virAttr instanceof UVirAttr) {
- ((UVirAttr) virAttr).setSchema((UVirSchema) virSchema);
- } else if (virAttr instanceof GVirAttr) {
- GVirAttrTemplate template = ((Group) attributable).
- getAttrTemplate(GVirAttrTemplate.class, virSchema.getKey());
- if (template != null) {
- ((GVirAttr) virAttr).setTemplate(template);
- }
- } else if (virAttr instanceof MVirAttr) {
- MVirAttrTemplate template =
- ((Membership) attributable).getGroup().
- getAttrTemplate(MVirAttrTemplate.class, virSchema.getKey());
- if (template != null) {
- ((MVirAttr) virAttr).setTemplate(template);
- }
- }
- }
-
- public void updateOnResourcesIfMappingMatches(final AttributableUtils attrUtils, final String schemaKey,
- final Set<ExternalResource> resources, final IntMappingType mappingType,
+ public void updateOnResourcesIfMappingMatches(final Any<?, ?, ?> any, final AnyUtils anyUtils,
+ final String schemaKey, final Set<ExternalResource> resources, final IntMappingType mappingType,
final PropagationByResource propByRes) {
for (ExternalResource resource : resources) {
- for (MappingItem mapItem : attrUtils.getMappingItems(resource, MappingPurpose.PROPAGATION)) {
+ for (MappingItem mapItem : anyUtils.getMappingItems(
+ resource.getProvision(any.getType()), MappingPurpose.PROPAGATION)) {
+
if (schemaKey.equals(mapItem.getIntAttrName()) && mapItem.getIntMappingType() == mappingType) {
propByRes.add(ResourceOperation.UPDATE, resource.getKey());
}
@@ -127,44 +101,44 @@ public class VirAttrHandler {
}
@SuppressWarnings({ "unchecked", "rawtypes" })
- public PropagationByResource fillVirtual(final Attributable attributable,
- final Set<String> vAttrsToBeRemoved, final Set<AttrMod> vAttrsToBeUpdated,
- final AttributableUtils attrUtils) {
+ public PropagationByResource fillVirtual(final Any any,
+ final Set<String> vAttrsToBeRemoved, final Set<AttrMod> vAttrsToBeUpdated, final AnyUtils anyUtils) {
PropagationByResource propByRes = new PropagationByResource();
Set<ExternalResource> externalResources = new HashSet<>();
- if (attributable instanceof User) {
- externalResources.addAll(userDAO.findAllResources((User) attributable));
- } else if (attributable instanceof Group) {
- externalResources.addAll(((Group) attributable).getResources());
- } else if (attributable instanceof Membership) {
- externalResources.addAll(userDAO.findAllResources(((Membership) attributable).getUser()));
- externalResources.addAll(((Membership) attributable).getGroup().getResources());
+ if (any instanceof User) {
+ externalResources.addAll(userDAO.findAllResources((User) any));
+ } else if (any instanceof Group) {
+ externalResources.addAll(((Group) any).getResources());
+ } else if (any instanceof AnyObject) {
+ externalResources.addAll(anyObjectDAO.findAllResources((AnyObject) any));
}
// 1. virtual attributes to be removed
for (String vAttrToBeRemoved : vAttrsToBeRemoved) {
- VirSchema virSchema = getVirSchema(vAttrToBeRemoved, attrUtils.virSchemaClass());
+ VirSchema virSchema = getVirSchema(vAttrToBeRemoved);
if (virSchema != null) {
- VirAttr virAttr = attributable.getVirAttr(virSchema.getKey());
+ VirAttr virAttr = any.getVirAttr(virSchema.getKey());
if (virAttr == null) {
LOG.debug("No virtual attribute found for schema {}", virSchema.getKey());
} else {
- attributable.removeVirAttr(virAttr);
+ any.remove(virAttr);
virAttrDAO.delete(virAttr);
}
for (ExternalResource resource : externalResources) {
- for (MappingItem mapItem : attrUtils.getMappingItems(resource, MappingPurpose.PROPAGATION)) {
+ for (MappingItem mapItem : anyUtils.getMappingItems(
+ resource.getProvision(any.getType()), MappingPurpose.PROPAGATION)) {
+
if (virSchema.getKey().equals(mapItem.getIntAttrName())
- && mapItem.getIntMappingType() == attrUtils.virIntMappingType()) {
+ && mapItem.getIntMappingType() == anyUtils.virIntMappingType()) {
propByRes.add(ResourceOperation.UPDATE, resource.getKey());
- // Using virtual attribute as AccountId must be avoided
- if (mapItem.isAccountid() && virAttr != null && !virAttr.getValues().isEmpty()) {
- propByRes.addOldAccountId(resource.getKey(), virAttr.getValues().get(0));
+ // Using virtual attribute as ConnObjectKey must be avoided
+ if (mapItem.isConnObjectKey() && virAttr != null && !virAttr.getValues().isEmpty()) {
+ propByRes.addOldAccountId(resource.getKey(), virAttr.getValues().get(0).toString());
}
}
}
@@ -176,31 +150,26 @@ public class VirAttrHandler {
// 2. virtual attributes to be updated
for (AttrMod vAttrToBeUpdated : vAttrsToBeUpdated) {
- VirSchema virSchema = getVirSchema(vAttrToBeUpdated.getSchema(), attrUtils.virSchemaClass());
+ VirSchema virSchema = getVirSchema(vAttrToBeUpdated.getSchema());
VirAttr virAttr = null;
if (virSchema != null) {
- virAttr = attributable.getVirAttr(virSchema.getKey());
+ virAttr = any.getVirAttr(virSchema.getKey());
if (virAttr == null) {
- virAttr = attrUtils.newVirAttr();
- setVirAttrSchema(attributable, virAttr, virSchema);
+ virAttr = anyUtils.newVirAttr();
+ virAttr.setSchema(virSchema);
if (virAttr.getSchema() == null) {
- LOG.debug("Ignoring {} because no valid schema or template was found", vAttrToBeUpdated);
+ LOG.debug("Ignoring {} because no valid schema was found", vAttrToBeUpdated);
} else {
- attributable.addVirAttr(virAttr);
+ any.add(virAttr);
}
}
}
if (virSchema != null && virAttr != null && virAttr.getSchema() != null) {
- if (attributable instanceof Subject) {
- updateOnResourcesIfMappingMatches(attrUtils, virSchema.getKey(),
- externalResources, attrUtils.derIntMappingType(), propByRes);
- } else if (attributable instanceof Membership) {
- updateOnResourcesIfMappingMatches(attrUtils, virSchema.getKey(),
- externalResources, IntMappingType.MembershipVirtualSchema, propByRes);
- }
+ updateOnResourcesIfMappingMatches(any, anyUtils, virSchema.getKey(),
+ externalResources, anyUtils.derIntMappingType(), propByRes);
- final List<String> values = new ArrayList<>(virAttr.getValues());
+ List<String> values = new ArrayList<>(virAttr.getValues());
values.removeAll(vAttrToBeUpdated.getValuesToBeRemoved());
values.addAll(vAttrToBeUpdated.getValuesToBeAdded());
@@ -208,7 +177,7 @@ public class VirAttrHandler {
virAttr.getValues().addAll(values);
// Owner cannot be specified before otherwise a virtual attribute remove will be invalidated.
- virAttr.setOwner(attributable);
+ virAttr.setOwner(any);
}
}
@@ -220,33 +189,31 @@ public class VirAttrHandler {
/**
* Add virtual attributes and specify values to be propagated.
*
- * @param attributable attributable.
+ * @param any any.
* @param vAttrs virtual attributes to be added.
- * @param attrUtils attributable util.
+ * @param anyUtils utils
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
- public void fillVirtual(final Attributable attributable, final Collection<AttrTO> vAttrs,
- final AttributableUtils attrUtils) {
-
- for (AttrTO attributeTO : vAttrs) {
- VirAttr virAttr = attributable.getVirAttr(attributeTO.getSchema());
+ public void fillVirtual(final Any any, final Collection<AttrTO> vAttrs, final AnyUtils anyUtils) {
+ for (AttrTO attrTO : vAttrs) {
+ VirAttr virAttr = any.getVirAttr(attrTO.getSchema());
if (virAttr == null) {
- VirSchema virSchema = getVirSchema(attributeTO.getSchema(), attrUtils.virSchemaClass());
+ VirSchema virSchema = getVirSchema(attrTO.getSchema());
if (virSchema != null) {
- virAttr = attrUtils.newVirAttr();
- setVirAttrSchema(attributable, virAttr, virSchema);
+ virAttr = anyUtils.newVirAttr();
+ virAttr.setSchema(virSchema);
if (virAttr.getSchema() == null) {
- LOG.debug("Ignoring {} because no valid schema or template was found", attributeTO);
+ LOG.debug("Ignoring {} because no valid schema was found", attrTO);
} else {
- virAttr.setOwner(attributable);
- attributable.addVirAttr(virAttr);
+ virAttr.setOwner(any);
+ any.add(virAttr);
virAttr.getValues().clear();
- virAttr.getValues().addAll(attributeTO.getValues());
+ virAttr.getValues().addAll(attrTO.getValues());
}
}
} else {
virAttr.getValues().clear();
- virAttr.getValues().addAll(attributeTO.getValues());
+ virAttr.getValues().addAll(attrTO.getValues());
}
}
}
@@ -263,50 +230,9 @@ public class VirAttrHandler {
final Long key, final Set<String> vAttrsToBeRemoved, final Set<AttrMod> vAttrsToBeUpdated) {
return fillVirtual(
- userDAO.authFetch(key),
+ anyObjectDAO.authFind(key),
vAttrsToBeRemoved,
vAttrsToBeUpdated,
- attrUtilsFactory.getInstance(AttributableType.USER));
+ anyUtilsFactory.getInstance(AnyTypeKind.USER));
}
-
- private Set<String> getAttrNames(final List<? extends VirAttr> virAttrs) {
- final Set<String> virAttrNames = new HashSet<>();
- for (VirAttr attr : virAttrs) {
- virAttrNames.add(attr.getSchema().getKey());
- }
- return virAttrNames;
- }
-
- /**
- * SYNCOPE-501: build membership virtual attribute changes in case no other changes were made.
- *
- * @param key user key
- * @param groupKey group key
- * @param membershipKey membership key
- * @param vAttrsToBeRemoved virtual attributes to be removed.
- * @param vAttrsToBeUpdated virtual attributes to be updated.
- * @param isRemoval flag to check if fill is on removed or added membership
- * @return operations to be performed on external resources for membership virtual attributes changes
- */
- public PropagationByResource fillMembershipVirtual(
- final Long key, final Long groupKey, final Long membershipKey, final Set<String> vAttrsToBeRemoved,
- final Set<AttrMod> vAttrsToBeUpdated, final boolean isRemoval) {
-
- Membership membership = membershipKey == null
- ? userDAO.authFetch(key).getMembership(groupKey)
- : membershipDAO.authFetch(membershipKey);
-
- return membership == null ? new PropagationByResource() : isRemoval
- ? fillVirtual(
- membership,
- getAttrNames(membership.getVirAttrs()),
- vAttrsToBeUpdated,
- attrUtilsFactory.getInstance(AttributableType.MEMBERSHIP))
- : fillVirtual(
- membership,
- vAttrsToBeRemoved,
- vAttrsToBeUpdated,
- attrUtilsFactory.getInstance(AttributableType.MEMBERSHIP));
- }
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/DisabledVirAttrCache.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/DisabledVirAttrCache.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/DisabledVirAttrCache.java
index faaa070..8ec8e84 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/DisabledVirAttrCache.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/DisabledVirAttrCache.java
@@ -18,7 +18,6 @@
*/
package org.apache.syncope.core.provisioning.java.cache;
-import org.apache.syncope.common.lib.types.AttributableType;
import org.apache.syncope.core.provisioning.api.cache.VirAttrCache;
import org.apache.syncope.core.provisioning.api.cache.VirAttrCacheValue;
@@ -32,12 +31,12 @@ public class DisabledVirAttrCache implements VirAttrCache {
}
@Override
- public void expire(final AttributableType type, final Long id, final String schemaName) {
+ public void expire(final String type, final Long id, final String schemaName) {
// nothing to do
}
@Override
- public VirAttrCacheValue get(final AttributableType type, final Long id, final String schemaName) {
+ public VirAttrCacheValue get(final String type, final Long id, final String schemaName) {
return null;
}
@@ -47,9 +46,7 @@ public class DisabledVirAttrCache implements VirAttrCache {
}
@Override
- public void put(
- final AttributableType type, final Long id, final String schemaName, final VirAttrCacheValue value) {
-
+ public void put(final String type, final Long id, final String schemaName, final VirAttrCacheValue value) {
// nothing to do
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/081d9a04/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/MemoryVirAttrCache.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/MemoryVirAttrCache.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/MemoryVirAttrCache.java
index 885b194..bac145e 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/MemoryVirAttrCache.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/cache/MemoryVirAttrCache.java
@@ -23,7 +23,6 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
-import org.apache.syncope.common.lib.types.AttributableType;
import org.apache.syncope.core.provisioning.api.cache.VirAttrCache;
import org.apache.syncope.core.provisioning.api.cache.VirAttrCacheKey;
import org.apache.syncope.core.provisioning.api.cache.VirAttrCacheValue;
@@ -56,14 +55,14 @@ public class MemoryVirAttrCache implements VirAttrCache {
/**
* Cache virtual attribute values.
*
- * @param type user, group or membership
+ * @param type any object type
* @param key attributable key
* @param schemaName virtual attribute name
* @param value virtual attribute values
*/
@Override
public void put(
- final AttributableType type,
+ final String type,
final Long key,
final String schemaName,
final VirAttrCacheValue value) {
@@ -81,25 +80,25 @@ public class MemoryVirAttrCache implements VirAttrCache {
/**
* Retrieve cached value. Return null in case of virtual attribute not cached.
*
- * @param type user, group or membership
+ * @param type any object type
* @param key attributable key
* @param schemaName virtual attribute schema name.
* @return cached values or null if virtual attribute is not cached.
*/
@Override
- public VirAttrCacheValue get(final AttributableType type, final Long key, final String schemaName) {
+ public VirAttrCacheValue get(final String type, final Long key, final String schemaName) {
return cache.get(new VirAttrCacheKey(type, key, schemaName));
}
/**
* Force entry expiring.
*
- * @param type user, group or membership
+ * @param type any object type
* @param key attributable key
* @param schemaName virtual attribute schema name
*/
@Override
- public void expire(final AttributableType type, final Long key, final String schemaName) {
+ public void expire(final String type, final Long key, final String schemaName) {
final VirAttrCacheValue value = cache.get(new VirAttrCacheKey(type, key, schemaName));
if (isValidEntry(value)) {
synchronized (cache) {