RestComm / gmlc

Restcomm Location Server
http://www.restcomm.com/
GNU Affero General Public License v3.0
17 stars 37 forks source link

Improve code by replacing hard-codes and misplaced references to USSD #8

Closed nhanth87 closed 8 years ago

nhanth87 commented 8 years ago

In GMLC code, there're many place that hard coded and confuse function name, we must refactory to easy read.

Example: convertAddressFieldToSCCPAddress() and getServiceCenterSccpAddress() --> getMSCAddress, getGMLCAddress()

RequestedInfo requestedInfo = new RequestedInfoImpl(true, true, null, false, null, false, false, false); --> should clarify which's true, true and false..

BR, TN

FerUy commented 8 years ago

True about confusing pieces of code, there're a lot of references to USSD, for example in GmlcManagement.java:

    protected static final String USSD_PERSIST_DIR_KEY = "gmlc.persist.dir";

    public void start() throws Exception {
    this.gmlcPropertiesManagement = GmlcPropertiesManagement.getInstance(this.name);
    this.gmlcPropertiesManagement.setPersistDir(this.persistDir);
    this.gmlcPropertiesManagement.start();

    // Register the MBeans
    this.mbeanServer = MBeanServerLocator.locateJBoss();

    ObjectName ussdPropObjNname = new ObjectName(GmlcManagement.JMX_DOMAIN + ":name=GmlcPropertiesManagement");
    StandardMBean ussdPropMxBean = new StandardMBean(this.gmlcPropertiesManagement,
            GmlcPropertiesManagementMBean.class, true);
    this.mbeanServer.registerMBean(ussdPropMxBean, ussdPropObjNname);

    logger.info("Started GMLC Management");
}

public void stop() throws Exception {
    this.gmlcPropertiesManagement.stop();

    if (this.mbeanServer != null) {

        ObjectName ussdPropObjNname = new ObjectName(GmlcManagement.JMX_DOMAIN + ":name=GmlcPropertiesManagement");
        this.mbeanServer.unregisterMBean(ussdPropObjNname);
    }
}
FerUy commented 8 years ago

Resolved by PR #68