Skip to content

Commit

Permalink
refactor: change method signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
sitepark-veltrup committed Jun 29, 2022
1 parent 11483f7 commit 113506a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.sitepark.ies.contentrepository.core.port;

import com.sitepark.ies.contentrepository.core.domain.entity.Entity;

public interface SearchIndex {
void index(Entity entity);
void index(long id);
void remove(long id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ public void recover(long id) {

this.historyManager.createEntry(id, System.currentTimeMillis(), HistoryEntryType.RESTORED);

this.searchIndex.index(entity);
this.searchIndex.index(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private Identifier create(Entity newEntity) {
this.repository.store(versioned);
this.historyManager.createEntry(generatedId, versioned.getVersion().get().getTimestamp(),
HistoryEntryType.CREATED);
this.searchIndex.index(versioned);
this.searchIndex.index(generatedId);

return versioned.getIdentifier().get();
}
Expand Down Expand Up @@ -104,10 +104,9 @@ private Identifier update(Entity updateEntity) {
Entity versioned = this.versioningManager.createNewVersion(updateEntity);

this.repository.store(versioned);
this.searchIndex.index(versioned);

this.historyManager.createEntry(id, versioned.getVersion().get().getTimestamp(),
HistoryEntryType.UPDATED);
this.searchIndex.index(id);

return versioned.getIdentifier().get();
}
Expand Down

0 comments on commit 113506a

Please sign in to comment.