package journal.action; import java.util.ArrayList; import java.util.List; import journal.reader.DeleteJournalEntry; import journal.reader.DataJournalEntry; import journal.reader.NoteJournalEntry; import journal.reader.Options; import journal.reader.TransactionJournalEntry; public class CompoundAction implements Action { private List<Action> actions = new ArrayList<Action>(); public void addAction(Action action) { actions.add(action); } @Override public void help() { for( Action a : actions ) a.help(); } @Override public void start() throws Exception { for( Action a : actions ) a.start(); } @Override public void setDefaultOptions(Options options) { // pass } @Override public void finish() throws Exception { for( Action a : actions ) a.finish(); } @Override public String[] parseArgs(String[] args) { for( Action a : actions ) { args = a.parseArgs(args); } return args; } @Override public void putValue(DataJournalEntry entry) throws Exception { for( Action a : actions ) a.putValue(entry); } @Override public void replaceValue(DataJournalEntry entry) throws Exception { for( Action a : actions ) a.replaceValue(entry); } @Override public void deleteValue(DataJournalEntry entry) throws Exception { for( Action a : actions ) a.deleteValue(entry); } @Override public void verifyValue(DataJournalEntry entry) throws Exception { for( Action a : actions ) a.verifyValue(entry); } @Override public void commitMarker(TransactionJournalEntry entry) throws Exception { for( Action a : actions ) a.commitMarker(entry); } @Override public void flushMarker(TransactionJournalEntry entry) throws Exception { for( Action a : actions ) a.flushMarker(entry); } @Override public void journalMarker(NoteJournalEntry entry) throws Exception { for( Action a : actions ) a.journalMarker(entry); } @Override public void deleteMarker(DeleteJournalEntry entry) throws Exception { for( Action a : actions ) a.deleteMarker(entry); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 8296 | Sven Erik Knop |
Clean-up: instead of casting in every action, cast only once in the dispatcher. Should make code saner and safer. No functional change. |
||
#3 | 8200 | Sven Erik Knop |
JournalReader can now process delete records (@dl@). Also fixed processing of type 12 note records = journaldbchecksum |
||
#2 | 8023 | Sven Erik Knop |
Complete rewrite of the configuration file, now based on an ini-file format. The ini file has a general [reader] section for settings like verbose, outputFile, case-sensitivity and so on. It also allows to set up a range of Actions and Filters. The section name here is the fully classified class name, followed by settings for the particular actions. An example will make this clearer: ================================================================ [reader] verbose=true [journal.action.UserRenamer] fileName=user.txt patch=True outputFile=user.out [journal.action.ClientRenamer] fileName=client.txt outputFile=client.out patch=true ================================================================ I will provide more example set-ups in the near future. Filters are classes implementing journal.action.Filter (soon to be journal.filter.Filter) which can be chained together and are all executed before the actions. Actions are applied in order that they are given in the config file. |
||
#1 | 8021 | Sven Erik Knop |
Add compound action, which contains a list of actions that will all be invoked on a JournalEntry. Needs refactoring of the way Options are processed, which will come in a later change. |