Package io.goobi.viewer.controller.mq
Class ViewerMessage
java.lang.Object
io.goobi.viewer.controller.mq.ViewerMessage
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetDelay()getId()static Optional<ViewerMessage> getLastSuccessfulTask(String type) Returns the latest VieweMessage of the given type that finished successfully.intgetQueue()intbooleanstatic ViewerMessagevoidsetDelay(long delay) voidCall this method to set the max number of allowed retries to the number of retries already done, effectively preventing any further retries.voidvoidsetLastUpdateTime(LocalDateTime lastUpdateTime) voidsetMaxRetries(int maxRetries) voidsetMessageId(String messageId) voidsetMessageStatus(MessageStatus messageStatus) voidsetProperties(Map<String, String> properties) voidvoidsetRetryCount(int retryCount) voidsetTaskName(String taskName) booleantoString()
-
Field Details
-
MESSAGE_PROPERTY_ERROR
- See Also:
-
MESSAGE_PROPERTY_INFO
- See Also:
-
-
Constructor Details
-
ViewerMessage
public ViewerMessage() -
ViewerMessage
-
-
Method Details
-
getId
-
setId
-
getTaskName
-
setTaskName
-
getMessageId
-
setMessageId
-
getProperties
-
setProperties
-
getMessageStatus
-
setMessageStatus
-
getRetryCount
public int getRetryCount() -
setRetryCount
public void setRetryCount(int retryCount) -
setLastUpdateTime
-
getLastUpdateTime
-
getQueue
-
setQueue
-
getDelay
public long getDelay() -
setDelay
public void setDelay(long delay) -
isProcessing
public boolean isProcessing() -
parseJSON
public static ViewerMessage parseJSON(String json) throws com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonProcessingException
-
toString
-
getMaxRetries
public int getMaxRetries() -
setMaxRetries
public void setMaxRetries(int maxRetries) -
setDoNotRetry
public void setDoNotRetry()Call this method to set the max number of allowed retries to the number of retries already done, effectively preventing any further retries. This is useful if the ticket runs into an error which it cannot reasonably recover from, so further retries are futile -
shouldRetry
public boolean shouldRetry() -
getLastSuccessfulTask
Returns the latest VieweMessage of the given type that finished successfully.- Parameters:
type-- Returns:
- Optional
- Throws:
DAOException
-