Class MagpieEnvelope


  • public class MagpieEnvelope
    extends Object
    A Jackson-serializable envelope that is passed from layer to layer via plugin emitters and acceptors.
    Author:
    Jason Nichols (jason@openraven.com)
    • Constructor Detail

      • MagpieEnvelope

        public MagpieEnvelope()
      • MagpieEnvelope

        public MagpieEnvelope​(Session session,
                              List<String> pluginPath,
                              com.fasterxml.jackson.databind.node.ObjectNode contents)
    • Method Detail

      • of

        public static MagpieEnvelope of​(MagpieEnvelope current,
                                        String pluginId,
                                        com.fasterxml.jackson.databind.node.ObjectNode contents)
        IntermediatePlugin implementations should use this static factory method to create a new envelope that derives from an existing envelope. This ensures the continuity of the envelops pluginPath.
        Parameters:
        current - The currently received envelope that the plugin is processing.
        pluginId - The ID of the current plugin
        contents - The contents (preferably JSON) to be passed downstream to the next layer.
        Returns:
        The newly derived envelope.
      • getSession

        public Session getSession()
      • setSession

        public void setSession​(Session session)
      • getPluginPath

        public List<String> getPluginPath()
        The pluginPath list represents this envelope's path through the Magpie framework. Each plugin that operates on data should append it's ID to the ordered list. This allows downstream plugins to make decisions based on expected schemas for upstream plugins or sub-services.
        Returns:
      • setPluginPath

        public void setPluginPath​(List<String> pluginPath)
      • getContents

        public com.fasterxml.jackson.databind.node.ObjectNode getContents()
      • setContents

        public void setContents​(com.fasterxml.jackson.databind.node.ObjectNode contents)
      • getContentClass

        public String getContentClass()
      • setContentClass

        public void setContentClass​(String contentClass)
      • setMetadata

        public void setMetadata​(Map<String,​String> metadata)