KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > engine > SyncEngine


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package sync4j.framework.engine;
19
20 import sync4j.framework.core.Sync4jException;
21 import sync4j.framework.security.Sync4jPrincipal;
22 import sync4j.framework.engine.SyncStrategy;
23
24 /**
25  * A synchronization engine represents a mechanism used to drive the syncrhonization
26  * process.
27  * <i>SyncEngine</i> represents the Context partecipant of the Strategy pattern.<br>
28  * It is a sort of factory and manager for the starategy object referenced by
29  * the property <i>strategy</i> (that implementing classes must provide).<p>
30  * <i>SyncEngine</i> concentrate all the implementation specific information
31  * regarding strategies, sources, databases, services, etc. It is the point of
32  * contact between the synchronization, protocol and server services.
33  * <p>
34  * When a synchronization process must take place, the <i>SyncEngine</i> will
35  * pass the control to the configured strategy, which has the responsability of
36  * query item sources in order to define which synchronization operations are
37  * required. Then the synchronization operations are applied to the sources.
38  *
39  * @see SyncStrategy
40  *
41  * @author Stefano Fornari @ Funambol
42  *
43  * @version $Id: SyncEngine.java,v 1.9 2005/03/02 20:57:37 harrie Exp $
44  */

45 public interface SyncEngine {
46     
47     /**
48      * Get the underlying strategy
49      *
50      * @return the underlying strategy
51      */

52     public SyncStrategy getStrategy();
53     
54     /**
55      * Set the synchronization strategy to be used
56      */

57     public void setStrategy(SyncStrategy strategy);
58     
59     /**
60      * Fires and manages the synchronization process.
61      *
62      * @throws Sync4jException in case of error
63      */

64     public void sync(Sync4jPrincipal principal) throws Sync4jException;
65 }
66
Popular Tags