public class MockBasicInstantMessaging extends AbstractOperationSetBasicInstantMessaging
DEFAULT_MIME_ENCODING, DEFAULT_MIME_TYPE, HTML_MIME_TYPE
Constructor and Description |
---|
MockBasicInstantMessaging(MockProvider provider,
MockPersistentPresenceOperationSet opSetPersPresence)
Creates an instance of this operation set keeping a reference to the
parent protocol provider and presence operation set.
|
Modifier and Type | Method and Description |
---|---|
Message |
createMessage(java.lang.String content,
java.lang.String contentType,
java.lang.String encoding,
java.lang.String subject)
Create a Message instance for sending arbitrary MIME-encoding content.
|
void |
deliverMessage(java.lang.String to,
Message msg)
Methods for manipulating mock operation set as deliver(receive) messageop
|
boolean |
isContentTypeSupported(java.lang.String contentType)
Determines whether the protocol supports the supplied content type
|
boolean |
isOfflineMessagingSupported()
Determines whether the protocol provider (or the protocol itself) support
sending and receiving offline messages.
|
void |
sendInstantMessage(Contact to,
Message message)
Sends the message to the destination indicated by the
to contact.
|
addMessageListener, createMessage, createMessage, createMessageWithUID, fireMessageDelivered, fireMessageDeliveryFailed, fireMessageEvent, fireMessageReceived, getInactivityTimeout, isContentTypeSupported, messageDeliveryPendingTransform, removeMessageListener, sendInstantMessage
public MockBasicInstantMessaging(MockProvider provider, MockPersistentPresenceOperationSet opSetPersPresence)
provider
- The provider instance that creates us.opSetPersPresence
- the currently valid
MockPersistentPresenceOperationSet instance.public Message createMessage(java.lang.String content, java.lang.String contentType, java.lang.String encoding, java.lang.String subject)
OperationSetBasicInstantMessaging
createMessage
in interface OperationSetBasicInstantMessaging
createMessage
in class AbstractOperationSetBasicInstantMessaging
content
- content valuecontentType
- the MIME-type for contentencoding
- encoding used for contentsubject
- a String subject or null for now
subject.public void sendInstantMessage(Contact to, Message message) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
to
- the Contact to send message tomessage
- the Message to send.java.lang.IllegalStateException
- if the underlying ICQ stack is not
registered and initialized.java.lang.IllegalArgumentException
- if to is not an instance
belonging to the underlying implementation.public boolean isOfflineMessagingSupported()
public boolean isContentTypeSupported(java.lang.String contentType)
contentType
- the type we want to checkpublic void deliverMessage(java.lang.String to, Message msg)
to
- the address of the contact whom we are to deliver the message.msg
- the message that we are to deliver.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.