From 58dc243782b7bfe366f9e246e9cb39c290971e6b Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Thu, 22 Feb 2007 12:38:23 +0000 Subject: [PATCH] Added multichat operation set definition and Gibberish protocol implementation. Related issues: Issue #241 , Issue #244, Issue #250 Added comments --- .../mock/MockBasicInstantMessaging.java | 53 +++++++++++++------ 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/mock/MockBasicInstantMessaging.java b/src/net/java/sip/communicator/impl/protocol/mock/MockBasicInstantMessaging.java index 5f9d4c2b5..694ae7663 100644 --- a/src/net/java/sip/communicator/impl/protocol/mock/MockBasicInstantMessaging.java +++ b/src/net/java/sip/communicator/impl/protocol/mock/MockBasicInstantMessaging.java @@ -1,3 +1,9 @@ +/* + * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ package net.java.sip.communicator.impl.protocol.mock; import java.util.*; @@ -5,16 +11,44 @@ import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; +/** + * Instant messaging functionalites for the mock protocol. + * + * @author Damian Minkov + * @author Emil Ivov + */ public class MockBasicInstantMessaging implements OperationSetBasicInstantMessaging { + /** + * Currently registered message listeners. + */ private Vector messageListeners = new Vector(); + + /** + * The currently valid persistent presence operation set.. + */ private MockPersistentPresenceOperationSet opSetPersPresence = null; - public MockBasicInstantMessaging(MockProvider provider, - MockPersistentPresenceOperationSet opSetPersPresence) + /** + * The protocol provider that created us. + */ + private MockProvider parentProvider = null; + + /** + * Creates an instance of this operation set keeping a reference to the + * parent protocol provider and presence operation set. + * + * @param provider The provider instance that creates us. + * @param opSetPersPresence the currently valid + * MockPersistentPresenceOperationSet instance. + */ + public MockBasicInstantMessaging( + MockProvider provider, + MockPersistentPresenceOperationSet opSetPersPresence) { this.opSetPersPresence = opSetPersPresence; + this.parentProvider = provider; } /** @@ -23,9 +57,6 @@ public MockBasicInstantMessaging(MockProvider provider, * incoming messages.. * * @param listener the MessageListener to register. - * @todo Implement this - * net.java.sip.communicator.service.protocol.OperationSetBasicInstantMessaging - * method */ public void addMessageListener(MessageListener listener) { @@ -42,9 +73,6 @@ public void addMessageListener(MessageListener listener) * @param subject a String subject or null for now * subject. * @return the newly created message. - * @todo Implement this - * net.java.sip.communicator.service.protocol.OperationSetBasicInstantMessaging - * method */ public Message createMessage(byte[] content, String contentType, String contentEncoding, String subject) @@ -59,9 +87,6 @@ public Message createMessage(byte[] content, String contentType, * * @param messageText the string content of the message. * @return Message the newly created message - * @todo Implement this - * net.java.sip.communicator.service.protocol.OperationSetBasicInstantMessaging - * method */ public Message createMessage(String messageText) { @@ -75,9 +100,6 @@ public Message createMessage(String messageText) * of incoming messages.. * * @param listener the MessageListener to unregister. - * @todo Implement this - * net.java.sip.communicator.service.protocol.OperationSetBasicInstantMessaging - * method */ public void removeMessageListener(MessageListener listener) { @@ -94,9 +116,6 @@ public void removeMessageListener(MessageListener listener) * registered and initialized. * @throws IllegalArgumentException if to is not an instance * belonging to the underlying implementation. - * @todo Implement this - * net.java.sip.communicator.service.protocol.OperationSetBasicInstantMessaging - * method */ public void sendInstantMessage(Contact to, Message message) throws IllegalStateException, IllegalArgumentException