com.interfaceware.iguana.plugin
Class DestinationMessageReceivedEventOutputs

java.lang.Object
  extended by com.interfaceware.iguana.plugin.DestinationMessageReceivedEventOutputs

public class DestinationMessageReceivedEventOutputs
extends java.lang.Object

This class is used to send response data from messageReceived event handlers back to Iguana.

Destination plugins are provided with an instance of this class as an argument to their messageReceived event handler. The event handler uses the properties and methods of the provided instance to craft a suitable response to send back to Iguana. After the event handler returns, the response is sent back to Iguana.

At a minimum, the event handler should set the MessageProcessedFlag property to true to indicate to Iguana that the message was received and processed by the plugin. Setting this property to false will simply result in Iguana logging a generic error message; it will not result in Iguana resending the message or stopping the channel. Plugins can achieve more sophisticated and precise error handling using the properties and methods described below.

If the event handler is unable to complete processing in a timely fashion, it should use the ResendMessageFlag and ResendMessageDelay properties to request that Iguana resend the message. This ensures that Iguana does not time-out the connection to the plugin due to inactivity. The exact duration of the time-out is determined by the Plugin Time field value configured for the To Plugin channel component to which the plugin is connected.

The plugin event handler may request that the Iguana channel be stopped via the StopChannelFlag, StopChannelErrorFlag and StopChannelReason properties.

The plugin event handler may add log messages to Iguana's logs using the addErrorLogMessage, addWarningLogMessage, addInfoLogMessage and addDebugLogMessage methods.


Constructor Summary
DestinationMessageReceivedEventOutputs()
           
DestinationMessageReceivedEventOutputs(long Handle)
           
 
Method Summary
 void addDebugLogMessage(java.lang.String DebugLogMessage)
           Adds a debug log message to Iguana's logs.
 void addErrorLogMessage(java.lang.String ErrorLogMessage)
           Adds an error log message to Iguana's logs.
 void addInfoLogMessage(java.lang.String InfoLogMessage)
           Adds an info log message to Iguana's logs.
 void addWarningLogMessage(java.lang.String WarningLogMessage)
           Adds a warning log message to Iguana's logs.
protected  void finalize()
           
 boolean getMessageProcessedFlag()
           Indicates to Iguana whether or not the message was processed by the plugin.
 int getResendMessageDelay()
           Specifies the delay time in milliseconds that Iguana should wait before resending the message.
 boolean getResendMessageFlag()
           Requests that Iguana resend the message.
 boolean getStopChannelErrorFlag()
           When combined with StopChannelFlag, requests that Iguana stop the channel with the channel status set to 'error'.
 boolean getStopChannelFlag()
           Requests that Iguana stop the channel to which the plugin is connected.
 java.lang.String getStopChannelReason()
           Describes the reason for the 'stop channel' request.
 void release()
           
 void setMessageProcessedFlag(boolean Value)
          Set method for MessageProcessedFlag.
 void setResendMessageDelay(int Value)
          Set method for ResendMessageDelay.
 void setResendMessageFlag(boolean Value)
          Set method for ResendMessageFlag.
 void setStopChannelErrorFlag(boolean Value)
          Set method for StopChannelErrorFlag.
 void setStopChannelFlag(boolean Value)
          Set method for StopChannelFlag.
 void setStopChannelReason(java.lang.String Value)
          Set method for StopChannelReason.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DestinationMessageReceivedEventOutputs

public DestinationMessageReceivedEventOutputs()
                                       throws PluginException
Throws:
PluginException

DestinationMessageReceivedEventOutputs

public DestinationMessageReceivedEventOutputs(long Handle)
                                       throws PluginException
Throws:
PluginException
Method Detail

release

public void release()
             throws PluginException
Throws:
PluginException

finalize

protected void finalize()
                 throws PluginException
Overrides:
finalize in class java.lang.Object
Throws:
PluginException

getMessageProcessedFlag

public boolean getMessageProcessedFlag()
                                throws PluginException

Indicates to Iguana whether or not the message was processed by the plugin.

Default value: false.

Should generally be set by event handlers to true.

If set to false, Iguana will simply issue a relatively generic error message. Event handlers can add their own specific error log message to the Iguana logs using the addErrorLogMessage method instead.

See also the setMessageProcessedFlag method.

Throws:
PluginException

setMessageProcessedFlag

public void setMessageProcessedFlag(boolean Value)
                             throws PluginException

Set method for MessageProcessedFlag.

See MessageProcessedFlag.

Parameters:
Value - Value to set MessageProcessedFlag to.
Throws:
PluginException

getResendMessageFlag

public boolean getResendMessageFlag()
                             throws PluginException

Requests that Iguana resend the message.

Default value: false.

The message will be resent after the delay specified by ResendMessageDelay.

If the channel is stopped, the message will be resent once the channel is restarted.

See also the setResendMessageFlag method.

Throws:
PluginException

setResendMessageFlag

public void setResendMessageFlag(boolean Value)
                          throws PluginException

Set method for ResendMessageFlag.

See ResendMessageFlag.

Parameters:
Value - Value to set ResendMessageFlag to.
Throws:
PluginException

getResendMessageDelay

public int getResendMessageDelay()
                          throws PluginException

Specifies the delay time in milliseconds that Iguana should wait before resending the message.

Default value: 0 milliseconds.

Only applicable if ResendMessageFlag is set to true.

See also the setResendMessageDelay method.

Throws:
PluginException

setResendMessageDelay

public void setResendMessageDelay(int Value)
                           throws PluginException

Set method for ResendMessageDelay.

See ResendMessageDelay.

Parameters:
Value - Value to set ResendMessageDelay to.
Throws:
PluginException

getStopChannelFlag

public boolean getStopChannelFlag()
                           throws PluginException

Requests that Iguana stop the channel to which the plugin is connected.

Default value: false.

See also: StopChannelErrorFlag and StopChannelReason.

See also the setStopChannelFlag method.

Throws:
PluginException

setStopChannelFlag

public void setStopChannelFlag(boolean Value)
                        throws PluginException

Set method for StopChannelFlag.

See StopChannelFlag.

Parameters:
Value - Value to set StopChannelFlag to.
Throws:
PluginException

getStopChannelErrorFlag

public boolean getStopChannelErrorFlag()
                                throws PluginException

When combined with StopChannelFlag, requests that Iguana stop the channel with the channel status set to 'error'.

Default value: false.

Only applicable if StopChannelFlag is set to true.

See also the setStopChannelErrorFlag method.

Throws:
PluginException

setStopChannelErrorFlag

public void setStopChannelErrorFlag(boolean Value)
                             throws PluginException

Set method for StopChannelErrorFlag.

See StopChannelErrorFlag.

Parameters:
Value - Value to set StopChannelErrorFlag to.
Throws:
PluginException

getStopChannelReason

public java.lang.String getStopChannelReason()
                                      throws PluginException

Describes the reason for the 'stop channel' request.

Only applicable if StopChannelFlag is set to true.

See also the setStopChannelReason method.

Throws:
PluginException

setStopChannelReason

public void setStopChannelReason(java.lang.String Value)
                          throws PluginException

Set method for StopChannelReason.

See StopChannelReason.

Parameters:
Value - Value to set StopChannelReason to.
Throws:
PluginException

addErrorLogMessage

public void addErrorLogMessage(java.lang.String ErrorLogMessage)
                        throws PluginException

Adds an error log message to Iguana's logs.

Parameters:
ErrorLogMessage - Log message text.
Throws:
PluginException

addWarningLogMessage

public void addWarningLogMessage(java.lang.String WarningLogMessage)
                          throws PluginException

Adds a warning log message to Iguana's logs.

Parameters:
WarningLogMessage - Log message text.
Throws:
PluginException

addInfoLogMessage

public void addInfoLogMessage(java.lang.String InfoLogMessage)
                       throws PluginException

Adds an info log message to Iguana's logs.

Parameters:
InfoLogMessage - Log message text.
Throws:
PluginException

addDebugLogMessage

public void addDebugLogMessage(java.lang.String DebugLogMessage)
                        throws PluginException

Adds a debug log message to Iguana's logs.

Parameters:
DebugLogMessage - Log message text.
Throws:
PluginException