Search in sources :

Example 1 with MReplication

use of org.compiere.model.MReplication in project adempiere by adempiere.

the class ReplicationLocal method connectRemote.

//	doIt
/**
	 * 	Connect to Remote Server
	 *	@throws java.lang.Exception
	 */
private void connectRemote() throws Exception {
    //	Replication Info
    m_replication = new MReplication(getCtx(), getRecord_ID(), get_TrxName());
    //
    String AppsHost = m_replication.getHostAddress();
    int AppsPort = m_replication.getHostPort();
    CConnection connection = new CConnection(AppsHost);
    connection.setAppsPort(AppsPort);
    log.info(AppsHost + ":" + AppsPort);
    try {
        Server server = connection.getServer();
        //	log.fine("- ServerHome: " + serverHome);
        if (server == null)
            throw new Exception("NoServer");
        m_serverRemote = server;
    //	log.fine("- Server: " + m_serverRemote);
    //	log.fine("- Remote Status = " + m_serverRemote.getStatus());
    } catch (Exception ex) {
        log.log(Level.SEVERE, "connectRemote", ex);
        throw new Exception(ex);
    }
}
Also used : CConnection(org.compiere.db.CConnection) Server(org.compiere.interfaces.Server) MReplication(org.compiere.model.MReplication) SQLException(java.sql.SQLException)

Aggregations

SQLException (java.sql.SQLException)1 CConnection (org.compiere.db.CConnection)1 Server (org.compiere.interfaces.Server)1 MReplication (org.compiere.model.MReplication)1