You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Version warning

Content of this page applies to Apache Syncope Espressivo (1.0.X)
Not your version? Check the updated page.

Introduction

A synchronization action class is a Java class that implements some specific actions to be performed before and after synchronization.

Implementation

A synchronization action class is a Java implementation of the SyncJobActions interface provided below.

package org.apache.syncope.core.scheduling;

import java.util.List;
import org.identityconnectors.framework.common.objects.SyncDelta;
import org.quartz.JobExecutionException;
import org.apache.syncope.client.mod.UserMod;
import org.apache.syncope.client.to.UserTO;

/**
 * Interface for actions to be performed during SyncJob execution.
 */
public interface SyncJobActions {

    void beforeAll(List<SyncDelta> deltas)
            throws JobExecutionException;

    void beforeCreate(SyncDelta delta, UserTO user)
            throws JobExecutionException;

    void beforeUpdate(SyncDelta delta, UserTO user, UserMod userMod)
            throws JobExecutionException;

    void beforeDelete(SyncDelta delta, UserTO user)
            throws JobExecutionException;

    void after(SyncDelta delta, UserTO user, SyncResult result)
            throws JobExecutionException;

    void afterAll(List<SyncDelta> deltas, List<SyncResult> results)
            throws JobExecutionException;
}

If a Synchronization Actions Class has been specified for a certain Synchronization Task, SyncJobActions's implemented methods will be executed during synchronization:

  • beforeAll(...) will be executed before to start synchronization;
  • beforeCreate(...) will be executed before each local create of a new user retrieved during synchronization;
  • beforeUpdate(...) will be executed before each local update of an existing user retrieved during synchronization;
  • beforeDelete(...) will be executed before each local delete of a user removed from synchronized external resource;
  • after(...) will be executed after each single user synchronization;
  • afterAll(...) will be executed after synchronization process completion.

Deploy

A synchronization actions class can be deployed:

  • at project definition time
    • by adding own implementation into the overlay project, before to build Syncope.
  • at run-time
    • by adding into the container classpath own implementation (container must be re-started to reload the classpath).
  • No labels