Interface CachedMessageFactory


  • public interface CachedMessageFactory

    A message factory is used to create cached DataSource messages that can be published to other DataSources.

     

    You do not have to implement this interface yourself. An implementation is provided, and can be retrieved from any CachingPublisher by calling the CachingPublisher.getCachedMessageFactory() method.

    • Method Detail

      • createJsonMessage

        JsonMessage createJsonMessage​(java.lang.String subject,
                                      java.lang.Object userObject)
        Creates a JSON message for the given subject.
        Parameters:
        subject - The subject of the message.
        userObject - A Java object to be serialized using the installed JsonHandler.
        Returns:
        A new JSON message.
      • createSubjectErrorEvent

        SubjectErrorEvent createSubjectErrorEvent​(java.lang.String subject,
                                                  SubjectError error,
                                                  SubjectError.Flags... flags)
        Creates a subject error event.
        Parameters:
        subject - The subject to which the error relates.
        error - The error.
        flags - Additional flags to be set on the nodata
        Returns:
        A subject error event.
      • createSubjectStatusEvent

        SubjectStatusEvent createSubjectStatusEvent​(java.lang.String subject,
                                                    SubjectStatus status,
                                                    java.lang.String message)
        Creates a subject status event.
        Parameters:
        subject - The subject to which the status relates.
        status - The status.
        message - A free form textual message indicating the reason for the status message being raised.
        Returns:
        A subject status event.