Awesome
<h1 align="center"> Tigase Java XMPP Client Library </h1>NOTE: Tigase JaXMPP has new home at tigase.dev/tigase/_libraries/jaxmpp - please submit all issues/pull-requests there!
What it is
Tigase Java XMPP Client Library is an XMPP client library written in a Java programming language. It provides implementation of core of the XMPP standard and processing XML. Additionally it provides support for many popular extensions (XEP's).
This repository contains source files of the library.
Features
JaXMPP implements support for RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core and RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence. Additionally it supports many popular XEPs. Below is a list of some of the supported XEPs:
- XEP-0004: Data Forms
- XEP-0030: Service Discovery
- XEP-0045: Multi-User Chat
- XEP-0050: Ad-Hoc Commands
- XEP-0054: vcard-temp
- XEP-0069: Result Set Management
- XEP-0060: Publish-Subscribe
- XEP-0077: In-Band Registration
- XEP-0084: User Avatar
- XEP-0092: Software Version
- XEP-0115: Entity Capabilities
- XEP-0138: Stream Compression
- XEP-0153: vCard-Based Avatar
- XEP-0163: Personal Eventing Protocol
- XEP-0166: Jingle
- XEP-0167: Jingle RTP Session
- XEP-0176: Jingle ICE-UDP Transport Method
- XEP-0184: Message Delivery Receipts
- XEP-0198: Stream Management
- XEP-0203: Delayed Delivery
- XEP-0249: Direct MUC Invitations
- XEP-0280: Message Carbons
- XEP-0305: XMPP Quickstart
- XEP-0313: Message Archive Management
- XEP-0357: Push Notifications
- XEP-0363: HTTP File Upload
- XEP-0384: OMEMO Encryption
Compilation
Maven is required tool to compile library:
mvn package
To build Android JaXMPP module just use android
profile:
mvn package -Pandroid
Note, that following requirements has to be met:
- Java 1.8 has to be used
- Android sdk must be installed (e.g.:
brew install android-sdk
) - Proper tooling mus be installed (e.g.:
sdkmanager "platform-tools" "platforms;android-28"
) ANDROID_HOME
must be declared. (e.g.:export ANDROID_HOME=/usr/local/Caskroom/android-sdk/4333796
)
Releasing
- prepare release:
mvn -Pdist clean release:clean release:prepare
- perform:
mvn -Pdist release:perform
Simple client
Following snippet (in groovy
) creates simple XMPP client, that connects to the server and prints out all incomming messages (waits for 1 minut and disconnects)
import tigase.jaxmpp.core.client.BareJID
import tigase.jaxmpp.core.client.JID
import tigase.jaxmpp.core.client.SessionObject
import tigase.jaxmpp.core.client.exceptions.JaxmppException
import tigase.jaxmpp.core.client.xmpp.modules.chat.Chat
import tigase.jaxmpp.core.client.xmpp.modules.chat.MessageModule
import tigase.jaxmpp.core.client.xmpp.stanzas.Message
import tigase.jaxmpp.j2se.Jaxmpp
final Jaxmpp contact = new Jaxmpp()
tigase.jaxmpp.j2se.Presence.initialize(contact);
contact.getModulesManager().register(new MessageModule());
contact.getProperties().setUserProperty(SessionObject.USER_BARE_JID, BareJID.bareJIDInstance("admin@atlantiscity"))
contact.getProperties().setUserProperty(SessionObject.PASSWORD, "admin")
contact.getEventBus().addHandler(MessageModule.MessageReceivedHandler.MessageReceivedEvent.class,
new MessageModule.MessageReceivedHandler() {
@Override
public void onMessageReceived(SessionObject sessionObject, Chat chat, Message stanza) {
System.out.println("received message: " + stanza.getBody());
}
});
println("Loging in...");
contact.login(true)
if (contact.isConnected()) {
TimeUnit.MINUTES.sleep(1);
contact.disconnect()
}
Support
When looking for support, please first search for answers to your question in the available online channels:
- Our online documentation: Tigase Docs
- Existing issues in relevant project, for Tigase Server it's: Tigase XMPP Server GitHub issues
If you didn't find an answer in the resources above, feel free to submit your question as new issue on GitHub or, if you have valid support subscription, open new support ticket.
License
<img alt="Tigase Tigase Logo" src="https://github.com/tigase/website-assets/blob/master/tigase/images/tigase-logo.png?raw=true" width="25"/> Official <a href="https://tigase.net/">Tigase</a> repository is available at: https://github.com/tigase/jaxmpp/.
Copyright (c) 2004 Tigase, Inc.
Licensed under AGPL License Version 3. Other licensing options available upon request.