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/01/12 17:31:52 UTC
[13/52] [abbrv] [partial] syncope git commit: [SYNCOPE-620] Unit
tests all in
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/propagation/PropagationManager.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/propagation/PropagationManager.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/propagation/PropagationManager.java
deleted file mode 100644
index d2060c9..0000000
--- a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/propagation/PropagationManager.java
+++ /dev/null
@@ -1,248 +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.provisioning.api.propagation;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-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.persistence.api.entity.Subject;
-import org.apache.syncope.persistence.api.entity.task.PropagationTask;
-import org.apache.syncope.persistence.api.entity.user.User;
-import org.apache.syncope.provisioning.api.WorkflowResult;
-
-public interface PropagationManager {
-
- /**
- * Create the role on every associated resource.
- *
- * @param wfResult user to be propagated (and info associated), as per result from workflow
- * @param vAttrs virtual attributes to be set
- * @return list of propagation tasks
- */
- List<PropagationTask> getRoleCreateTaskIds(WorkflowResult<Long> wfResult, List<AttrTO> vAttrs);
-
- /**
- * Create the role on every associated resource.
- *
- * @param wfResult role to be propagated (and info associated), as per result from workflow
- * @param vAttrs virtual attributes to be set
- * @param noPropResourceNames external resources performing not to be considered for propagation
- * @return list of propagation tasks
- */
- List<PropagationTask> getRoleCreateTaskIds(
- WorkflowResult<Long> wfResult, Collection<AttrTO> vAttrs, Collection<String> noPropResourceNames);
-
- /**
- * Create the role on every associated resource.
- *
- * @param key role id
- * @param vAttrs virtual attributes to be set
- * @param propByRes operation to be performed per resource
- * @param noPropResourceNames external resources performing not to be considered for propagation
- * @return list of propagation tasks
- */
- List<PropagationTask> getRoleCreateTaskIds(Long key, Collection<AttrTO> vAttrs, PropagationByResource propByRes,
- Collection<String> noPropResourceNames);
-
- /**
- * Perform delete on each resource associated to the role. 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.
- *
- * @param roleId to be deleted
- * @return list of propagation tasks
- */
- List<PropagationTask> getRoleDeleteTaskIds(Long roleId);
-
- /**
- * Perform delete on each resource associated to the role. 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.
- *
- * @param roleId to be deleted
- * @param noPropResourceName name of external resource not to be considered for propagation
- * @return list of propagation tasks
- */
- List<PropagationTask> getRoleDeleteTaskIds(Long roleId, String noPropResourceName);
-
- /**
- * Perform delete on each resource associated to the user. 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.
- *
- * @param roleId to be deleted
- * @param noPropResourceNames name of external resources not to be considered for propagation
- * @return list of propagation tasks
- */
- List<PropagationTask> getRoleDeleteTaskIds(Long roleId, Collection<String> noPropResourceNames);
-
- /**
- * Perform delete on each resource associated to the user. 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.
- *
- * @param roleId to be deleted
- * @param noPropResourceNames name of external resources not to be considered for propagation
- * @return list of propagation tasks
- */
- List<PropagationTask> getRoleDeleteTaskIds(
- Long roleId, Set<String> resourceNames, Collection<String> noPropResourceNames);
-
- /**
- * Performs update on each resource associated to the role.
- *
- * @param wfResult role to be propagated (and info associated), as per result from workflow
- * @param vAttrsToBeRemoved virtual attributes to be removed
- * @param vAttrsToBeUpdated virtual attributes to be added
- * @return list of propagation tasks
- */
- List<PropagationTask> getRoleUpdateTaskIds(WorkflowResult<Long> wfResult, Set<String> vAttrsToBeRemoved,
- Set<AttrMod> vAttrsToBeUpdated);
-
- /**
- * Performs update on each resource associated to the role.
- *
- * @param wfResult role to be propagated (and info associated), as per result from workflow
- * @param vAttrsToBeRemoved virtual attributes to be removed
- * @param vAttrsToBeUpdated virtual attributes to be added
- * @param noPropResourceNames external resource names not to be considered for propagation
- * @return list of propagation tasks
- */
- List<PropagationTask> getRoleUpdateTaskIds(WorkflowResult<Long> wfResult, Set<String> vAttrsToBeRemoved,
- Set<AttrMod> vAttrsToBeUpdated, Set<String> noPropResourceNames);
-
- List<PropagationTask> getUpdateTaskIds(Subject<?, ?, ?> subject, String password, boolean changePwd,
- Boolean enable, Set<String> vAttrsToBeRemoved, Set<AttrMod> vAttrsToBeUpdated,
- PropagationByResource propByRes, Collection<String> noPropResourceNames,
- Set<MembershipMod> membershipsToAdd);
-
- /**
- * Create the user on every associated resource.
- *
- * @param wfResult user to be propagated (and info associated), as per result from workflow
- * @param password to be set
- * @param vAttrs virtual attributes to be set
- * @param membershipTOs user memberships
- * @return list of propagation tasks
- */
- List<PropagationTask> getUserCreateTaskIds(WorkflowResult<Map.Entry<Long, Boolean>> wfResult,
- String password, List<AttrTO> vAttrs, List<MembershipTO> membershipTOs);
-
- /**
- * Create the user on every associated resource.
- *
- * @param wfResult user to be propagated (and info associated), as per result from workflow
- * @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> getUserCreateTaskIds(WorkflowResult<Map.Entry<Long, Boolean>> wfResult,
- String password, Collection<AttrTO> vAttrs, Set<String> noPropResourceNames,
- List<MembershipTO> membershipTOs);
-
- List<PropagationTask> getUserCreateTaskIds(Long id, Boolean enabled,
- PropagationByResource propByRes, String password, Collection<AttrTO> vAttrs,
- Collection<MembershipTO> membershipTOs, Collection<String> noPropResourceNames);
-
- /**
- * Perform delete on each resource associated to the user. 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.
- *
- * @param userKey to be deleted
- * @return list of propagation tasks
- */
- List<PropagationTask> getUserDeleteTaskIds(Long userKey);
-
- /**
- * Perform delete on each resource associated to the user. 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.
- *
- * @param userKey to be deleted
- * @param noPropResourceName name of external resource not to be considered for propagation
- * @return list of propagation tasks
- */
- List<PropagationTask> getUserDeleteTaskIds(Long userKey, String noPropResourceName);
-
- /**
- * Perform delete on each resource associated to the user. 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.
- *
- * @param userKey to be deleted
- * @param noPropResourceNames name of external resources not to be considered for propagation
- * @return list of propagation tasks
- */
- List<PropagationTask> getUserDeleteTaskIds(Long userKey, Collection<String> noPropResourceNames);
-
- /**
- * Perform delete on each resource associated to the user. 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.
- *
- * @param userKey to be deleted
- * @param noPropResourceNames name of external resources not to be considered for propagation
- * @return list of propagation tasks
- */
- List<PropagationTask> getUserDeleteTaskIds(
- Long userKey, Set<String> resourceNames, Collection<String> noPropResourceNames);
-
- /**
- * Perform delete on each resource associated to the user. 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.
- *
- * @param wfResult user to be propagated (and info associated), as per result from workflow
- * @return list of propagation tasks
- */
- List<PropagationTask> getUserDeleteTaskIds(WorkflowResult<Long> wfResult);
-
- /**
- * Performs update on each resource associated to the user excluding the specified into 'resourceNames' parameter.
- *
- * @param user to be propagated
- * @param enable whether user must be enabled or not
- * @param noPropResourceNames external resource names not to be considered for propagation
- * @return list of propagation tasks
- */
- List<PropagationTask> getUserUpdateTaskIds(User user, Boolean enable, Set<String> noPropResourceNames);
-
- /**
- * Performs update on each resource associated to the user.
- *
- * @param wfResult user to be propagated (and info associated), as per result from workflow
- * @param changePwd whether password should be included for propagation attributes or not
- * @param noPropResourceNames external resources not to be considered for propagation
- * @return list of propagation tasks
- */
- List<PropagationTask> getUserUpdateTaskIds(WorkflowResult<Map.Entry<UserMod, Boolean>> wfResult,
- boolean changePwd, Collection<String> noPropResourceNames);
-
- List<PropagationTask> getUserUpdateTaskIds(WorkflowResult<Map.Entry<UserMod, Boolean>> wfResult);
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/propagation/PropagationReporter.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/propagation/PropagationReporter.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/propagation/PropagationReporter.java
deleted file mode 100644
index b4b714b..0000000
--- a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/propagation/PropagationReporter.java
+++ /dev/null
@@ -1,58 +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.provisioning.api.propagation;
-
-import java.util.List;
-import org.apache.syncope.common.lib.to.PropagationStatus;
-import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
-import org.apache.syncope.persistence.api.entity.task.PropagationTask;
-import org.identityconnectors.framework.common.objects.ConnectorObject;
-
-/**
- * Report propagation status after executions.
- */
-public interface PropagationReporter {
-
- /**
- * Report propagation status after executions in case of success or non-blocking failure
- * (e.g. on secondary resources).
- *
- * @param resourceName resource name.
- * @param execStatus propagation execution status.
- * @param failureReason propagation execution failure message.
- * @param beforeObj retrieved connector object before operation execution.
- * @param afterObj retrieved connector object after operation execution.
- */
- void onSuccessOrSecondaryResourceFailures(String resourceName, PropagationTaskExecStatus execStatus,
- String failureReason, ConnectorObject beforeObj, ConnectorObject afterObj);
-
- /**
- * Report propagation status after executions in case blocking failure (e.g. on primary resources).
- *
- * @param tasks propagation tasks performed before failure
- */
- void onPrimaryResourceFailure(List<PropagationTask> tasks);
-
- /**
- * Returns the list of propagation statuses.
- *
- * @return the list of propagation statuses
- */
- List<PropagationStatus> getStatuses();
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/propagation/PropagationTaskExecutor.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/propagation/PropagationTaskExecutor.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/propagation/PropagationTaskExecutor.java
deleted file mode 100644
index 1b37718..0000000
--- a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/propagation/PropagationTaskExecutor.java
+++ /dev/null
@@ -1,77 +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.provisioning.api.propagation;
-
-import java.util.Collection;
-import org.apache.syncope.persistence.api.entity.task.PropagationTask;
-import org.apache.syncope.persistence.api.entity.task.TaskExec;
-
-/**
- * Execute propagation tasks.
- *
- * @see PropagationTask
- */
-public interface PropagationTaskExecutor {
-
- /**
- * Name for special propagation attribute used to indicate whether there are attributes, marked as mandatory in the
- * mapping but not to be propagated.
- */
- String MANDATORY_MISSING_ATTR_NAME = "__MANDATORY_MISSING__";
-
- /**
- * Name for special propagation attribute used to indicate whether there are attributes, marked as mandatory in the
- * mapping but about to be propagated as null or empty.
- */
- String MANDATORY_NULL_OR_EMPTY_ATTR_NAME = "__MANDATORY_NULL_OR_EMPTY__";
-
- /**
- * Execute the given PropagationTask and returns the generated TaskExec.
- *
- * @param task to be executed
- * @return the generated TaskExec
- */
- TaskExec execute(PropagationTask task);
-
- /**
- * Execute the given PropagationTask, invoke the given handler and returns the generated TaskExec.
- *
- * @param task to be executed
- * @param reporter to report propagation execution status
- * @return the generated TaskExec
- */
- TaskExec execute(PropagationTask task, PropagationReporter reporter);
-
- /**
- * Execute a collection of PropagationTask objects.
- * The process is interrupted as soon as the result of the communication with a primary resource is in error.
- *
- * @param tasks to be executed
- */
- void execute(Collection<PropagationTask> tasks);
-
- /**
- * Execute a collection of PropagationTask objects and invoke the given handler on each of these.
- * The process is interrupted as soon as the result of the communication with a primary resource is in error.
- *
- * @param tasks to be execute, in given order
- * @param reporter to report propagation execution status
- */
- void execute(Collection<PropagationTask> tasks, PropagationReporter reporter);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/ProvisioningActions.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/ProvisioningActions.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/ProvisioningActions.java
deleted file mode 100644
index f69a455..0000000
--- a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/ProvisioningActions.java
+++ /dev/null
@@ -1,42 +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.provisioning.api.sync;
-
-import java.util.List;
-import org.quartz.JobExecutionException;
-
-public interface ProvisioningActions {
-
- /**
- * Action to be executed before to start the synchronization task execution.
- *
- * @param profile sync profile
- * @throws JobExecutionException in case of generic failure
- */
- void beforeAll(final SyncProfile<?, ?> profile) throws JobExecutionException;
-
- /**
- * Action to be executed after the synchronization task completion.
- *
- * @param profile sync profile
- * @param results synchronization result
- * @throws JobExecutionException in case of generic failure
- */
- void afterAll(final SyncProfile<?, ?> profile, final List<SyncResult> results) throws JobExecutionException;
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/PushActions.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/PushActions.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/PushActions.java
deleted file mode 100644
index fc79334..0000000
--- a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/PushActions.java
+++ /dev/null
@@ -1,137 +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.provisioning.api.sync;
-
-import org.apache.syncope.persistence.api.entity.Subject;
-import org.quartz.JobExecutionException;
-
-/**
- * Interface for actions to be performed during PushJob execution.
- */
-public interface PushActions extends ProvisioningActions {
-
- /**
- * Action to be executed before to assign (link & provision) a synchronized user / role to the resource.
- *
- * @param profile profile of the synchronization being executed.
- * @param subject user / role to be created.
- * @return subject.
- * @throws JobExecutionException in case of generic failure
- */
- <T extends Subject<?, ?, ?>> T beforeAssign(
- final SyncProfile<?, ?> profile,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed before to provision a synchronized user / role to the resource.
- *
- * @param profile profile of the synchronization being executed.
- * @param subject user / role to be created.
- * @return subject.
- * @throws JobExecutionException in case of generic failure
- */
- <T extends Subject<?, ?, ?>> T beforeProvision(
- final SyncProfile<?, ?> profile,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed before to update a synchronized user / role on the resource.
- *
- * @param profile profile of the synchronization being executed.
- * @param subject user / role to be updated.
- * @return subject.
- * @throws JobExecutionException in case of generic failure
- */
- <T extends Subject<?, ?, ?>> T beforeUpdate(
- final SyncProfile<?, ?> profile,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed before to link a synchronized user / role to the resource.
- *
- * @param profile profile of the synchronization being executed.
- * @param subject user / role to be created.
- * @return subject.
- * @throws JobExecutionException in case of generic failure
- */
- <T extends Subject<?, ?, ?>> T beforeLink(
- final SyncProfile<?, ?> profile,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed before to unlink a synchronized user / role from the resource.
- *
- * @param profile profile of the synchronization being executed.
- * @param subject user / role to be created.
- * @return subject.
- * @throws JobExecutionException in case of generic failure
- */
- <T extends Subject<?, ?, ?>> T beforeUnlink(
- final SyncProfile<?, ?> profile,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed before to unassign a synchronized user / role from the resource.
- *
- * @param profile profile of the synchronization being executed.
- * @param subject user / role to be created.
- * @return subject.
- * @throws JobExecutionException in case of generic failure
- */
- <T extends Subject<?, ?, ?>> T beforeUnassign(
- final SyncProfile<?, ?> profile,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed before to unassign a synchronized user / role from the resource.
- *
- * @param profile profile of the synchronization being executed.
- * @param subject user / role to be created.
- * @return subject.
- * @throws JobExecutionException in case of generic failure
- */
- <T extends Subject<?, ?, ?>> T beforeDeprovision(
- final SyncProfile<?, ?> profile,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed before delete a synchronized user / role locally and from the resource.
- *
- * @param profile profile of the synchronization being executed.
- * @param subject user / role to be created.
- * @return subject.
- * @throws JobExecutionException in case of generic failure
- */
- <T extends Subject<?, ?, ?>> T beforeDelete(
- final SyncProfile<?, ?> profile,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed after each local user / role synchronization.
- *
- * @param profile profile of the synchronization being executed.
- * @param subject synchronized user / role.
- * @param result operation result.
- * @throws JobExecutionException in case of generic failure
- */
- <T extends Subject<?, ?, ?>> void after(
- final SyncProfile<?, ?> profile,
- final T subject,
- final SyncResult result) throws JobExecutionException;
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncActions.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncActions.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncActions.java
deleted file mode 100644
index ae6c3b3..0000000
--- a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncActions.java
+++ /dev/null
@@ -1,175 +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.provisioning.api.sync;
-
-import org.apache.syncope.common.lib.mod.AbstractSubjectMod;
-import org.apache.syncope.common.lib.to.AbstractSubjectTO;
-import org.identityconnectors.framework.common.objects.SyncDelta;
-import org.quartz.JobExecutionException;
-
-/**
- * Interface for actions to be performed during SyncJob execution.
- */
-public interface SyncActions extends ProvisioningActions {
-
- /**
- * Action to be executed before to create a synchronized user / role locally.
- * User/role is created locally upon synchronization in case of the un-matching rule
- * {@link org.apache.syncope.common.types.UnmatchingRule#PROVISION} (default un-matching rule) is applied.
- *
- * @param profile profile of the synchronization being executed.
- * @param delta retrieved synchronization information
- * @param subject user / role to be created
- * @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(
- final SyncProfile<?, ?> profile,
- final SyncDelta delta,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed before creating (and linking to the resource) a synchronized user / role locally.
- * User/role is created locally and linked to the synchronized resource upon synchronization in case of the
- * un-matching rule {@link org.apache.syncope.common.types.UnmatchingRule#ASSIGN} is applied.
- *
- * @param profile profile of the synchronization being executed.
- * @param delta retrieved synchronization information
- * @param subject user / role to be created
- * @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(
- final SyncProfile<?, ?> profile,
- final SyncDelta delta,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed before unlinking resource from the synchronized user / role and de-provisioning.
- * User/role is unlinked and de-provisioned from the synchronized resource upon synchronization in case of the
- * matching rule {@link org.apache.syncope.common.types.MatchingRule#UNASSIGN} is applied.
- *
- * @param profile profile of the synchronization being executed.
- * @param delta retrieved synchronization information
- * @param subject user / role to be created
- * @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(
- final SyncProfile<?, ?> profile,
- final SyncDelta delta,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed before de-provisioning action only.
- * User/role is de-provisioned (without unlinking) from the synchronized resource upon synchronization in case of
- * the matching rule {@link org.apache.syncope.common.types.MatchingRule#DEPROVISION} is applied.
- *
- * @param profile profile of the synchronization being executed.
- * @param delta retrieved synchronization information
- * @param subject user / role to be created
- * @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(
- final SyncProfile<?, ?> profile,
- final SyncDelta delta,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed before unlinking resource from the synchronized user / role.
- * User/role is unlinked (without de-provisioning) from the synchronized resource upon synchronization in case of
- * the matching rule {@link org.apache.syncope.common.types.MatchingRule#UNLINK} is applied.
- *
- * @param profile profile of the synchronization being executed.
- * @param delta retrieved synchronization information
- * @param subject user / role to be created
- * @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(
- final SyncProfile<?, ?> profile,
- final SyncDelta delta,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed before linking resource to the synchronized user / role.
- * User/role is linked (without updating) to the synchronized resource upon synchronization in case of
- * the matching rule {@link org.apache.syncope.common.types.MatchingRule#LINK} is applied.
- *
- * @param profile profile of the synchronization being executed.
- * @param delta retrieved synchronization information
- * @param subject user / role to be created
- * @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(
- final SyncProfile<?, ?> profile,
- final SyncDelta delta,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed before to update a synchronized user / role locally.
- * User/role is updated upon synchronization in case of the matching rule
- * {@link org.apache.syncope.common.types.MatchingRule#UPDATE} (default matching rule) is applied.
- *
- * @param profile profile of the synchronization being executed.
- * @param delta retrieved synchronization information
- * @param subject local user / role information
- * @param subjectMod 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(
- final SyncProfile<?, ?> profile,
- final SyncDelta delta,
- final T subject,
- final K subjectMod)
- throws JobExecutionException;
-
- /**
- * Action to be executed before to delete a synchronized user / role locally.
- *
- * @param profile profile of the synchronization being executed.
- * @param delta retrieved synchronization information
- * @param subject local user / role 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(
- final SyncProfile<?, ?> profile,
- final SyncDelta delta,
- final T subject) throws JobExecutionException;
-
- /**
- * Action to be executed after each local user / role synchronization.
- *
- * @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 / role
- * @param result global synchronization results at the current synchronization step
- * @throws JobExecutionException in case of generic failure
- */
- <T extends AbstractSubjectTO> void after(
- final SyncProfile<?, ?> profile,
- final SyncDelta delta,
- final T subject,
- final SyncResult result) throws JobExecutionException;
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncCorrelationRule.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncCorrelationRule.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncCorrelationRule.java
deleted file mode 100644
index 4056e74..0000000
--- a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncCorrelationRule.java
+++ /dev/null
@@ -1,36 +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.provisioning.api.sync;
-
-import org.apache.syncope.persistence.api.dao.search.SearchCond;
-import org.identityconnectors.framework.common.objects.ConnectorObject;
-
-/**
- * Interface for correlation rule to be evaluated during SyncJob execution.
- */
-public interface SyncCorrelationRule {
-
- /**
- * Return a search condition.
- *
- * @param connObj connector object.
- * @return search condition.
- */
- SearchCond getSearchCond(ConnectorObject connObj);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncProfile.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncProfile.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncProfile.java
deleted file mode 100644
index 77cbfe1..0000000
--- a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncProfile.java
+++ /dev/null
@@ -1,84 +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.provisioning.api.sync;
-
-import java.util.Collection;
-import java.util.List;
-import org.apache.syncope.common.lib.types.ConflictResolutionAction;
-import org.apache.syncope.persistence.api.entity.task.SyncTask;
-import org.apache.syncope.provisioning.api.Connector;
-
-public class SyncProfile<T extends SyncTask, A extends ProvisioningActions> {
-
- /**
- * Syncing connector.
- */
- private final Connector connector;
-
- private final T syncTask;
-
- private Collection<SyncResult> results;
-
- private boolean dryRun;
-
- private ConflictResolutionAction resAct;
-
- private List<A> actions;
-
- public SyncProfile(final Connector connector, final T syncTask) {
- this.connector = connector;
- this.syncTask = syncTask;
- }
-
- public Connector getConnector() {
- return connector;
- }
-
- public T getSyncTask() {
- return syncTask;
- }
-
- public Collection<SyncResult> getResults() {
- return results;
- }
-
- public boolean isDryRun() {
- return dryRun;
- }
-
- public void setDryRun(final boolean dryRun) {
- this.dryRun = dryRun;
- }
-
- public ConflictResolutionAction getResAct() {
- return resAct;
- }
-
- public void setResAct(final ConflictResolutionAction resAct) {
- this.resAct = resAct;
- }
-
- public List<A> getActions() {
- return actions;
- }
-
- public void setActions(final List<A> actions) {
- this.actions = actions;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncResult.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncResult.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncResult.java
deleted file mode 100644
index e6c17ea..0000000
--- a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncResult.java
+++ /dev/null
@@ -1,140 +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.provisioning.api.sync;
-
-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;
-
-public class SyncResult {
-
- public enum Status {
-
- SUCCESS,
- FAILURE
-
- }
-
- private String message;
-
- private Status status;
-
- private AttributableType subjectType;
-
- private ResourceOperation operation;
-
- private Long id;
-
- private String name;
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(final String message) {
- this.message = message;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(final String name) {
- this.name = name;
- }
-
- public Long getId() {
- return id;
- }
-
- public void setId(final Long id) {
- this.id = id;
- }
-
- public Status getStatus() {
- return status;
- }
-
- public void setStatus(final Status status) {
- this.status = status;
- }
-
- public AttributableType getSubjectType() {
- return subjectType;
- }
-
- public void setSubjectType(final AttributableType subjectType) {
- this.subjectType = subjectType;
- }
-
- public ResourceOperation getOperation() {
- return operation;
- }
-
- public void setOperation(final ResourceOperation operation) {
- this.operation = operation;
- }
-
- @Override
- public String toString() {
- return new ReflectionToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).toString();
- }
-
- /**
- * Human readable report string, using the given trace level.
- *
- * @param level trace level
- * @return String for certain levels, null for level NONE
- */
- public String getReportString(final TraceLevel level) {
- if (level == TraceLevel.SUMMARY) {
- // No per entry log in this case.
- return null;
- } else if (level == TraceLevel.FAILURES && status == Status.FAILURE) {
- // only report failures
- return String.format("Failed %s (id/name): %d/%s with message: %s", operation, id, name, message);
- } else {
- // All
- return String.format("%s %s (id/name): %d/%s %s", operation, status, id, name,
- StringUtils.isBlank(message)
- ? ""
- : "with message: " + message);
- }
- }
-
- /**
- * Helper method to invoke logging per synchronization result for the given trace level.
- *
- * @param results synchronization result
- * @param level trace level
- * @return report as string
- */
- public static String produceReport(final Collection<SyncResult> results, final TraceLevel level) {
- StringBuilder sb = new StringBuilder();
- for (SyncResult result : results) {
- sb.append(result.getReportString(level)).append("\n");
- }
- return sb.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncopeResultHandler.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncopeResultHandler.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncopeResultHandler.java
deleted file mode 100644
index b3b366c..0000000
--- a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/provisioning/api/sync/SyncopeResultHandler.java
+++ /dev/null
@@ -1,29 +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.provisioning.api.sync;
-
-import org.apache.syncope.persistence.api.entity.task.SyncTask;
-
-public interface SyncopeResultHandler<T extends SyncTask, A extends SyncActions> {
-
- SyncProfile<T, A> getProfile();
-
- void setProfilee(SyncProfile<T, A> profile);
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/AttributableTransformer.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/AttributableTransformer.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/AttributableTransformer.java
new file mode 100644
index 0000000..b9d39fd
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/AttributableTransformer.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.server.provisioning.api;
+
+import org.apache.syncope.common.lib.mod.AbstractAttributableMod;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+
+/**
+ * Provides logic for transforming user or role, 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/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnIdBundleManager.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnIdBundleManager.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnIdBundleManager.java
new file mode 100644
index 0000000..764f76e
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnIdBundleManager.java
@@ -0,0 +1,46 @@
+/*
+ * 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.server.provisioning.api;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+import org.identityconnectors.framework.api.ConfigurationProperties;
+import org.identityconnectors.framework.api.ConnectorInfo;
+import org.identityconnectors.framework.api.ConnectorInfoManager;
+
+/**
+ * Manage information about ConnId connector bundles.
+ */
+public interface ConnIdBundleManager {
+
+ ConfigurationProperties getConfigurationProperties(final ConnectorInfo info);
+
+ Map<URI, ConnectorInfoManager> getConnManagers();
+
+ ConnectorInfo getConnectorInfo(final String location, final String bundleName, final String bundleVersion,
+ final String connectorName);
+
+ Map<String, List<ConnectorInfo>> getConnectorInfos();
+
+ void resetConnManagers();
+
+ void setStringLocations(final String stringLocations);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnPoolConfUtil.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnPoolConfUtil.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnPoolConfUtil.java
new file mode 100644
index 0000000..8e5d190
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnPoolConfUtil.java
@@ -0,0 +1,69 @@
+/*
+ * 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.server.provisioning.api;
+
+import org.apache.syncope.common.lib.to.ConnPoolConfTO;
+import org.apache.syncope.server.persistence.api.entity.ConnPoolConf;
+import org.identityconnectors.common.pooling.ObjectPoolConfiguration;
+
+public final class ConnPoolConfUtil {
+
+ public static ConnPoolConf getConnPoolConf(final ConnPoolConfTO cpcto, final ConnPoolConf cpc) {
+ ObjectPoolConfiguration opc = new ObjectPoolConfiguration();
+
+ cpc.setMaxIdle(cpcto.getMaxIdle() == null ? opc.getMaxIdle() : cpcto.getMaxIdle());
+ cpc.setMaxObjects(cpcto.getMaxObjects() == null ? opc.getMaxObjects() : cpcto.getMaxObjects());
+ cpc.setMaxWait(cpcto.getMaxWait() == null ? opc.getMaxWait() : cpcto.getMaxWait());
+ cpc.setMinEvictableIdleTimeMillis(cpcto.getMinEvictableIdleTimeMillis() == null
+ ? opc.getMinEvictableIdleTimeMillis() : cpcto.getMinEvictableIdleTimeMillis());
+ cpc.setMinIdle(cpcto.getMinIdle() == null ? opc.getMinIdle() : cpcto.getMinIdle());
+
+ return cpc;
+ }
+
+ public static ObjectPoolConfiguration getObjectPoolConfiguration(final ConnPoolConf cpc) {
+ ObjectPoolConfiguration opc = new ObjectPoolConfiguration();
+ updateObjectPoolConfiguration(opc, cpc);
+ return opc;
+ }
+
+ public static void updateObjectPoolConfiguration(
+ final ObjectPoolConfiguration opc, final ConnPoolConf cpc) {
+
+ if (cpc.getMaxIdle() != null) {
+ opc.setMaxIdle(cpc.getMaxIdle());
+ }
+ if (cpc.getMaxObjects() != null) {
+ opc.setMaxObjects(cpc.getMaxObjects());
+ }
+ if (cpc.getMaxWait() != null) {
+ opc.setMaxWait(cpc.getMaxWait());
+ }
+ if (cpc.getMinEvictableIdleTimeMillis() != null) {
+ opc.setMinEvictableIdleTimeMillis(cpc.getMinEvictableIdleTimeMillis());
+ }
+ if (cpc.getMinIdle() != null) {
+ opc.setMinIdle(cpc.getMinIdle());
+ }
+ }
+
+ private ConnPoolConfUtil() {
+ // empty constructor for static utility class
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/Connector.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/Connector.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/Connector.java
new file mode 100644
index 0000000..9f5bd39
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/Connector.java
@@ -0,0 +1,216 @@
+/*
+ * 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.server.provisioning.api;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+import org.apache.syncope.common.lib.types.PropagationMode;
+import org.apache.syncope.common.lib.types.ResourceOperation;
+import org.apache.syncope.server.persistence.api.entity.ConnInstance;
+import org.apache.syncope.server.persistence.api.entity.MappingItem;
+import org.identityconnectors.framework.common.objects.Attribute;
+import org.identityconnectors.framework.common.objects.ConnectorObject;
+import org.identityconnectors.framework.common.objects.ObjectClass;
+import org.identityconnectors.framework.common.objects.OperationOptions;
+import org.identityconnectors.framework.common.objects.SyncResultsHandler;
+import org.identityconnectors.framework.common.objects.SyncToken;
+import org.identityconnectors.framework.common.objects.Uid;
+import org.identityconnectors.framework.common.objects.filter.Filter;
+
+/**
+ * Entry point for making requests on underlying connector bundles.
+ */
+public interface Connector {
+
+ /**
+ * Authenticate user on a connector instance.
+ *
+ * @param username the name based credential for authentication
+ * @param password the password based credential for authentication
+ * @param options ConnId's OperationOptions
+ * @return Uid of the account that was used to authenticate
+ */
+ Uid authenticate(String username, String password, OperationOptions options);
+
+ /**
+ * Create user / role on a connector instance.
+ *
+ * @param propagationMode propagation mode
+ * @param objectClass ConnId's object class
+ * @param attrs attributes for creation
+ * @param options ConnId's OperationOptions
+ * @param propagationAttempted if creation is actually performed (based on connector instance's capabilities)
+ * @return Uid for created object
+ */
+ Uid create(PropagationMode propagationMode, ObjectClass objectClass,
+ Set<Attribute> attrs, OperationOptions options,
+ Set<String> propagationAttempted);
+
+ /**
+ * Update user / role on a connector instance.
+ *
+ * @param propagationMode propagation mode
+ * @param objectClass ConnId's object class
+ * @param uid user to be updated
+ * @param attrs attributes for update
+ * @param options ConnId's OperationOptions
+ * @param propagationAttempted if update is actually performed (based on connector instance's capabilities)
+ * @return Uid for updated object
+ */
+ Uid update(PropagationMode propagationMode, ObjectClass objectClass,
+ Uid uid, Set<Attribute> attrs, OperationOptions options,
+ Set<String> propagationAttempted);
+
+ /**
+ * Delete user / role on a connector instance.
+ *
+ * @param propagationMode propagation mode
+ * @param objectClass ConnId's object class
+ * @param uid user to be deleted
+ * @param options ConnId's OperationOptions
+ * @param propagationAttempted if deletion is actually performed (based on connector instance's capabilities)
+ */
+ void delete(PropagationMode propagationMode, ObjectClass objectClass,
+ Uid uid, OperationOptions options, Set<String> propagationAttempted);
+
+ /**
+ * Sync users / roles from a connector instance.
+ *
+ * @param objectClass ConnId's object class
+ * @param token to be passed to the underlying connector
+ * @param handler to be used to handle deltas
+ * @param options ConnId's OperationOptions
+ */
+ void sync(ObjectClass objectClass, SyncToken token, SyncResultsHandler handler, OperationOptions options);
+
+ /**
+ * Read latest sync token from a connector instance.
+ *
+ * @param objectClass ConnId's object class.
+ * @return latest sync token
+ */
+ SyncToken getLatestSyncToken(ObjectClass objectClass);
+
+ /**
+ * Get remote object.
+ *
+ * @param objectClass ConnId's object class
+ * @param uid ConnId's Uid
+ * @param options ConnId's OperationOptions
+ * @return ConnId's connector object for given uid
+ */
+ ConnectorObject getObject(ObjectClass objectClass, Uid uid, OperationOptions options);
+
+ /**
+ * Get remote object used by the propagation manager in order to choose for a create (object doesn't exist) or an
+ * update (object exists).
+ *
+ * @param propagationMode propagation mode
+ * @param operationType resource operation type
+ * @param objectClass ConnId's object class
+ * @param uid ConnId's Uid
+ * @param options ConnId's OperationOptions
+ * @return ConnId's connector object for given uid
+ */
+ ConnectorObject getObject(PropagationMode propagationMode, ResourceOperation operationType, ObjectClass objectClass,
+ Uid uid, OperationOptions options);
+
+ /**
+ * Search for remote objects.
+ *
+ * @param objectClass ConnId's object class
+ * @param filter search filter
+ * @param options ConnId's OperationOptions
+ * @return ConnId's connector objects matching the given filter
+ */
+ List<ConnectorObject> search(ObjectClass objectClass, Filter filter, OperationOptions options);
+
+ /**
+ * Get remote object used by the propagation manager in order to choose for a create (object doesn't exist) or an
+ * update (object exists).
+ *
+ * @param objectClass ConnId's object class.
+ * @param handler to be used to handle deltas.
+ * @param options ConnId's OperationOptions.
+ */
+ void getAllObjects(ObjectClass objectClass, SyncResultsHandler handler, OperationOptions options);
+
+ /**
+ * Read attribute for a given connector object.
+ *
+ * @param objectClass ConnId's object class
+ * @param uid ConnId's Uid
+ * @param options ConnId's OperationOptions
+ * @param attributeName attribute to read
+ * @return attribute (if present)
+ */
+ Attribute getObjectAttribute(ObjectClass objectClass, Uid uid, OperationOptions options, String attributeName);
+
+ /**
+ * Read attributes for a given connector object.
+ *
+ * @param objectClass ConnId's object class
+ * @param uid ConnId's Uid
+ * @param options ConnId's OperationOptions
+ * @return attributes (if present)
+ */
+ Set<Attribute> getObjectAttributes(ObjectClass objectClass, Uid uid, OperationOptions options);
+
+ /**
+ * Return resource schema names.
+ *
+ * @param includeSpecial return special attributes (like as __NAME__ or __PASSWORD__) if true
+ * @return schema names
+ */
+ Set<String> getSchemaNames(boolean includeSpecial);
+
+ /**
+ * Return ConnId's object classes supported by this connector.
+ *
+ * @return supported object classes
+ */
+ Set<ObjectClass> getSupportedObjectClasses();
+
+ /**
+ * Validate a connector instance.
+ */
+ void validate();
+
+ /**
+ * Check connection to resource.
+ */
+ void test();
+
+ /**
+ * Getter for active connector instance.
+ *
+ * @return active connector instance.
+ */
+ ConnInstance getActiveConnInstance();
+
+ /**
+ * Build options for requesting all mapped connector attributes.
+ *
+ * @param mapItems mapping items
+ * @return options for requesting all mapped connector attributes
+ * @see OperationOptions
+ */
+ OperationOptions getOperationOptions(Collection<? extends MappingItem> mapItems);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnectorFactory.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnectorFactory.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnectorFactory.java
new file mode 100644
index 0000000..616f01e
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnectorFactory.java
@@ -0,0 +1,63 @@
+/*
+ * 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.server.provisioning.api;
+
+import java.util.Set;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.server.persistence.api.entity.ConnInstance;
+import org.apache.syncope.server.persistence.api.entity.ExternalResource;
+
+/**
+ * Entry point for creating and destroying connectors for external resources.
+ *
+ * @see org.apache.syncope.core.propagation.Connector
+ */
+public interface ConnectorFactory {
+
+ /**
+ * Create connector from given connector instance and configuration properties.
+ *
+ * @param connInstance connector instance
+ * @param configuration configuration properties
+ * @return connector
+ */
+ Connector createConnector(ConnInstance connInstance, Set<ConnConfProperty> configuration);
+
+ /**
+ * Get existing connector for the given resource.
+ *
+ * @param resource the resource.
+ * @return live connector bran for given resource
+ */
+ Connector getConnector(ExternalResource resource);
+
+ /**
+ * Load connectors for all existing resources.
+ *
+ * @see ExternalResource
+ */
+ void load();
+
+ /**
+ * Unload connectors for all existing resources.
+ *
+ * @see ExternalResource
+ */
+ void unload();
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnectorRegistry.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnectorRegistry.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnectorRegistry.java
new file mode 100644
index 0000000..ceeb3ba
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ConnectorRegistry.java
@@ -0,0 +1,53 @@
+/*
+ * 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.server.provisioning.api;
+
+import java.util.Set;
+import org.apache.syncope.common.lib.types.ConnConfProperty;
+import org.apache.syncope.server.persistence.api.entity.ConnInstance;
+import org.apache.syncope.server.persistence.api.entity.ExternalResource;
+
+/**
+ * Manage Spring beans lifecycle for connectors.
+ */
+public interface ConnectorRegistry {
+
+ /**
+ * Returns a connector instance with overridden property values, if found.
+ *
+ * @param connInstance base connector instance
+ * @param overridden overridden property values
+ * @return connector instance with overridden property values, if found
+ */
+ ConnInstance getOverriddenConnInstance(ConnInstance connInstance, Set<ConnConfProperty> overridden);
+
+ /**
+ * Create and register into Spring context a bean for the given resource.
+ *
+ * @param resource external resource
+ */
+ void registerConnector(ExternalResource resource);
+
+ /**
+ * Removes the Spring bean for the given id from the context.
+ *
+ * @param id Spring bean id
+ */
+ void unregisterConnector(String id);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ProvisioningManager.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ProvisioningManager.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ProvisioningManager.java
new file mode 100644
index 0000000..8a111a5
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/ProvisioningManager.java
@@ -0,0 +1,42 @@
+/*
+ * 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.server.provisioning.api;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import org.apache.syncope.common.lib.mod.AbstractAttributableMod;
+import org.apache.syncope.common.lib.to.AbstractAttributableTO;
+import org.apache.syncope.common.lib.to.PropagationStatus;
+
+public interface ProvisioningManager<T extends AbstractAttributableTO, M extends AbstractAttributableMod> {
+
+ Map.Entry<Long, List<PropagationStatus>> create(T subject);
+
+ Map.Entry<Long, List<PropagationStatus>> update(M subjectMod);
+
+ List<PropagationStatus> delete(Long subjectId);
+
+ Long unlink(M subjectMod);
+
+ Long link(M subjectMod);
+
+ List<PropagationStatus> deprovision(Long user, Collection<String> resources);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/RoleProvisioningManager.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/RoleProvisioningManager.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/RoleProvisioningManager.java
new file mode 100644
index 0000000..d1c5585
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/RoleProvisioningManager.java
@@ -0,0 +1,37 @@
+/*
+ * 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.server.provisioning.api;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.syncope.common.lib.mod.RoleMod;
+import org.apache.syncope.common.lib.to.PropagationStatus;
+import org.apache.syncope.common.lib.to.RoleTO;
+
+public interface RoleProvisioningManager extends ProvisioningManager<RoleTO, RoleMod> {
+
+ Map.Entry<Long, List<PropagationStatus>> create(RoleTO roleTO, Set<String> excludedResources);
+
+ Map.Entry<Long, List<PropagationStatus>> create(
+ RoleTO roleTO, Map<Long, String> roleOwnerMap, Set<String> excludedResources);
+
+ Map.Entry<Long, List<PropagationStatus>> update(RoleMod subjectMod, Set<String> excludedResources);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/TimeoutException.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/TimeoutException.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/TimeoutException.java
new file mode 100644
index 0000000..af1d3f6
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/TimeoutException.java
@@ -0,0 +1,42 @@
+/*
+ * 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.server.provisioning.api;
+
+public class TimeoutException extends RuntimeException {
+
+ private static final long serialVersionUID = -6577300049818278323L;
+
+ /**
+ * Creates a new instance of
+ * <code>TimeoutException</code> without detail message.
+ */
+ public TimeoutException() {
+ super();
+ }
+
+ /**
+ * Constructs an instance of
+ * <code>TimeoutException</code> with the specified detail message.
+ *
+ * @param msg the detail message.
+ */
+ public TimeoutException(final String msg) {
+ super(msg);
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/URIUtil.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/URIUtil.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/URIUtil.java
new file mode 100644
index 0000000..4a7e1cc
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/URIUtil.java
@@ -0,0 +1,61 @@
+/*
+ * 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.server.provisioning.api;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+public final class URIUtil {
+
+ private URIUtil() {
+ // empty constructor for static utility class
+ }
+
+ /**
+ * Build a valid URI out of the given location.
+ * Only "file", "connid" and "connids" schemes are allowed.
+ * For "file", invalid characters are handled via intermediate transformation into URL.
+ *
+ * @param location the candidate location for URI
+ * @return valid URI for the given location
+ * @throws MalformedURLException if the intermediate URL is not valid
+ * @throws URISyntaxException if the given location does not correspond to a valid URI
+ */
+ public static URI buildForConnId(final String location) throws MalformedURLException, URISyntaxException {
+ final String candidate = location.trim();
+
+ if (!candidate.startsWith("file:")
+ && !candidate.startsWith("connid:") && !candidate.startsWith("connids:")) {
+
+ throw new IllegalArgumentException(candidate + " is not a valid URI for file or connid(s) schemes");
+ }
+
+ URI uri;
+ if (candidate.startsWith("file:")) {
+ uri = new File(new URL(candidate).getFile()).getAbsoluteFile().toURI();
+ } else {
+ uri = new URI(candidate);
+ }
+
+ return uri;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/UserProvisioningManager.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/UserProvisioningManager.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/UserProvisioningManager.java
new file mode 100644
index 0000000..f49b9bf
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/UserProvisioningManager.java
@@ -0,0 +1,57 @@
+/*
+ * 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.server.provisioning.api;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.syncope.common.lib.mod.StatusMod;
+import org.apache.syncope.common.lib.mod.UserMod;
+import org.apache.syncope.common.lib.to.PropagationStatus;
+import org.apache.syncope.common.lib.to.UserTO;
+import org.apache.syncope.server.persistence.api.entity.user.User;
+import org.apache.syncope.server.provisioning.api.sync.ProvisioningResult;
+
+public interface UserProvisioningManager extends ProvisioningManager<UserTO, UserMod> {
+
+ Map.Entry<Long, List<PropagationStatus>> activate(User user, StatusMod statusMod);
+
+ Map.Entry<Long, List<PropagationStatus>> reactivate(User user, StatusMod statusMod);
+
+ Map.Entry<Long, List<PropagationStatus>> suspend(User user, StatusMod statusMod);
+
+ void innerSuspend(User user, boolean propagate);
+
+ Map.Entry<Long, List<PropagationStatus>> create(UserTO userTO, boolean storePassword);
+
+ Map.Entry<Long, List<PropagationStatus>> create(UserTO userTO, boolean storePassword,
+ boolean disablePwdPolicyCheck, Boolean enabled, Set<String> excludedResources);
+
+ Map.Entry<Long, List<PropagationStatus>> update(UserMod userMod, boolean removeMemberships);
+
+ Map.Entry<Long, List<PropagationStatus>> update(UserMod userMod, Long key,
+ ProvisioningResult result, Boolean enabled, Set<String> excludedResources);
+
+ List<PropagationStatus> delete(Long subjectKey, Set<String> excludedResources);
+
+ void requestPasswordReset(Long key);
+
+ void confirmPasswordReset(User user, String token, String password);
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/235f60fa/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/WorkflowResult.java
----------------------------------------------------------------------
diff --git a/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/WorkflowResult.java b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/WorkflowResult.java
new file mode 100644
index 0000000..aa4041c
--- /dev/null
+++ b/syncope620/server/provisioning-api/src/main/java/org/apache/syncope/server/provisioning/api/WorkflowResult.java
@@ -0,0 +1,87 @@
+/*
+ * 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.server.provisioning.api;
+
+import java.util.Collections;
+import java.util.Set;
+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.PropagationByResource;
+
+public class WorkflowResult<T> {
+
+ private T result;
+
+ private PropagationByResource propByRes;
+
+ private Set<String> performedTasks;
+
+ public WorkflowResult(final T result, final PropagationByResource propByRes, final String performedTask) {
+ this.result = result;
+ this.propByRes = propByRes;
+ this.performedTasks = Collections.singleton(performedTask);
+ }
+
+ public WorkflowResult(final T result, final PropagationByResource propByRes, final Set<String> performedTasks) {
+ this.result = result;
+ this.propByRes = propByRes;
+ this.performedTasks = performedTasks;
+ }
+
+ public T getResult() {
+ return result;
+ }
+
+ public void setResult(final T result) {
+ this.result = result;
+ }
+
+ public Set<String> getPerformedTasks() {
+ return performedTasks;
+ }
+
+ public void setPerformedTasks(final Set<String> performedTasks) {
+ this.performedTasks = performedTasks;
+ }
+
+ public PropagationByResource getPropByRes() {
+ return propByRes;
+ }
+
+ public void setPropByRes(final PropagationByResource propByRes) {
+ this.propByRes = propByRes;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return EqualsBuilder.reflectionEquals(this, obj);
+ }
+
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this);
+ }
+
+ @Override
+ public String toString() {
+ return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+ }
+}