private static DataAccessConnection findConnection ( final MasterServer from, final MasterServer to ) { for ( final org.eclipse.scada.configuration.world.osgi.Connection c : from.getConnections () ) { if ( ! ( c instanceof DataAccessConnection ) ) { continue; } for ( final Exporter e : to.getExporter () ) { final Endpoint ep = c.getMatchingEndpoint ( e ); if ( ep != null ) { // this is a common endpoing of the connection and the exporter return (DataAccessConnection)c; } } } return null; }