|  | Apama
    10.15.0.2
    | 
Base class that simplifies implementation of codec plug-ins that deal only with individual messages not batches, and ignore messages with null payloads. More...
#include <sag_connectivity_plugins.hpp>
 
  
| Public Member Functions | |
| AbstractSimpleCodec (const PluginConstructorParameters::CodecConstructorParameters ¶ms) | |
| Constructor.  More... | |
| virtual void | sendBatchTowardsHost (Message *start, Message *end) | 
| Implements batch sending, calling transformMessageTowardsHost(Message &) for each message individually.  More... | |
| virtual void | sendBatchTowardsTransport (Message *start, Message *end) | 
| Implements batch sending, calling transformMessageTowardsTransport(Message &) for each message individually.  More... | |
| virtual bool | transformMessageTowardsHost (Message &msg)=0 | 
| Abstract method that must be implemented to handle transformation of an individual message.  More... | |
| virtual bool | transformMessageTowardsTransport (Message &msg)=0 | 
| Abstract method that must be implemented to handle transformation of an individual message in a transport-wards direction.  More... | |
| virtual bool | transformNullPayloadTowardsHost (Message &msg) | 
| Transform a message with a null payload in a host-wards direction.  More... | |
| virtual bool | transformNullPayloadTowardsTransport (Message &msg) | 
| Transform a message with a null payload in a transport-wards direction.  More... | |
| virtual bool | handleException (Message &m, bool towardsTransport) | 
| Handle an exception thrown while delivering a message.  More... | |
|  Public Member Functions inherited from com::softwareag::connectivity::AbstractCodec | |
| AbstractCodec (const PluginConstructorParameters::CodecConstructorParameters ¶ms) | |
| Constructor.  More... | |
|  Public Member Functions inherited from com::softwareag::connectivity::Plugin | |
| virtual | ~Plugin () | 
| This destructor must be virtual.  More... | |
| virtual void | start () | 
| Called when an entire chain has been created and the plugin is allowed to start up (after all plugins are connected together).  More... | |
| virtual void | hostReady () | 
| Called some time after start(), when the host is ready to start receiving input (sends will be queued until this point).  More... | |
| virtual void | shutdown () | 
| Stop processing messages and terminate and join any background threads.  More... | |
| const std::string & | getName () const | 
| The name used for this plug-in in the configuration file.  More... | |
|  Public Member Functions inherited from com::softwareag::connectivity::HostSide | |
| virtual | ~HostSide () | 
| Ensure virtual destruction.  More... | |
| void | sendBatchTowardsHost (Message &&message) | 
| Overload for sending a batch containing a single message.  More... | |
| template<typename IT > | |
| auto | sendBatchTowardsHost (const IT &begin, const IT &end) -> typename std::enable_if< !std::is_const< ampl::remove_ref_t< decltype(*begin)>>::value &&l::is_same< Message, ampl::remove_const_t< ampl::remove_ref_t< decltype(*begin)>>>::value, void >::type | 
| Overload for sending messages using an iterator range.  More... | |
|  Public Member Functions inherited from com::softwareag::connectivity::TransportSide | |
| virtual | ~TransportSide () | 
| Ensure virtual destruction.  More... | |
| void | sendBatchTowardsTransport (Message &&message) | 
| Overload for sending a batch containing a single message.  More... | |
| template<typename IT > | |
| auto | sendBatchTowardsTransport (const IT &begin, const IT &end) -> typename std::enable_if< !std::is_const< ampl::remove_ref_t< decltype(*begin)>>::value &&l::is_same< Message, ampl::remove_const_t< ampl::remove_ref_t< decltype(*begin)>>>::value, void >::type | 
| Overload for sending messages using an iterator range.  More... | |
| Additional Inherited Members | |
|  Public Types inherited from com::softwareag::connectivity::HostSide | |
| typedef std::unique_ptr< HostSide > | ptr_t | 
| Pointers to HostSides should always be this ptr_t type, which is a std::unique_ptr.  More... | |
|  Public Types inherited from com::softwareag::connectivity::TransportSide | |
| typedef std::unique_ptr< TransportSide > | ptr_t | 
| Pointers to TransportSides should always be this ptr_t type, which is a std::unique_ptr.  More... | |
|  Public Attributes inherited from com::softwareag::connectivity::Plugin | |
| Logger | logger | 
| Logging for writing to the host log file.  More... | |
|  Protected Member Functions inherited from com::softwareag::connectivity::Plugin | |
| StatusReporter & | getStatusReporter () | 
| Allows reporting status information from this plug-in, such as online or failed status and number of messages sent/received in each direction.  More... | |
|  Protected Attributes inherited from com::softwareag::connectivity::AbstractCodec | |
| HostSide::ptr_t | hostSide | 
| The next plug-in in the chain towards host.  More... | |
| TransportSide::ptr_t | transportSide | 
| The next plug-in in the chain towards transport.  More... | |
|  Protected Attributes inherited from com::softwareag::connectivity::Plugin | |
| const std::string | pluginName | 
| The name used for this plug-in in the configuration file.  More... | |
| const std::string | chainId | 
| The identifier used for the chain this plug-in is part of.  More... | |
| map_t | config | 
| The configuration of this plug-in.  More... | |
| const PluginHost::ptr_t | host | 
| Interface to support miscellaneous requests from this plug-in to the host system.  More... | |
Base class that simplifies implementation of codec plug-ins that deal only with individual messages not batches, and ignore messages with null payloads.
To export a codec class for use in the host you should use the SAG_DECLARE_CONNECTIVITY_CODEC_CLASS(Class) macro, and provide a public constructor with the same signature as AbstractSimpleCodec(const PluginConstructorParameters::CodecConstructorParameters &).
Handles batches of messages and ignoring null payload messages (by default). Implementors will typically subclass this class, providing an implementation of the transformMessageTowardsHost(Message&) and transformMessageTowardsTransport(Message&) methods.
If you don't need to handle messages a batch at a time, then you should derive from this class. If you do then you should directly derive from AbstractCodec.
| 
 | inline | 
Constructor.
A subclass should provide its own constructor with the same signature as this one.
A plug-in should throw an exception from the constructor if there is a problem with the configuration or any other error that will prevent the plug-in from working correctly.
| params | Provides access to the configuration for this plug-in, and other capabilities. | 
| 
 | inlinevirtual | 
Handle an exception thrown while delivering a message.
Default is to log a warning and discard a message.
This is called from within a catch block, so if you need to know the exception thrown then you can rethrow it yourself:
| m | The Message that caused the error is passed in by reference. | 
| towardsTransport | set to true if it was transformMessageTowardsTransport that threw or false if it was transformMessageTowardsHost that threw | 
| 
 | inlinevirtual | 
Implements batch sending, calling transformMessageTowardsHost(Message &) for each message individually.
Exceptions from transformMessageTowardsHost are caught and handleException(Message &, bool) is called (the default implementation is to log a warning and discard the event) If handleException or transformMessageTowardsHost returns false then that event is removed, but processing continues for the next message.
Implements com::softwareag::connectivity::HostSide.
| 
 | inlinevirtual | 
Implements batch sending, calling transformMessageTowardsTransport(Message &) for each message individually.
Exceptions from transformMessageTowardsTransport are caught and handleException(Message &, bool) is called (the default implementation is to log a warning and discard the event). If handleException or transformMessageTowardsTransport returns false then that event is removed, but processing continues for the next message.
Implements com::softwareag::connectivity::TransportSide.
| 
 | pure virtual | 
Abstract method that must be implemented to handle transformation of an individual message.
in a host-wards direction
| 
 | pure virtual | 
Abstract method that must be implemented to handle transformation of an individual message in a transport-wards direction.
| 
 | inlinevirtual | 
Transform a message with a null payload in a host-wards direction.
default is to do nothing
| 
 | inlinevirtual | 
Transform a message with a null payload in a transport-wards direction.
default is to do nothing