git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Programs for which there was already an attempt to record them will no
[utils]
/
crawler
/
kiss
/
src
/
org
/
wamblee
/
crawler
/
kiss
/
main
/
ProgramConfigurationParser.java
diff --git
a/crawler/kiss/src/org/wamblee/crawler/kiss/main/ProgramConfigurationParser.java
b/crawler/kiss/src/org/wamblee/crawler/kiss/main/ProgramConfigurationParser.java
index 103ec0702c6caea299ca6583e265797c6e7cc8ee..c16f4f93df34043fe9fde22297cff6cc81559944 100644
(file)
--- a/
crawler/kiss/src/org/wamblee/crawler/kiss/main/ProgramConfigurationParser.java
+++ b/
crawler/kiss/src/org/wamblee/crawler/kiss/main/ProgramConfigurationParser.java
@@
-38,11
+38,9
@@
import org.wamblee.crawler.kiss.notification.Notifier;
* Parse the configuration of desired programs.
*/
class ProgramConfigurationParser {
* Parse the configuration of desired programs.
*/
class ProgramConfigurationParser {
-
- /**
- *
- */
private static final int DEFAULT_SMTP_PORT = 25;
private static final int DEFAULT_SMTP_PORT = 25;
+
+ private static final int DEFAULT_PRIORITY = 1;
private static final String ELEM_PASSWORD = "password";
private static final String ELEM_PASSWORD = "password";
@@
-74,6
+72,8
@@
class ProgramConfigurationParser {
// Configuration of interesting programs.
private static final String ELEM_PROGRAM = "program";
// Configuration of interesting programs.
private static final String ELEM_PROGRAM = "program";
+
+ private static final String ELEM_PRIORITY = "priority";
private static final String ELEM_PATTERN = "match";
private static final String ELEM_PATTERN = "match";
@@
-117,7
+117,12
@@
class ProgramConfigurationParser {
}
Element actionElem = program.element(ELEM_ACTION);
}
Element actionElem = program.element(ELEM_ACTION);
- ProgramAction action = new RecordProgramAction(1);
+ int priority = DEFAULT_PRIORITY;
+ String priorityString = program.elementTextTrim(ELEM_PRIORITY);
+ if ( priorityString != null ) {
+ priority = Integer.valueOf(priorityString);
+ }
+ ProgramAction action = new RecordProgramAction(priority);
if (actionElem != null) {
if (actionElem.getText().equals(ACTION_NOTIFY)) {
action = new InterestingProgramAction(category);
if (actionElem != null) {
if (actionElem.getText().equals(ACTION_NOTIFY)) {
action = new InterestingProgramAction(category);