org.eclipse.ecf.provider.xmpp.container
Class XMPPGroupChatSharedObject

java.lang.Object
  extended by org.eclipse.ecf.provider.xmpp.container.XMPPGroupChatSharedObject
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, ISharedObject, IEventHandler

public class XMPPGroupChatSharedObject
extends java.lang.Object
implements ISharedObject


Field Summary
protected  org.jivesoftware.smack.packet.Message.Type[] ALLOWED_MESSAGES
           
static Trace trace
           
 
Constructor Summary
XMPPGroupChatSharedObject(Namespace usernamespace, org.jivesoftware.smack.XMPPConnection conn)
           
 
Method Summary
protected  void addChatParticipantListener(IChatParticipantListener listener)
           
protected  void addMessageListener(IMessageListener listener)
           
protected  java.lang.String canonicalizeRoomFrom(java.lang.String from)
           
protected  java.lang.String canonicalizeRoomTo(java.lang.String to)
           
protected  IPresence createIPresence(org.jivesoftware.smack.packet.Presence xmppPresence)
           
protected  IPresence.Mode createIPresenceMode(org.jivesoftware.smack.packet.Presence xmppPresence)
           
protected  IPresence.Type createIPresenceType(org.jivesoftware.smack.packet.Presence xmppPresence)
           
protected  IMessageListener.Type createMessageType(org.jivesoftware.smack.packet.Message.Type type)
           
protected  ID createRoomIDFromName(java.lang.String from)
           
protected  ID createUserIDFromName(java.lang.String name)
           
protected  void debug(java.lang.String msg)
           
 void dispose(ID containerID)
          Method called by the ISharedObjectContainer upon ISharedObject destruction.
protected  void dumpStack(java.lang.String msg, java.lang.Throwable e)
           
protected  org.jivesoftware.smack.packet.Message filterMessageType(org.jivesoftware.smack.packet.Message msg)
           
protected  void fireChatParticipant(ID fromID, boolean join)
           
protected  void fireMessage(ID from, ID to, IMessageListener.Type type, java.lang.String subject, java.lang.String body)
           
protected  void fireParticipant(ID fromID, IPresence presence)
           
 java.lang.Object getAdapter(java.lang.Class clazz)
           
protected  ISharedObjectContext getContext()
           
protected  void handleChatMembershipEvent(ChatMembershipEvent evt)
           
 void handleEvent(Event event)
          Handle Event passed to this ISharedObject.
 void handleEvents(Event[] events)
          Handle Events passed to this ISharedObject.
protected  void handleMessageEvent(MessageEvent evt)
           
protected  void handlePresenceEvent(PresenceEvent evt)
           
 void init(ISharedObjectConfig initData)
          Initialize this ISharedObject.
protected  void removeChatParticipantListener(IChatParticipantListener listener)
           
protected  void removeMessageListener(IMessageListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trace

public static Trace trace

ALLOWED_MESSAGES

protected org.jivesoftware.smack.packet.Message.Type[] ALLOWED_MESSAGES
Constructor Detail

XMPPGroupChatSharedObject

public XMPPGroupChatSharedObject(Namespace usernamespace,
                                 org.jivesoftware.smack.XMPPConnection conn)
Method Detail

debug

protected void debug(java.lang.String msg)

dumpStack

protected void dumpStack(java.lang.String msg,
                         java.lang.Throwable e)

addChatParticipantListener

protected void addChatParticipantListener(IChatParticipantListener listener)

removeChatParticipantListener

protected void removeChatParticipantListener(IChatParticipantListener listener)

addMessageListener

protected void addMessageListener(IMessageListener listener)

removeMessageListener

protected void removeMessageListener(IMessageListener listener)

getContext

protected ISharedObjectContext getContext()

init

public void init(ISharedObjectConfig initData)
          throws SharedObjectInitException
Description copied from interface: ISharedObject
Initialize this ISharedObject. The ISharedObjectContainer for this ISharedObject must call this method with a non-null instance of ISharedObjectConfig. ISharedObject implementations can use this initialization to perform any initialization necessary prior to receiving any events (via handleEvent/s). Note that the ISharedObjectContext provided via the ISharedObjectConfig.getSharedObjectContext() method is not guaranteed to allow any method calls until after this init() method call has completed.

Specified by:
init in interface ISharedObject
Parameters:
initData - the initialization data passed by the ISharedObjectContainer upon initialization
Throws:
SharedObjectInitException - thrown by ISharedObject to halt initialization. ISharedObjectContainers must respond to such an exception by halting the addition of the ISharedObject instance and treating it as not in the container.

createUserIDFromName

protected ID createUserIDFromName(java.lang.String name)

filterMessageType

protected org.jivesoftware.smack.packet.Message filterMessageType(org.jivesoftware.smack.packet.Message msg)

canonicalizeRoomFrom

protected java.lang.String canonicalizeRoomFrom(java.lang.String from)

createMessageType

protected IMessageListener.Type createMessageType(org.jivesoftware.smack.packet.Message.Type type)

fireMessage

protected void fireMessage(ID from,
                           ID to,
                           IMessageListener.Type type,
                           java.lang.String subject,
                           java.lang.String body)

canonicalizeRoomTo

protected java.lang.String canonicalizeRoomTo(java.lang.String to)

createRoomIDFromName

protected ID createRoomIDFromName(java.lang.String from)

handleMessageEvent

protected void handleMessageEvent(MessageEvent evt)

createIPresenceType

protected IPresence.Type createIPresenceType(org.jivesoftware.smack.packet.Presence xmppPresence)

createIPresenceMode

protected IPresence.Mode createIPresenceMode(org.jivesoftware.smack.packet.Presence xmppPresence)

createIPresence

protected IPresence createIPresence(org.jivesoftware.smack.packet.Presence xmppPresence)

handlePresenceEvent

protected void handlePresenceEvent(PresenceEvent evt)

handleChatMembershipEvent

protected void handleChatMembershipEvent(ChatMembershipEvent evt)

fireParticipant

protected void fireParticipant(ID fromID,
                               IPresence presence)

fireChatParticipant

protected void fireChatParticipant(ID fromID,
                                   boolean join)

handleEvent

public void handleEvent(Event event)
Description copied from interface: IEventHandler
Handle Event passed to this ISharedObject. The ISharedObjectContainer will pass events to all SharedObjects via this method and the handleEvents method.

Specified by:
handleEvent in interface IEventHandler
Parameters:
event - the Event for the ISharedObject to handle

handleEvents

public void handleEvents(Event[] events)
Description copied from interface: IEventHandler
Handle Events passed to this ISharedObject. The ISharedObjectContainer will pass events to all SharedObjects via this method and the handleEvents method.

Specified by:
handleEvents in interface IEventHandler
Parameters:
events - the Events [] for the ISharedObject to handle

dispose

public void dispose(ID containerID)
Description copied from interface: ISharedObject
Method called by the ISharedObjectContainer upon ISharedObject destruction. Once this method is called, no more Events will be passed to a ISharedObject until the init method is called again.

Specified by:
dispose in interface ISharedObject
Parameters:
containerID - the ID of the container that is disposing this ISharedObject

getAdapter

public java.lang.Object getAdapter(java.lang.Class clazz)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable