KickJava   Java API By Example, From Geeks To Geeks.

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


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.*;
21 import sync4j.framework.security.Sync4jPrincipal;
22 import sync4j.framework.engine.SyncEngine;
23 import sync4j.framework.engine.SyncStrategy;
24
25
26 /**
27  * Abstract base implementation of <i>SyncEngine</i>. <br>
28  * Subclasses must at least redefine the following methods:
29  * <ul>
30  * <li><i>sync()</i>
31  * <li><i>getModifiedSources()</i>
32  * <li><i>addModifiedSource()</i>
33  * </ul>
34  *
35  * @author Stefano Fornari @ Funambol
36  * @version $Id: AbstractSyncEngine.java,v 1.10 2005/03/02 20:57:37 harrie Exp $
37  *
38  */

39 public abstract class AbstractSyncEngine
40 implements SyncEngine, java.io.Serializable JavaDoc {
41     /**
42      * The underlying strategy.
43      */

44     private SyncStrategy strategy = null;
45     
46     /**
47      * Get the underlying strategy
48      *
49      * @return the underlying strategy
50      */

51     public SyncStrategy getStrategy() {
52         return this.strategy;
53     }
54     
55     /**
56      * Set the synchronization strategy to be used
57      */

58     public void setStrategy(SyncStrategy strategy) {
59         this.strategy = strategy;
60     }
61     
62     /**
63      * @see sync4j.framework.engine.SyncEngine
64      */

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