Monitoring::Spooler::Cmd::SendingCommand - base class for any sending command
This class is the baseclass for any command which sends messages to the outside.
It fetches any pending message from the DB and tries to send each message using the best transport available. In order to minimize code duplication the control flow is a bit like ping-pong.
execute fetch all waiting message from the DB using _fetch_waiting_messages which orders them by group_id. For each group _prepare_message_and_send is called with all available messages. This method is not implemented by SendingCommand but rather by it's subclasses. Insnide _prepare_message_and_send the messages may be aggreated, filtered or otherwise altered. Also this method does the escalation handling, see ...::Command::phone for an example. Inside those subclasses _send_with_best_transport SHOULD be called. This method puts the control flow back to this class which tries each transport by order of preference and tries to dispatch the message.
If all goes well the method cleanup is called with a true value, the group_id and message ref. It SHOULD remove all sent messages from the queue. This method MUST be implemented by the subclasses. See ...::Command::phone for an example.
Utility method. Removes all stale entries from the PID table.
Issue a HTTP GET request in case of severe failures as a measure of last resort.
Retrieve a HashRef containing all queued messages for the appropriate media-type.
This method calls the method _media_type which subclasses _MUST_ override.
Subclasses of this class _MUST_ override this method and return a SCALAR string containing the media-type they can handle.
This method actually send a message. It tries all successfully initialized transports. This message should be called by the method _prepare_message_and_send which _MUST_ be implemented by subclasses.
This method is essential in this implementation since it places this process' PID in the PID table and ensures concurrency control.
This method is essential in this implementatino since it removes our PID from the PID table.
This mandatory method is called by App::Cmd. It is automatically called when the appropriate command is invoked.
Monitoring::Spooler::Cmd::SendingCommand - base class for any command which sends messages.
Dominik Schulz <email@example.com>
This software is copyright (c) 2012 by Dominik Schulz.