Package io.openraven.magpie.api
Class MagpieEnvelope
java.lang.Object
io.openraven.magpie.api.MagpieEnvelope
A Jackson-serializable envelope that is passed from layer to layer via plugin emitters and acceptors.
- Author:
- Jason Nichols (jason@openraven.com)
-
Constructor Summary
ConstructorsConstructorDescriptionMagpieEnvelope(Session session, List<String> pluginPath, com.fasterxml.jackson.databind.node.ObjectNode contents) -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.node.ObjectNodeThe pluginPath list represents this envelope's path through the Magpie framework.static MagpieEnvelopeof(MagpieEnvelope current, String pluginId, com.fasterxml.jackson.databind.node.ObjectNode contents) IntermediatePluginimplementations should use this static factory method to create a new envelope that derives from an existing envelope.voidsetContentClass(String contentClass) voidsetContents(com.fasterxml.jackson.databind.node.ObjectNode contents) voidsetMetadata(Map<String, String> metadata) voidsetPluginPath(List<String> pluginPath) voidsetSession(Session session)
-
Constructor Details
-
MagpieEnvelope
public MagpieEnvelope() -
MagpieEnvelope
-
-
Method Details
-
of
public static MagpieEnvelope of(MagpieEnvelope current, String pluginId, com.fasterxml.jackson.databind.node.ObjectNode contents) IntermediatePluginimplementations 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 plugincontents- The contents (preferably JSON) to be passed downstream to the next layer.- Returns:
- The newly derived envelope.
-
getSession
-
setSession
-
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
-
getContents
public com.fasterxml.jackson.databind.node.ObjectNode getContents() -
setContents
public void setContents(com.fasterxml.jackson.databind.node.ObjectNode contents) -
getContentClass
-
setContentClass
-
getMetadata
-
setMetadata
-