KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.security.Principal JavaDoc;
21
22 import sync4j.framework.engine.SyncItem;
23
24 /**
25  * This interface represents a synchronization operation between two items.
26  * The possible operations are:
27  * <ul>
28  * <li>create
29  * <li>update
30  * <li>delete
31  * </ul>
32  *
33  * @author Stefano Fornari @ Funambol
34  *
35  * @version $Id: SyncOperation.java,v 1.11 2005/03/02 20:57:37 harrie Exp $
36  */

37 public interface SyncOperation {
38     
39     public static final char NEW = 'N';
40     public static final char DELETE = 'D';
41     public static final char UPDATE = 'U';
42     public static final char CONFLICT = 'O';
43     public static final char ACCEPT_CHUNK = 'A';
44     public static final char NOP = '-';
45     
46     public SyncItem getSyncItemA();
47     public void setSyncItemA(SyncItem syncItemA);
48     
49     public SyncItem getSyncItemB();
50     public void setSyncItemB(SyncItem syncItemB);
51     
52     /**
53      * Does the operation apply to the client source
54      *
55      * @return true if the operation applies to the client source or false otherwise.
56      */

57     public boolean isAOperation();
58     public void setAOperation(boolean a);
59     
60     /**
61      * Does the operation apply to the server source*
62      *
63      * @return true if the operation applies to the server source or false otherwise.
64      */

65     public boolean isBOperation();
66     public void setBOperation(boolean b);
67     
68     public char getOperation();
69     
70     /**
71      * The principal that requested this operation.
72      *
73      * @return the principal that requested this operation. It may be null.
74      */

75     public Principal JavaDoc getOwner();
76 }
Popular Tags