Class FHIRNotificationService
- java.lang.Object
-
- org.linuxforhealth.fhir.server.notification.FHIRNotificationService
-
- All Implemented Interfaces:
FHIRPersistenceInterceptor
public class FHIRNotificationService extends java.lang.Object implements FHIRPersistenceInterceptor
This class coordinates the activities of the FHIR Server notification service.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterCreate(FHIRPersistenceEvent pEvent)
This method is called during the processing of a 'create' REST API invocation, immediately after the new resource has been stored by the persistence layer.void
afterDelete(FHIRPersistenceEvent pEvent)
This method is called during the processing of a 'delete' REST API invocation, immediately after the resource has been deleted by the persistence layer.void
afterPatch(FHIRPersistenceEvent pEvent)
This method is called during the processing of an 'patch' REST API invocation, immediately after the updated resource has been stored by the persistence layer.void
afterUpdate(FHIRPersistenceEvent pEvent)
This method is called during the processing of an 'update' REST API invocation, immediately after the updated resource has been stored by the persistence layer.static FHIRNotificationService
getInstance()
boolean
isSubscribed(FHIRNotificationSubscriber subscriber)
Check if this subscriber has subscribed to this servicevoid
publish(FHIRNotificationEvent event)
Method for broadcasting message to each subscriber.void
subscribe(FHIRNotificationSubscriber subscriber)
Method to subscribe the target notification implementationvoid
unsubscribe(FHIRNotificationSubscriber subscriber)
Method to unsubscribe the target notification implementation-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.linuxforhealth.fhir.server.spi.interceptor.FHIRPersistenceInterceptor
afterHistory, afterInvoke, afterRead, afterSearch, afterVread, beforeCreate, beforeDelete, beforeHistory, beforeInvoke, beforePatch, beforeRead, beforeSearch, beforeUpdate, beforeVread
-
-
-
-
Method Detail
-
getInstance
public static FHIRNotificationService getInstance()
-
publish
public void publish(FHIRNotificationEvent event)
Method for broadcasting message to each subscriber.- Parameters:
event
-
-
subscribe
public void subscribe(FHIRNotificationSubscriber subscriber)
Method to subscribe the target notification implementation- Parameters:
subscriber
-
-
unsubscribe
public void unsubscribe(FHIRNotificationSubscriber subscriber)
Method to unsubscribe the target notification implementation- Parameters:
subscriber
-
-
isSubscribed
public boolean isSubscribed(FHIRNotificationSubscriber subscriber)
Check if this subscriber has subscribed to this service- Parameters:
subscriber
-- Returns:
-
afterCreate
public void afterCreate(FHIRPersistenceEvent pEvent) throws FHIRPersistenceInterceptorException
Description copied from interface:FHIRPersistenceInterceptor
This method is called during the processing of a 'create' REST API invocation, immediately after the new resource has been stored by the persistence layer.- Specified by:
afterCreate
in interfaceFHIRPersistenceInterceptor
- Parameters:
pEvent
- information about the 'create' event- Throws:
FHIRPersistenceInterceptorException
-
afterUpdate
public void afterUpdate(FHIRPersistenceEvent pEvent) throws FHIRPersistenceInterceptorException
Description copied from interface:FHIRPersistenceInterceptor
This method is called during the processing of an 'update' REST API invocation, immediately after the updated resource has been stored by the persistence layer.- Specified by:
afterUpdate
in interfaceFHIRPersistenceInterceptor
- Parameters:
pEvent
- information about the 'update' event- Throws:
FHIRPersistenceInterceptorException
-
afterDelete
public void afterDelete(FHIRPersistenceEvent pEvent) throws FHIRPersistenceInterceptorException
Description copied from interface:FHIRPersistenceInterceptor
This method is called during the processing of a 'delete' REST API invocation, immediately after the resource has been deleted by the persistence layer.- Specified by:
afterDelete
in interfaceFHIRPersistenceInterceptor
- Parameters:
pEvent
- information about the 'delete' event- Throws:
FHIRPersistenceInterceptorException
-
afterPatch
public void afterPatch(FHIRPersistenceEvent pEvent) throws FHIRPersistenceInterceptorException
Description copied from interface:FHIRPersistenceInterceptor
This method is called during the processing of an 'patch' REST API invocation, immediately after the updated resource has been stored by the persistence layer.- Specified by:
afterPatch
in interfaceFHIRPersistenceInterceptor
- Parameters:
pEvent
- information about the 'patch' event- Throws:
FHIRPersistenceInterceptorException
-
-