* @return
* @throws Exception
*/
public ApplicationConnection
connectApplication(final Long accountId, final String apiKey) throws Exception{
final Application application = getApplicationByKey(apiKey);
final UserAccount account = getAccountDaoImp().getUserAccountById(accountId);
final ApplicationConnection app = searchConnectionByAppIdAndUserId(account, application);
ApplicationConnection applicationConnection = null;
if (app != null) {
log.debug("Removing application connection id "+app.getConnectionId());