Element.java

00001 /*
00002  * OpenMobileIS - a free Java(TM) Framework for mobile applications Java(TM)
00003  * Copyright (C) 2004-2006 Philippe Delrieu
00004  * All rights reserved.
00005  * Contact: pdelrieu@openmobileis.org
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00020  * USA
00021  *
00022  *  Author : Philippe Delrieu
00023  * 
00024  */
00025 
00026 package org.openmobileis.synchro.openmsp.protocol;
00027 
00028 import org.openmobileis.common.util.OpenMISSerializable;
00029 
00038 public interface Element extends OpenMISSerializable {
00043   final static long serialVersionUID = 1L;
00044 
00045 
00046  // list of known element types
00047   public static int HEADER = 0;
00048   public static int SYNC = 1;
00049   public static int GET = 2;
00050   public static int ADD = 3;
00051   public static int REPLACE = 4;
00052   public static int DELETE = 5;
00053   public static int MAP = 6;
00054   public static int RESULT = 7;
00055   public static int STATUS = 8;
00056   public static int ITEM = 9;
00057   public static int MAP_ITEM = 10;
00058   public static int SEQUENCE = 11;
00059   public static int FINAL = 12;
00060 
00061   /*
00062   * Return the element type whose the value is one the element type defined as constant
00063   * @return: int
00064   */
00065   public int getElementType();
00066 
00067   /*
00068   * Return the command id of the element, return 0 if it is not initialized
00069   * @return: int
00070   */
00071   public int getCmdId();
00072 
00073   public boolean hasCommmandId();
00074 
00075  //**** Methods used to encode OpenMSP messages
00076 
00077   public void writeBeginTag(StringBuffer buffer);
00078 
00079   public void writeContent(StringBuffer buffer);
00080 
00081   public void writeEndTag(StringBuffer buffer);
00082 
00083  //***** Methods used to decode OpenMSP messages
00084 
00085  public void setCmdId (int cmdId);
00086 
00087  public void setElementType(int elementType);
00088 
00089  public void setCredentialData (String data);
00090 
00091  public void setCredentialMeta (String meta);
00092 
00093  public void setSource(String source);
00094 
00095  public void setSourceSessionID(long sessionID);
00096 
00097  public void setTarget (String target);
00098 
00099  public void setMetaInformation (String meta);
00100 
00101  public void setCmdRef (int cmdRef);
00102 
00103  public void setSourceRef(String source);
00104 
00105  public void setTargetRef(String target);
00106 
00107  public void setData (String data);
00108 
00109 
00110 
00111 
00112 
00113 }

Generated on Mon Dec 4 11:03:26 2006 for OpenMobileIS by  doxygen 1.5.1-p1