syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Syncope > SyncActionsClass
Date Tue, 23 Oct 2012 11:36:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/3/_/styles/combined.css?spaceKey=SYNCOPE&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/SYNCOPE/SyncActionsClass">SyncActionsClass</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://cwiki.apache.org/confluence/display/~ilgrosso">Francesco
Chicchiricco</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h1><a name="SyncActionsClass-Introduction"></a>Introduction</h1>
<p>A synchronization action class is a Java class that implements some specific actions
to be performed before and after synchronization.</p>

<h1><a name="SyncActionsClass-Implementation"></a>Implementation</h1>
<p>A synchronization action class is a Java implementation of the <em>SyncActions</em>
interface provided below.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
/**
 * Interface <span class="code-keyword">for</span> actions to be performed during
SyncJob execution.
 */
<span class="code-keyword">public</span> <span class="code-keyword">interface</span>
SyncActions {

    /**
     * Action to be executed before to start the synchronization task execution.
     *
     * @param task synchronization task to be executed.
     * @<span class="code-keyword">throws</span> JobExecutionException in <span
class="code-keyword">case</span> of <span class="code-keyword">generic</span>
failure.
     */
    void beforeAll(<span class="code-keyword">final</span> SyncTask task) <span
class="code-keyword">throws</span> JobExecutionException;

    /**
     * Action to be executed before to create a <span class="code-keyword">synchronized</span>
user locally.
     *
     * @param delta retrieved synchronization information.
     * @param user user to be created.
     * @<span class="code-keyword">return</span> synchronization information used
<span class="code-keyword">for</span> user status evaluation and to be passed
to the 'after' method.
     * @<span class="code-keyword">throws</span> JobExecutionException in <span
class="code-keyword">case</span> of <span class="code-keyword">generic</span>
failure.
     */
    SyncDelta beforeCreate(<span class="code-keyword">final</span> SyncDelta delta,
<span class="code-keyword">final</span> UserTO user) <span class="code-keyword">throws</span>
JobExecutionException;

    /**
     * Action to be executed before to update a <span class="code-keyword">synchronized</span>
user locally.
     *
     * @param delta retrieved synchronization information.
     * @param user local user information.
     * @param userMod modification.
     * @<span class="code-keyword">return</span> synchronization information used
<span class="code-keyword">for</span> logging and to be passed to the 'after'
method.
     * @<span class="code-keyword">throws</span> JobExecutionException in <span
class="code-keyword">case</span> of <span class="code-keyword">generic</span>
failure.
     */
    SyncDelta beforeUpdate(<span class="code-keyword">final</span> SyncDelta delta,
<span class="code-keyword">final</span> UserTO user, <span class="code-keyword">final</span>
UserMod userMod)
            <span class="code-keyword">throws</span> JobExecutionException;

    /**
     * Action to be executed before to delete a <span class="code-keyword">synchronized</span>
user locally.
     *
     * @param delta retrieved synchronization information.
     * @param userlocal user to be deleted.
     * @<span class="code-keyword">return</span> synchronization information used
<span class="code-keyword">for</span> logging and to be passed to the 'after'
method.
     * @<span class="code-keyword">throws</span> JobExecutionException in <span
class="code-keyword">case</span> of <span class="code-keyword">generic</span>
failure.
     */
    SyncDelta beforeDelete(<span class="code-keyword">final</span> SyncDelta delta,
<span class="code-keyword">final</span> UserTO user) <span class="code-keyword">throws</span>
JobExecutionException;

    /**
     * Action to be executed after each local user synchronization.
     *
     * @param delta retrieved synchronization information (may be modified by 'beforeCreate/beforeUpdate/beforeDelete').
     * @param user <span class="code-keyword">synchronized</span> local user.
     * @param result global synchronization results at the current synchronization step.
     * @<span class="code-keyword">throws</span> JobExecutionException in <span
class="code-keyword">case</span> of <span class="code-keyword">generic</span>
failure.
     */
    void after(<span class="code-keyword">final</span> SyncDelta delta, <span
class="code-keyword">final</span> UserTO user, <span class="code-keyword">final</span>
SyncResult result) <span class="code-keyword">throws</span> JobExecutionException;

    /**
     * Action to be executed after the synchronization task completion.
     *
     * @param task executed synchronization task.
     * @param results synchronization result.
     * @<span class="code-keyword">throws</span> JobExecutionException in <span
class="code-keyword">case</span> of <span class="code-keyword">generic</span>
failure.
     */
    void afterAll(<span class="code-keyword">final</span> SyncTask task, <span
class="code-keyword">final</span> List&lt;SyncResult&gt; results) <span
class="code-keyword">throws</span> JobExecutionException;
}
</pre>
</div></div>

<p>If a <em>Synchronization Actions Class</em> has been specified for a
certain <a href="/confluence/display/SYNCOPE/Tasks#Tasks-SynchronizationTask">Synchronization
Task</a>, <em>SyncActions</em>'s implemented methods will be executed during
synchronization:</p>

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



<h1><a name="SyncActionsClass-Deploy"></a>Deploy</h1>
<p>A synchronization actions class can be deployed:</p>

<ul>
	<li>at project definition time
	<ul>
		<li>by adding own implementation into the <a href="/confluence/display/SYNCOPE/Create+a+new+Syncope+project#CreateanewSyncopeproject-Createnewproject">overlay
project</a>, before to build Syncope.</li>
	</ul>
	</li>
	<li>at run-time
	<ul>
		<li>by adding into the container classpath own implementation (container needs to
be re-started).</li>
	</ul>
	</li>
</ul>

    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>
       <a href="https://cwiki.apache.org/confluence/display/SYNCOPE/SyncActionsClass">View
Online</a>
              |
       <a href="https://cwiki.apache.org/confluence/display/SYNCOPE/SyncActionsClass?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message