Revision: 0d4ea31c32a9
Author:   [email protected] <[email protected]>
Date:     Wed Aug 15 06:29:01 2012
Log:       Issue 28:    JMX to expose SMSC properties and accessible from SBB's
http://code.google.com/p/smscgateway/source/detail?r=0d4ea31c32a9

Added:
 /core/smpp/src/main/java/org/mobicents/smsc/smpp/EsmeManagement.java
 /core/smpp/src/main/java/org/mobicents/smsc/smpp/EsmeManagementMBean.java
/core/smpp/src/main/java/org/mobicents/smsc/smpp/SmscPropertiesManagement.java /core/smpp/src/main/java/org/mobicents/smsc/smpp/SmscPropertiesManagementMBean.java
Deleted:
 /core/bootstrap/src/main/config/smsc.properties
Modified:
 /core/bootstrap/pom.xml
 /core/slee/services/mtsbb/pom.xml
/core/slee/services/mtsbb/src/main/java/org/mobicents/smsc/slee/services/mt/MtCommonSbb.java /core/slee/services/mtsbb/src/main/java/org/mobicents/smsc/slee/services/mt/MtSbb.java /core/slee/services/mtsbb/src/main/java/org/mobicents/smsc/slee/services/mt/SriSbb.java /core/smpp/src/main/java/org/mobicents/smsc/smpp/DefaultSmppServerHandler.java
 /core/smpp/src/main/java/org/mobicents/smsc/smpp/Esme.java
 /core/smpp/src/main/java/org/mobicents/smsc/smpp/SMSCShellExecutor.java
 /core/smpp/src/main/java/org/mobicents/smsc/smpp/SmppServer.java
 /core/smpp/src/main/java/org/mobicents/smsc/smpp/SmscManagement.java

=======================================
--- /dev/null
+++ /core/smpp/src/main/java/org/mobicents/smsc/smpp/EsmeManagement.java Wed Aug 15 06:29:01 2012
@@ -0,0 +1,214 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.mobicents.smsc.smpp;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.util.List;
+
+import javolution.text.TextBuilder;
+import javolution.util.FastList;
+import javolution.xml.XMLBinding;
+import javolution.xml.XMLObjectReader;
+import javolution.xml.XMLObjectWriter;
+import javolution.xml.stream.XMLStreamException;
+
+import org.apache.log4j.Logger;
+
+import com.cloudhopper.smpp.SmppBindType;
+import com.cloudhopper.smpp.type.Address;
+
+public class EsmeManagement implements EsmeManagementMBean {
+
+ private static final Logger logger = Logger.getLogger(EsmeManagement.class);
+
+       private static final String ESME_LIST = "esmeList";
+       private static final String TAB_INDENT = "\t";
+       private static final String CLASS_ATTRIBUTE = "type";
+       private static final XMLBinding binding = new XMLBinding();
+       private static final String PERSIST_FILE_NAME = "esme.xml";
+
+       private final String name;
+
+       private String persistDir = null;
+
+       protected FastList<Esme> esmes = new FastList<Esme>();
+
+       private final TextBuilder persistFile = TextBuilder.newInstance();
+
+       public EsmeManagement(String name) {
+               this.name = name;
+
+               binding.setClassAttribute(CLASS_ATTRIBUTE);
+               binding.setAlias(Esme.class, "esme");
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public String getPersistDir() {
+               return persistDir;
+       }
+
+       public void setPersistDir(String persistDir) {
+               this.persistDir = persistDir;
+       }
+
+       public List<Esme> getEsmes() {
+               return esmes.unmodifiable();
+       }
+
+       public Esme getEsme(String systemId) {
+ for (FastList.Node<Esme> n = esmes.head(), end = esmes.tail(); (n = n.getNext()) != end;) {
+                       Esme esme = n.getValue();
+                       if (esme.getSystemId().equals(systemId)) {
+                               return esme;
+                       }
+               }
+               return null;
+       }
+
+       /**
+        * <p>
+        * Create new {@link Esme}
+        * </p>
+        * <p>
+        * Command is smsc esme create <Any 4/5 digit number> <Specify password>
+ * <host-ip> <port> system-type <sms | vms | ota > interface-version <3.3 |
+        * 3.4 | 5.0> esme-ton <esme address ton> esme-npi <esme address npi>
+        * esme-range <esme address range>
+        * </p>
+        * <p>
+ * where system-type, interface-version, esme-ton, esme-npi, esme-range are
+        * optional, by default interface-version is 3.4.
+        *
+        * </p>
+        *
+        * @param args
+        * @return
+        * @throws Exception
+        */
+ public Esme createEsme(String systemId, String password, String host, String port, SmppBindType smppBindType, + String systemType, SmppInterfaceVersionType smppIntVersion, Address address) throws Exception {
+
+               /* Esme system id should be unique and mandatory for each esme 
*/
+               Esme esme = this.getEsme(systemId);
+               if (esme != null) {
+ throw new Exception(String.format(SMSCOAMMessages.CREATE_EMSE_FAIL_ALREADY_EXIST, systemId));
+               }
+
+               // TODO check if RC is already taken?
+               if (smppIntVersion == null) {
+                       smppIntVersion = SmppInterfaceVersionType.SMPP34;
+               }
+
+ esme = new Esme(systemId, password, host, port, smppBindType, systemType, smppIntVersion, address);
+               esmes.add(esme);
+
+               this.store();
+
+               return esme;
+       }
+
+       public Esme destroyEsme(String systemId) throws Exception {
+               Esme esme = this.getEsme(systemId);
+               if (esme == null) {
+ throw new Exception(String.format(SMSCOAMMessages.DELETE_ESME_FAILED_NO_ESME_FOUND, systemId));
+               }
+               esmes.remove(esme);
+               this.store();
+
+               return esme;
+       }
+
+       public void start() throws Exception {
+
+               this.persistFile.clear();
+
+               if (persistDir != null) {
+ this.persistFile.append(persistDir).append(File.separator).append(this.name).append("_")
+                                       .append(PERSIST_FILE_NAME);
+               } else {
+                       persistFile
+                                       
.append(System.getProperty(SmscManagement.SMSC_PERSIST_DIR_KEY,
+ System.getProperty(SmscManagement.USER_DIR_KEY))).append(File.separator).append(this.name)
+                                       .append("_").append(PERSIST_FILE_NAME);
+               }
+
+ logger.info(String.format("Loading ESME configuration from %s", persistFile.toString()));
+
+               try {
+                       this.load();
+               } catch (FileNotFoundException e) {
+ logger.warn(String.format("Failed to load the SS7 configuration file. \n%s", e.getMessage()));
+               }
+
+       }
+
+       public void stop() throws Exception {
+               this.store();
+       }
+
+       /**
+        * Persist
+        */
+       public void store() {
+
+               // TODO : Should we keep reference to Objects rather than 
recreating
+               // everytime?
+               try {
+ XMLObjectWriter writer = XMLObjectWriter.newInstance(new FileOutputStream(persistFile.toString()));
+                       writer.setBinding(binding);
+                       // Enables cross-references.
+                       // writer.setReferenceResolver(new 
XMLReferenceResolver());
+                       writer.setIndentation(TAB_INDENT);
+                       writer.write(esmes, ESME_LIST, FastList.class);
+
+                       writer.close();
+               } catch (Exception e) {
+                       logger.error("Error while persisting the Rule state in 
file", e);
+               }
+       }
+
+       /**
+        * Load and create LinkSets and Link from persisted file
+        *
+        * @throws Exception
+        */
+       public void load() throws FileNotFoundException {
+
+               XMLObjectReader reader = null;
+               try {
+ reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
+
+                       reader.setBinding(binding);
+                       esmes = reader.read(ESME_LIST, FastList.class);
+
+               } catch (XMLStreamException ex) {
+                       // this.logger.info(
+                       // "Error while re-creating Linksets from persisted 
file", ex);
+               }
+       }
+}
=======================================
--- /dev/null
+++ /core/smpp/src/main/java/org/mobicents/smsc/smpp/EsmeManagementMBean.java Wed Aug 15 06:29:01 2012
@@ -0,0 +1,39 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.mobicents.smsc.smpp;
+
+import java.util.List;
+
+import com.cloudhopper.smpp.SmppBindType;
+import com.cloudhopper.smpp.type.Address;
+
+public interface EsmeManagementMBean {
+       public List<Esme> getEsmes();
+
+       public Esme getEsme(String systemId);
+
+ public Esme createEsme(String systemId, String password, String host, String port, SmppBindType smppBindType, + String systemType, SmppInterfaceVersionType smppIntVersion, Address address) throws Exception;
+
+       public Esme destroyEsme(String systemId) throws Exception;
+
+}
=======================================
--- /dev/null
+++ /core/smpp/src/main/java/org/mobicents/smsc/smpp/SmscPropertiesManagement.java Wed Aug 15 06:29:01 2012
@@ -0,0 +1,202 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.mobicents.smsc.smpp;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+
+import javolution.text.TextBuilder;
+import javolution.xml.XMLBinding;
+import javolution.xml.XMLObjectReader;
+import javolution.xml.XMLObjectWriter;
+import javolution.xml.stream.XMLStreamException;
+
+import org.apache.log4j.Logger;
+
+public class SmscPropertiesManagement implements SmscPropertiesManagementMBean { + private static final Logger logger = Logger.getLogger(SmscPropertiesManagement.class);
+
+       private static final String SC_GT = "scgt";
+       private static final String SC_SSN = "scssn";
+       private static final String HLR_SSN = "hlrssn";
+       private static final String MSC_SSN = "mscssn";
+
+       private static final String TAB_INDENT = "\t";
+       private static final String CLASS_ATTRIBUTE = "type";
+       private static final XMLBinding binding = new XMLBinding();
+       private static final String PERSIST_FILE_NAME = "smscproperties.xml";
+
+       private static SmscPropertiesManagement instance;
+
+       private final String name;
+
+       private String persistDir = null;
+
+       private final TextBuilder persistFile = TextBuilder.newInstance();
+
+       private String serviceCenterGt = null;
+       private int serviceCenterSsn = -1;
+       private int hlrSsn = -1;
+       private int mscSsn = -1;
+
+       private SmscPropertiesManagement(String name) {
+               this.name = name;
+               binding.setClassAttribute(CLASS_ATTRIBUTE);
+       }
+
+       protected static SmscPropertiesManagement getInstance(String name){
+               if(instance == null){
+                       instance = new SmscPropertiesManagement(name);
+               }
+               return instance;
+       }
+
+       public static SmscPropertiesManagement getInstance(){
+               return instance;
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public String getPersistDir() {
+               return persistDir;
+       }
+
+       public void setPersistDir(String persistDir) {
+               this.persistDir = persistDir;
+       }
+
+       public String getServiceCenterGt() {
+               return serviceCenterGt;
+       }
+
+       public void setServiceCenterGt(String serviceCenterGt) {
+               this.serviceCenterGt = serviceCenterGt;
+               this.store();
+       }
+
+       public int getServiceCenterSsn() {
+               return serviceCenterSsn;
+       }
+
+       public void setServiceCenterSsn(int serviceCenterSsn) {
+               this.serviceCenterSsn = serviceCenterSsn;
+               this.store();
+       }
+
+       public int getHlrSsn() {
+               return hlrSsn;
+       }
+
+       public void setHlrSsn(int hlrSsn) {
+               this.hlrSsn = hlrSsn;
+               this.store();
+       }
+
+       public int getMscSsn() {
+               return mscSsn;
+       }
+
+       public void setMscSsn(int mscSsn) {
+               this.mscSsn = mscSsn;
+               this.store();
+       }
+
+       public void start() throws Exception {
+
+               this.persistFile.clear();
+
+               if (persistDir != null) {
+ this.persistFile.append(persistDir).append(File.separator).append(this.name).append("_")
+                                       .append(PERSIST_FILE_NAME);
+               } else {
+                       persistFile
+                                       
.append(System.getProperty(SmscManagement.SMSC_PERSIST_DIR_KEY,
+ System.getProperty(SmscManagement.USER_DIR_KEY))).append(File.separator).append(this.name)
+                                       .append("_").append(PERSIST_FILE_NAME);
+               }
+
+ logger.info(String.format("Loading SMSC Properties from %s", persistFile.toString()));
+
+               try {
+                       this.load();
+               } catch (FileNotFoundException e) {
+ logger.warn(String.format("Failed to load the SMSC configuration file. \n%s", e.getMessage()));
+               }
+
+       }
+
+       public void stop() throws Exception {
+               this.store();
+       }
+
+       /**
+        * Persist
+        */
+       public void store() {
+
+               // TODO : Should we keep reference to Objects rather than 
recreating
+               // everytime?
+               try {
+ XMLObjectWriter writer = XMLObjectWriter.newInstance(new FileOutputStream(persistFile.toString()));
+                       writer.setBinding(binding);
+                       // Enables cross-references.
+                       // writer.setReferenceResolver(new 
XMLReferenceResolver());
+                       writer.setIndentation(TAB_INDENT);
+
+                       writer.write(this.serviceCenterGt, SC_GT, String.class);
+                       writer.write(this.serviceCenterSsn, SC_SSN, 
Integer.class);
+                       writer.write(this.hlrSsn, HLR_SSN, Integer.class);
+                       writer.write(this.mscSsn, MSC_SSN, Integer.class);
+
+                       writer.close();
+               } catch (Exception e) {
+                       logger.error("Error while persisting the Rule state in 
file", e);
+               }
+       }
+
+       /**
+        * Load and create LinkSets and Link from persisted file
+        *
+        * @throws Exception
+        */
+       public void load() throws FileNotFoundException {
+
+               XMLObjectReader reader = null;
+               try {
+ reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
+
+                       reader.setBinding(binding);
+                       this.serviceCenterGt = reader.read(SC_GT, String.class);
+                       this.serviceCenterSsn = reader.read(SC_SSN, 
Integer.class);
+                       this.hlrSsn = reader.read(HLR_SSN, Integer.class);
+                       this.mscSsn = reader.read(MSC_SSN, Integer.class);
+
+               } catch (XMLStreamException ex) {
+                       // this.logger.info(
+                       // "Error while re-creating Linksets from persisted 
file", ex);
+               }
+       }
+}
=======================================
--- /dev/null
+++ /core/smpp/src/main/java/org/mobicents/smsc/smpp/SmscPropertiesManagementMBean.java Wed Aug 15 06:29:01 2012
@@ -0,0 +1,41 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.mobicents.smsc.smpp;
+
+public interface SmscPropertiesManagementMBean {
+
+       public String getServiceCenterGt();
+
+       public void setServiceCenterGt(String serviceCenterGt);
+
+       public int getServiceCenterSsn();
+
+       public void setServiceCenterSsn(int serviceCenterSsn);
+
+       public int getHlrSsn();
+
+       public void setHlrSsn(int hlrSsn);
+
+       public int getMscSsn();
+
+       public void setMscSsn(int mscSsn);
+}
=======================================
--- /core/bootstrap/src/main/config/smsc.properties     Thu Apr 26 01:25:46 2012
+++ /dev/null
@@ -1,4 +0,0 @@
-service.center.gt=923330053058
-service.center.ssn=8
-hlr.ssn=6
-msc.ssn=8
=======================================
--- /core/bootstrap/pom.xml     Sat Jul  7 02:48:18 2012
+++ /core/bootstrap/pom.xml     Wed Aug 15 06:29:01 2012
@@ -237,9 +237,6 @@

                                                                        
</fileset>
                                                                </copy>
-                                                               <copy 
file="${basedir}/src/main/config/smsc.properties"
-                                                                       
tofile="${jboss.home}/server/${node}/conf/smsc.properties">
-                                                               </copy>
                                                        </tasks>
                                                </configuration>
                                        </execution>
@@ -255,7 +252,6 @@
                                                                        <fileset
dir="${jboss.home}/server/${node}/deploy/mobicents-smsc-server" />
                                                                </delete>
-                                                               <delete 
file="${jboss.home}/server/${node}/conf/smsc.properties" />
                                                        </tasks>
                                                </configuration>
                                        </execution>
=======================================
--- /core/slee/services/mtsbb/pom.xml   Sun Jun  3 05:05:03 2012
+++ /core/slee/services/mtsbb/pom.xml   Wed Aug 15 06:29:01 2012
@@ -9,9 +9,9 @@
                <version>1.0.0.ALPHA-SNAPSHOT</version>
        </parent>
        <artifactId>mt-sbb</artifactId>
-
+
        <name>Core : SLEE : Services Mt SBB</name>
-
+
        <dependencies>
                <dependency>
                        <artifactId>smsc-events</artifactId>
@@ -30,6 +30,13 @@
                <dependency>
                        <artifactId>smpp-server-ra-ratype</artifactId>
                        <groupId>${pom.groupId}</groupId>
-               </dependency>
+               </dependency>
+
+               <dependency>
+                       <groupId>${pom.groupId}</groupId>
+                       <artifactId>smpp</artifactId>
+                       <version>${pom.version}</version>
+                       <scope>provided</scope>
+               </dependency>
        </dependencies>
 </project>
=======================================
--- /core/slee/services/mtsbb/src/main/java/org/mobicents/smsc/slee/services/mt/MtCommonSbb.java Sun Aug 12 05:35:01 2012 +++ /core/slee/services/mtsbb/src/main/java/org/mobicents/smsc/slee/services/mt/MtCommonSbb.java Wed Aug 15 06:29:01 2012
@@ -1,11 +1,28 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.mobicents.smsc.slee.services.mt;

-import java.io.File;
-import java.io.FileNotFoundException;
-import java.net.URL;
 import java.sql.Timestamp;
 import java.text.SimpleDateFormat;
-import java.util.Properties;

 import javax.naming.Context;
 import javax.naming.InitialContext;
@@ -44,6 +61,7 @@
 import org.mobicents.slee.resource.map.events.ProviderErrorComponent;
 import org.mobicents.slee.resource.map.events.RejectComponent;
 import org.mobicents.smsc.slee.services.smpp.server.events.SmsEvent;
+import org.mobicents.smsc.smpp.SmscPropertiesManagement;

 import com.cloudhopper.commons.charset.CharsetUtil;
 import com.cloudhopper.smpp.util.SmppUtil;
@@ -69,19 +87,10 @@
        private static final String DELIVERY_ACK_STATE_UNKNOWN = "UNKNOWN";
        private static final String DELIVERY_ACK_STATE_REJECTED = "REJECTD";

+ protected static final SmscPropertiesManagement smscPropertiesManagement = SmscPropertiesManagement.getInstance();
+
private final SimpleDateFormat DELIVERY_ACK_DATE_FORMAT = new SimpleDateFormat("yyMMddHHmm");

-       private static final String SMSC_PROPERTIES = "smsc.properties";
-       private static final String SC_GT_KEY = "service.center.gt";
-       private static final String SC_SSN_KEY = "service.center.ssn";
-       private static final String HLR_SSN_KEY = "hlr.ssn";
-       private static final String MSC_SSN_KEY = "msc.ssn";
-
-       protected String SC_GT = null;
-       protected int SC_SSN = 0;
-       protected int HLR_SSN = 0;
-       protected int MSC_SSN = 0;
-
        private final String className;

        protected Tracer logger;
@@ -94,8 +103,6 @@
        private AddressString serviceCenterAddress;
        private SccpAddress serviceCenterSCCPAddress = null;

-       protected Properties smscProperteis = null;
-
        public MtCommonSbb(String className) {
                this.className = className;
        }
@@ -124,31 +131,31 @@
                if (original != null) {
                        if (original.getSystemId() != null) {
                                this.sendFailureDeliverSmToEsms(original);
-                       }
+                       }
                }
        }

public void onProviderErrorComponent(ProviderErrorComponent event, ActivityContextInterface aci) {
                this.logger.severe("Rx :  onProviderErrorComponent" + event);
-
+
                SmsEvent original = this.getOriginalSmsEvent();

                if (original != null) {
                        if (original.getSystemId() != null) {
                                this.sendFailureDeliverSmToEsms(original);
-                       }
+                       }
                }
        }

public void onRejectComponent(RejectComponent event, ActivityContextInterface aci) {
                this.logger.severe("Rx :  onRejectComponent" + event);
-
+
                SmsEvent original = this.getOriginalSmsEvent();

                if (original != null) {
                        if (original.getSystemId() != null) {
                                this.sendFailureDeliverSmToEsms(original);
-                       }
+                       }
                }
        }

@@ -174,13 +181,13 @@
                }

                // TODO : Error condition. Take care
-
+
                SmsEvent original = this.getOriginalSmsEvent();

                if (original != null) {
                        if (original.getSystemId() != null) {
                                this.sendFailureDeliverSmToEsms(original);
-                       }
+                       }
                }
        }

@@ -188,25 +195,25 @@
                this.logger.severe("Rx :  onDialogUserAbort=" + evt);

                // TODO : Error condition. Take care
-
+
                SmsEvent original = this.getOriginalSmsEvent();

                if (original != null) {
                        if (original.getSystemId() != null) {
                                this.sendFailureDeliverSmToEsms(original);
-                       }
+                       }
                }
        }

public void onDialogProviderAbort(DialogProviderAbort evt, ActivityContextInterface aci) {
                this.logger.severe("Rx :  onDialogProviderAbort=" + evt);
-
+
                SmsEvent original = this.getOriginalSmsEvent();

                if (original != null) {
                        if (original.getSystemId() != null) {
                                this.sendFailureDeliverSmToEsms(original);
-                       }
+                       }
                }
        }

@@ -312,30 +319,6 @@
                        this.mapParameterFactory = 
this.mapProvider.getMAPParameterFactory();

                        this.logger = this.sbbContext.getTracer(this.className);
-
-                       if (this.smscProperteis == null) {
- String path = System.getProperty("jboss.server.config.url") + SMSC_PROPERTIES;
-                               URL url = new URL(path);
-
-                               if (new File(url.toURI()).exists()) {
-                                       this.smscProperteis = new Properties();
-                                       
this.smscProperteis.load(url.openStream());
- logger.info("loaded application properties from file: " + path + " SBB=" + this);
-                               } else {
- throw new FileNotFoundException(String.format("File %s not found", path));
-                               }
-
-                               this.SC_GT = 
this.smscProperteis.getProperty(SC_GT_KEY);
-
-                               if (this.SC_GT == null) {
- throw new RuntimeException(String.format("No value defined for key=%s in %s file", SC_GT_KEY,
-                                                       SMSC_PROPERTIES));
-                               }
-
- this.SC_SSN = Integer.parseInt(this.smscProperteis.getProperty(SC_SSN_KEY)); - this.HLR_SSN = Integer.parseInt(this.smscProperteis.getProperty(HLR_SSN_KEY)); - this.MSC_SSN = Integer.parseInt(this.smscProperteis.getProperty(MSC_SSN_KEY));
-                       }
                } catch (Exception ne) {
                        logger.severe("Could not set SBB context:", ne);
                }
@@ -383,7 +366,8 @@
                if (this.serviceCenterAddress == null) {
this.serviceCenterAddress = this.mapParameterFactory.createAddressString(
                                        AddressNature.international_number,
- org.mobicents.protocols.ss7.map.api.primitives.NumberingPlan.ISDN, this.SC_GT);
+                                       
org.mobicents.protocols.ss7.map.api.primitives.NumberingPlan.ISDN,
+                                       
smscPropertiesManagement.getServiceCenterGt());
                }
                return this.serviceCenterAddress;
        }
@@ -397,9 +381,10 @@
         */
        protected SccpAddress getServiceCenterSccpAddress() {
                if (this.serviceCenterSCCPAddress == null) {
- GT0100 gt = new GT0100(0, NumberingPlan.ISDN_TELEPHONY, NatureOfAddress.INTERNATIONAL, this.SC_GT); + GT0100 gt = new GT0100(0, NumberingPlan.ISDN_TELEPHONY, NatureOfAddress.INTERNATIONAL,
+                                       
smscPropertiesManagement.getServiceCenterGt());
this.serviceCenterSCCPAddress = new SccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, 0, gt,
-                                       this.SC_SSN);
+                                       
smscPropertiesManagement.getServiceCenterSsn());
                }
                return this.serviceCenterSCCPAddress;
        }
=======================================
--- /core/slee/services/mtsbb/src/main/java/org/mobicents/smsc/slee/services/mt/MtSbb.java Sun Aug 12 05:35:01 2012 +++ /core/slee/services/mtsbb/src/main/java/org/mobicents/smsc/slee/services/mt/MtSbb.java Wed Aug 15 06:29:01 2012
@@ -1,7 +1,27 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.mobicents.smsc.slee.services.mt;

 import java.sql.Timestamp;
-import java.text.SimpleDateFormat;

 import javax.slee.ActivityContextInterface;
 import javax.slee.EventContext;
@@ -117,7 +137,8 @@
                                if (smsEvent.getSystemId() != null) {
                                        sendSuccessDeliverSmToEsms(smsEvent);
                                } else {
-                                       //TODO : This is destined for Mobile 
user, send SMS-STATUS-REPORT
+                                       // TODO : This is destined for Mobile 
user, send
+                                       // SMS-STATUS-REPORT
                                }
                        } catch (Exception e) {
                                this.logger.severe(
@@ -127,9 +148,9 @@

                // Amit (12 Aug 2012): this is also done in onDialogRelease why 
repeat
                // here?
-
-               //aci.detach(this.sbbContext.getSbbLocalObject());
-
+
+               // aci.detach(this.sbbContext.getSbbLocalObject());
+
                // MtActivityContextInterface mtSbbActivityContextInterface =
                // this.asSbbActivityContextInterface(this
                // 
.getNullActivityEventContext().getActivityContextInterface());
@@ -224,7 +245,8 @@
                // International / ISDN?
GT0100 gt = new GT0100(0, NumberingPlan.ISDN_TELEPHONY, NatureOfAddress.INTERNATIONAL,
                                networkNodeNumber.getAddress());
- return new SccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, 0, gt, this.MSC_SSN); + return new SccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, 0, gt,
+                               smscPropertiesManagement.getMscSsn());
        }

private AddressField getSmsTpduOriginatingAddress(byte ton, byte npi, String address) {
=======================================
--- /core/slee/services/mtsbb/src/main/java/org/mobicents/smsc/slee/services/mt/SriSbb.java Tue May 15 06:25:33 2012 +++ /core/slee/services/mtsbb/src/main/java/org/mobicents/smsc/slee/services/mt/SriSbb.java Wed Aug 15 06:29:01 2012
@@ -1,3 +1,24 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.mobicents.smsc.slee.services.mt;

 import javax.slee.ActivityContextInterface;
@@ -215,7 +236,7 @@

        private SccpAddress convertAddressFieldToSCCPAddress(String address) {
GT0100 gt = new GT0100(0, NumberingPlan.ISDN_TELEPHONY, NatureOfAddress.INTERNATIONAL, address); - return new SccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, 0, gt, this.HLR_SSN); + return new SccpAddress(RoutingIndicator.ROUTING_BASED_ON_GLOBAL_TITLE, 0, gt, smscPropertiesManagement.getHlrSsn());
        }

        private MAPApplicationContext getSRIMAPApplicationContext() {
=======================================
--- /core/smpp/src/main/java/org/mobicents/smsc/smpp/DefaultSmppServerHandler.java Thu Jul 12 08:19:12 2012 +++ /core/smpp/src/main/java/org/mobicents/smsc/smpp/DefaultSmppServerHandler.java Wed Aug 15 06:29:01 2012
@@ -1,3 +1,24 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.mobicents.smsc.smpp;

 import java.io.Serializable;
@@ -30,15 +51,15 @@

private transient SmppSessionHandlerInterface smppSessionHandlerInterface = null;

-       private transient SmscManagement smscManagement = null;
+       private transient EsmeManagement esmeManagement = null;

        private MBeanServer mbeanServer = null;

        public DefaultSmppServerHandler() {
        }

-       public void setSmscManagement(SmscManagement smscManagement) {
-               this.smscManagement = smscManagement;
+       public void setEsmeManagement(EsmeManagement esmeManagement) {
+               this.esmeManagement = esmeManagement;
        }

        public SmppSessionHandlerInterface getSmppSessionHandlerInterface() {
@@ -58,7 +79,7 @@
                        throw new 
SmppProcessingException(SmppConstants.STATUS_BINDFAIL);
                }

-               Esme esme = 
this.smscManagement.getEsme(bindRequest.getSystemId());
+               Esme esme = 
this.esmeManagement.getEsme(bindRequest.getSystemId());

                if (esme == null) {
logger.error(String.format("No ESME configured for SystemId=%s", bindRequest.getSystemId()));
@@ -154,7 +175,7 @@

                this.registerMBean(sessionId, session);

- Esme esme = this.smscManagement.getEsme(session.getConfiguration().getSystemId()); + Esme esme = this.esmeManagement.getEsme(session.getConfiguration().getSystemId());
                esme.setState(session.getStateName());
        }

@@ -178,7 +199,7 @@

                this.unregisterMBean(sessionId, session);

- Esme esme = this.smscManagement.getEsme(session.getConfiguration().getSystemId()); + Esme esme = this.esmeManagement.getEsme(session.getConfiguration().getSystemId());
                esme.setState(session.getStateName());
        }

=======================================
--- /core/smpp/src/main/java/org/mobicents/smsc/smpp/Esme.java Wed Jul 11 08:29:09 2012 +++ /core/smpp/src/main/java/org/mobicents/smsc/smpp/Esme.java Wed Aug 15 06:29:01 2012
@@ -102,14 +102,6 @@
        public void setSystemId(String systemId) {
                this.systemId = systemId;
        }
-
-       public void setSmscManagement(SmscManagement smscManagement) {
-               this.smscManagement = smscManagement;
-       }
-
-       public SmscManagement getSmscManagement() {
-               return smscManagement;
-       }

        /**
         * @return the password
=======================================
--- /core/smpp/src/main/java/org/mobicents/smsc/smpp/SMSCShellExecutor.java Wed Jul 11 08:29:09 2012 +++ /core/smpp/src/main/java/org/mobicents/smsc/smpp/SMSCShellExecutor.java Wed Aug 15 06:29:01 2012
@@ -23,8 +23,7 @@
 package org.mobicents.smsc.smpp;

 import java.util.Arrays;
-
-import javolution.util.FastList;
+import java.util.List;

 import org.apache.log4j.Logger;
 import org.mobicents.ss7.management.console.ShellExecutor;
@@ -157,8 +156,8 @@
                        return SMSCOAMMessages.NULL_ESME_ADDRESS_RANGE;
                }
                Address address = new Address(esmeTonType, esmeNpiType, 
esmeAddrRange);
- Esme esme = this.smscManagement.createEsme(systemId, password, host, strPort, smppBindType, systemType,
-                               smppVersionType, address);
+ Esme esme = this.smscManagement.getEsmeManagement().createEsme(systemId, password, host, strPort, smppBindType,
+                               systemType, smppVersionType, address);
return String.format(SMSCOAMMessages.CREATE_ESME_SUCCESSFULL, esme.getSystemId());
        }

@@ -179,19 +178,18 @@
                        return SMSCOAMMessages.INVALID_COMMAND;
                }

-               Esme esme = this.smscManagement.destroyEsme(systemId);
+ Esme esme = this.smscManagement.getEsmeManagement().destroyEsme(systemId);

                return String.format(SMSCOAMMessages.DELETE_ESME_SUCCESSFUL, 
systemId);
        }

        private String showEsme() {
-               FastList<Esme> esmes = this.smscManagement.getEsmes();
+               List<Esme> esmes = 
this.smscManagement.getEsmeManagement().getEsmes();
                if (esmes.size() == 0) {
                        return SMSCOAMMessages.NO_ESME_DEFINED_YET;
                }
                StringBuffer sb = new StringBuffer();
- for (FastList.Node<Esme> n = esmes.head(), end = esmes.tail(); (n = n.getNext()) != end;) {
-                       Esme esme = n.getValue();
+               for (Esme esme : esmes) {
                        sb.append(SMSCOAMMessages.NEW_LINE);
                        esme.show(sb);
                }
=======================================
--- /core/smpp/src/main/java/org/mobicents/smsc/smpp/SmppServer.java Tue May 15 06:25:33 2012 +++ /core/smpp/src/main/java/org/mobicents/smsc/smpp/SmppServer.java Wed Aug 15 06:29:01 2012
@@ -1,3 +1,24 @@
+/*
+ * TeleStax, Open Source Cloud Communications  Copyright 2012.
+ * and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.mobicents.smsc.smpp;

 import java.util.concurrent.Executors;
@@ -52,15 +73,15 @@

        private MBeanServer mbeanServer = null;

-       private SmscManagement smscManagement = null;
+       private EsmeManagement esmeManagement = null;

        public SmppServer() {

        }

-       public void setSmscManagement(SmscManagement smscManagement) {
-               this.smscManagement = smscManagement;
- ((DefaultSmppServerHandler)this.smppServerHandler).setSmscManagement(smscManagement);
+       public void setEsmeManagement(EsmeManagement esmeManagement) {
+               this.esmeManagement = esmeManagement;
+ ((DefaultSmppServerHandler)this.smppServerHandler).setEsmeManagement(esmeManagement);
        }

        public void setName(String name) {
=======================================
--- /core/smpp/src/main/java/org/mobicents/smsc/smpp/SmscManagement.java Sat Jul 7 10:32:42 2012 +++ /core/smpp/src/main/java/org/mobicents/smsc/smpp/SmscManagement.java Wed Aug 15 06:29:01 2012
@@ -23,52 +23,51 @@
 package org.mobicents.smsc.smpp;

 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.management.StandardMBean;

 import javolution.text.TextBuilder;
-import javolution.util.FastList;
 import javolution.xml.XMLBinding;
-import javolution.xml.XMLObjectReader;
-import javolution.xml.XMLObjectWriter;
-import javolution.xml.stream.XMLStreamException;

 import org.apache.log4j.Logger;
-
-import com.cloudhopper.smpp.SmppBindType;
-import com.cloudhopper.smpp.type.Address;
+import org.jboss.mx.util.MBeanServerLocator;

 /**
- * @author zaheer abbas
+ * @author Amit Bhayani
  *
  */
 public class SmscManagement {
private static final Logger logger = Logger.getLogger(SmscManagement.class);
-
+
        public static final String JMX_DOMAIN = "org.mobicents.smsc";
-
-       private static final String ESME_LIST = "esmeList";
+
        private static final String ROUTING_RULE_LIST = "routingRuleList";

-       private static final String SMSC_PERSIST_DIR_KEY = "smsc.persist.dir";
-       private static final String USER_DIR_KEY = "user.dir";
+       protected static final String SMSC_PERSIST_DIR_KEY = "smsc.persist.dir";
+       protected static final String USER_DIR_KEY = "user.dir";
+
        private static final String PERSIST_FILE_NAME = "smsc.xml";

        private static final XMLBinding binding = new XMLBinding();
        private static final String TAB_INDENT = "\t";
        private static final String CLASS_ATTRIBUTE = "type";

-       protected FastList<Esme> esmes = new FastList<Esme>();
-
        private final TextBuilder persistFile = TextBuilder.newInstance();

        private final String name;

        private String persistDir = null;
-
+
        private SmppServer smppServer = null;

+       private EsmeManagement esmeManagement = null;
+       private SmscPropertiesManagement smscPropertiesManagement = null;
+
+       private MBeanServer mbeanServer = null;
+
        public SmscManagement(String name) {
                this.name = name;
                binding.setClassAttribute(CLASS_ATTRIBUTE);
@@ -94,13 +93,36 @@
        public void setSmppServer(SmppServer smppServer) {
                this.smppServer = smppServer;
        }
+
+       public EsmeManagement getEsmeManagement() {
+               return esmeManagement;
+       }

        public void start() throws Exception {
-
-               if(this.smppServer == null){
+               if (this.smppServer == null) {
                        throw new Exception("SmppServer not set");
                }
-
+
+               this.esmeManagement = new EsmeManagement(this.name);
+               this.esmeManagement.setPersistDir(this.persistDir);
+               this.esmeManagement.start();
+
+ this.smscPropertiesManagement = SmscPropertiesManagement.getInstance(this.name);
+               this.smscPropertiesManagement.setPersistDir(this.persistDir);
+               this.smscPropertiesManagement.start();
+
+               // Register the MBeans
+               this.mbeanServer = MBeanServerLocator.locateJBoss();
+
+ ObjectName esmeObjNname = new ObjectName(SmscManagement.JMX_DOMAIN + ":name=EsmeManagement"); + StandardMBean esmeMxBean = new StandardMBean(this.esmeManagement, EsmeManagementMBean.class, true);
+               this.mbeanServer.registerMBean(esmeMxBean, esmeObjNname);
+
+ ObjectName smscObjNname = new ObjectName(SmscManagement.JMX_DOMAIN + ":name=SmscPropertiesManagement"); + StandardMBean smscMxBean = new StandardMBean(this.smscPropertiesManagement,
+                               SmscPropertiesManagementMBean.class, true);
+               this.mbeanServer.registerMBean(smscMxBean, smscObjNname);
+
                this.persistFile.clear();

                if (persistDir != null) {
@@ -119,86 +141,24 @@
logger.warn(String.format("Failed to load the SS7 configuration file. \n%s", e.getMessage()));
                }

-               this.smppServer.setSmscManagement(this);
-
+               this.smppServer.setEsmeManagement(this.esmeManagement);
+
                logger.info("Started SmscManagement");
        }

        public void stop() throws Exception {
-
+               this.esmeManagement.stop();
+               this.smscPropertiesManagement.stop();
                this.store();
-       }

-       public FastList<Esme> getEsmes() {
-               return esmes;
-       }
+               if (this.mbeanServer != null) {
+ ObjectName esmeObjNname = new ObjectName(SmscManagement.JMX_DOMAIN + ":name=EsmeManagement");
+                       this.mbeanServer.unregisterMBean(esmeObjNname);

-       protected Esme getEsme(String systemId) {
- for (FastList.Node<Esme> n = esmes.head(), end = esmes.tail(); (n = n.getNext()) != end;) {
-                       Esme esme = n.getValue();
-                       if (esme.getSystemId().equals(systemId)) {
-                               return esme;
-                       }
+ ObjectName smscObjNname = new ObjectName(SmscManagement.JMX_DOMAIN + ":name=SmscPropertiesManagement");
+                       this.mbeanServer.unregisterMBean(smscObjNname);
                }
-               return null;
        }
-
-       /**
-        * <p>
-        * Create new {@link Esme}
-        * </p>
-        * <p>
-        * Command is smsc esme create <Any 4/5 digit number> <Specify password>
- * <host-ip> <port> system-type <sms | vms | ota > interface-version <3.3 |
-        * 3.4 | 5.0> esme-ton <esme address ton> esme-npi <esme address npi>
-        * esme-range <esme address range>
-        * </p>
-        * <p>
- * where system-type, interface-version, esme-ton, esme-npi, esme-range are
-        * optional, by default interface-version is 3.4.
-        *
-        * </p>
-        *
-        * @param args
-        * @return
-        * @throws Exception
-        */
- public Esme createEsme(String systemId, String password, String host, String port, SmppBindType smppBindType, String systemType,
-                       SmppInterfaceVersionType smppIntVersion, Address 
address)
-                       throws Exception {
-
-               /* Esme system id should be unique and mandatory for each esme 
*/
-               Esme esme = this.getEsme(systemId);
-               if (esme != null) {
- throw new Exception(String.format(SMSCOAMMessages.CREATE_EMSE_FAIL_ALREADY_EXIST, systemId));
-               }
-
-               // TODO check if RC is already taken?
-               if (smppIntVersion == null) {
-                       smppIntVersion = SmppInterfaceVersionType.SMPP34;
-               }
-
- esme = new Esme(systemId, password, host, port, smppBindType, systemType, smppIntVersion, address);
-               esme.setSmscManagement(this);
-               esmes.add(esme);
-
-               this.store();
-
-               return esme;
-       }
-
-       public Esme destroyEsme(String systemId) throws Exception {
-               Esme esme = this.getEsme(systemId);
-               if (esme == null) {
- throw new Exception(String.format(SMSCOAMMessages.DELETE_ESME_FAILED_NO_ESME_FOUND, systemId));
-               }
-
-               esmes.remove(esme);
-
-               this.store();
-
-               return esme;
-       }

        /**
         * Persist
@@ -207,18 +167,19 @@

                // TODO : Should we keep reference to Objects rather than 
recreating
                // everytime?
-               try {
- XMLObjectWriter writer = XMLObjectWriter.newInstance(new FileOutputStream(persistFile.toString()));
-                       writer.setBinding(binding);
-                       // Enables cross-references.
-                       // writer.setReferenceResolver(new 
XMLReferenceResolver());
-                       writer.setIndentation(TAB_INDENT);
-                       writer.write(esmes, ESME_LIST, FastList.class);
-
-                       writer.close();
-               } catch (Exception e) {
-                       logger.error("Error while persisting the Rule state in 
file", e);
-               }
+               // try {
+               // XMLObjectWriter writer = XMLObjectWriter.newInstance(new
+               // FileOutputStream(persistFile.toString()));
+               // writer.setBinding(binding);
+               // // Enables cross-references.
+               // // writer.setReferenceResolver(new XMLReferenceResolver());
+               // writer.setIndentation(TAB_INDENT);
+               // writer.write(esmes, ESME_LIST, FastList.class);
+               //
+               // writer.close();
+               // } catch (Exception e) {
+               // logger.error("Error while persisting the Rule state in 
file", e);
+               // }
        }

        /**
@@ -228,16 +189,17 @@
         */
        public void load() throws FileNotFoundException {

-               XMLObjectReader reader = null;
-               try {
- reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
-
-                       reader.setBinding(binding);
-                       esmes = reader.read(ESME_LIST, FastList.class);
-
-               } catch (XMLStreamException ex) {
-                       // this.logger.info(
-                       // "Error while re-creating Linksets from persisted 
file", ex);
-               }
+               // XMLObjectReader reader = null;
+               // try {
+               // reader = XMLObjectReader.newInstance(new
+               // FileInputStream(persistFile.toString()));
+               //
+               // reader.setBinding(binding);
+               // esmes = reader.read(ESME_LIST, FastList.class);
+               //
+               // } catch (XMLStreamException ex) {
+               // // this.logger.info(
+               // // "Error while re-creating Linksets from persisted file", 
ex);
+               // }
        }
 }

Reply via email to