src/net/java/otr4j/OtrEngine.java
changeset 810 0ff0059f2ec3
child 815 ca323cff3ac9
equal deleted inserted replaced
797:fbd3585af53e 810:0ff0059f2ec3
       
     1 package net.java.otr4j;
       
     2 
       
     3 import java.security.PublicKey;
       
     4 
       
     5 import net.java.otr4j.session.SessionID;
       
     6 import net.java.otr4j.session.SessionStatus;
       
     7 
       
     8 /**
       
     9  * 
       
    10  * @author George Politis
       
    11  * 
       
    12  */
       
    13 public interface OtrEngine {
       
    14 
       
    15 	/**
       
    16 	 * 
       
    17 	 * @param sessionID
       
    18 	 *            The session identifier.
       
    19 	 * @param content
       
    20 	 *            The message content to be transformed.
       
    21 	 * @return The transformed message content.
       
    22 	 */
       
    23 	public abstract String transformReceiving(SessionID sessionID,
       
    24 			String content);
       
    25 
       
    26 	/**
       
    27 	 * 
       
    28 	 * @param sessionID
       
    29 	 *            The session identifier.
       
    30 	 * @param content
       
    31 	 *            The message content to be transformed.
       
    32 	 * @return The transformed message content.
       
    33 	 */
       
    34 	public abstract String transformSending(SessionID sessionID, String content);
       
    35 
       
    36 	/**
       
    37 	 * Starts an Off-the-Record session, if there is no active one.
       
    38 	 * 
       
    39 	 * @param sessionID
       
    40 	 *            The session identifier.
       
    41 	 */
       
    42 	public abstract void startSession(SessionID sessionID);
       
    43 
       
    44 	/**
       
    45 	 * Ends the Off-the-Record session, if exists.
       
    46 	 * 
       
    47 	 * @param sessionID
       
    48 	 *            The session identifier.
       
    49 	 */
       
    50 	public abstract void endSession(SessionID sessionID);
       
    51 
       
    52 	/**
       
    53 	 * Stops/Starts the Off-the-Record session.
       
    54 	 * 
       
    55 	 * @param sessionID
       
    56 	 *            The session identifier.
       
    57 	 */
       
    58 	public abstract void refreshSession(SessionID sessionID);
       
    59 
       
    60 	/**
       
    61 	 * 
       
    62 	 * @param sessionID
       
    63 	 *            The session identifier.
       
    64 	 * @return The status of an Off-the-Record session.
       
    65 	 */
       
    66 	public abstract SessionStatus getSessionStatus(SessionID sessionID);
       
    67 
       
    68 	/**
       
    69 	 * 
       
    70 	 * @param sessionID
       
    71 	 *            The session identifier.
       
    72 	 * @return The remote public key.
       
    73 	 */
       
    74 	public abstract PublicKey getRemotePublicKey(SessionID sessionID);
       
    75 
       
    76 	public abstract void addOtrEngineListener(OtrEngineListener l);
       
    77 
       
    78 	public abstract void removeOtrEngineListener(OtrEngineListener l);
       
    79 }