-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
82 additions
and
17 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
52 changes: 52 additions & 0 deletions
52
...saging/src/main/java/ca/gc/aafc/dina/messaging/message/DocumentOperationNotification.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,52 @@ | ||
package ca.gc.aafc.dina.messaging.message; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import ca.gc.aafc.dina.messaging.DinaMessage; | ||
|
||
/** | ||
* Class representing a message to indicate a change on a document (JSON document) | ||
* | ||
*/ | ||
@Getter | ||
public class DocumentOperationNotification implements DinaMessage { | ||
|
||
public static final String NOT_DEFINED = "Not-Defined"; | ||
|
||
private final boolean dryRun; | ||
private final String documentId; | ||
private final String documentType; | ||
private final DocumentOperationType operationType; | ||
|
||
public DocumentOperationNotification() { | ||
this.dryRun = false; | ||
this.documentId = NOT_DEFINED; | ||
this.documentType = NOT_DEFINED; | ||
this.operationType = DocumentOperationType.NOT_DEFINED; | ||
} | ||
|
||
/** | ||
* Document operation notification. | ||
* | ||
* @param dryRun flag denoting if the operation/processing associated with the message should be | ||
* bypassed. | ||
* @param documentType DINA document type (metadata, person, organization, etc...) | ||
* @param documentId The document UUID | ||
* @param operationType Operation type as defined by the enumerated type. | ||
*/ | ||
@Builder | ||
public DocumentOperationNotification(boolean dryRun, String documentType, String documentId, | ||
DocumentOperationType operationType) { | ||
this.dryRun = dryRun; | ||
this.documentId = documentId; | ||
this.documentType = documentType; | ||
this.operationType = operationType; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "DocumentOperationNotification [operationType=" + operationType + ", documentId=" + documentId | ||
+ ", documentType=" + documentType + ", dryRun=" + dryRun + "]"; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
dina-messaging/src/main/java/ca/gc/aafc/dina/messaging/message/DocumentOperationType.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 ca.gc.aafc.dina.messaging.message; | ||
|
||
/** | ||
* Enumerated type describing the type of operations that can be done to document. | ||
*/ | ||
public enum DocumentOperationType { | ||
NOT_DEFINED, | ||
ADD, | ||
UPDATE, | ||
DELETE; | ||
} |
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