Class XmppConnectionFactoryBean
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<org.jivesoftware.smack.XMPPConnection>
org.springframework.integration.xmpp.config.XmppConnectionFactoryBean
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,BeanFactoryAware,DisposableBean,FactoryBean<org.jivesoftware.smack.XMPPConnection>,InitializingBean,Lifecycle,Phased,SmartLifecycle
public class XmppConnectionFactoryBean
extends AbstractFactoryBean<org.jivesoftware.smack.XMPPConnection>
implements SmartLifecycle
This class configures an
XMPPTCPConnection object.
This object is used for all scenarios to talk to a Smack server.- Since:
- 2.0
- Author:
- Josh Long, Mark Fisher, Oleg Zhurakousky, Florian Schmaus, Artem Bilan, Philipp Etschel, Gary Russell
- See Also:
-
XMPPTCPConnection
-
Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
loggerFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTEFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.jivesoftware.smack.XMPPConnectionprotected org.jivesoftware.smack.tcp.XMPPTCPConnectionClass<? extends org.jivesoftware.smack.XMPPConnection>intgetPhase()booleanbooleanvoidsetAutoStartup(boolean autoStartup) voidsetConnectionConfiguration(org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration connectionConfiguration) voidvoidsetPassword(String password) voidsetPhase(int phase) voidsetPort(int port) voidsetResource(String resource) voidsetServiceName(String serviceName) voidsetSubscriptionMode(org.jivesoftware.smack.roster.Roster.SubscriptionMode subscriptionMode) Sets the subscription processing mode, which dictates what action Smack will take when subscription requests from other users are made.voidvoidstart()voidstop()Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingletonMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecycle
stop
-
Constructor Details
-
XmppConnectionFactoryBean
public XmppConnectionFactoryBean()
-
-
Method Details
-
setConnectionConfiguration
public void setConnectionConfiguration(org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration connectionConfiguration) - Parameters:
connectionConfiguration- theXMPPTCPConnectionConfigurationto use.- Since:
- 4.2.5
-
setAutoStartup
public void setAutoStartup(boolean autoStartup) -
setPhase
public void setPhase(int phase) -
setUser
-
setPassword
-
setResource
-
setServiceName
-
setHost
-
setPort
public void setPort(int port) -
setSubscriptionMode
public void setSubscriptionMode(org.jivesoftware.smack.roster.Roster.SubscriptionMode subscriptionMode) Sets the subscription processing mode, which dictates what action Smack will take when subscription requests from other users are made. The default subscription mode isRoster.SubscriptionMode.accept_all.To disable Roster subscription (e.g. for sub-protocol without its support such a GCM) specify this option as
null.- Parameters:
subscriptionMode- theRoster.SubscriptionModeto use. Can benull.- See Also:
-
Roster.setSubscriptionMode(Roster.SubscriptionMode)
-
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<org.jivesoftware.smack.XMPPConnection>- Specified by:
getObjectTypein classAbstractFactoryBean<org.jivesoftware.smack.XMPPConnection>
-
createInstance
protected org.jivesoftware.smack.XMPPConnection createInstance() throws org.jxmpp.stringprep.XmppStringprepException- Specified by:
createInstancein classAbstractFactoryBean<org.jivesoftware.smack.XMPPConnection>- Throws:
org.jxmpp.stringprep.XmppStringprepException
-
getConnection
protected org.jivesoftware.smack.tcp.XMPPTCPConnection getConnection() -
start
public void start() -
stop
public void stop() -
isRunning
public boolean isRunning() -
getPhase
public int getPhase()- Specified by:
getPhasein interfacePhased- Specified by:
getPhasein interfaceSmartLifecycle
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceSmartLifecycle
-