public class

ErrorLogGenerator

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.client.ErrorLogGenerator

Class Overview

An error log generator.

Summary

Constants
int ERRORLOG_VERSION
Public Constructors
ErrorLogGenerator(Throwable t)
Public Methods
String addRecord(String key, Object value)
Add a new record.
String dumpTo(String folder, String filename, boolean encode)
Dump the log to disk.
String dumpTo(String folder)
Dump the unencoded log to a folder on disk.
String getLog(Collection<String> keys, boolean encode)
Generate a string representation of this error log.
String getLog()
Generate an unencoded string representation of this entire error log.
LinkedHashMap<String, String> getRecords()
Throwable getThrowable()
void recordEnginesInformation(IEnginesContext engctx)
boolean removeRecord(String key)
boolean setRecord(String key, Object value)
Add a new or replace an existing record.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int ERRORLOG_VERSION

Constant Value: 2 (0x00000002)

Public Constructors

public ErrorLogGenerator (Throwable t)

Public Methods

public String addRecord (String key, Object value)

Add a new record. If a record with a similar key exists, it will *not* be replaced.

Returns
  • the actual key that was used to register the record

public String dumpTo (String folder, String filename, boolean encode)

Dump the log to disk.

Parameters
filename optional; if null, will auto-generate a filename (jeb_errorlog_...)
encode true to URL-encode the keys and values

public String dumpTo (String folder)

Dump the unencoded log to a folder on disk.

public String getLog (Collection<String> keys, boolean encode)

Generate a string representation of this error log.

Parameters
keys the keys of records to be generated; use null to mean all; if an ordered collection is provided, the order is maintained
encode true to URL-encode the keys and values
Returns
  • the string representation of this log

public String getLog ()

Generate an unencoded string representation of this entire error log.

Returns
  • the string representation of this log

public LinkedHashMap<String, String> getRecords ()

public Throwable getThrowable ()

public void recordEnginesInformation (IEnginesContext engctx)

public boolean removeRecord (String key)

Returns
  • true if the record was removed

public boolean setRecord (String key, Object value)

Add a new or replace an existing record.

Returns
  • true if the key did not exist, false if a record having a same key was replaced

public String toString ()