/** * Creates and initializes a BatchInterrupted object. * * @param cause exception that caused batch processing to stop * @param totalCount number of entries parsed so far, note that * it is to be expected that {@code totalCount >= successCount + errorCount} * @param successCount number of entries processed successfully so far * @param errorCount number of entries rejected so far */ public BatchInterrupted(Throwable cause, int totalCount, int successCount, int errorCount) { this(getReasonFromException(cause), totalCount, successCount, errorCount); if (cause instanceof ServiceException) { ServiceException se = (ServiceException)cause; content = se.getResponseBody(); contentType = se.getResponseContentType(); } }
/** * Creates and initializes a BatchInterrupted object. * * @param cause exception that caused batch processing to stop * @param totalCount number of entries parsed so far, note that * it is to be expected that {@code totalCount >= successCount + errorCount} * @param successCount number of entries processed successfully so far * @param errorCount number of entries rejected so far */ public BatchInterrupted(Throwable cause, int totalCount, int successCount, int errorCount) { this(getReasonFromException(cause), totalCount, successCount, errorCount); if (cause instanceof ServiceException) { ServiceException se = (ServiceException)cause; content = se.getResponseBody(); contentType = se.getResponseContentType(); } }
/** * Creates and initializes a BatchInterrupted object. * * @param cause exception that caused batch processing to stop * @param totalCount number of entries parsed so far, note that * it is to be expected that {@code totalCount >= successCount + errorCount} * @param successCount number of entries processed successfully so far * @param errorCount number of entries rejected so far */ public BatchInterrupted(Throwable cause, int totalCount, int successCount, int errorCount) { this(getReasonFromException(cause), totalCount, successCount, errorCount); if (cause instanceof ServiceException) { ServiceException se = (ServiceException)cause; content = se.getResponseBody(); contentType = se.getResponseContentType(); } }
/** * Creates a BatchStatus and initializes it * based on an exception. * * @param e */ public BatchStatus(ServiceException e) { code = e.getHttpErrorCodeOverride(); if (code == -1) { code = HttpURLConnection.HTTP_INTERNAL_ERROR; } reason = e.getMessage(); contentType = e.getResponseContentType(); content = e.getResponseBody(); }
/** * Extracts errors from a {@link ServiceException}. * * @param e the ServiceException to be parsed */ public void addErrors(ServiceException e) { addErrors(e.getMessage(), e.getResponseContentType(), e.getResponseBody()); }
/** * Extracts errors from a {@link ServiceException}. * * @param e the ServiceException to be parsed */ public void addErrors(ServiceException e) { addErrors(e.getMessage(), e.getResponseContentType(), e.getResponseBody()); }
/** * Creates a BatchStatus and initializes it * based on an exception. * * @param e */ public BatchStatus(ServiceException e) { code = e.getHttpErrorCodeOverride(); if (code == -1) { code = HttpURLConnection.HTTP_INTERNAL_ERROR; } reason = e.getMessage(); contentType = e.getResponseContentType(); content = e.getResponseBody(); }
/** * Creates a BatchStatus and initializes it * based on an exception. * * @param e */ public BatchStatus(ServiceException e) { code = e.getHttpErrorCodeOverride(); if (code == -1) { code = HttpURLConnection.HTTP_INTERNAL_ERROR; } reason = e.getMessage(); contentType = e.getResponseContentType(); content = e.getResponseBody(); }
if ((se.getResponseContentType() == null) || (se.getResponseBody() == null)) { return null; if ((se.getResponseContentType().equals(new ContentType("text/xml"))) && (se.getResponseBody().contains("AppsForYourDomainErrors"))) { try {
if ((se.getResponseContentType() == null) || (se.getResponseBody() == null)) { return null; if ((se.getResponseContentType().equals(new ContentType("text/xml"))) && (se.getResponseBody().contains("AppsForYourDomainErrors"))) { try {
/** * Creates and initializes a BatchInterrupted object. * * @param cause exception that caused batch processing to stop * @param totalCount number of entries parsed so far, note that * it is to be expected that {@code totalCount >= successCount + errorCount} * @param successCount number of entries processed successfully so far * @param errorCount number of entries rejected so far */ public BatchInterrupted(Throwable cause, int totalCount, int successCount, int errorCount) { this(getReasonFromException(cause), totalCount, successCount, errorCount); if (cause instanceof ServiceException) { ServiceException se = (ServiceException)cause; setContent(se.getResponseBody()); setContentType(se.getResponseContentType()); } }
/** * Creates and initializes a BatchInterrupted object. * * @param cause exception that caused batch processing to stop * @param totalCount number of entries parsed so far, note that * it is to be expected that {@code totalCount >= successCount + errorCount} * @param successCount number of entries processed successfully so far * @param errorCount number of entries rejected so far */ public BatchInterrupted(Throwable cause, int totalCount, int successCount, int errorCount) { this(getReasonFromException(cause), totalCount, successCount, errorCount); if (cause instanceof ServiceException) { ServiceException se = (ServiceException)cause; setContent(se.getResponseBody()); setContentType(se.getResponseContentType()); } }
/** * Creates and initializes a BatchInterrupted object. * * @param cause exception that caused batch processing to stop * @param totalCount number of entries parsed so far, note that * it is to be expected that {@code totalCount >= successCount + errorCount} * @param successCount number of entries processed successfully so far * @param errorCount number of entries rejected so far */ public BatchInterrupted(Throwable cause, int totalCount, int successCount, int errorCount) { this(getReasonFromException(cause), totalCount, successCount, errorCount); if (cause instanceof ServiceException) { ServiceException se = (ServiceException)cause; setContent(se.getResponseBody()); setContentType(se.getResponseContentType()); } }
/** * Creates a BatchStatus and initializes it * based on an exception. * * @param e exception to initialize the status from */ public BatchStatus(ServiceException e) { this(); int code = e.getHttpErrorCodeOverride(); if (code == -1) { code = HttpURLConnection.HTTP_INTERNAL_ERROR; } setCode(code); setReason(e.getMessage()); setContentType(e.getResponseContentType()); setContent(e.getResponseBody()); }
/** * Creates a BatchStatus and initializes it * based on an exception. * * @param e exception to initialize the status from */ public BatchStatus(ServiceException e) { this(); int code = e.getHttpErrorCodeOverride(); if (code == -1) { code = HttpURLConnection.HTTP_INTERNAL_ERROR; } setCode(code); setReason(e.getMessage()); setContentType(e.getResponseContentType()); setContent(e.getResponseBody()); }
/** * Creates a BatchStatus and initializes it * based on an exception. * * @param e exception to initialize the status from */ public BatchStatus(ServiceException e) { this(); int code = e.getHttpErrorCodeOverride(); if (code == -1) { code = HttpURLConnection.HTTP_INTERNAL_ERROR; } setCode(code); setReason(e.getMessage()); setContentType(e.getResponseContentType()); setContent(e.getResponseBody()); }