-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Story/GECO-139] Adding deletion of files to nepomuk (#30)
* [GECO-139] Add new topic for listening to delete requests * [GECO-139] Initial changes to nepomuk to support deletion of files * [GECO-139] Using storage file id * [GECO-139] Changes to nepomuk message handler addition * Revert "[GECO-139] Changes to nepomuk message handler addition" This reverts commit dc19c70. * [GECO-139] Fixing bug for null in filepath for baseDirectory and adding producer part * [GECO-139] Implementing f no files are remaining for the document the request to delete the document and upload in Giles is pushed * [GECO-139] Implementing checks for storage deletion in case of old file deletion * [GECO-139] Adding tests and refactoring * [GECO-139] Adding test cases * [GECO-139] Clearing code factor issues * [GECO-139] Addressing review comments * [GECO-139] Grouping similar methods together * [GECO-139] Making changes to process documents * [GECO-139] Making testcase changes * [GECO-139] : Update to pom * [GECO-139] Addressing code factor issues * [GECO-139] Review comments * [GECO-139] Updating pom with new published version * [GECO-139] Updating pom * [GECO-139] Addressing review comments * [GECO-139] Code changes and refactoring * [GECO-139] Addressing review comments * [GECO-139] Addressing review comments * [GECO-139] Changing tests * [GECO-139] Adding service * [GECO-139] Changing request version * [GECO-139] Comment out svn to see if that makes Jenkins build Nepomuk * [GECO-139] try to use dummy git connection --------- Co-authored-by: Julia Damerow <[email protected]>
- Loading branch information
Showing
19 changed files
with
537 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...edu/asu/diging/gilesecosystem/nepomuk/core/kafka/impl/StorageDeletionRequestReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package edu.asu.diging.gilesecosystem.nepomuk.core.kafka.impl; | ||
|
||
import java.io.IOException; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.PropertySource; | ||
import org.springframework.kafka.annotation.KafkaListener; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
import edu.asu.diging.gilesecosystem.nepomuk.core.service.IDeletionRequestProcessor; | ||
import edu.asu.diging.gilesecosystem.requests.IStorageDeletionRequest; | ||
import edu.asu.diging.gilesecosystem.requests.impl.StorageDeletionRequest; | ||
import edu.asu.diging.gilesecosystem.septemberutil.properties.MessageType; | ||
import edu.asu.diging.gilesecosystem.septemberutil.service.ISystemMessageHandler; | ||
|
||
@PropertySource("classpath:/config.properties") | ||
public class StorageDeletionRequestReceiver { | ||
@Autowired | ||
private IDeletionRequestProcessor deletionRequestProcessor; | ||
|
||
@Autowired | ||
private ISystemMessageHandler messageHandler; | ||
|
||
/** | ||
* Kafka listener method for receiving and processing a delete storage request message. | ||
* @param message The message containing the delete storage request. | ||
*/ | ||
@KafkaListener(topics = "${topic_delete_storage_request}") | ||
public void receiveDeleteMessage(String message) { | ||
ObjectMapper mapper = new ObjectMapper(); | ||
IStorageDeletionRequest request = null; | ||
try { | ||
request = mapper.readValue(message, StorageDeletionRequest.class); | ||
} catch (IOException e) { | ||
messageHandler.handleMessage("Could not unmarshall request.", e, MessageType.ERROR); | ||
return; | ||
} | ||
deletionRequestProcessor.processRequest(request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...in/java/edu/asu/diging/gilesecosystem/nepomuk/core/service/IDeletionRequestProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package edu.asu.diging.gilesecosystem.nepomuk.core.service; | ||
|
||
import edu.asu.diging.gilesecosystem.requests.IStorageDeletionRequest; | ||
|
||
public interface IDeletionRequestProcessor { | ||
/** | ||
* Processes a storage deletion request by deleting associated files and generating a completed storage deletion request. | ||
* @param request The storage deletion request to be processed. | ||
*/ | ||
void processRequest(IStorageDeletionRequest request); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ public interface IRequestProcessor { | |
|
||
public abstract void processRequest(IStorageRequest request); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.