Skip to content

Commit

Permalink
0001625 - New events attribute for getting scripts associated with a …
Browse files Browse the repository at this point in the history
…given load filter.
  • Loading branch information
jhicks committed May 13, 2014
1 parent 5d7a699 commit b4c6f91
Showing 1 changed file with 21 additions and 0 deletions.
Expand Up @@ -223,7 +223,28 @@ public void setHandleErrorScript(String handleErrorScript) {
public String getHandleErrorScript() {
return handleErrorScript;
}

public String getEvents() {
StringBuilder events = new StringBuilder();
buildStringBasedList(getBeforeWriteScript(), events, "Before Write");
buildStringBasedList(getAfterWriteScript(), events, "After Write");
buildStringBasedList(getBatchCompleteScript(), events, "Batch Complete");
buildStringBasedList(getBatchCommitScript(), events, "Batch Commit");
buildStringBasedList(getBatchRollbackScript(), events, "Batch Rollback");
buildStringBasedList(getHandleErrorScript(), events, "Handle Error");

return events.toString();
}

private void buildStringBasedList(String source, StringBuilder target, String value) {
if (source != null && !source.equals("")) {
if (target.length() > 0) {
target.append(", ");
}
target.append(value);
}
}

@Override
public boolean equals(Object obj) {
if (obj instanceof LoadFilter && loadFilterId != null) {
Expand Down

0 comments on commit b4c6f91

Please sign in to comment.