Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.plugin.otr
Class OtrTransformLayer

java.lang.Object
  extended by net.java.sip.communicator.plugin.otr.OtrTransformLayer
All Implemented Interfaces:
TransformLayer

public class OtrTransformLayer
extends Object
implements TransformLayer

The Off-the-Record TransformLayer implementation.

Author:
George Politis

Constructor Summary
OtrTransformLayer()
           
 
Method Summary
 MessageDeliveredEvent messageDelivered(MessageDeliveredEvent evt)
          Called when the underlying implementation has received an indication that a message, sent earlier has been successfully received by the destination.
 MessageDeliveryFailedEvent messageDeliveryFailed(MessageDeliveryFailedEvent evt)
          Called to indicated that delivery of a message sent earlier has failed.
 MessageDeliveredEvent messageDeliveryPending(MessageDeliveredEvent evt)
          Called when the underlying implementation has just been asked by other bundles to send an outgoing message.
 MessageReceivedEvent messageReceived(MessageReceivedEvent evt)
          Called when a new incoming Message has been received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OtrTransformLayer

public OtrTransformLayer()
Method Detail

messageDelivered

public MessageDeliveredEvent messageDelivered(MessageDeliveredEvent evt)
Description copied from interface: TransformLayer
Called when the underlying implementation has received an indication that a message, sent earlier has been successfully received by the destination. The method returns an instance of MessageDeliveredEvent which in many cases would be different from the evt instance that was passed as a parameter. The param and the return instances could very well (and will often) be instances of different implementations so users of this interface (i.e. protocol implementors) should make no assumptions for the class of the return type and copy the returned instance into a new one if necessary.

Specified by:
messageDelivered in interface TransformLayer
Parameters:
evt - the MessageDeliveredEvent containing the id of the message that has caused the event.
Returns:
an instance of a (possibly new) MessageDeliveredEvent instance containing the transformed message or null if the TransportLayer has determined that this message event should not be delivered to the upper layers.

messageDeliveryFailed

public MessageDeliveryFailedEvent messageDeliveryFailed(MessageDeliveryFailedEvent evt)
Description copied from interface: TransformLayer
Called to indicated that delivery of a message sent earlier has failed. Reason code and phrase are contained by the MessageFailedEvent The method returns an instance of MessageDeliveredEvent which in many cases would be different from the evt instance that was passed as a parameter. The param and the return instances could very well (and will often) be instances of different implementations so users of this interface (i.e. protocol implementors) should make no assumptions for the class of the return type and copy the returned instance into a new one if necessary.

Specified by:
messageDeliveryFailed in interface TransformLayer
Parameters:
evt - the MessageFailedEvent containing the ID of the message whose delivery has failed.
Returns:
an instance of a (possibly new) MessageDeliveredEvent instance containing the transformed message or null if the TransportLayer has determined that this message event should not be delivered to the upper layers.

messageDeliveryPending

public MessageDeliveredEvent messageDeliveryPending(MessageDeliveredEvent evt)
Description copied from interface: TransformLayer
Called when the underlying implementation has just been asked by other bundles to send an outgoing message. The method returns an instance of MessageDeliveredEvent which in many cases would be different from the evt instance that was passed as a parameter. The param and the return instances could very well (and will often) be instances of different implementations so users of this interface (i.e. protocol implementors) should make no assumptions for the class of the return type and copy the returned instance into a new one if necessary.

Specified by:
messageDeliveryPending in interface TransformLayer
Parameters:
evt - the MessageDeliveredEvent containing the id of the message that has caused the event.
Returns:
an instance of a (possibly new) MessageDeliveredEvent instance containing the transformed message or null if the TransportLayer has determined that this message event should not be delivered to the upper layers.

messageReceived

public MessageReceivedEvent messageReceived(MessageReceivedEvent evt)
Description copied from interface: TransformLayer
Called when a new incoming Message has been received. The method returns an instance of MessageReceivedEvent which in many cases would be different from the evt instance that was passed as param. The param and the return instances could very well (and will often) be instances of different implementations so users of this interface (i.e. protocol implementors) should make no assumptions for the class of the return type and copy the returned instance into a new one if necessary.

Specified by:
messageReceived in interface TransformLayer
Parameters:
evt - the MessageReceivedEvent containing the newly received message, its sender and other details.
Returns:
an instance of a (possibly new) MessageReceivedEvent instance containing the transformed message or null if the TransportLayer has determined that this message event should not be delivered to the upper layers.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.