Skip to content

Commit 34f3f7f

Browse files
schlotzereimer-atb
authored andcommitted
configurable indexer
1 parent 1ea53f1 commit 34f3f7f

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-2
lines changed

context-monitoring/src/main/java/de/atb/context/monitoring/monitors/ThreadedMonitor.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ protected ThreadedMonitor(final DataSource dataSource,
101101

102102
public abstract void monitor() throws Exception;
103103

104+
protected abstract boolean isIndexEnabled();
105+
104106
public final void stop() {
105107
// if (this.isRunning()) {
106108
this.shutdown();
@@ -160,8 +162,10 @@ protected final void parseAndAnalyse(final P objectToParse,
160162
if (parser.parse(objectToParse)) {
161163
final Document document = parser.getDocument();
162164
this.raiseParsedEvent(objectToParse, document);
163-
this.indexer.addDocumentToIndex(document);
164-
this.raiseIndexedEvent(document);
165+
if (isIndexEnabled()) {
166+
this.indexer.addDocumentToIndex(document);
167+
this.raiseIndexedEvent(document);
168+
}
165169
final List<A> analysedModels = analyser.analyse(objectToParse);
166170
this.raiseAnalysedEvent(analysedModels, objectToParse, analyser.getDocument());
167171
}

context-monitoring/src/main/java/de/atb/context/monitoring/monitors/database/DatabaseMonitor.java

+5
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ protected InterpreterConfiguration getInterpreterConfiguration() {
6969
return this.interpreter.getConfiguration("monitoring-config.xml");
7070
}
7171

72+
@Override
73+
protected boolean isIndexEnabled() {
74+
return false;
75+
}
76+
7277
@Override
7378
protected void doMonitor(final InterpreterConfiguration setting) {
7479
if (setting != null) {

context-monitoring/src/main/java/de/atb/context/monitoring/monitors/file/AbstractFileSystemMonitor.java

+5
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ public final void run() {
8888
}
8989
}
9090

91+
@Override
92+
protected boolean isIndexEnabled() {
93+
return true;
94+
}
95+
9196
@Override
9297
public final void monitor() throws Exception {
9398
this.logger.info("Starting monitoring for path " + this.pathToMonitor);

context-monitoring/src/main/java/de/atb/context/monitoring/monitors/messagebroker/MessageBrokerMonitor.java

+5
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ protected InterpreterConfiguration getInterpreterConfiguration() {
7777
return this.interpreter.getConfigurations().isEmpty() ? null : this.interpreter.getConfigurations().get(0);
7878
}
7979

80+
@Override
81+
protected boolean isIndexEnabled() {
82+
return false;
83+
}
84+
8085
@Override
8186
protected void doMonitor(final InterpreterConfiguration setting) throws Exception {
8287
if (setting != null) {

context-monitoring/src/main/java/de/atb/context/monitoring/monitors/webservice/WebServiceMonitor.java

+5
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ protected long getScheduleInitialDelay() {
6969
return this.dataSource.getStartDelay() != null ? this.dataSource.getStartDelay() : getSchedulePeriod();
7070
}
7171

72+
@Override
73+
protected boolean isIndexEnabled() {
74+
return false;
75+
}
76+
7277
@Override
7378
protected void doMonitor(final InterpreterConfiguration setting) {
7479
if (setting != null) {

0 commit comments

Comments
 (0)