239 lines
7.3 KiB
Java
239 lines
7.3 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.nre.util.Array
|
|
*/
|
|
package javax.baja.job;
|
|
|
|
import com.tridium.util.ThrowableUtil;
|
|
import java.util.StringTokenizer;
|
|
import javax.baja.job.JobLogItem;
|
|
import javax.baja.nre.util.Array;
|
|
import javax.baja.sys.BAbsTime;
|
|
import javax.baja.util.BFormat;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public final class JobLog {
|
|
Array items;
|
|
int limit;
|
|
static /* synthetic */ Class class$javax$baja$job$JobLogItem;
|
|
|
|
public final int size() {
|
|
return this.items.size();
|
|
}
|
|
|
|
public final JobLogItem getItem(int n) {
|
|
return (JobLogItem)this.items.get(n);
|
|
}
|
|
|
|
public final JobLogItem[] getItems() {
|
|
return (JobLogItem[])this.items.trim();
|
|
}
|
|
|
|
public final void setLimit(int n) {
|
|
this.limit = n;
|
|
if (n > -1) {
|
|
while (this.items.size() > n) {
|
|
this.items.remove(0);
|
|
}
|
|
}
|
|
}
|
|
|
|
public final int getLimit() {
|
|
return this.limit;
|
|
}
|
|
|
|
public final void start(String string) {
|
|
this.add(new JobLogItem(1, string));
|
|
}
|
|
|
|
public final void start(String string, String string2, String[] stringArray) {
|
|
this.add(new JobLogItem(1, string, string2, stringArray));
|
|
}
|
|
|
|
public final void endSuccess(String string) {
|
|
this.end(3, string, null);
|
|
}
|
|
|
|
public final void endSuccess(String string, String string2, String[] stringArray) {
|
|
this.end(3, string, string2, stringArray, null);
|
|
}
|
|
|
|
public final void endSuccess() {
|
|
this.end(3, null, null);
|
|
}
|
|
|
|
public final void endFailed(String string, Throwable throwable) {
|
|
this.end(4, string, throwable);
|
|
}
|
|
|
|
public final void endFailed(String string, String string2, String[] stringArray, Throwable throwable) {
|
|
this.end(4, string, string2, stringArray, throwable);
|
|
}
|
|
|
|
public final void endFailed(Throwable throwable) {
|
|
this.end(4, null, throwable);
|
|
}
|
|
|
|
public final void endFailed(String string) {
|
|
this.end(4, string, null);
|
|
}
|
|
|
|
public final void endFailed(String string, String string2, String[] stringArray) {
|
|
this.end(4, string, string2, stringArray, null);
|
|
}
|
|
|
|
public final void end(int n, String string, Throwable throwable) {
|
|
JobLogItem jobLogItem = (JobLogItem)this.items.last();
|
|
if (jobLogItem == null) {
|
|
return;
|
|
}
|
|
jobLogItem.id = n;
|
|
jobLogItem.timestamp = BAbsTime.make();
|
|
if (string != null && string.length() > 0) {
|
|
jobLogItem.message = jobLogItem.message + "; " + string;
|
|
}
|
|
if (throwable != null) {
|
|
jobLogItem.details = ThrowableUtil.dumpToString(throwable);
|
|
}
|
|
}
|
|
|
|
public final void end(int n, String string, String string2, String[] stringArray, Throwable throwable) {
|
|
JobLogItem jobLogItem = (JobLogItem)this.items.last();
|
|
if (jobLogItem == null) {
|
|
return;
|
|
}
|
|
jobLogItem.id = n;
|
|
jobLogItem.timestamp = BAbsTime.make();
|
|
if (string != null && string.length() > 0) {
|
|
String string3 = BFormat.getLexiconPattern(string, string2, stringArray);
|
|
jobLogItem.message = jobLogItem.message + "; " + string3;
|
|
}
|
|
if (throwable != null) {
|
|
jobLogItem.details = ThrowableUtil.dumpToString(throwable);
|
|
}
|
|
}
|
|
|
|
public final void message(String string) {
|
|
this.add(new JobLogItem(0, string));
|
|
}
|
|
|
|
public final void message(String string, String string2, String[] stringArray) {
|
|
this.add(new JobLogItem(0, string, string2, stringArray));
|
|
}
|
|
|
|
public final void message(String string, String string2, String string3) {
|
|
this.add(new JobLogItem(0, string, string2, new String[]{string3}));
|
|
}
|
|
|
|
public final void message(String string, String string2) {
|
|
this.add(new JobLogItem(0, string, string2, null));
|
|
}
|
|
|
|
public final void success(String string) {
|
|
this.add(new JobLogItem(3, string));
|
|
}
|
|
|
|
public final void success(String string, String string2, String string3) {
|
|
this.add(new JobLogItem(3, string, string2, new String[]{string3}));
|
|
}
|
|
|
|
public final void success(String string, String string2) {
|
|
this.add(new JobLogItem(3, string, string2, null));
|
|
}
|
|
|
|
public final void success(String string, String string2, String[] stringArray) {
|
|
this.add(new JobLogItem(3, string, string2, stringArray));
|
|
}
|
|
|
|
public final void failed(String string) {
|
|
this.add(new JobLogItem(4, string));
|
|
}
|
|
|
|
public final void failed(String string, String string2, String[] stringArray) {
|
|
this.add(new JobLogItem(4, string, string2, stringArray));
|
|
}
|
|
|
|
public final void failed(String string, String string2, String string3) {
|
|
this.add(new JobLogItem(4, string, string2, new String[]{string3}));
|
|
}
|
|
|
|
public final void failed(String string, String string2) {
|
|
this.add(new JobLogItem(4, string, string2, null));
|
|
}
|
|
|
|
public final void failed(String string, Throwable throwable) {
|
|
this.add(new JobLogItem(4, string, throwable));
|
|
}
|
|
|
|
public final void failed(String string, String string2, String[] stringArray, Throwable throwable) {
|
|
this.add(new JobLogItem(4, string, string2, stringArray, throwable));
|
|
}
|
|
|
|
public final void failed(String string, String string2, String string3, Throwable throwable) {
|
|
this.add(new JobLogItem(4, string, string2, new String[]{string3}, throwable));
|
|
}
|
|
|
|
public final void failed(String string, String string2, Throwable throwable) {
|
|
this.add(new JobLogItem(4, string, string2, null, throwable));
|
|
}
|
|
|
|
public final void add(JobLogItem jobLogItem) {
|
|
this.items.add((Object)jobLogItem);
|
|
if (this.limit > -1) {
|
|
while (this.items.size() > this.limit) {
|
|
this.items.remove(0);
|
|
}
|
|
}
|
|
}
|
|
|
|
public final String encode() {
|
|
StringBuffer stringBuffer = new StringBuffer();
|
|
int n = 0;
|
|
while (n < this.size()) {
|
|
stringBuffer.append(this.getItem(n).encode()).append('\n');
|
|
++n;
|
|
}
|
|
return stringBuffer.toString();
|
|
}
|
|
|
|
public static final JobLog decode(String string) throws Exception {
|
|
JobLog jobLog = new JobLog();
|
|
StringTokenizer stringTokenizer = new StringTokenizer(string, "\n");
|
|
while (stringTokenizer.hasMoreTokens()) {
|
|
jobLog.add(JobLogItem.decode(stringTokenizer.nextToken()));
|
|
}
|
|
return jobLog;
|
|
}
|
|
|
|
static /* synthetic */ Class class(String string, boolean bl) {
|
|
try {
|
|
Class<?> clazz = Class.forName(string);
|
|
if (!bl) {
|
|
clazz = clazz.getComponentType();
|
|
}
|
|
return clazz;
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
|
|
private final /* synthetic */ void this() {
|
|
Class clazz = class$javax$baja$job$JobLogItem;
|
|
if (clazz == null) {
|
|
clazz = class$javax$baja$job$JobLogItem = JobLog.class("[Ljavax.baja.job.JobLogItem;", false);
|
|
}
|
|
this.items = new Array(clazz);
|
|
this.limit = -1;
|
|
}
|
|
|
|
public JobLog() {
|
|
this.this();
|
|
}
|
|
}
|
|
|