Class XmppConnectionFactoryBean

java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<org.jivesoftware.smack.XMPPConnection>
org.springframework.integration.xmpp.config.XmppConnectionFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<org.jivesoftware.smack.XMPPConnection>, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class XmppConnectionFactoryBean
extends org.springframework.beans.factory.config.AbstractFactoryBean<org.jivesoftware.smack.XMPPConnection>
implements org.springframework.context.SmartLifecycle
This class configures an XMPPTCPConnection object. This object is used for all scenarios to talk to a Smack server.
Since:
2.0
See Also:
XMPPTCPConnection
  • Field Summary

    Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    logger

    Fields inherited from interface org.springframework.beans.factory.FactoryBean

    OBJECT_TYPE_ATTRIBUTE

    Fields inherited from interface org.springframework.context.SmartLifecycle

    DEFAULT_PHASE
  • Constructor Summary

    Constructors 
    Constructor Description
    XmppConnectionFactoryBean()  
  • Method Summary

    Modifier and Type Method Description
    protected org.jivesoftware.smack.XMPPConnection createInstance()  
    protected org.jivesoftware.smack.tcp.XMPPTCPConnection getConnection()  
    java.lang.Class<? extends org.jivesoftware.smack.XMPPConnection> getObjectType()  
    int getPhase()  
    boolean isAutoStartup()  
    boolean isRunning()  
    void setAutoStartup​(boolean autoStartup)  
    void setConnectionConfiguration​(org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration connectionConfiguration)  
    void setHost​(java.lang.String host)  
    void setPassword​(java.lang.String password)  
    void setPhase​(int phase)  
    void setPort​(int port)  
    void setResource​(java.lang.String resource)  
    void setServiceName​(java.lang.String serviceName)  
    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.
    void setUser​(java.lang.String user)  
    void start()  
    void stop()  

    Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean

    afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.context.SmartLifecycle

    stop
  • Constructor Details

  • Method Details

    • setConnectionConfiguration

      public void setConnectionConfiguration​(org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration connectionConfiguration)
      Parameters:
      connectionConfiguration - the XMPPTCPConnectionConfiguration to use.
      Since:
      4.2.5
    • setAutoStartup

      public void setAutoStartup​(boolean autoStartup)
    • setPhase

      public void setPhase​(int phase)
    • setUser

      public void setUser​(java.lang.String user)
    • setPassword

      public void setPassword​(java.lang.String password)
    • setResource

      public void setResource​(java.lang.String resource)
    • setServiceName

      public void setServiceName​(java.lang.String serviceName)
    • setHost

      public void setHost​(java.lang.String host)
    • 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 is Roster.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 - the Roster.SubscriptionMode to use. Can be null.
      See Also:
      Roster.setSubscriptionMode(Roster.SubscriptionMode)
    • getObjectType

      public java.lang.Class<? extends org.jivesoftware.smack.XMPPConnection> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<org.jivesoftware.smack.XMPPConnection>
      Specified by:
      getObjectType in class org.springframework.beans.factory.config.AbstractFactoryBean<org.jivesoftware.smack.XMPPConnection>
    • createInstance

      protected org.jivesoftware.smack.XMPPConnection createInstance() throws org.jxmpp.stringprep.XmppStringprepException
      Specified by:
      createInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<org.jivesoftware.smack.XMPPConnection>
      Throws:
      org.jxmpp.stringprep.XmppStringprepException
    • getConnection

      protected org.jivesoftware.smack.tcp.XMPPTCPConnection getConnection()
    • start

      public void start()
      Specified by:
      start in interface org.springframework.context.Lifecycle
    • stop

      public void stop()
      Specified by:
      stop in interface org.springframework.context.Lifecycle
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface org.springframework.context.Lifecycle
    • getPhase

      public int getPhase()
      Specified by:
      getPhase in interface org.springframework.context.Phased
      Specified by:
      getPhase in interface org.springframework.context.SmartLifecycle
    • isAutoStartup

      public boolean isAutoStartup()
      Specified by:
      isAutoStartup in interface org.springframework.context.SmartLifecycle