Code Monkey home page Code Monkey logo

jaxmpp's Introduction

NOTE: Tigase JaXMPP has new home at tigase.dev/tigase/_libraries/jaxmpp - please submit all issues/pull-requests there!

Tigase Java XMPP Client Library

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:

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:

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

Tigase Tigase Logo Official Tigase 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.

jaxmpp's People

Contributors

arthef avatar bmalkow avatar dependabot[bot] avatar hantu85 avatar qianqianluo avatar woj-tek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.