Class XmppConnectionFactoryBean
java.lang.Object
org.springframework.ws.transport.xmpp.support.XmppConnectionFactoryBean
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.FactoryBean<org.jivesoftware.smack.tcp.XMPPTCPConnection>
,org.springframework.beans.factory.InitializingBean
public class XmppConnectionFactoryBean
extends Object
implements org.springframework.beans.factory.FactoryBean<org.jivesoftware.smack.tcp.XMPPTCPConnection>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Factory to make
XMPPConnection
and perform connection and login on the XMPP server- Since:
- 2.0
- Author:
- Gildas Cuisinier, Arjen Poutsma
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
protected org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration
createConnectionConfiguration
(String host, int port, String serviceName) Creates theConnectionConfiguration
from the given parameters.void
destroy()
org.jivesoftware.smack.tcp.XMPPTCPConnection
Class<org.jivesoftware.smack.tcp.XMPPTCPConnection>
boolean
void
Sets the server host to connect to.void
setPassword
(String password) void
setPort
(int port) Sets the server port to connect to.void
setResource
(String resource) void
setServiceName
(String serviceName) Sets the service name to connect to.void
setUsername
(String username)
-
Constructor Details
-
XmppConnectionFactoryBean
public XmppConnectionFactoryBean()
-
-
Method Details
-
setHost
Sets the server host to connect to. -
setPort
public void setPort(int port) Sets the server port to connect to.Defaults to
5222
. -
setServiceName
Sets the service name to connect to. -
setUsername
-
setPassword
-
setResource
-
afterPropertiesSet
public void afterPropertiesSet() throws org.jivesoftware.smack.XMPPException, IOException, org.jivesoftware.smack.SmackException- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
org.jivesoftware.smack.XMPPException
IOException
org.jivesoftware.smack.SmackException
-
destroy
public void destroy()- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
-
getObject
public org.jivesoftware.smack.tcp.XMPPTCPConnection getObject()- Specified by:
getObject
in interfaceorg.springframework.beans.factory.FactoryBean<org.jivesoftware.smack.tcp.XMPPTCPConnection>
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<org.jivesoftware.smack.tcp.XMPPTCPConnection>
-
isSingleton
public boolean isSingleton()- Specified by:
isSingleton
in interfaceorg.springframework.beans.factory.FactoryBean<org.jivesoftware.smack.tcp.XMPPTCPConnection>
-
createConnectionConfiguration
protected org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration createConnectionConfiguration(String host, int port, String serviceName) throws org.jxmpp.stringprep.XmppStringprepException Creates theConnectionConfiguration
from the given parameters.- Parameters:
host
- the host to connect toport
- the port to connect toserviceName
- the name of the service to connect to. May benull
- Throws:
org.jxmpp.stringprep.XmppStringprepException
-