http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java new file mode 100644 index 0000000..c042ec7 --- /dev/null +++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullActions.java @@ -0,0 +1,203 @@ +/* + * 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.pushpull; + +import org.apache.syncope.common.lib.patch.AnyPatch; +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 pull. + * All methods can throw {@link IgnoreProvisionException} to make the current any object ignored by the pull + * process. + */ +public interface PullActions extends ProvisioningActions { + + /** + * Action to be executed before to create a pulled user / group locally. + * User/group is created locally upon pull in case of the un-matching rule + * {@link org.apache.syncope.common.lib.types.UnmatchingRule#PROVISION} (default un-matching rule) is applied. + * + * @param <A> concrete any object + * @param profile profile of the pull being executed. + * @param delta retrieved pull information + * @param any any object + * @return pull information used for user status evaluation and to be passed to the 'after' method. + * @throws JobExecutionException in case of generic failure + */ + <A extends AnyTO> SyncDelta beforeProvision( + ProvisioningProfile<?, ?> profile, + SyncDelta delta, + A any) throws JobExecutionException; + + /** + * Action to be executed before creating (and linking to the resource) a pulled user / group locally. + * User/group is created locally and linked to the pulled resource upon pull in case of the + * un-matching rule {@link org.apache.syncope.common.lib.types.UnmatchingRule#ASSIGN} is applied. + * + * @param <A> concrete any object + * @param profile profile of the pull being executed. + * @param delta retrieved pull information + * @param any any object + * @return pull information used for user status evaluation and to be passed to the 'after' method. + * @throws JobExecutionException in case of generic failure + */ + <A extends AnyTO> SyncDelta beforeAssign( + ProvisioningProfile<?, ?> profile, + SyncDelta delta, + A any) throws JobExecutionException; + + /** + * Action to be executed before unlinking resource from the pulled user / group and de-provisioning. + * User/group is unlinked and de-provisioned from the pulled resource upon pull in case of the + * matching rule {@link org.apache.syncope.common.lib.types.MatchingRule#UNASSIGN} is applied. + * + * @param <A> concrete any object + * @param profile profile of the pull being executed. + * @param delta retrieved pull information + * @param any any object + * @return pull information used for user status evaluation and to be passed to the 'after' method. + * @throws JobExecutionException in case of generic failure + */ + <A extends AnyTO> SyncDelta beforeUnassign( + ProvisioningProfile<?, ?> profile, + SyncDelta delta, + A any) throws JobExecutionException; + + /** + * Action to be executed before de-provisioning action only. + * User/group is de-provisioned (without unlinking) from the pulled resource upon pull in case of + * the matching rule {@link org.apache.syncope.common.lib.types.MatchingRule#DEPROVISION} is applied. + * + * @param <A> concrete any object + * @param profile profile of the pull being executed. + * @param delta retrieved pull information + * @param any any object + * @return pull information used for user status evaluation and to be passed to the 'after' method. + * @throws JobExecutionException in case of generic failure + */ + <A extends AnyTO> SyncDelta beforeDeprovision( + ProvisioningProfile<?, ?> profile, + SyncDelta delta, + A any) throws JobExecutionException; + + /** + * Action to be executed before unlinking resource from the pulled user / group. + * User/group is unlinked (without de-provisioning) from the pulled resource upon pull in case of + * the matching rule {@link org.apache.syncope.common.lib.types.MatchingRule#UNLINK} is applied. + * + * @param <A> concrete any object + * @param profile profile of the pull being executed. + * @param delta retrieved pull information + * @param any any object + * @return pull information used for user status evaluation and to be passed to the 'after' method. + * @throws JobExecutionException in case of generic failure + */ + <A extends AnyTO> SyncDelta beforeUnlink( + ProvisioningProfile<?, ?> profile, + SyncDelta delta, + A any) throws JobExecutionException; + + /** + * Action to be executed before linking resource to the pulled user / group. + * User/group is linked (without updating) to the pulled resource upon pull in case of + * the matching rule {@link org.apache.syncope.common.lib.types.MatchingRule#LINK} is applied. + * + * @param <A> concrete any object + * @param profile profile of the pull being executed. + * @param delta retrieved pull information + * @param any any object + * @return pull information used for user status evaluation and to be passed to the 'after' method. + * @throws JobExecutionException in case of generic failure + */ + <A extends AnyTO> SyncDelta beforeLink( + ProvisioningProfile<?, ?> profile, + SyncDelta delta, + A any) throws JobExecutionException; + + /** + * Action to be executed before to update a pulled user / group locally. + * User/group is updated upon pull in case of the matching rule + * {@link org.apache.syncope.common.lib.types.MatchingRule#UPDATE} (default matching rule) is applied. + * + * @param <M> concrete any object + * @param <P> any object modifications + * @param profile profile of the pull being executed. + * @param delta retrieved pull information + * @param any any object + * @param anyPatch modification + * @return pull information used for logging and to be passed to the 'after' method. + * @throws JobExecutionException in case of generic failure. + */ + <M extends AnyTO, P extends AnyPatch> SyncDelta beforeUpdate( + ProvisioningProfile<?, ?> profile, + SyncDelta delta, + M any, + P anyPatch) + throws JobExecutionException; + + /** + * Action to be executed before to delete a pulled user / group locally. + * + * @param <A> concrete any object + * @param profile profile of the pull being executed. + * @param delta retrieved pull information + * @param any any object to be deleted + * @return pull information used for logging and to be passed to the 'after' method. + * @throws JobExecutionException in case of generic failure + */ + <A extends AnyTO> SyncDelta beforeDelete( + ProvisioningProfile<?, ?> profile, + SyncDelta delta, + A any) throws JobExecutionException; + + /** + * Action to be executed when user / group pull goes on error. + * + * @param profile profile of the pull being executed. + * @param delta retrieved pull information (may be modified by + * 'beforeProvision/beforeUpdate/beforeDelete') + * @param result global pull results at the current pull step + * @param error error being reported + * @throws JobExecutionException in case of generic failure + */ + void onError( + ProvisioningProfile<?, ?> profile, + SyncDelta delta, + ProvisioningReport result, + Exception error) throws JobExecutionException; + + /** + * Action to be executed after each local user / group pull. + * + * @param <A> concrete any object + * @param profile profile of the pull being executed. + * @param delta retrieved pull information (may be modified by beforeProvision / beforeUpdate / + * beforeDelete) + * @param any any object + * @param result global pull results at the current pull step + * @throws JobExecutionException in case of generic failure + */ + <A extends AnyTO> void after( + ProvisioningProfile<?, ?> profile, + SyncDelta delta, + A any, + ProvisioningReport result) throws JobExecutionException; +}
http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullCorrelationRule.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullCorrelationRule.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullCorrelationRule.java new file mode 100644 index 0000000..5d6d922 --- /dev/null +++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PullCorrelationRule.java @@ -0,0 +1,36 @@ +/* + * 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.pushpull; + +import org.apache.syncope.core.persistence.api.dao.search.SearchCond; +import org.identityconnectors.framework.common.objects.ConnectorObject; + +/** + * Interface for correlation rule to be evaluated during PullJob execution. + */ +public interface PullCorrelationRule { + + /** + * 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/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PushActions.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PushActions.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PushActions.java new file mode 100644 index 0000000..93180d4 --- /dev/null +++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/PushActions.java @@ -0,0 +1,163 @@ +/* + * 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.pushpull; + +import org.apache.syncope.core.persistence.api.entity.Any; +import org.quartz.JobExecutionException; + +/** + * Interface for actions to be performed during push. + * 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 any object to the resource. + * + * @param <A> concrete any object + * @param profile profile of the push being executed. + * @param any any object to be created. + * @return any. + * @throws JobExecutionException in case of generic failure + */ + <A extends Any<?>> A beforeAssign( + ProvisioningProfile<?, ?> profile, + A any) throws JobExecutionException; + + /** + * Action to be executed before to provision a synchronized any object to the resource. + * + * @param <A> concrete any object + * @param profile profile of the push being executed. + * @param any any object to be created. + * @return any. + * @throws JobExecutionException in case of generic failure + */ + <A extends Any<?>> A beforeProvision( + ProvisioningProfile<?, ?> profile, + A any) throws JobExecutionException; + + /** + * Action to be executed before to update a synchronized any object on the resource. + * + * @param <A> concrete any object + * @param profile profile of the push being executed. + * @param any any object to be updated. + * @return any. + * @throws JobExecutionException in case of generic failure + */ + <A extends Any<?>> A beforeUpdate( + ProvisioningProfile<?, ?> profile, + A any) throws JobExecutionException; + + /** + * Action to be executed before to link a synchronized any object to the resource. + * + * @param <A> concrete any object + * @param profile profile of the push being executed. + * @param any any object to be created. + * @return any. + * @throws JobExecutionException in case of generic failure + */ + <A extends Any<?>> A beforeLink( + ProvisioningProfile<?, ?> profile, + A any) throws JobExecutionException; + + /** + * Action to be executed before to unlink a synchronized any object from the resource. + * + * @param <A> concrete any object + * @param profile profile of the push being executed. + * @param any any object to be created. + * @return any. + * @throws JobExecutionException in case of generic failure + */ + <A extends Any<?>> A beforeUnlink( + ProvisioningProfile<?, ?> profile, + A any) throws JobExecutionException; + + /** + * Action to be executed before to unassign a synchronized any object from the resource. + * + * @param <A> concrete any object + * @param profile profile of the push being executed. + * @param any any object to be created. + * @return any. + * @throws JobExecutionException in case of generic failure + */ + <A extends Any<?>> A beforeUnassign( + ProvisioningProfile<?, ?> profile, + A any) throws JobExecutionException; + + /** + * Action to be executed before to unassign a synchronized any object from the resource. + * + * @param <A> concrete any object + * @param profile profile of the push being executed. + * @param any any object to be created. + * @return any. + * @throws JobExecutionException in case of generic failure + */ + <A extends Any<?>> A beforeDeprovision( + ProvisioningProfile<?, ?> profile, + A any) throws JobExecutionException; + + /** + * Action to be executed before delete a synchronized any object locally and from the resource. + * + * @param <A> concrete any object + * @param profile profile of the push being executed. + * @param any any object to be created. + * @return any. + * @throws JobExecutionException in case of generic failure + */ + <A extends Any<?>> A beforeDelete( + ProvisioningProfile<?, ?> profile, + A any) throws JobExecutionException; + + /** + * Action to be executed after any object push goes on error. + * + * @param <A> concrete any object + * @param profile profile of the push being executed. + * @param any synchronized any object. + * @param result operation result. + * @param error error being reported + * @throws JobExecutionException in case of generic failure + */ + <A extends Any<?>> void onError( + ProvisioningProfile<?, ?> profile, + A any, + ProvisioningReport result, + Exception error) throws JobExecutionException; + + /** + * Action to be executed after each local any object push. + * + * @param <A> concrete any object + * @param profile profile of the push being executed. + * @param any synchronized any object. + * @param result operation result. + * @throws JobExecutionException in case of generic failure + */ + <A extends Any<?>> void after( + ProvisioningProfile<?, ?> profile, + A any, + ProvisioningReport result) throws JobExecutionException; +} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/ReconciliationFilterBuilder.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/ReconciliationFilterBuilder.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/ReconciliationFilterBuilder.java new file mode 100644 index 0000000..579e5ca --- /dev/null +++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/ReconciliationFilterBuilder.java @@ -0,0 +1,30 @@ +/* + * 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.pushpull; + +import org.identityconnectors.framework.common.objects.filter.Filter; + +/** + * Interface to be implemented for performing filtered reconciliation of a + * {@link org.apache.syncope.core.persistence.api.entity.task.PullTask}. + */ +public interface ReconciliationFilterBuilder { + + Filter build(); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/SyncopePullResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/SyncopePullResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/SyncopePullResultHandler.java new file mode 100644 index 0000000..aa99468 --- /dev/null +++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/SyncopePullResultHandler.java @@ -0,0 +1,29 @@ +/* + * 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.pushpull; + +import org.identityconnectors.framework.common.objects.SyncDelta; +import org.identityconnectors.framework.common.objects.SyncResultsHandler; +import org.apache.syncope.core.persistence.api.entity.task.PullTask; + +public interface SyncopePullResultHandler extends SyncopeResultHandler<PullTask, PullActions>, SyncResultsHandler { + + @Override + boolean handle(SyncDelta delta); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/SyncopePushResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/SyncopePushResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/SyncopePushResultHandler.java new file mode 100644 index 0000000..8a32c53 --- /dev/null +++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/SyncopePushResultHandler.java @@ -0,0 +1,26 @@ +/* + * 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.pushpull; + +import org.apache.syncope.core.persistence.api.entity.task.PushTask; + +public interface SyncopePushResultHandler extends SyncopeResultHandler<PushTask, PushActions> { + + boolean handle(long anyKey); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/SyncopeResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/SyncopeResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/SyncopeResultHandler.java new file mode 100644 index 0000000..16d958f --- /dev/null +++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/SyncopeResultHandler.java @@ -0,0 +1,29 @@ +/* + * 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.pushpull; + +import org.apache.syncope.core.persistence.api.entity.task.ProvisioningTask; + +public interface SyncopeResultHandler<T extends ProvisioningTask, A extends ProvisioningActions> { + + ProvisioningProfile<T, A> getProfile(); + + void setProfile(ProvisioningProfile<T, A> profile); + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/UserPullResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/UserPullResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/UserPullResultHandler.java new file mode 100644 index 0000000..c86420a --- /dev/null +++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/UserPullResultHandler.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.pushpull; + +public interface UserPullResultHandler extends SyncopePullResultHandler { + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/UserPushResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/UserPushResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/UserPushResultHandler.java new file mode 100644 index 0000000..f96c0ef --- /dev/null +++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/UserPushResultHandler.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.pushpull; + +public interface UserPushResultHandler extends SyncopePushResultHandler { + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/AnyObjectPushResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/AnyObjectPushResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/AnyObjectPushResultHandler.java deleted file mode 100644 index 4198b53..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/AnyObjectPushResultHandler.java +++ /dev/null @@ -1,23 +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.syncpull; - -public interface AnyObjectPushResultHandler extends SyncopePushResultHandler { - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/AnyObjectSyncResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/AnyObjectSyncResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/AnyObjectSyncResultHandler.java deleted file mode 100644 index dba6377..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/AnyObjectSyncResultHandler.java +++ /dev/null @@ -1,23 +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.syncpull; - -public interface AnyObjectSyncResultHandler extends SyncopeSyncResultHandler { - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/GroupPushResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/GroupPushResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/GroupPushResultHandler.java deleted file mode 100644 index 457c78e..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/GroupPushResultHandler.java +++ /dev/null @@ -1,23 +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.syncpull; - -public interface GroupPushResultHandler extends SyncopePushResultHandler { - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/GroupSyncResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/GroupSyncResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/GroupSyncResultHandler.java deleted file mode 100644 index 19c8b8f..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/GroupSyncResultHandler.java +++ /dev/null @@ -1,26 +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.syncpull; - -import java.util.Map; - -public interface GroupSyncResultHandler extends SyncopeSyncResultHandler { - - Map<Long, String> getGroupOwnerMap(); -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/IgnoreProvisionException.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/IgnoreProvisionException.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/IgnoreProvisionException.java deleted file mode 100644 index cdd885a..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/IgnoreProvisionException.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.core.provisioning.api.syncpull; - -/** - * 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 { - - private static final long serialVersionUID = -8803817097998786364L; - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ProvisioningActions.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ProvisioningActions.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ProvisioningActions.java deleted file mode 100644 index 7479c96..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ProvisioningActions.java +++ /dev/null @@ -1,40 +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.syncpull; - -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 ProvisioningProfile<?, ?> profile) throws JobExecutionException; - - /** - * Action to be executed after the synchronization task completion. - * - * @param profile sync profile - * @throws JobExecutionException in case of generic failure - */ - void afterAll(final ProvisioningProfile<?, ?> profile) throws JobExecutionException; -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ProvisioningProfile.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ProvisioningProfile.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ProvisioningProfile.java deleted file mode 100644 index 08ab034..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ProvisioningProfile.java +++ /dev/null @@ -1,81 +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.syncpull; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.apache.syncope.common.lib.types.ConflictResolutionAction; -import org.apache.syncope.core.persistence.api.entity.task.ProvisioningTask; -import org.apache.syncope.core.provisioning.api.Connector; - -public class ProvisioningProfile<T extends ProvisioningTask, A extends ProvisioningActions> { - - /** - * Syncing connector. - */ - private final Connector connector; - - private final T task; - - private final List<ProvisioningReport> results = new ArrayList<>(); - - private boolean dryRun; - - private ConflictResolutionAction resAct; - - private final List<A> actions = new ArrayList<>(); - - public ProvisioningProfile(final Connector connector, final T task) { - this.connector = connector; - this.task = task; - } - - public Connector getConnector() { - return connector; - } - - public T getTask() { - return task; - } - - public Collection<ProvisioningReport> 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; - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ProvisioningReport.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ProvisioningReport.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ProvisioningReport.java deleted file mode 100644 index 1e82796d..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ProvisioningReport.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.core.provisioning.api.syncpull; - -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.ResourceOperation; -import org.apache.syncope.common.lib.types.TraceLevel; - -public class ProvisioningReport { - - public enum Status { - - SUCCESS, - IGNORE, - FAILURE - - } - - private String message; - - private Status status; - - private String anyType; - - private ResourceOperation operation; - - private Long key; - - 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 getKey() { - return key; - } - - public void setKey(final Long key) { - this.key = key; - } - - public Status getStatus() { - return status; - } - - public void setStatus(final Status status) { - this.status = status; - } - - public String getAnyType() { - return anyType; - } - - public void setAnyType(final String anyType) { - this.anyType = anyType; - } - - 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, key, name, message); - } else { - // All - return String.format("%s %s (id/name): %d/%s %s", operation, status, key, 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<ProvisioningReport> results, final TraceLevel level) { - StringBuilder sb = new StringBuilder(); - for (ProvisioningReport result : results) { - sb.append(result.getReportString(level)).append('\n'); - } - return sb.toString(); - } -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/PushActions.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/PushActions.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/PushActions.java deleted file mode 100644 index 75e5a5f..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/PushActions.java +++ /dev/null @@ -1,163 +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.syncpull; - -import org.apache.syncope.core.persistence.api.entity.Any; -import org.quartz.JobExecutionException; - -/** - * Interface for actions to be performed during push. - * 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 any object to the resource. - * - * @param <A> concrete any object - * @param profile profile of the push being executed. - * @param any any object to be created. - * @return any. - * @throws JobExecutionException in case of generic failure - */ - <A extends Any<?>> A beforeAssign( - ProvisioningProfile<?, ?> profile, - A any) throws JobExecutionException; - - /** - * Action to be executed before to provision a synchronized any object to the resource. - * - * @param <A> concrete any object - * @param profile profile of the push being executed. - * @param any any object to be created. - * @return any. - * @throws JobExecutionException in case of generic failure - */ - <A extends Any<?>> A beforeProvision( - ProvisioningProfile<?, ?> profile, - A any) throws JobExecutionException; - - /** - * Action to be executed before to update a synchronized any object on the resource. - * - * @param <A> concrete any object - * @param profile profile of the push being executed. - * @param any any object to be updated. - * @return any. - * @throws JobExecutionException in case of generic failure - */ - <A extends Any<?>> A beforeUpdate( - ProvisioningProfile<?, ?> profile, - A any) throws JobExecutionException; - - /** - * Action to be executed before to link a synchronized any object to the resource. - * - * @param <A> concrete any object - * @param profile profile of the push being executed. - * @param any any object to be created. - * @return any. - * @throws JobExecutionException in case of generic failure - */ - <A extends Any<?>> A beforeLink( - ProvisioningProfile<?, ?> profile, - A any) throws JobExecutionException; - - /** - * Action to be executed before to unlink a synchronized any object from the resource. - * - * @param <A> concrete any object - * @param profile profile of the push being executed. - * @param any any object to be created. - * @return any. - * @throws JobExecutionException in case of generic failure - */ - <A extends Any<?>> A beforeUnlink( - ProvisioningProfile<?, ?> profile, - A any) throws JobExecutionException; - - /** - * Action to be executed before to unassign a synchronized any object from the resource. - * - * @param <A> concrete any object - * @param profile profile of the push being executed. - * @param any any object to be created. - * @return any. - * @throws JobExecutionException in case of generic failure - */ - <A extends Any<?>> A beforeUnassign( - ProvisioningProfile<?, ?> profile, - A any) throws JobExecutionException; - - /** - * Action to be executed before to unassign a synchronized any object from the resource. - * - * @param <A> concrete any object - * @param profile profile of the push being executed. - * @param any any object to be created. - * @return any. - * @throws JobExecutionException in case of generic failure - */ - <A extends Any<?>> A beforeDeprovision( - ProvisioningProfile<?, ?> profile, - A any) throws JobExecutionException; - - /** - * Action to be executed before delete a synchronized any object locally and from the resource. - * - * @param <A> concrete any object - * @param profile profile of the push being executed. - * @param any any object to be created. - * @return any. - * @throws JobExecutionException in case of generic failure - */ - <A extends Any<?>> A beforeDelete( - ProvisioningProfile<?, ?> profile, - A any) throws JobExecutionException; - - /** - * Action to be executed after any object push goes on error. - * - * @param <A> concrete any object - * @param profile profile of the push being executed. - * @param any synchronized any object. - * @param result operation result. - * @param error error being reported - * @throws JobExecutionException in case of generic failure - */ - <A extends Any<?>> void onError( - ProvisioningProfile<?, ?> profile, - A any, - ProvisioningReport result, - Exception error) throws JobExecutionException; - - /** - * Action to be executed after each local any object push. - * - * @param <A> concrete any object - * @param profile profile of the push being executed. - * @param any synchronized any object. - * @param result operation result. - * @throws JobExecutionException in case of generic failure - */ - <A extends Any<?>> void after( - ProvisioningProfile<?, ?> profile, - A any, - ProvisioningReport result) throws JobExecutionException; -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ReconciliationFilterBuilder.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ReconciliationFilterBuilder.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ReconciliationFilterBuilder.java deleted file mode 100644 index cc073ce..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/ReconciliationFilterBuilder.java +++ /dev/null @@ -1,30 +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.syncpull; - -import org.identityconnectors.framework.common.objects.filter.Filter; - -/** - * Interface to be implemented for performing filtered reconciliation of a - * {@link org.apache.syncope.core.persistence.api.entity.task.SyncTask}. - */ -public interface ReconciliationFilterBuilder { - - Filter build(); -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncActions.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncActions.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncActions.java deleted file mode 100644 index ae072b7..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncActions.java +++ /dev/null @@ -1,203 +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.syncpull; - -import org.apache.syncope.common.lib.patch.AnyPatch; -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 synchronization. - * All methods can throw {@link IgnoreProvisionException} to make the current any object ignored by the synchronization - * process. - */ -public interface SyncActions extends ProvisioningActions { - - /** - * Action to be executed before to create a synchronized user / group locally. - * User/group is created locally upon synchronization in case of the un-matching rule - * {@link org.apache.syncope.common.lib.types.UnmatchingRule#PROVISION} (default un-matching rule) is applied. - * - * @param <A> concrete any object - * @param profile profile of the synchronization being executed. - * @param delta retrieved synchronization information - * @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 - */ - <A extends AnyTO> SyncDelta beforeProvision( - ProvisioningProfile<?, ?> profile, - SyncDelta delta, - A any) throws JobExecutionException; - - /** - * Action to be executed before creating (and linking to the resource) a synchronized user / group locally. - * User/group is created locally and linked to the synchronized resource upon synchronization in case of the - * un-matching rule {@link org.apache.syncope.common.lib.types.UnmatchingRule#ASSIGN} is applied. - * - * @param <A> concrete any object - * @param profile profile of the synchronization being executed. - * @param delta retrieved synchronization information - * @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 - */ - <A extends AnyTO> SyncDelta beforeAssign( - ProvisioningProfile<?, ?> profile, - SyncDelta delta, - A any) throws JobExecutionException; - - /** - * Action to be executed before unlinking resource from the synchronized user / group and de-provisioning. - * User/group is unlinked and de-provisioned from the synchronized resource upon synchronization in case of the - * matching rule {@link org.apache.syncope.common.lib.types.MatchingRule#UNASSIGN} is applied. - * - * @param <A> concrete any object - * @param profile profile of the synchronization being executed. - * @param delta retrieved synchronization information - * @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 - */ - <A extends AnyTO> SyncDelta beforeUnassign( - ProvisioningProfile<?, ?> profile, - SyncDelta delta, - A any) throws JobExecutionException; - - /** - * Action to be executed before de-provisioning action only. - * User/group is de-provisioned (without unlinking) from the synchronized resource upon synchronization in case of - * the matching rule {@link org.apache.syncope.common.lib.types.MatchingRule#DEPROVISION} is applied. - * - * @param <A> concrete any object - * @param profile profile of the synchronization being executed. - * @param delta retrieved synchronization information - * @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 - */ - <A extends AnyTO> SyncDelta beforeDeprovision( - ProvisioningProfile<?, ?> profile, - SyncDelta delta, - A any) throws JobExecutionException; - - /** - * Action to be executed before unlinking resource from the synchronized user / group. - * User/group is unlinked (without de-provisioning) from the synchronized resource upon synchronization in case of - * the matching rule {@link org.apache.syncope.common.lib.types.MatchingRule#UNLINK} is applied. - * - * @param <A> concrete any object - * @param profile profile of the synchronization being executed. - * @param delta retrieved synchronization information - * @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 - */ - <A extends AnyTO> SyncDelta beforeUnlink( - ProvisioningProfile<?, ?> profile, - SyncDelta delta, - A any) throws JobExecutionException; - - /** - * Action to be executed before linking resource to the synchronized user / group. - * User/group is linked (without updating) to the synchronized resource upon synchronization in case of - * the matching rule {@link org.apache.syncope.common.lib.types.MatchingRule#LINK} is applied. - * - * @param <A> concrete any object - * @param profile profile of the synchronization being executed. - * @param delta retrieved synchronization information - * @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 - */ - <A extends AnyTO> SyncDelta beforeLink( - ProvisioningProfile<?, ?> profile, - SyncDelta delta, - A any) throws JobExecutionException; - - /** - * Action to be executed before to update a synchronized user / group locally. - * User/group is updated upon synchronization in case of the matching rule - * {@link org.apache.syncope.common.lib.types.MatchingRule#UPDATE} (default matching rule) is applied. - * - * @param <M> concrete any object - * @param <P> any object modifications - * @param profile profile of the synchronization being executed. - * @param delta retrieved synchronization information - * @param any any object - * @param anyPatch modification - * @return synchronization information used for logging and to be passed to the 'after' method. - * @throws JobExecutionException in case of generic failure. - */ - <M extends AnyTO, P extends AnyPatch> SyncDelta beforeUpdate( - ProvisioningProfile<?, ?> profile, - SyncDelta delta, - M any, - P anyPatch) - throws JobExecutionException; - - /** - * Action to be executed before to delete a synchronized user / group locally. - * - * @param <A> concrete any object - * @param profile profile of the synchronization being executed. - * @param delta retrieved synchronization information - * @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 - */ - <A extends AnyTO> SyncDelta beforeDelete( - ProvisioningProfile<?, ?> profile, - SyncDelta delta, - A any) throws JobExecutionException; - - /** - * Action to be executed when user / group synchronization goes on error. - * - * @param profile profile of the synchronization being executed. - * @param delta retrieved synchronization information (may be modified by - * 'beforeProvision/beforeUpdate/beforeDelete') - * @param result global synchronization results at the current synchronization step - * @param error error being reported - * @throws JobExecutionException in case of generic failure - */ - void onError( - ProvisioningProfile<?, ?> profile, - SyncDelta delta, - ProvisioningReport result, - Exception error) throws JobExecutionException; - - /** - * Action to be executed after each local user / group synchronization. - * - * @param <A> concrete any object - * @param profile profile of the synchronization being executed. - * @param delta retrieved synchronization information (may be modified by beforeProvision / beforeUpdate / - * beforeDelete) - * @param any any object - * @param result global synchronization results at the current synchronization step - * @throws JobExecutionException in case of generic failure - */ - <A extends AnyTO> void after( - ProvisioningProfile<?, ?> profile, - SyncDelta delta, - A any, - ProvisioningReport result) throws JobExecutionException; -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncCorrelationRule.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncCorrelationRule.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncCorrelationRule.java deleted file mode 100644 index dff841a..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/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.core.provisioning.api.syncpull; - -import org.apache.syncope.core.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/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncopePushResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncopePushResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncopePushResultHandler.java deleted file mode 100644 index deb6e9b..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncopePushResultHandler.java +++ /dev/null @@ -1,26 +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.syncpull; - -import org.apache.syncope.core.persistence.api.entity.task.PushTask; - -public interface SyncopePushResultHandler extends SyncopeResultHandler<PushTask, PushActions> { - - boolean handle(long anyKey); -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncopeResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncopeResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncopeResultHandler.java deleted file mode 100644 index c078ef2..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/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.core.provisioning.api.syncpull; - -import org.apache.syncope.core.persistence.api.entity.task.ProvisioningTask; - -public interface SyncopeResultHandler<T extends ProvisioningTask, A extends ProvisioningActions> { - - ProvisioningProfile<T, A> getProfile(); - - void setProfile(ProvisioningProfile<T, A> profile); - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncopeSyncResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncopeSyncResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncopeSyncResultHandler.java deleted file mode 100644 index 5c293830..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/SyncopeSyncResultHandler.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.core.provisioning.api.syncpull; - -import org.apache.syncope.core.persistence.api.entity.task.SyncTask; -import org.identityconnectors.framework.common.objects.SyncDelta; -import org.identityconnectors.framework.common.objects.SyncResultsHandler; - -public interface SyncopeSyncResultHandler extends SyncopeResultHandler<SyncTask, SyncActions>, SyncResultsHandler { - - @Override - boolean handle(SyncDelta delta); -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/UserPushResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/UserPushResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/UserPushResultHandler.java deleted file mode 100644 index 8a0459a..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/UserPushResultHandler.java +++ /dev/null @@ -1,23 +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.syncpull; - -public interface UserPushResultHandler extends SyncopePushResultHandler { - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/UserSyncResultHandler.java ---------------------------------------------------------------------- diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/UserSyncResultHandler.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/UserSyncResultHandler.java deleted file mode 100644 index 7f9c827..0000000 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/syncpull/UserSyncResultHandler.java +++ /dev/null @@ -1,23 +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.syncpull; - -public interface UserSyncResultHandler extends SyncopeSyncResultHandler { - -} http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/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 4e7f9e9..438d97f 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 @@ -38,7 +38,7 @@ import org.apache.syncope.core.provisioning.api.TimeoutException; import org.apache.syncope.core.spring.ApplicationContextProvider; import org.apache.syncope.core.persistence.api.dao.search.OrderByClause; import org.apache.syncope.core.persistence.api.entity.resource.MappingItem; -import org.apache.syncope.core.provisioning.api.syncpull.ReconciliationFilterBuilder; +import org.apache.syncope.core.provisioning.api.pushpull.ReconciliationFilterBuilder; import org.identityconnectors.common.security.GuardedByteArray; import org.identityconnectors.common.security.GuardedString; import org.identityconnectors.framework.api.APIConfiguration; http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/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 cd3fc5c..8abf123 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 @@ -49,7 +49,7 @@ import org.apache.syncope.core.provisioning.api.propagation.PropagationReporter; import org.apache.syncope.core.provisioning.api.propagation.PropagationTaskExecutor; import org.apache.syncope.core.spring.ApplicationContextProvider; import org.apache.syncope.core.provisioning.api.VirAttrHandler; -import org.apache.syncope.core.provisioning.api.syncpull.ProvisioningReport; +import org.apache.syncope.core.provisioning.api.pushpull.ProvisioningReport; import org.apache.syncope.core.workflow.api.UserWorkflowAdapter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -150,11 +150,11 @@ public class DefaultUserProvisioningManager implements UserProvisioningManager { try { updated = uwfAdapter.update(userPatch); } catch (Exception e) { - LOG.error("Update of user {} failed, trying to sync its status anyway (if configured)", + LOG.error("Update of user {} failed, trying to pull its status anyway (if configured)", userPatch.getKey(), e); result.setStatus(ProvisioningReport.Status.FAILURE); - result.setMessage("Update failed, trying to sync status anyway (if configured)\n" + e.getMessage()); + result.setMessage("Update failed, trying to pull status anyway (if configured)\n" + e.getMessage()); updated = new WorkflowResult<Pair<UserPatch, Boolean>>( new ImmutablePair<>(userPatch, false), new PropagationByResource(), http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java ---------------------------------------------------------------------- diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java index 7c97448..a5cd9d6 100644 --- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java +++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/MappingManagerImpl.java @@ -151,7 +151,7 @@ public class MappingManagerImpl implements MappingManager { List<MappingItem> result = new ArrayList<>(); switch (purpose) { - case SYNCHRONIZATION: + case PULL: for (MappingItem item : items) { if (MappingPurpose.PROPAGATION != item.getPurpose() && MappingPurpose.NONE != item.getPurpose()) { @@ -163,7 +163,7 @@ public class MappingManagerImpl implements MappingManager { case PROPAGATION: for (MappingItem item : items) { - if (MappingPurpose.SYNCHRONIZATION != item.getPurpose() + if (MappingPurpose.PULL != item.getPurpose() && MappingPurpose.NONE != item.getPurpose()) { result.add(item); @@ -201,8 +201,8 @@ public class MappingManagerImpl implements MappingManager { return getMappingItems(provision, MappingPurpose.PROPAGATION); } - public static List<MappingItem> getSyncMappingItems(final Provision provision) { - return getMappingItems(provision, MappingPurpose.SYNCHRONIZATION); + public static List<MappingItem> getPullMappingItems(final Provision provision) { + return getMappingItems(provision, MappingPurpose.PULL); } /** @@ -728,7 +728,7 @@ public class MappingManagerImpl implements MappingManager { if (attr != null) { values = attr.getValue(); for (MappingItemTransformer transformer : getMappingItemTransformers(mappingItem)) { - values = transformer.beforeSync(values); + values = transformer.beforePull(values); } } values = ListUtils.emptyIfNull(values); http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/DefaultMappingItemTransformer.java ---------------------------------------------------------------------- diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/DefaultMappingItemTransformer.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/DefaultMappingItemTransformer.java index 3810a87..70cd1d0 100644 --- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/DefaultMappingItemTransformer.java +++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/DefaultMappingItemTransformer.java @@ -33,7 +33,7 @@ public class DefaultMappingItemTransformer implements MappingItemTransformer { } @Override - public List<Object> beforeSync(final List<Object> values) { + public List<Object> beforePull(final List<Object> values) { return values; } http://git-wip-us.apache.org/repos/asf/syncope/blob/61a7fdd3/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java ---------------------------------------------------------------------- diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java index f2074f8..92149c3 100644 --- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java +++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java @@ -27,7 +27,7 @@ import org.apache.syncope.common.lib.policy.AccountPolicyTO; import org.apache.syncope.common.lib.policy.AccountRuleConf; import org.apache.syncope.common.lib.policy.PasswordPolicyTO; import org.apache.syncope.common.lib.policy.PasswordRuleConf; -import org.apache.syncope.common.lib.policy.SyncPolicyTO; +import org.apache.syncope.common.lib.policy.PullPolicyTO; import org.apache.syncope.common.lib.types.ClientExceptionType; import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO; import org.apache.syncope.core.persistence.api.dao.RealmDAO; @@ -37,11 +37,11 @@ import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource; import org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy; import org.apache.syncope.core.persistence.api.entity.Policy; import org.apache.syncope.core.persistence.api.entity.Realm; -import org.apache.syncope.core.persistence.api.entity.policy.SyncPolicy; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.apache.syncope.core.persistence.api.entity.policy.PullPolicy; @Component public class PolicyDataBinderImpl implements PolicyDataBinder { @@ -92,10 +92,10 @@ public class PolicyDataBinderImpl implements PolicyDataBinder { accountPolicyTO.getResources().addAll(accountPolicy.getResourceNames()); break; - case SYNC: + case PULL: default: - policyTO = (T) new SyncPolicyTO(); - ((SyncPolicyTO) policyTO).setSpecification(((SyncPolicy) policy).getSpecification()); + policyTO = (T) new PullPolicyTO(); + ((PullPolicyTO) policyTO).setSpecification(((PullPolicy) policy).getSpecification()); } policyTO.setKey(policy.getKey()); @@ -172,16 +172,16 @@ public class PolicyDataBinderImpl implements PolicyDataBinder { } break; - case SYNC: + case PULL: default: - if (!(policyTO instanceof SyncPolicyTO)) { - throw new ClassCastException("Expected " + SyncPolicyTO.class.getName() + if (!(policyTO instanceof PullPolicyTO)) { + throw new ClassCastException("Expected " + PullPolicyTO.class.getName() + ", found " + policyTO.getClass().getName()); } if (result == null) { - result = (T) entityFactory.newEntity(SyncPolicy.class); + result = (T) entityFactory.newEntity(PullPolicy.class); } - ((SyncPolicy) result).setSpecification(((SyncPolicyTO) policyTO).getSpecification()); + ((PullPolicy) result).setSpecification(((PullPolicyTO) policyTO).getSpecification()); } result.setDescription(policyTO.getDescription());
