Class CommunityProfileOutTopicPublisher


public class CommunityProfileOutTopicPublisher extends Object
CommunityProfileOutTopicPublisher is responsible for publishing events about changes to personal profiles, communities and related elements. It is called when an interesting OMRS Event is added to the Enterprise OMRS Topic (see CommunityProfileOMRSTopicListener). The actual sending of events is done by the super class CommunityProfileOutTopicPublisher. This class logs a message to the OMRS Audit Log before calling the super class.
  • Constructor Details

    • CommunityProfileOutTopicPublisher

      public CommunityProfileOutTopicPublisher(CommunityProfileOutTopicServerConnector outTopicServerConnector, String outTopicName, AuditLog auditLog)
      Constructor for the publisher.
      outTopicServerConnector - connector to the out topic
      outTopicName - name of the out topic
      auditLog - logging destination if anything goes wrong.
  • Method Details

    • sendEntityEvent

      public void sendEntityEvent(CommunityProfileOutboundEventType eventType, String elementGUID, String elementTypeName, String classificationName, ElementStub elementStub)
      Send an event that relates to an entity.
      eventType - type of change to the entity
      elementGUID - unique identifier for the entity
      elementTypeName - type of entity
      classificationName - if a classification has changed this identifies which classification
      elementStub - encoded header of the entity
    • sendRelationshipEvent

      public void sendRelationshipEvent(CommunityProfileOutboundEventType eventType, String relationshipGUID, String relationshipTypeName, ElementStub relationshipElementStub, ElementStub endOneElementStub, ElementStub endTwoElementStub)
      Send an event that relates to a relationship.
      eventType - type of change to the relationship
      relationshipGUID - unique identifier for the relationship
      relationshipTypeName - type of relationship
      relationshipElementStub - encoded header of the relationship
      endOneElementStub - encoded header of the entity at end 1 of the relationship
      endTwoElementStub - encoded header of the entity at end 2 of the relationship
    • sendKarmaPointPlateauEvent

      public void sendKarmaPointPlateauEvent(ElementStub profileElementStub, String contributingUserId, boolean isPublic, long pointsTotal, long plateau)
      Send an event that indicates that a person has achieved a karma point plateau.
      profileElementStub - profile of person
      contributingUserId - the userId that took them to the plateau
      isPublic - can this be sent to colleagues
      pointsTotal - the number of points that the person has achieved
      plateau - the plateau achieved
    • disconnect

      public void disconnect()
      Shutdown the publishing process.