ProfileModule.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  *  
00023  *  Modifications :
00024  *  2006 Creation P.Delrieu
00025  * 
00026  */
00027 package org.openmobileis.module.core;
00028 
00029 import java.util.Enumeration;
00030 import java.util.Hashtable;
00031 
00032 import org.openmobileis.common.util.OpenMISSerializable;
00033 import org.openmobileis.common.util.collection.Array;
00034 
00046 public class ProfileModule  implements OpenMISSerializable {
00047   static final long serialVersionUID = 5521257935120563452L;
00048         
00049         private String name;
00050         private String version;
00051   private String terminalType;
00052         private Hashtable properties;
00053   private String serverjar;
00054   private String terminaljar;
00055   private Array dependModuleList;
00056   private Array synchroListenerList;
00057 
00058   private String moduleLoaderClass;
00059   private String xmlFile;
00060         
00061         public ProfileModule(String xml) {
00062                 this.properties = new Hashtable();
00063     dependModuleList = new Array();
00064     synchroListenerList = new Array();
00065     this.xmlFile = xml;
00066   }     
00067         
00068         public ProfileModule() {
00069                 this.properties = new Hashtable();
00070     dependModuleList = new Array();
00071     synchroListenerList = new Array();
00072   }
00073         
00074         public void setXMLFile(String xml)      {
00075                 this.xmlFile = xml;
00076         }
00077         
00078         public String toXML()   {
00079                 return this.xmlFile;
00080         }
00081   
00082   public void addDependProfilModule(DependProfileModule moduleName) {
00083     dependModuleList.add(moduleName);
00084   }
00085   
00086   public Array getDependModuleList()  {
00087     return dependModuleList;
00088   }
00089 
00090   public void addSynchroListener(ProfileModuleSynchroListener synchrolistener) {
00091     synchroListenerList.add(synchrolistener);
00092   } 
00093 
00094   public Array getSynchroListenerList() {
00095     return synchroListenerList;
00096   } 
00097   
00098         public void setName(String name) {
00099                 this.name = name;
00100         }
00101         
00102         public String getName() {
00103                 return this.name;
00104         }
00105         
00106         public void setVersion(String version) {
00107                 this.version = version;
00108         }
00109         
00110         public String getVersion() {
00111                 return this.version;
00112         }
00113         
00114         public void addProperty(String name, String value) {
00115                 properties.put(name, value);
00116         }
00117         
00118         public String getProperty(String name) {
00119                 return (String)this.properties.get(name);
00120         }
00121         
00122         public String[] getAllPropertiesNames() {
00123                 Enumeration enumkeys = this.properties.keys();
00124                 Array keys = new Array();
00125                 while (enumkeys.hasMoreElements()) {
00126                         keys.add((String)enumkeys.nextElement());
00127                 }
00128                 String[] result = new String[keys.size()];
00129                 keys.toArray(result);
00130                 return result;
00131         }
00132 
00133   public String getServerjar() {
00134     return serverjar;
00135   }
00136 
00137   public void setServerjar(String serverjar) {
00138     this.serverjar = serverjar;
00139   }
00140 
00141   public String getTerminaljar() {
00142     return terminaljar;
00143   }
00144 
00145   public void setTerminaljar(String terminaljar) {
00146     this.terminaljar = terminaljar;
00147   }
00148 
00149   public String getTerminalType() {
00150     return terminalType;
00151   }
00152 
00153   public void setTerminalType(String terminalType) {
00154     this.terminalType = terminalType;
00155   }
00156 
00157         public String getModuleLoaderClass() {
00158                 return moduleLoaderClass;
00159         }
00160 
00161         public void setModuleLoaderClass(String moduleLoaderClass) {
00162                 this.moduleLoaderClass = moduleLoaderClass;
00163         }
00164 
00165 }

Generated on Mon Jan 11 21:19:16 2010 for OpenMobileIS by  doxygen 1.5.4