public class ObjectStepLogger extends Object implements StepLogger
| Constructor and Description |
|---|
ObjectStepLogger()
Default constructor with no logging.
|
ObjectStepLogger(OutputStream out)
Constructor with output stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the logger output, writes code to close the array and opened object
|
List<StepError> |
getErrors()
Get step errors.
|
StepError |
getFirstError(String id)
Get first
StepError with given name. |
StepError |
getFirstErrorByName(String errorName)
Get first
StepError with given name. |
StepItem |
getFirstItem(String id)
Get first
StepItem with given ID. |
StepItem |
getFirstItemByName(String itemName)
Get first
StepItem with given name. |
List<StepItem> |
getItems()
Get step items.
|
StepRequest |
getRequest()
Get request.
|
StepResponse |
getResponse()
Get response.
|
StepResult |
getResult()
Get step result.
|
void |
start()
Start the object streaming, outputs start of the result object:
|
void |
writeDoneFailed(String id)
Write error about a failed execution.
|
void |
writeDoneOK(String id)
Write information about a successful completion.
|
void |
writeError(String id,
Exception exception)
Write information about an error.
|
void |
writeError(String id,
String errorMessage)
Write information about an error.
|
void |
writeError(String id,
String name,
String errorMessage)
Write information about an error.
|
void |
writeError(String id,
String name,
String errorMessage,
Exception exception)
Write information about an error.
|
void |
writeItem(String id,
String name,
String description,
String status,
Object object)
Writes an object representing the step of the execution.
|
void |
writeServerCall(String id,
String uri,
String method,
Object requestObject,
Map<String,?> headers)
Write the information about the server call.
|
void |
writeServerCallConnectionError(String id,
Exception e)
Write information about service call network connection error.
|
void |
writeServerCallError(String id,
int statusCode,
Object responseObject,
Map<String,?> headers)
Write information about the service call error.
|
void |
writeServerCallOK(String id,
Object responseObject,
Map<String,?> headers)
Write information about the successful server request.
|
public ObjectStepLogger()
public ObjectStepLogger(OutputStream out)
out - Output stream for logging.public void start()
StepLoggerstart in interface StepLoggerpublic void writeItem(String id, String name, String description, String status, Object object)
writeItem in interface StepLoggerid - Step ID.name - Step name.description - Step detailed description.status - Step status result.object - Custom object associated with the step.public void writeServerCall(String id, String uri, String method, Object requestObject, Map<String,?> headers)
writeServerCall in interface StepLoggerid - Step ID.uri - URI that will be called.method - HTTP method of the call.requestObject - Request object, in case of the POST, PUT, DELETE method.headers - HTTP request headers.public void writeServerCallOK(String id, Object responseObject, Map<String,?> headers)
writeServerCallOK in interface StepLoggerid - Step ID.responseObject - HTTP response object.headers - HTTP response headers.public void writeServerCallError(String id, int statusCode, Object responseObject, Map<String,?> headers)
writeServerCallError in interface StepLoggerid - Step ID.statusCode - HTTP response status code.responseObject - HTTP response object.headers - HTTP response headers.public void close()
StepLoggerclose in interface StepLoggerpublic void writeServerCallConnectionError(String id, Exception e)
writeServerCallConnectionError in interface StepLoggerid - Step ID.e - Exception that caused the error.public void writeError(String id, String errorMessage)
writeError in interface StepLoggerid - Step ID.errorMessage - Error message.public void writeError(String id, Exception exception)
writeError in interface StepLoggerid - Step ID.exception - Exception that caused the error.public void writeError(String id, String name, String errorMessage)
writeError in interface StepLoggerid - Step ID.name - Error item name.errorMessage - Error message.public void writeError(String id, String name, String errorMessage, Exception exception)
writeError in interface StepLoggerid - Step ID.name - Error item name.errorMessage - Error message.exception - Exception that caused the error.public void writeDoneOK(String id)
writeDoneOK in interface StepLoggerid - Step ID.public void writeDoneFailed(String id)
writeDoneFailed in interface StepLoggerid - Step ID.public StepItem getFirstItem(String id)
StepItem with given ID.id - Item ID.StepItem with given id or null if logger doesn't contain such item.public StepItem getFirstItemByName(String itemName)
StepItem with given name.itemName - Item name.StepItem with given name or null if logger doesn't contain such item.public StepError getFirstError(String id)
StepError with given name.id - Error ID.StepError with given ID or null if logger doesn't contain such error.public StepError getFirstErrorByName(String errorName)
StepError with given name.errorName - Error name.StepError with given name or null if logger doesn't contain such error.public StepRequest getRequest()
public StepResponse getResponse()
public StepResult getResult()
Copyright © 2016–2020 Wultra s.r.o.. All rights reserved.