ca.gc.aafc.dina.messaging.message.DocumentOperationNotification Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dina-messaging Show documentation
Show all versions of dina-messaging Show documentation
Base DINA messaging classes based on RabbitMQ
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 extends DinaMessage {
public static final String TYPE = "DocumentOperationNotification";
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() {
super(TYPE);
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) {
super(TYPE);
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 + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy