Package ca.uhn.fhir.subscription.api
Interface IResourceModifiedMessagePersistenceSvc
public interface IResourceModifiedMessagePersistenceSvc
An implementer of this interface will provide
ResourceModifiedMessage
persistence services.
Client of this interface should persist ResourceModifiedMessage as part of the processing of an operation on
a resource. Upon a successful submission to the subscription pipeline, the persisted message should be deleted.
When submission fails, the message should be left un-altered for re-submission at a later time (see IResourceModifiedConsumerWithRetries
).-
Method Summary
Modifier and TypeMethodDescriptioncreateResourceModifiedMessageFromEntityWithoutInflation
(IPersistedResourceModifiedMessage thePersistedResourceModifiedMessage) Create a ResourceModifiedMessage without its pre persistence representation, i.e.boolean
deleteByPK
(IPersistedResourceModifiedMessagePK thePersistedResourceModifiedMessagePK) Delete a persistedResourceModifiedMessage by its primary key.org.springframework.data.domain.Page
<IPersistedResourceModifiedMessage> findAllOrderedByCreatedTime
(org.springframework.data.domain.Pageable thePageable) Find all persistedResourceModifiedMessage sorted by ascending created dates (oldest to newest).long
inflatePersistedResourceModifiedMessage
(ResourceModifiedMessage theResourceModifiedMessage) Restore a resourceModifiedMessage to its pre persistence representation.inflatePersistedResourceModifiedMessageOrNull
(ResourceModifiedMessage theResourceModifiedMessage) Restore a resourceModifiedMessage to its pre persistence representation or null if the resource does not exist.persist
(ResourceModifiedMessage theMsg) Persist a resourceModifiedMessage and return its resulting persisted representation.
-
Method Details
-
findAllOrderedByCreatedTime
org.springframework.data.domain.Page<IPersistedResourceModifiedMessage> findAllOrderedByCreatedTime(org.springframework.data.domain.Pageable thePageable) Find all persistedResourceModifiedMessage sorted by ascending created dates (oldest to newest).- Parameters:
thePageable
- Page request- Returns:
- A sorted list of persistedResourceModifiedMessage needing submission.
-
deleteByPK
Delete a persistedResourceModifiedMessage by its primary key.- Parameters:
thePersistedResourceModifiedMessagePK
- The primary key of the persistedResourceModifiedMessage to delete.- Returns:
- Whether the persistedResourceModifiedMessage pointed to by
theResourceModifiedPK
was deleted.
-
persist
Persist a resourceModifiedMessage and return its resulting persisted representation.- Parameters:
theMsg
- The resourceModifiedMessage to persist.- Returns:
- The persisted representation of
theMsg
.
-
inflatePersistedResourceModifiedMessage
ResourceModifiedMessage inflatePersistedResourceModifiedMessage(ResourceModifiedMessage theResourceModifiedMessage) Restore a resourceModifiedMessage to its pre persistence representation.- Parameters:
theResourceModifiedMessage
- The message needing restoration.- Returns:
- The resourceModifiedMessage in its pre persistence form.
-
inflatePersistedResourceModifiedMessageOrNull
Optional<ResourceModifiedMessage> inflatePersistedResourceModifiedMessageOrNull(ResourceModifiedMessage theResourceModifiedMessage) Restore a resourceModifiedMessage to its pre persistence representation or null if the resource does not exist.- Parameters:
theResourceModifiedMessage
-- Returns:
- An Optional containing The resourceModifiedMessage in its pre persistence form or null when the resource does not exist
-
createResourceModifiedMessageFromEntityWithoutInflation
ResourceModifiedMessage createResourceModifiedMessageFromEntityWithoutInflation(IPersistedResourceModifiedMessage thePersistedResourceModifiedMessage) Create a ResourceModifiedMessage without its pre persistence representation, i.e. without the resource body in payload- Parameters:
thePersistedResourceModifiedMessage
- The message needing creation- Returns:
- The resourceModifiedMessage without its pre persistence form
-
getMessagePersistedCount
long getMessagePersistedCount()- Returns:
- the number of persisted resourceModifiedMessage.
-