Class XMPPBridge

  • All Implemented Interfaces:
    EventListener

    public class XMPPBridge
    extends org.apache.cayenne.event.EventBridge
    An EventBridge implementation based on XMPP protocol and Smack XMPP client library. What's good about XMPP (Extensible Messaging and Presence Protocol, an IETF standard protocol that grew up from Jabber IM) is that generally it has fewer or no deployment limitations (unlike JMS and JGroups that are generally a good solution for local controlled networks). Also it provides lots of additional information for free, such as presence, and much more.

    This implementation is based on Smack XMPP client library from JiveSoftware.

    Since:
    1.2
    • Field Detail

      • XMPP_PORT_PROPERTY

        public static final String XMPP_PORT_PROPERTY
        An optional property, port 5222 is used as default XMPP port.
        See Also:
        Constant Field Values
      • XMPP_CHAT_SERVICE_PROPERTY

        public static final String XMPP_CHAT_SERVICE_PROPERTY
        An optional property, "conference" is used as default chat service.
        See Also:
        Constant Field Values
      • secureConnection

        protected boolean secureConnection
      • loginId

        protected String loginId
      • password

        protected String password
      • xmppHost

        protected String xmppHost
      • xmppPort

        protected int xmppPort
      • chatService

        protected String chatService
      • sessionHandle

        protected String sessionHandle
      • connection

        protected org.jivesoftware.smack.XMPPConnection connection
      • groupChat

        protected org.jivesoftware.smack.GroupChat groupChat
      • connected

        protected boolean connected
    • Constructor Detail

      • XMPPBridge

        public XMPPBridge​(org.apache.cayenne.event.EventSubject localSubject,
                          String externalSubject)
        Creates an XMPPBridge. External subject will be used as the chat group name.
      • XMPPBridge

        public XMPPBridge​(Collection<org.apache.cayenne.event.EventSubject> localSubjects,
                          String externalSubject)
        Creates an XMPPBridge. External subject will be used as the chat group name.
      • XMPPBridge

        public XMPPBridge​(Collection<org.apache.cayenne.event.EventSubject> localSubjects,
                          String externalSubject,
                          Map<String,​String> properties)
    • Method Detail

      • getXmppHost

        public String getXmppHost()
      • setXmppHost

        public void setXmppHost​(String xmppHost)
      • getXmppPort

        public int getXmppPort()
      • setXmppPort

        public void setXmppPort​(int xmppPort)
      • getLoginId

        public String getLoginId()
      • setLoginId

        public void setLoginId​(String loginId)
      • getPassword

        public String getPassword()
      • setPassword

        public void setPassword​(String password)
      • isSecureConnection

        public boolean isSecureConnection()
      • setSecureConnection

        public void setSecureConnection​(boolean secureConnection)
      • getChatService

        public String getChatService()
      • setChatService

        public void setChatService​(String chatService)
      • getSessionHandle

        public String getSessionHandle()
      • setSessionHandle

        public void setSessionHandle​(String sessionHandle)
      • startupExternal

        protected void startupExternal()
                                throws Exception
        Specified by:
        startupExternal in class org.apache.cayenne.event.EventBridge
        Throws:
        Exception
      • shutdownExternal

        protected void shutdownExternal()
                                 throws Exception
        Specified by:
        shutdownExternal in class org.apache.cayenne.event.EventBridge
        Throws:
        Exception
      • sendExternalEvent

        protected void sendExternalEvent​(org.apache.cayenne.event.CayenneEvent localEvent)
                                  throws Exception
        Specified by:
        sendExternalEvent in class org.apache.cayenne.event.EventBridge
        Throws:
        Exception