public abstract class ErrorableProcess extends Object implements Loggable
Modifier and Type | Field and Description |
---|---|
List<String> |
errors |
org.apache.logging.log4j.Logger |
log |
List<String> |
warnings |
Constructor and Description |
---|
ErrorableProcess(co.ecg.alpaca.toolkit.model.BroadWorksServer bws) |
Modifier and Type | Method and Description |
---|---|
void |
checkValidity()
Checks the validity of the process
|
String |
exception(Throwable throwable)
Adds an exception error to the errors to report.
|
List<String> |
getErrors()
Retrieves the Error list
|
String |
getReport() |
List<String> |
getWarnings()
Retrieves the Warning list
|
boolean |
hasErrors()
Reports if the process contains errors
|
boolean |
isError(co.ecg.alpaca.toolkit.messaging.response.Response response)
Checks if a response is an error -- If so add the response message to the list of errors
|
boolean |
isError(co.ecg.alpaca.toolkit.messaging.response.Response response,
boolean markErrorCodesAsWarnings,
String... expectedErrorCodes)
Checks if a Response is an error with optional expected error codes
|
boolean |
isError(co.ecg.alpaca.toolkit.messaging.response.Response response,
String... expectedErrorCodes)
Checks if a Response is an error with optional expected error codes
|
void |
printReport(PrintStream out)
Prints a report of errors and warnings to the provided printstream.
|
void |
setExceptionOnErrors(boolean exceptionOnErrors)
Determines whether to throw an exception on errors or just log.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSessionLogger, logger
public ErrorableProcess(co.ecg.alpaca.toolkit.model.BroadWorksServer bws)
public void setExceptionOnErrors(boolean exceptionOnErrors)
exceptionOnErrors
- a booleanpublic List<String> getWarnings()
public boolean hasErrors()
public void checkValidity() throws HelperException
HelperException
public void printReport(PrintStream out)
out
- The printstream to write the reportpublic String getReport()
public String exception(Throwable throwable)
throwable
- public boolean isError(co.ecg.alpaca.toolkit.messaging.response.Response response)
response
- The response to checkpublic boolean isError(co.ecg.alpaca.toolkit.messaging.response.Response response, String... expectedErrorCodes)
response
- The response to checkexpectedErrorCodes
- The array of expected error codespublic boolean isError(co.ecg.alpaca.toolkit.messaging.response.Response response, boolean markErrorCodesAsWarnings, String... expectedErrorCodes)
response
- The response to checkmarkErrorCodesAsWarnings
- Flag to add expected error codes as warning messages.expectedErrorCodes
- The array of expected error codesCopyright © 2016. All rights reserved.