Skip to content

Commit eab5fed

Browse files
committed
Handle deindexing event; simplify log
IndexPathsCommand: pass the session event into indexPath and handle DumAemEvent.DEINDEXING by creating a de-index job and returning early; added the DumAemEvent import and updated the indexPath signature. DumAemJobService: simplified the DeIndex log message to remove the "- infinity Json file not found" suffix. These changes enable explicit de-indexing flows and produce cleaner logs.
1 parent 1e64fff commit eab5fed

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

aem/aem-plugin/src/main/java/com/viglet/dumont/connector/plugin/aem/command/impl/IndexPathsCommand.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import org.apache.commons.lang3.StringUtils;
2121

22+
import com.viglet.dumont.connector.aem.commons.bean.DumAemEvent;
2223
import com.viglet.dumont.connector.aem.commons.utils.DumAemCommonsUtils;
2324
import com.viglet.dumont.connector.plugin.aem.command.IndexingCommand;
2425
import com.viglet.dumont.connector.plugin.aem.context.DumAemSession;
@@ -57,15 +58,20 @@ public void execute() {
5758

5859
paths.stream()
5960
.filter(StringUtils::isNotBlank)
60-
.forEach(this::indexPath);
61+
.forEach(path -> indexPath(path, session.getEvent()));
6162
}
6263

6364
/**
6465
* Indexes a single path, creating a de-index job if content is not found.
6566
*/
66-
private void indexPath(String path) {
67+
private void indexPath(String path, DumAemEvent event) {
6768
log.debug("Processing path: {}", path);
6869

70+
if (event.equals(DumAemEvent.DEINDEXING)) {
71+
createDeIndexJob(path);
72+
return;
73+
}
74+
6975
DumAemCommonsUtils.getInfinityJson(path, session.getConfiguration(), false)
7076
.ifPresentOrElse(
7177
infinityJson -> nodeNavigator.navigateAndIndex(session, path, infinityJson),

aem/aem-plugin/src/main/java/com/viglet/dumont/connector/plugin/aem/service/DumAemJobService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public void createDeIndexJobAndSendToConnectorQueue(DumAemSession dumAemSession,
214214

215215
indexingItems.forEach(indexing -> {
216216
try {
217-
log.info("DeIndex initiated for {} - infinity Json file not found.",
217+
log.info("DeIndex initiated for {}.",
218218
DumAemPluginUtils.getObjectDetailForLogs(contentId,
219219
indexing,
220220
dumAemSession));

0 commit comments

Comments
 (0)