svn commit: r3281 - trunk/src/net/java/sip/communicator/service/protocol/OperationSetSmsMessaging.java

damencho at dev.java.net damencho at dev.java.net
Tue Dec 4 10:11:58 CET 2007


Author: damencho
Date: 2007-12-04 09:11:56+0000
New Revision: 3281

Added:
   trunk/src/net/java/sip/communicator/service/protocol/OperationSetSmsMessaging.java

Log:
Add operation set for sending sms

Added: trunk/src/net/java/sip/communicator/service/protocol/OperationSetSmsMessaging.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/service/protocol/OperationSetSmsMessaging.java?view=auto&rev=3281
==============================================================================
--- (empty file)
+++ trunk/src/net/java/sip/communicator/service/protocol/OperationSetSmsMessaging.java	2007-12-04 09:11:56+0000
@@ -0,0 +1,101 @@
+/*
+ * 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.service.protocol;
+
+import net.java.sip.communicator.service.protocol.event.*;
+
+/**
+ * Provides basic functionality for sending and receiving SMS Messages.
+ *
+ * @author Damian Minkov
+ */
+public interface OperationSetSmsMessaging
+    extends OperationSet
+{
+    /**
+     * Default encoding for outgoing messages.
+     */
+    public static final String DEFAULT_MIME_ENCODING = "UTF-8";
+
+    /**
+     * Default mime type for outgoing messages.
+     */
+    public static final String DEFAULT_MIME_TYPE = "text/plain";
+
+    /**
+     * Create a Message instance for sending arbitrary MIME-encoding content.
+     *
+     * @param content content value
+     * @param contentType the MIME-type for <tt>content</tt>
+     * @param contentEncoding encoding used for <tt>content</tt>
+     * @return the newly created message.
+     */
+    public Message createMessage(byte[] content,         String contentType,
+                                 String contentEncoding);
+
+    /**
+     * Create a Message instance for sending a sms messages with default
+     * (text/plain) content type and encoding.
+     *
+     * @param messageText the string content of the message.
+     * @return Message the newly created message
+     */
+    public Message createMessage(String messageText);
+
+    /**
+     * Sends the <tt>message</tt> to the destination indicated by the
+     * <tt>to</tt> contact.
+     * @param to the <tt>Contact</tt> to send <tt>message</tt> to
+     * @param message the <tt>Message</tt> to send.
+     * @throws java.lang.IllegalStateException if the underlying stack is
+     * not registered and initialized.
+     * @throws java.lang.IllegalArgumentException if <tt>to</tt> is not an
+     * instance belonging to the underlying implementation.
+     */
+    public void sendSmsMessage(Contact to, Message message)
+        throws IllegalStateException, IllegalArgumentException;
+    
+    /**
+     * Sends the <tt>message</tt> to the destination indicated by the
+     * <tt>to</tt> parameter.
+     * @param to the destination to send <tt>message</tt> to
+     * @param message the <tt>Message</tt> to send.
+     * @throws java.lang.IllegalStateException if the underlying stack is
+     * not registered and initialized.
+     * @throws java.lang.IllegalArgumentException if <tt>to</tt> is not an
+     * instance belonging to the underlying implementation.
+     */
+    public void sendSmsMessage(String to, Message message)
+        throws IllegalStateException, IllegalArgumentException;
+
+    /**
+     * Registers a MessageListener with this operation set so that it gets
+     * notifications of successful message delivery, failure or reception of
+     * incoming messages..
+     *
+     * @param listener the <tt>MessageListener</tt> to register.
+     */
+    public void addMessageListener(MessageListener listener);
+
+    /**
+     * Unregisters <tt>listener</tt> so that it won't receive any further
+     * notifications upon successful message delivery, failure or reception of
+     * incoming messages..
+     *
+     * @param listener the <tt>MessageListener</tt> to unregister.
+     */
+    public void removeMessageListener(MessageListener listener);
+
+    /**
+     * Determines whether the protocol supports the supplied content type
+     *
+     * @param contentType the type we want to check
+     * @return <tt>true</tt> if the protocol supports it and
+     * <tt>false</tt> otherwise.
+     */
+    public boolean isContentTypeSupported(String contentType);
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: commits-help at sip-communicator.dev.java.net





More information about the commits mailing list