Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.plugin.otr
Interface ScOtrEngine

All Known Implementing Classes:
ScOtrEngineImpl

public interface ScOtrEngine

This interface must be implemented by classes that provide the Off-the-Record functionality.

Author:
George Politis

Method Summary
 void addListener(ScOtrEngineListener listener)
          Registers an ScOtrEngineListener.
 void endSession(Contact contact)
          Ends the Off-the-Record session for the given Contact, if it is not already started.
 net.java.otr4j.OtrPolicy getContactPolicy(Contact contact)
          Gets a Contact specific policy.
 net.java.otr4j.OtrPolicy getGlobalPolicy()
          Gets the global OtrPolicy.
 net.java.otr4j.session.SessionStatus getSessionStatus(Contact contact)
          Gets the SessionStatus for the given Contact.
 boolean isMessageUIDInjected(String messageUID)
          Gets weather the passed in messageUID is injected by the engine or not.
 void launchHelp()
          Launches the help page.
 void refreshSession(Contact contact)
          Refreshes the Off-the-Record session for the given Contact.
 void removeListener(ScOtrEngineListener listener)
          Unregisters an ScOtrEngineListener.
 void setContactPolicy(Contact contact, net.java.otr4j.OtrPolicy policy)
          Sets the contact specific policy
 void setGlobalPolicy(net.java.otr4j.OtrPolicy policy)
          Sets the global policy.
 void startSession(Contact contact)
          Starts the Off-the-Record session for the given Contact, if it's not already started.
 String transformReceiving(Contact contact, String content)
          Transforms an incoming message.
 String transformSending(Contact contact, String content)
          Transforms an outgoing message.
 

Method Detail

transformSending

String transformSending(Contact contact,
                        String content)
Transforms an outgoing message.

Parameters:
contact - the destination Contact.
content - the original message content.
Returns:
the transformed message content.

transformReceiving

String transformReceiving(Contact contact,
                          String content)
Transforms an incoming message.

Parameters:
contact - the source Contact.
content - the original message content.
Returns:
the transformed message content.

startSession

void startSession(Contact contact)
Starts the Off-the-Record session for the given Contact, if it's not already started.

Parameters:
contact - the Contact with whom we want to start an OTR session.

endSession

void endSession(Contact contact)
Ends the Off-the-Record session for the given Contact, if it is not already started.

Parameters:
contact - the Contact with whom we want to end the OTR session.

refreshSession

void refreshSession(Contact contact)
Refreshes the Off-the-Record session for the given Contact. If the session does not exist, a new session is established.

Parameters:
contact - the Contact with whom we want to refresh the OTR session.

getSessionStatus

net.java.otr4j.session.SessionStatus getSessionStatus(Contact contact)
Gets the SessionStatus for the given Contact.

Parameters:
contact - the Contact whose SessionStatus we are interested in.
Returns:
the SessionStatus.

isMessageUIDInjected

boolean isMessageUIDInjected(String messageUID)
Gets weather the passed in messageUID is injected by the engine or not. If it is injected, it shouldn't be re-transformed.

Parameters:
messageUID - the messageUID which is to be determined whether it is injected by the engine or not
Returns:
true if the passed in messageUID is injected by the engine; false, otherwise

addListener

void addListener(ScOtrEngineListener listener)
Registers an ScOtrEngineListener.

Parameters:
listener - the ScOtrEngineListener to register.

removeListener

void removeListener(ScOtrEngineListener listener)
Unregisters an ScOtrEngineListener.

Parameters:
listener - the ScOtrEngineListener to unregister.

getGlobalPolicy

net.java.otr4j.OtrPolicy getGlobalPolicy()
Gets the global OtrPolicy.

Returns:
the global OtrPolicy

getContactPolicy

net.java.otr4j.OtrPolicy getContactPolicy(Contact contact)
Gets a Contact specific policy.

Parameters:
contact - the Contact whose policy we want.
Returns:
The Contact specific OTR policy. If the specified Contact has no policy, the global policy is returned.

setGlobalPolicy

void setGlobalPolicy(net.java.otr4j.OtrPolicy policy)
Sets the global policy.

Parameters:
policy - the global policy

setContactPolicy

void setContactPolicy(Contact contact,
                      net.java.otr4j.OtrPolicy policy)
Sets the contact specific policy

Parameters:
contact - the Contact whose policy we want to set
policy - the OtrPolicy

launchHelp

void launchHelp()
Launches the help page.


Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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