FODBCollectionDescriptor.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 package org.openmobileis.database.fastobjectdb;
00026 
00027 import org.openmobileis.common.util.OpenMISSerializable;
00028 
00036 public class FODBCollectionDescriptor implements OpenMISSerializable {
00037   static final long serialVersionUID = 5521257935120563452L;
00042   public final static short TWO_WAY_SYNCHRO =0; //default
00047   public final static short ONE_WAY_SEND_DATA =1;
00052   public final static short ONE_WAY_GET_DATA =2;
00053   private String collectionName;
00054   private Class objectType;
00055   private boolean synchronize;
00056   private boolean compressed;
00057   private short[] stateList; //list all collection state :
00058   //                    0 : synchro way : define the way the synchronisation occurs.
00059   private String[] synchroDependList;
00060 
00064   public FODBCollectionDescriptor(String collectionName, Class objectType) {
00065     super();
00066     this.collectionName = collectionName;
00067     this.objectType = objectType;
00068     this.synchronize = true;
00069     this.compressed = false;
00070     this.stateList = new short[1];
00071     this.stateList[0] = FODBCollectionDescriptor.TWO_WAY_SYNCHRO;
00072   }
00073 
00080   public boolean isCompressed() {
00081     return compressed;
00082   }
00083 
00089   public short getSynchroWay()  {
00090         return this.stateList[0];
00091   }
00092 
00098   public void setSynchroWay(short way)  {
00099         this.stateList[0] = way;
00100   }
00101 
00108   public void setCompressed(boolean compressed) {
00109     this.compressed = compressed;
00110   }
00111 
00112   public boolean isSynchronize() {
00113     return synchronize;
00114   }
00115 
00116   public void setSynchronize(boolean synchronize) {
00117     this.synchronize = synchronize;
00118   }
00119 
00120   public String getCollectionName() {
00121     return collectionName;
00122   }
00123 
00124   public Class getObjectType() {
00125     return objectType;
00126   }
00127 
00128         public String[] getSynchroDependList() {
00129                 return synchroDependList;
00130         }
00131 
00132         public void setSynchroDependList(String[] synchroDependList) {
00133                 this.synchroDependList = synchroDependList;
00134         }
00135 
00136 }

Generated on Mon Jan 14 17:29:45 2008 for OpenMobileIS by  doxygen 1.5.4