/** * Adds a task to the executor service to post call logs to the Restlet Cloud * analytics service. * * If the executor service cannot satisfy the request, the call logs are * lost and an error message is logged with the reason of the failure. * * @param logsToPost * The call logs to post to the Restlet Cloud analytics service. */ private void postLogs(CallLogs logsToPost) { try { executorService.execute(new AsyncCallLogsPostTask(logsToPost)); } catch (RejectedExecutionException e) { LOGGER.severe("Posting " + logsToPost.size() + " call logs failed permanently due to \"" + e.getCause().getMessage() + "\"."); errorSendLog(logsToPost); } }
@Override public void run() { for (int attemptNumber = 1; attemptNumber <= MAX_ATTEMPTS + 1; attemptNumber++) { try { analyticsClientResource.postLogs(logsToPost); LOGGER.fine(logsToPost.size() + " call logs sent to the analytics service."); break; } catch (Exception e) { if (attemptNumber == MAX_ATTEMPTS) { LOGGER.severe("Posting " + logsToPost.size() + " call logs failed permanently after " + MAX_ATTEMPTS + " attempts."); errorSendLog(logsToPost); } else { LOGGER.warning("Error sending " + logsToPost.size() + " call logs to the analytics service during attempt n°" + attemptNumber + " because \"" + e.getMessage() + "\"."); try { Thread.sleep(getRetryTime(attemptNumber)); } catch (InterruptedException e1) { // ignore } } } } }
@Override public void run() { for (int attemptNumber = 1; attemptNumber <= MAX_ATTEMPTS + 1; attemptNumber++) { try { analyticsClientResource.postLogs(logsToPost); LOGGER.fine(logsToPost.size() + " call logs sent to the analytics service."); break; } catch (Exception e) { if (attemptNumber == MAX_ATTEMPTS) { LOGGER.severe("Posting " + logsToPost.size() + " call logs failed permanently after " + MAX_ATTEMPTS + " attempts."); errorSendLog(logsToPost); } else { LOGGER.warning("Error sending " + logsToPost.size() + " call logs to the analytics service during attempt n°" + attemptNumber + " because \"" + e.getMessage() + "\"."); try { Thread.sleep(getRetryTime(attemptNumber)); } catch (InterruptedException e1) { // ignore } } } } }
@Override public void run() { for (int attemptNumber = 1; attemptNumber <= MAX_ATTEMPTS + 1; attemptNumber++) { try { analyticsClientResource.postLogs(logsToPost); LOGGER.fine(logsToPost.size() + " call logs sent to the analytics service."); break; } catch (Exception e) { if (attemptNumber == MAX_ATTEMPTS) { LOGGER.severe("Posting " + logsToPost.size() + " call logs failed permanently after " + MAX_ATTEMPTS + " attempts."); errorSendLog(logsToPost); } else { LOGGER.warning("Error sending " + logsToPost.size() + " call logs to the analytics service during attempt n°" + attemptNumber + " because \"" + e.getMessage() + "\"."); try { Thread.sleep(getRetryTime(attemptNumber)); } catch (InterruptedException e1) { // ignore } } } } }
@Override public void run() { for (int attemptNumber = 1; attemptNumber <= MAX_ATTEMPTS + 1; attemptNumber++) { try { analyticsClientResource.postLogs(logsToPost); LOGGER.fine(logsToPost.size() + " call logs sent to the analytics service."); break; } catch (Exception e) { if (attemptNumber == MAX_ATTEMPTS) { LOGGER.severe("Posting " + logsToPost.size() + " call logs failed permanently after " + MAX_ATTEMPTS + " attempts."); errorSendLog(logsToPost); } else { LOGGER.warning("Error sending " + logsToPost.size() + " call logs to the analytics service during attempt n°" + attemptNumber + " because \"" + e.getMessage() + "\"."); try { Thread.sleep(getRetryTime(attemptNumber)); } catch (InterruptedException e1) { // ignore } } } } }
/** * Adds a task to the executor service to post call logs to the Restlet Cloud * analytics service. * * If the executor service cannot satisfy the request, the call logs are * lost and an error message is logged with the reason of the failure. * * @param logsToPost * The call logs to post to the Restlet Cloud analytics service. */ private void postLogs(CallLogs logsToPost) { try { executorService.execute(new AsyncCallLogsPostTask(logsToPost)); } catch (RejectedExecutionException e) { LOGGER.severe("Posting " + logsToPost.size() + " call logs failed permanently due to \"" + e.getCause().getMessage() + "\"."); errorSendLog(logsToPost); } }
/** * Adds a task to the executor service to post call logs to the Restlet Cloud * analytics service. * * If the executor service cannot satisfy the request, the call logs are * lost and an error message is logged with the reason of the failure. * * @param logsToPost * The call logs to post to the Restlet Cloud analytics service. */ private void postLogs(CallLogs logsToPost) { try { executorService.execute(new AsyncCallLogsPostTask(logsToPost)); } catch (RejectedExecutionException e) { LOGGER.severe("Posting " + logsToPost.size() + " call logs failed permanently due to \"" + e.getCause().getMessage() + "\"."); errorSendLog(logsToPost); } }
/** * Adds a task to the executor service to post call logs to the Restlet Cloud * analytics service. * * If the executor service cannot satisfy the request, the call logs are * lost and an error message is logged with the reason of the failure. * * @param logsToPost * The call logs to post to the Restlet Cloud analytics service. */ private void postLogs(CallLogs logsToPost) { try { executorService.execute(new AsyncCallLogsPostTask(logsToPost)); } catch (RejectedExecutionException e) { LOGGER.severe("Posting " + logsToPost.size() + " call logs failed permanently due to \"" + e.getCause().getMessage() + "\"."); errorSendLog(logsToPost); } }