|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ecf.core.AbstractContainer org.eclipse.ecf.provider.generic.SOContainer org.eclipse.ecf.provider.generic.ClientSOContainer org.eclipse.ecf.provider.xmpp.XMPPContainer
public class XMPPContainer
Field Summary | |
---|---|
static java.lang.String |
CONNECT_NAMESPACE
|
static java.lang.String |
CONTAINER_HELPER_ID
|
static int |
DEFAULT_KEEPALIVE
|
protected static java.lang.String |
GOOGLE_SERVICENAME
|
protected int |
keepAlive
|
protected ID |
presenceHelperID
|
static java.lang.String |
XMPP_GOOGLE_OVERRIDE_PROP_NAME
|
Fields inherited from class org.eclipse.ecf.provider.generic.ClientSOContainer |
---|
CONNECTED, CONNECTING, connection, connectionState, connectLock, connectPolicy, DEFAULT_CONNECT_TIMEOUT, DISCONNECTED, remoteServerID |
Fields inherited from class org.eclipse.ecf.provider.generic.SOContainer |
---|
config, DEFAULT_OBJECT_ARG_KEY, DEFAULT_OBJECT_ARGTYPES_KEY, groupManager, isClosing, loadingThreadGroup, policy, receiver, sharedObjectManager, sharedObjectMessageSerializer, sharedObjectThreadGroup |
Constructor Summary | |
---|---|
|
XMPPContainer()
|
|
XMPPContainer(int ka)
|
protected |
XMPPContainer(SOContainerConfig config,
int keepAlive)
|
|
XMPPContainer(java.lang.String userhost,
int ka)
|
Method Summary | |
---|---|
void |
connect(ID remote,
IConnectContext joinContext)
Connect to a target remote process or process group. |
protected Callback[] |
createAuthorizationCallbacks()
|
protected java.lang.Object |
createConnectData(ID target,
Callback[] cbs,
java.lang.Object data)
|
protected ISynchAsynchConnection |
createConnection(ID remoteSpace,
java.lang.Object data)
Create connection instance. |
protected SOContext |
createSharedObjectContext(SOConfig soconfig,
IQueueEnqueue queue)
|
protected void |
deliverEvent(Event evt)
|
void |
disconnect()
Disconnect. |
void |
dispose()
Dispose this IContainer instance. |
IAccountManager |
getAccountManager()
Get interface for managing account |
java.lang.Object |
getAdapter(java.lang.Class clazz)
This specialization of IAdaptable.getAdapter() returns additional services supported by this container. |
IChatManager |
getChatManager()
Get chat manager for sending and receiving chat messages |
IChatRoomManager |
getChatRoomManager()
Get chat room manager for this presence container. |
protected java.lang.Object |
getConnectData(ID remote,
IConnectContext joinContext)
|
Namespace |
getConnectNamespace()
Get the Namespace for creating a targetID suitable for use as the first parameter in subsequent calls to IContainer.connect(ID, IConnectContext) . |
protected int |
getConnectTimeout()
|
org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection |
getECFConnection()
|
protected org.jivesoftware.smack.Roster |
getRoster()
|
IRosterManager |
getRosterManager()
Get roster manager for access to roster model. |
IUserSearchManager |
getUserSearchManager()
Retrieve interface for search on the provide. |
org.jivesoftware.smack.XMPPConnection |
getXMPPConnection()
|
protected boolean |
handleAsExtension(org.jivesoftware.smack.packet.Packet packet)
|
protected ID |
handleConnectResponse(ID originalTarget,
java.lang.Object serverData)
|
protected void |
handleXMPPMessage(org.jivesoftware.smack.packet.Packet aPacket)
|
protected boolean |
isGoogle(ID remoteSpace)
|
protected void |
log(java.lang.String msg,
java.lang.Throwable e)
|
protected void |
processAsynch(AsynchEvent e)
|
protected void |
sendMessage(ContainerMessage data)
|
protected boolean |
verifySharedObjectMessageTarget(ID containerID)
|
Methods inherited from class org.eclipse.ecf.core.AbstractContainer |
---|
addListener, fireContainerEvent, getPasswordFromConnectContext, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.ecf.core.IContainer |
---|
addListener, removeListener |
Field Detail |
---|
public static final int DEFAULT_KEEPALIVE
public static final java.lang.String CONNECT_NAMESPACE
public static final java.lang.String CONTAINER_HELPER_ID
protected static final java.lang.String GOOGLE_SERVICENAME
public static final java.lang.String XMPP_GOOGLE_OVERRIDE_PROP_NAME
protected int keepAlive
protected ID presenceHelperID
Constructor Detail |
---|
protected XMPPContainer(SOContainerConfig config, int keepAlive) throws java.lang.Exception
java.lang.Exception
public XMPPContainer() throws java.lang.Exception
java.lang.Exception
public XMPPContainer(int ka) throws java.lang.Exception
java.lang.Exception
public XMPPContainer(java.lang.String userhost, int ka) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
protected boolean verifySharedObjectMessageTarget(ID containerID)
verifySharedObjectMessageTarget
in class SOContainer
protected void sendMessage(ContainerMessage data) throws java.io.IOException
sendMessage
in class ClientSOContainer
java.io.IOException
public IRosterManager getRosterManager()
IPresenceContainerAdapter
getRosterManager
in interface IPresenceContainerAdapter
null
if not available for for the implementing
provider.public IUserSearchManager getUserSearchManager()
IPresenceContainerAdapter
null
) can be used to search users
related to the same provider.
getUserSearchManager
in interface IPresenceContainerAdapter
null
if no search
available for this provider.public IAccountManager getAccountManager()
IPresenceContainerAdapter
getAccountManager
in interface IPresenceContainerAdapter
null
if no account manager
availablepublic IChatRoomManager getChatRoomManager()
IPresenceContainerAdapter
getChatRoomManager
in interface IPresenceContainerAdapter
null
.public IChatManager getChatManager()
IPresenceContainerAdapter
getChatManager
in interface IPresenceContainerAdapter
null
if no chat manager available for given
provider.public Namespace getConnectNamespace()
IContainer
IContainer.connect(ID, IConnectContext)
.
If this method returns null
, then it means that
null
is expected as a valid parameter in subsequent calls
to IContainer.connect(ID, IConnectContext)
. If this method returns a non-null
Namespace, then the targetID
parameter in
IContainer.connect(ID, IConnectContext)
must be non-null
instance created of the returned Namespace.
getConnectNamespace
in interface IContainer
getConnectNamespace
in class SOContainer
IContainer.connect(ID, IConnectContext)
. If null
,
then the targetID
instances passed to
IContainer.connect(ID, IConnectContext)
may be null
.
If not null
, then targetID
instances passed to IContainer.connect(ID, IConnectContext)
must be
instances of the returned Namespace.public void connect(ID remote, IConnectContext joinContext) throws ContainerConnectException
IContainer
connect
in interface IContainer
connect
in class ClientSOContainer
remote
- the ID of the remote server or group to connect to. See
IContainer.getConnectNamespace()
for a explanation of the
constraints upon this parameter.joinContext
- any required context to allow this container to authenticate.
May be null
if underlying provider does not
have any authentication requirements for connection.
ContainerConnectException
- thrown if communication cannot be established with remote
service. Causes can include network connection failure,
authentication failure, server error, or if container is
already connected.public void disconnect()
IContainer
null
.
disconnect
in interface IContainer
disconnect
in class ClientSOContainer
public void dispose()
IContainer
dispose
in interface IContainer
dispose
in class ClientSOContainer
public java.lang.Object getAdapter(java.lang.Class clazz)
IContainer
IContainer
should return them using this method. It is recommended that clients use
this method rather than instanceof checks and downcasts to find out about
the capabilities of a specific container.
Typically, after obtaining an IContainer, a client would use this method as a means to obtain a more meaningful interface to the container. This interface may or may not extend IContainer. For example, a client could use the following code to obtain an instance of ISharedObjectContainer:
IContainer newContainer = ContainerFactory.createContainer(type); ISharedObjectContainer soContainer = (ISharedObjectContainer) newContainer .getAdapter(ISharedObjectContainer.class); if (soContainer == null) throw new ContainerCreateException(message);
Implementations of this method should delegate to
IAdapterManager.loadAdapter()
if the service
cannot be provided directly to ensure extensibility by third-party
plug-ins.
getAdapter
in interface org.eclipse.core.runtime.IAdaptable
getAdapter
in interface IContainer
getAdapter
in class SOContainer
clazz
- the service type to look up
null
if this container does not support the given
serviceprotected ID handleConnectResponse(ID originalTarget, java.lang.Object serverData) throws java.lang.Exception
handleConnectResponse
in class ClientSOContainer
java.lang.Exception
protected ISynchAsynchConnection createConnection(ID remoteSpace, java.lang.Object data) throws ConnectionCreateException
ClientSOContainer
ClientSOContainer.connect(ID, IConnectContext)
. Following
a return from this method, the new ISynchAsynchConnection instance's IConnection.connect(ID, Object, int)
method is subsequently
called.
createConnection
in class ClientSOContainer
remoteSpace
- the targetID to connect to. The value is the same as that passed into ClientSOContainer.connect(ID, IConnectContext)
.data
- and data provided to the connection via the IConnectContext passed into the ClientSOContainer.connect(ID, IConnectContext)
call.
ISynchAsynchConnection
a connection instance. Will not be null
.
ConnectionCreateException
- thrown if the connection cannot be created.protected boolean isGoogle(ID remoteSpace)
protected java.lang.Object getConnectData(ID remote, IConnectContext joinContext) throws java.io.IOException, UnsupportedCallbackException
getConnectData
in class ClientSOContainer
java.io.IOException
UnsupportedCallbackException
protected java.lang.Object createConnectData(ID target, Callback[] cbs, java.lang.Object data)
protected Callback[] createAuthorizationCallbacks()
createAuthorizationCallbacks
in class ClientSOContainer
protected int getConnectTimeout()
getConnectTimeout
in class ClientSOContainer
protected org.jivesoftware.smack.Roster getRoster() throws java.io.IOException
java.io.IOException
protected void deliverEvent(Event evt)
protected void handleXMPPMessage(org.jivesoftware.smack.packet.Packet aPacket) throws java.io.IOException
java.io.IOException
protected boolean handleAsExtension(org.jivesoftware.smack.packet.Packet packet)
protected SOContext createSharedObjectContext(SOConfig soconfig, IQueueEnqueue queue)
createSharedObjectContext
in class SOContainer
protected void processAsynch(AsynchEvent e)
processAsynch
in class ClientSOContainer
public org.eclipse.ecf.internal.provider.xmpp.smack.ECFConnection getECFConnection()
public org.jivesoftware.smack.XMPPConnection getXMPPConnection()
protected void log(java.lang.String msg, java.lang.Throwable e)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |