├── debian ├── compat ├── std-logger.sh ├── tigase-server.dirs ├── watch ├── README.Debian ├── tigase-server.default ├── tigase-server.install ├── tigase-server.postrm ├── init.properties ├── control ├── copyright ├── rules └── tigase-server.postinst ├── scripts ├── debian │ ├── compat │ ├── tigase.dirs │ ├── tigase.default │ ├── init-debian.properties │ ├── copyright │ ├── tigase-debian.conf │ ├── control │ ├── rules │ ├── tigase.postrm │ └── tigase-install.sh ├── gentoo │ ├── conf.d │ │ └── tigase │ └── init.d │ │ └── tigase ├── restart-all-servers.sh ├── update-all-servers.sh ├── config.sh ├── db-create-derby.sh ├── mandriva │ └── init.d │ │ └── tigase ├── repo.sh ├── installer-generate.sh ├── db-create-postgresql.sh └── user_roster.sh ├── src └── main │ ├── izpack │ ├── resources │ │ ├── target_windows.dir │ │ ├── pics │ │ │ ├── tiger.png │ │ │ ├── solaris_ready.png │ │ │ ├── tiger-tigase-org.png │ │ │ ├── Java_powered_logo_rgb.png │ │ │ ├── tigase-5-install-logo.png │ │ │ ├── tigase-install-logo.png │ │ │ ├── tigase-4-3-1-install-logo.png │ │ │ ├── tigase-5-1-0-install-logo.png │ │ │ ├── tiger-tigase-org-5-0-0-beta.png │ │ │ └── tigase-5-0-0-beta-install-logo.png │ │ └── packsLang.xml │ ├── java │ │ ├── TigaseCheckPanelConsoleHelper.java │ │ ├── TigaseJDKPathPanelConsoleHelper.java │ │ ├── DerbyPathPanelConsoleHelper.java │ │ ├── TigaseConfigLoadPanelConsoleHelper.java │ │ ├── TigaseInstallerCommon.java │ │ └── TigaseConfigSavePanelConsoleHelper.java │ └── README.txt │ ├── java │ └── tigase │ │ ├── server │ │ ├── DisableDisco.java │ │ ├── xmppserver │ │ │ ├── OutgoingState.java │ │ │ └── S2SConnectionSelector.java │ │ ├── QueueType.java │ │ ├── Priority.java │ │ ├── sreceiver │ │ │ ├── TaskCreationPolicy.java │ │ │ ├── DefaultValues.java │ │ │ ├── StanzaReceiverIfc.java │ │ │ └── NewsDistributor.java │ │ ├── ReceiverTimeoutHandler.java │ │ ├── MessageRouterIfc.java │ │ ├── ssender │ │ │ └── StanzaHandler.java │ │ ├── ext │ │ │ ├── lb │ │ │ │ ├── LoadBalancerIfc.java │ │ │ │ └── ReceiverBareJidLB.java │ │ │ └── CompConfigRepository.java │ │ ├── gateways │ │ │ ├── GatewayException.java │ │ │ └── LoginGatewayException.java │ │ ├── Presence.java │ │ ├── amp │ │ │ ├── ConditionIfc.java │ │ │ └── ActionResultsHandlerIfc.java │ │ ├── Permissions.java │ │ ├── ServiceChecker.java │ │ ├── bosh │ │ │ └── BoshSessionTaskHandler.java │ │ └── ComponentRegistrator.java │ │ ├── xmpp │ │ ├── impl │ │ │ └── roster │ │ │ │ └── RosterElementIfc.java │ │ ├── XMPPProcessorIfc.java │ │ ├── PacketErrorTypeException.java │ │ ├── XMPPException.java │ │ ├── XMPPPacketFilterIfc.java │ │ ├── NotAuthorizedException.java │ │ └── XMPPStopListenerIfc.java │ │ ├── sys │ │ ├── CPULoadListener.java │ │ ├── MemoryChangeListener.java │ │ ├── ResourceState.java │ │ ├── ShutdownHook.java │ │ └── OnlineJidsReporter.java │ │ ├── http │ │ ├── HttpServer.java │ │ └── HttpService.java │ │ ├── net │ │ ├── SocketType.java │ │ ├── ConnectionType.java │ │ ├── Accept.java │ │ └── IOServiceListener.java │ │ ├── auth │ │ ├── AuthorisationSystem.java │ │ └── ResourceConnectionCallback.java │ │ ├── stats │ │ ├── JMXProxyListenerOpt.java │ │ ├── JMXProxyListener.java │ │ ├── StatisticsContainer.java │ │ └── StatisticsArchivizerIfc.java │ │ ├── io │ │ ├── TLSStatus.java │ │ ├── BufferUnderflowException.java │ │ └── TLSEventHandler.java │ │ ├── db │ │ ├── comp │ │ │ └── RepositoryChangeListenerIfc.java │ │ ├── DBInitException.java │ │ ├── TigaseDBException.java │ │ ├── AuthorizationException.java │ │ ├── UserNotFoundException.java │ │ └── DataOverwriteException.java │ │ ├── conf │ │ ├── Configurator.java │ │ ├── MonitoringSetupIfc.java │ │ └── ConfigurationException.java │ │ ├── util │ │ ├── PatternComparator.java │ │ ├── IdentityComparator.java │ │ ├── OSUtils.java │ │ ├── LogFilter.java │ │ ├── IntHistoryCache.java │ │ └── FloatHistoryCache.java │ │ ├── cluster │ │ └── api │ │ │ ├── CommandListener.java │ │ │ ├── ClusteredComponentIfc.java │ │ │ └── ClusterCommandException.java │ │ └── vhosts │ │ └── VhostConfigRepository.java │ ├── resources │ ├── pictures │ │ ├── Tigase16x16.png │ │ ├── Tigase32x32.png │ │ └── Tigase48x48.png │ └── META-INF │ │ └── MANIFEST.MF │ ├── php │ └── drupal │ │ └── modules │ │ ├── short_news-5.x │ │ └── short_news.info │ │ ├── tigase_monitor-5.x │ │ └── tigase_monitor.info │ │ ├── short_news-6.x │ │ └── short_news.info │ │ └── tigase_usrreg-5.x │ │ ├── tigase_usrreg.info │ │ └── tigase_usrreg.module │ ├── bash │ ├── cron-dnotify-check.sh │ └── users-list-moitor.sh │ ├── groovy │ └── tigase │ │ ├── converter │ │ ├── converter.sh │ │ ├── README │ │ └── Feeder.groovy │ │ └── admin │ │ ├── CompRepoReload.groovy │ │ ├── example_Tigase scripting guide.groovy │ │ ├── ListServiceKeys.groovy │ │ └── example_HelloWorld.groovy │ ├── python │ └── tigase │ │ └── admin │ │ └── PythonExample.py │ ├── scala │ └── tigase │ │ └── admin │ │ └── ScalaExample.scala │ └── ruby │ └── tigase │ └── admin │ └── RubyExample.rb ├── .gitignore ├── certs ├── keystore ├── truststore ├── rsa-keystore └── client_truststore ├── libs ├── derby.jar ├── derbytools.jar ├── jdbc-mysql.jar ├── groovy-all-1.8.5.jar └── jdbc-postgresql.jar ├── win-stuff ├── Tigase.ico ├── wrapper │ ├── wrapper.dll │ ├── wrapper.exe │ └── wrapper.jar └── scripts │ ├── Run.bat │ ├── Uninst.bat │ ├── InstallTigaseService.bat │ ├── UninstallTigaseService.bat │ └── Tigase.bat ├── etc ├── init.properties ├── bosh-extra-headers.txt ├── cross-domain-policy.xml ├── tigase-mysql.conf ├── tigase-pgsql.conf ├── init-debian.properties ├── tigase.conf └── init-mysql.properties ├── tests └── data │ └── telnet-test.xml ├── manifest.temp └── database ├── derby-installer-post.sql ├── mysql-installer-post.sql ├── derby-installer-create-db.sql ├── derby-schema-5-1-sp.sql ├── derby-schema-5-1-schema.sql ├── postgresql-schema-5-1-schema.sql ├── mysql-schema-5-1-schema.sql ├── derby-schema-4-props.sql ├── derby-schema-4.sql ├── derby-schema-5-1-props.sql ├── derby-schema-5.sql ├── mysql-schema-4.sql ├── mysql-schema-5.sql ├── derby-schema-5-1.sql ├── mysql-schema-5-1.sql ├── mysql-schema-4-props.sql ├── mysql-schema-5-1-props.sql ├── postgresql-schema-5-1-props.sql ├── postgresql-schema-4-props.sql ├── derby-schema-upgrade-to-5-1.sql ├── postgresql-schema-4.sql ├── postgresql-schema-5.sql ├── postgresql-schema-5-1.sql ├── postgresql-installer-create-db.sql ├── postgresql-installer-post.sql ├── postgresql-schema-5-1-sp.sql ├── mysql-schema-5-1-sp.sql ├── postgresql-schema-upgrade-to-5-1.sql └── mysql-schema-upgrade-to-5-1.sql /debian/compat: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /scripts/debian/compat: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /src/main/izpack/resources/target_windows.dir: -------------------------------------------------------------------------------- 1 | c:\Tigase -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .settings 2 | target 3 | init.properties 4 | .classpath 5 | .project 6 | -------------------------------------------------------------------------------- /certs/keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zooldk/tigase-server/HEAD/certs/keystore -------------------------------------------------------------------------------- /certs/truststore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zooldk/tigase-server/HEAD/certs/truststore -------------------------------------------------------------------------------- /libs/derby.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zooldk/tigase-server/HEAD/libs/derby.jar -------------------------------------------------------------------------------- /certs/rsa-keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zooldk/tigase-server/HEAD/certs/rsa-keystore -------------------------------------------------------------------------------- /debian/std-logger.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | LOG=$1 3 | shift 4 | exec $* >>$LOG 2>&1 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/main/izpack/resources/pics/tiger-tigase-org-5-0-0-beta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zooldk/tigase-server/HEAD/src/main/izpack/resources/pics/tiger-tigase-org-5-0-0-beta.png -------------------------------------------------------------------------------- /src/main/izpack/resources/pics/tigase-5-0-0-beta-install-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zooldk/tigase-server/HEAD/src/main/izpack/resources/pics/tigase-5-0-0-beta-install-logo.png -------------------------------------------------------------------------------- /src/main/php/drupal/modules/tigase_monitor-5.x/tigase_monitor.info: -------------------------------------------------------------------------------- 1 | ; $Id: $ 2 | name = Tigase server monitor 3 | description = Displays Tigase server statistics 4 | package = Tigase 5 | -------------------------------------------------------------------------------- /src/main/php/drupal/modules/short_news-6.x/short_news.info: -------------------------------------------------------------------------------- 1 | ; $Id: $ 2 | name = Short news 3 | description = Short news displaying from short_news table. 4 | package = Tigase 5 | 6 | core = 6.x -------------------------------------------------------------------------------- /etc/bosh-extra-headers.txt: -------------------------------------------------------------------------------- 1 | Access-Control-Allow-Origin: * 2 | Access-Control-Allow-Methods: GET, POST, OPTIONS 3 | Access-Control-Allow-Headers: Content-Type 4 | Access-Control-Max-Age: 86400 5 | -------------------------------------------------------------------------------- /tests/data/telnet-test.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /debian/README.Debian: -------------------------------------------------------------------------------- 1 | Tigase for Debian 2 | ----------------- 3 | 4 | Tigase Jabber/XMPP Server is Open Source and Free (GPLv3) Java based server. 5 | 6 | -- Tomasz Sterna , Thu Mar 13 10:40:12 CET 2009 7 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/xmppserver/OutgoingState.java: -------------------------------------------------------------------------------- 1 | package tigase.server.xmppserver; 2 | 3 | /** 4 | * Enum description 5 | * 6 | */ 7 | public enum OutgoingState { 8 | 9 | NULL, 10 | CONNECTING, 11 | HANDSHAKING, 12 | OK 13 | } 14 | -------------------------------------------------------------------------------- /debian/tigase-server.default: -------------------------------------------------------------------------------- 1 | # Defaults for tigase-server see /etc/init.d/tigase-server for more 2 | #TIGASE_DBDRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver" 3 | #TIGASE_USER=tigase 4 | 5 | NO_START=1 6 | -------------------------------------------------------------------------------- /debian/tigase-server.install: -------------------------------------------------------------------------------- 1 | target/*.jar usr/share/tigase/lib 2 | scripts/*.sh usr/share/tigase/scripts 3 | debian/*.sh usr/share/tigase/scripts 4 | database usr/share/tigase 5 | etc usr/share/tigase 6 | etc/init.properties etc/tigase 7 | certs etc/tigase 8 | *.html usr/share/doc/tigase-server 9 | -------------------------------------------------------------------------------- /etc/cross-domain-policy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /scripts/restart-all-servers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SERVERS=`cat all-servers.txt` 4 | DIR="tigase-server" 5 | 6 | for s in ${SERVERS} ; do 7 | 8 | if [[ ${s} != "#"* ]] ; then 9 | ssh root@${s} "/etc/init.d/tigase stop ; sleep 10 ; rm -f /home/tigase/${DIR}/logs/* ; /etc/init.d/tigase start" 10 | fi 11 | 12 | done 13 | -------------------------------------------------------------------------------- /etc/tigase-mysql.conf: -------------------------------------------------------------------------------- 1 | ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" 2 | DRV="-Djdbc.drivers=com.mysql.jdbc.Driver" 3 | #CLASSPATH="${CLASSPATH}:libs/jdbc-mysql.jar" 4 | CLASSPATH="" 5 | JAVA_OPTIONS="${ENC} ${DRV} -server -Xms100M -Xmx200M " 6 | TIGASE_CONFIG="etc/tigase-mysql.xml" 7 | TIGASE_OPTIONS=" --property-file etc/init-mysql.properties " 8 | -------------------------------------------------------------------------------- /scripts/debian/tigase.default: -------------------------------------------------------------------------------- 1 | # Defaults for tigase initscript 2 | # sourced by /etc/init.d/tigase 3 | # installed at /etc/default/tigase by the maintainer scripts 4 | 5 | # 6 | # This is a POSIX shell fragment 7 | # 8 | 9 | # Additional options that are passed to the Daemon. 10 | TIGASE_OPTIONS="--property-file /etc/tigase/init.properties" 11 | -------------------------------------------------------------------------------- /scripts/update-all-servers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SERVERS=`cat all-servers.txt` 4 | DIR="tigase-server" 5 | 6 | for s in ${SERVERS} ; do 7 | 8 | scp jars/tigase-server.jar tigase@${s}:${DIR}/jars/ 9 | scp libs/tigase-* tigase@${s}:${DIR}/libs/ 10 | scp src/main/groovy/tigase/admin/*.groovy tigase@${s}:${DIR}/scripts/admin/ 11 | 12 | done 13 | -------------------------------------------------------------------------------- /etc/tigase-pgsql.conf: -------------------------------------------------------------------------------- 1 | ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" 2 | DRV="-Djdbc.drivers=org.postgresql.Driver" 3 | 4 | JAVA_OPTIONS="${ENC} ${DRV} -server -Xms100M -Xmx100M " 5 | TIGASE_CONFIG="etc/tigase-pgsql.xml" 6 | TIGASE_OPTIONS="--gen-config-def --user-db pgsql --user-db-uri jdbc:postgresql://localhost/tigasedb?user=tigasedb-user --auth-db pgsql " 7 | -------------------------------------------------------------------------------- /scripts/debian/init-debian.properties: -------------------------------------------------------------------------------- 1 | config-type = --gen-config-def 2 | --admins = admin@$HOST_NAME 3 | --virt-hosts = $HOST_NAME 4 | --debug=server 5 | --user-db-uri = jdbc:derby:/var/lib/tigase/tigase-derbydb 6 | basic-conf/logging/java.util.logging.FileHandler.pattern = /var/log/tigase/tigase.log 7 | vhost-man/vhost-repo-uri = jdbc:derby:/var/lib/tigase/tigase-derbydb 8 | -------------------------------------------------------------------------------- /src/main/bash/cron-dnotify-check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | monitored_dir="/home/webapp/drupal-sites/users-list" 4 | mydir=`dirname $0` 5 | 6 | cron_check=`ps axw | grep -c "[d]notify -C"` 7 | 8 | if [ $cron_check -eq 0 ] ; then 9 | # echo "dnotify monitor is not running, starting a new one...." 10 | /usr/bin/dnotify -C -b $monitored_dir -e $mydir/users-list-moitor.sh '{}' 11 | fi 12 | -------------------------------------------------------------------------------- /src/main/php/drupal/modules/tigase_usrreg-5.x/tigase_usrreg.info: -------------------------------------------------------------------------------- 1 | ; $Rev: $ 2 | ; Last modified by $Author: $ 3 | ; $Date: $ 4 | 5 | name = User register hook 6 | description = Catches user creation event and for each new user creates a file in the filesystem with the new user name. This file is later used by system scripts which create system directory for the user so he can receive emails. 7 | package = Tigase 8 | version = 1.0 9 | -------------------------------------------------------------------------------- /etc/init-debian.properties: -------------------------------------------------------------------------------- 1 | config-type = --gen-config-def 2 | --admins = admin@$HOST_NAME 3 | --virt-hosts = $HOST_NAME 4 | --debug=server 5 | --user-db-uri = jdbc:derby:/var/lib/tigase/tigase-derbydb;create=true;logDevice=/var/log/tigase 6 | basic-conf/logging/java.util.logging.FileHandler.pattern = /var/log/tigase/tigase.log 7 | vhost-man/vhost-repo-uri = jdbc:derby:/var/lib/tigase/tigase-derbydb;create=true;logDevice=/var/log/tigase 8 | -------------------------------------------------------------------------------- /debian/tigase-server.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | #DEBHELPER# 4 | 5 | case "$1" in 6 | purge) 7 | userdel tigase || true 8 | rm -rf /var/log/tigase /var/spool/tigase 9 | ;; 10 | 11 | remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 12 | # Nothing to do here 13 | ;; 14 | 15 | *) 16 | echo "$0 called with unknown argument \`$1'" >&2 17 | exit 1 18 | ;; 19 | esac 20 | -------------------------------------------------------------------------------- /src/main/groovy/tigase/converter/converter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | LIBS="/usr/share/tigase/lib /usr/share/openfire/lib" 3 | 4 | # Locale check 5 | if ! locale | grep -iq '^LC_CTYPE=.*\.utf8.\?$'; then 6 | echo "You need to set UTF8 based locale first" >&2; exit 1 7 | fi 8 | 9 | for DIR in $LIBS; do CLASSPATH="`ls -d $DIR/*.jar 2>/dev/null | grep -v groovy | tr '\n' :`$CLASSPATH"; done 10 | export CLASSPATH 11 | #echo $CLASSPATH 12 | exec ${0/%.sh/.groovy} 13 | -------------------------------------------------------------------------------- /src/main/izpack/java/TigaseJDKPathPanelConsoleHelper.java: -------------------------------------------------------------------------------- 1 | package com.izforge.izpack.panels; 2 | 3 | import com.izforge.izpack.installer.AutomatedInstallData; 4 | 5 | public class TigaseJDKPathPanelConsoleHelper 6 | extends JDKPathPanelConsoleHelper { 7 | 8 | public boolean runConsole(AutomatedInstallData installData) { 9 | TigaseInstallerCommon.init(installData); 10 | return super.runConsole(installData); 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /scripts/debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Sergey Nazarov 2 | on January 9, 2009. 3 | The source was downloaded from http://www.tigase.org. 4 | 5 | Upstream author: Artur Hefczyc 6 | 7 | Copyright (C) 2004-2012 "Artur Hefczyc" 8 | 9 | You are free to distribute this software under the terms of 10 | the GNU Affero General Public License. On Debian systems, the complete 11 | text of the GNU Affero General Public License can be found in the file 12 | '/usr/share/common-licenses/GPL'. 13 | 14 | -------------------------------------------------------------------------------- /scripts/debian/tigase-debian.conf: -------------------------------------------------------------------------------- 1 | ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" 2 | DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver" 3 | #GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:ParallelCMSThreads=2" 4 | JAVA_HOME="/usr/lib/jvm/java-6-sun" 5 | CLASSPATH="" 6 | JAVA_OPTIONS="${GC} ${ENC} ${DRV} -server -Xms100M -Xmx200M -XX:PermSize=32m -XX:MaxPermSize=256m -XX:MaxDirectMemorySize=128m " 7 | TIGASE_CONFIG="/etc/tigase/tigase-server.xml" 8 | TIGASE_OPTIONS=" --property-file /etc/tigase/init.properties " 9 | -------------------------------------------------------------------------------- /src/main/bash/users-list-moitor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mydir=$1 4 | 5 | if [ "$mydir" == "" ] ; then 6 | echo "Directory name is missing..." 7 | exit 1 8 | fi 9 | 10 | for i in $mydir/* ; do 11 | newuser=`basename $i` 12 | echo "Adding new user: "$newuser 13 | /usr/sbin/useradd $newuser -m 14 | rm -f $i 15 | /usr/bin/mail -s "Welcome to Tigase LiveCD" -t ${newuser}@livecd.tigase.org < 5 | Build-Depends: debhelper (>= 5), cdbs, patchutils, sun-java6-jdk, ant 6 | Standards-Version: 3.7.2 7 | 8 | Package: tigase 9 | Section: net 10 | Priority: optional 11 | Pre-Depends: sun-java6-jre 12 | Architecture: all 13 | Description: A high performance XMPP (Jabber) server. 14 | Tigase is an instant messaging server that implements the XMPP 15 | (Jabber) protocol. It features high performance, a robust 16 | administration console, and a full plugin system. The server 17 | is 100% Java. 18 | . 19 | See http://www.tigase.org/ 20 | Homepage: http://www.tigase.org/ 21 | -------------------------------------------------------------------------------- /scripts/gentoo/init.d/tigase: -------------------------------------------------------------------------------- 1 | #!/sbin/runscript 2 | 3 | depend() { 4 | need net 5 | use dns logger postgresql mysql 6 | } 7 | 8 | start() { 9 | ebegin "Starting Tigase" 10 | su - ${TIGASE_USER} -c "${TIGASE_ENV} ${TIGASE_HOME}/bin/tigase.sh start ${TIGASE_HOME}/${TIGASE_CONF}" 11 | eend $? 12 | } 13 | 14 | stop () { 15 | ebegin "Stopping Tigase" 16 | su - ${TIGASE_USER} -c "${TIGASE_ENV} ${TIGASE_HOME}/bin/tigase.sh stop ${TIGASE_HOME}/${TIGASE_CONF}" 17 | sleep 2 18 | eend $? 19 | } 20 | 21 | svc_restart () { 22 | ebegin "Restarting Tigase" 23 | su - ${TIGASE_USER} -c "${TIGASE_ENV} ${TIGASE_HOME}/bin/tigase.sh stop ${TIGASE_HOME}/${TIGASE_CONF}" 24 | sleep 5 25 | su - ${TIGASE_USER} -c "${TIGASE_ENV} ${TIGASE_HOME}/bin/tigase.sh start ${TIGASE_HOME}/${TIGASE_CONF}" 26 | eend $? 27 | } 28 | -------------------------------------------------------------------------------- /manifest.temp: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Created-By: Artur Hefczyc 3 | Main-Class: tigase.server.XMPPServer 4 | 5 | Name: tigase/server/ 6 | Specification-Title: Tigase Jabber Server 7 | Specification-Version: 1.0.0 8 | Specification-Vendor: tigase.org 9 | Implementation-Title: tigase.server 10 | Implementation-Version: 1.0.0-b111 11 | Implementation-Vendor: tigase.org 12 | Package-Title: tigase.server 13 | Package-Version: build111 14 | Package-Vendor: tigase.org 15 | Tigase-Version: 1.0.0-b111 16 | 17 | Name: tigase/ 18 | Specification-Title: Tigase Jabber Server 19 | Specification-Version: 1.0.0 20 | Specification-Vendor: tigase.org 21 | Implementation-Title: tigase 22 | Implementation-Version: 1.0.0-b111 23 | Implementation-Vendor: tigase.org 24 | Package-Title: tigase 25 | Package-Version: build111 26 | Package-Vendor: tigase.org 27 | Tigase-Version: 1.0.0-b111 28 | -------------------------------------------------------------------------------- /scripts/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | #export DH_VERBOSE=1 4 | 5 | include /usr/share/cdbs/1/rules/simple-patchsys.mk 6 | include /usr/share/cdbs/1/rules/debhelper.mk 7 | include /usr/share/cdbs/1/class/ant.mk 8 | 9 | DEST := $(CURDIR)/debian/tigase 10 | TARGET := $(CURDIR) 11 | TIGJARS := $(CURDIR)/jars 12 | TIGASE := $(DEST)/usr/share/tigase 13 | ETCDIR := $(DEST)/etc/tigase 14 | LOGDIR := $(DEST)/var/log/tigase 15 | VARDIR := $(DEST)/var/lib/tigase 16 | 17 | JAVA_HOME := /usr/lib/jvm/java-6-openjdk 18 | ANT_HOME := /usr/share/ant 19 | DEB_ANT_BUILDFILE := build.xml 20 | DEB_ANT_CLEAN_TARGET := clean 21 | DEB_JARS := ant-nodeps 22 | 23 | install/tigase:: 24 | cp $(TIGJARS)/*.jar $(TIGASE)/jars 25 | cp $(TARGET)/libs/*.jar $(TIGASE)/libs 26 | cp -r $(TARGET)/certs $(TIGASE)/certs 27 | cp $(TARGET)/etc/init-debian.properties $(ETCDIR)/init.properties 28 | 29 | -------------------------------------------------------------------------------- /debian/init.properties: -------------------------------------------------------------------------------- 1 | --user-db=derby 2 | --user-db-uri=jdbc:derby:/var/spool/tigase/tigase-derbydb;create=true;logDevice=/var/log/tigase 3 | --ssl-container-class=tigase.extras.io.PEMSSLContextContainer 4 | basic-conf/logging/java.util.logging.FileHandler.pattern = /var/log/tigase/tigase.log 5 | s2s/connections/tls/keys-store = /etc/tigase/certs/rsa-keystore 6 | s2s/connections/tls/trusts-store = /etc/tigase/certs/truststore 7 | s2s/connections/tls/server-certs-dir = /etc/tigase/certs 8 | c2s/connections/tls/keys-store = /etc/tigase/certs/rsa-keystore 9 | c2s/connections/tls/trusts-store = /etc/tigase/certs/truststore 10 | c2s/connections/tls/server-certs-dir = /etc/tigase/certs 11 | bosh/connections/tls/keys-store = /etc/tigase/certs/rsa-keystore 12 | bosh/connections/tls/trusts-store = /etc/tigase/certs/truststore 13 | bosh/connections/tls/server-certs-dir = /etc/tigase/certs 14 | -------------------------------------------------------------------------------- /database/derby-installer-post.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -------------------------------------------------------------------------------- /database/mysql-installer-post.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -------------------------------------------------------------------------------- /database/derby-installer-create-db.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: tigase-server 2 | Section: net 3 | Priority: extra 4 | Maintainer: Tomasz Sterna 5 | Build-Depends: cdbs, debhelper (>= 5), sun-java6-jdk, maven2 6 | Standards-Version: 3.8.0 7 | 8 | Package: tigase-server 9 | Architecture: all 10 | Depends: sun-java6-jre | sun-java6-jdk, sun-java6-javadb | libmysql-java | libpg-java, 11 | tigase-xmltools, tigase-utils, tigase-extras, libbcprov-java, 12 | adduser, ${misc:Depends} 13 | Description: Open Source and Free (GPLv3) Java based Jabber/XMPP server 14 | The design and implementation goals of the Tigase Jabber/XMPP Server 15 | * Make the server robust and reliable. 16 | * Make the server secure communication platform. 17 | * Make flexible server which can be applied to different use cases. 18 | * Make extensible server which takes full advantage of XMPP protocol 19 | extensibility. 20 | * Make the server easy to setup and maintain. 21 | . 22 | See http://www.tigase.org/ 23 | Homepage: http://www.tigase.org/ 24 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Tomasz Sterna 2 | on Thu, 13 Mar 2009 10:46:12 +0200. 3 | 4 | It was downloaded from https://svn.tigase.org/reps/tigase-server/trunk 5 | 6 | Upstream Author: Artur Hefczyc 7 | 8 | Copyright (C) 2004-2012 "Artur Hefczyc" 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU Affero General Public License as published by 12 | the Free Software Foundation, version 3 of the License. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Affero General Public License for more details. 18 | 19 | You should have received a copy of the GNU Affero General Public License with 20 | the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL-3 21 | If not, see . 22 | -------------------------------------------------------------------------------- /src/main/groovy/tigase/converter/README: -------------------------------------------------------------------------------- 1 | Tigase Converter 2 | 3 | Copyright (c) 2009 "Tomasz Sterna" 4 | 5 | License: (either of) 6 | a. Creative Commons Attribution-Share Alike 3.0 Unported 7 | http://creativecommons.org/licenses/by-sa/3.0/ 8 | b. GNU Lesser General Public License v3 9 | http://www.gnu.org/licenses/lgpl-3.0.html 10 | 11 | 12 | * Supported source servers: 13 | - jabberd 2.2.x 14 | - ejabberd 2.x ODBC 15 | - OpenFire 3.6.x 16 | 17 | 18 | * Configuration 19 | - Edit converter.groovy: 20 | - enter correct path to tigase.xml 21 | - uncomment relevant source and feeder definitions 22 | (and comment-out unneded ones) 23 | 24 | * Running 25 | - Give executable permission to converter.groovy and converter.sh 26 | $ chmod +x converter.groovy converter.sh 27 | - Launch converter.sh 28 | (You may need to alter libraries paths) 29 | 30 | * Bugs/Suggestions/Patches 31 | - Drop me an e-mail at: tomek@xiaoka.com 32 | 33 | 34 | Good luck! 35 | -------------------------------------------------------------------------------- /src/main/izpack/java/DerbyPathPanelConsoleHelper.java: -------------------------------------------------------------------------------- 1 | package com.izforge.izpack.panels; 2 | 3 | import java.io.PrintWriter; 4 | import java.util.Properties; 5 | 6 | import com.izforge.izpack.installer.AutomatedInstallData; 7 | import com.izforge.izpack.installer.PanelConsole; 8 | import com.izforge.izpack.installer.PanelConsoleHelper; 9 | 10 | public class DerbyPathPanelConsoleHelper extends PanelConsoleHelper implements PanelConsole { 11 | 12 | public boolean runConsole(AutomatedInstallData installData) { 13 | new DerbyPathPanelHelper().setDefaultPath(installData); 14 | return true; 15 | } 16 | 17 | public boolean runConsoleFromPropertiesFile( 18 | AutomatedInstallData installData, Properties p) { 19 | new DerbyPathPanelHelper().setDefaultPath(installData); 20 | return true; 21 | } 22 | 23 | public boolean runGeneratePropertiesFile(AutomatedInstallData installData, 24 | PrintWriter printWriter) { 25 | new DerbyPathPanelHelper().setDefaultPath(installData); 26 | return true; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/izpack/java/TigaseConfigLoadPanelConsoleHelper.java: -------------------------------------------------------------------------------- 1 | package com.izforge.izpack.panels; 2 | 3 | import java.io.PrintWriter; 4 | import java.util.Properties; 5 | 6 | import com.izforge.izpack.installer.AutomatedInstallData; 7 | import com.izforge.izpack.installer.PanelConsole; 8 | import com.izforge.izpack.installer.PanelConsoleHelper; 9 | 10 | public class TigaseConfigLoadPanelConsoleHelper extends PanelConsoleHelper implements PanelConsole { 11 | 12 | public boolean runConsole(AutomatedInstallData installData) { 13 | new TigaseConfigLoadHelper().loadConfig(installData); 14 | return true; 15 | } 16 | 17 | public boolean runConsoleFromPropertiesFile( 18 | AutomatedInstallData installData, Properties p) { 19 | new TigaseConfigLoadHelper().loadConfig(installData); 20 | return true; 21 | } 22 | 23 | public boolean runGeneratePropertiesFile(AutomatedInstallData installData, 24 | PrintWriter printWriter) { 25 | new TigaseConfigLoadHelper().loadConfig(installData); 26 | return true; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /database/derby-schema-5-1-sp.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- QUERY START: 24 | run 'database/derby-schema-4-sp.sql'; 25 | -- QUERY END: 26 | 27 | -------------------------------------------------------------------------------- /database/derby-schema-5-1-schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- QUERY START: 24 | run 'database/derby-schema-4-schema.sql'; 25 | -- QUERY END: 26 | 27 | -------------------------------------------------------------------------------- /src/main/izpack/java/TigaseInstallerCommon.java: -------------------------------------------------------------------------------- 1 | package com.izforge.izpack.panels; 2 | 3 | import java.io.InputStream; 4 | 5 | import com.izforge.izpack.LocaleDatabase; 6 | import com.izforge.izpack.installer.ResourceManager; 7 | import com.izforge.izpack.installer.InstallData; 8 | import com.izforge.izpack.installer.AutomatedInstallData; 9 | import com.izforge.izpack.util.Debug; 10 | 11 | class TigaseInstallerCommon { 12 | 13 | public static AutomatedInstallData init(AutomatedInstallData iData) { 14 | insertResource(iData.langpack); 15 | return iData; 16 | } 17 | 18 | public static InstallData init(InstallData iData) { 19 | insertResource(iData.langpack); 20 | return iData; 21 | } 22 | 23 | private final static String LANG_FILE_NAME = "panelsLangPack.xml"; 24 | private static void insertResource(LocaleDatabase langpack) { 25 | try { 26 | InputStream inputStream = 27 | ResourceManager.getInstance().getInputStream(LANG_FILE_NAME); 28 | langpack.add(inputStream); 29 | } 30 | catch (Exception exc) { 31 | Debug.trace(exc); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # debian/rules for Jetty (uses CDBS) 3 | 4 | include /usr/share/cdbs/1/rules/debhelper.mk 5 | include /usr/share/cdbs/1/rules/simple-patchsys.mk 6 | 7 | build: 8 | mvn package 9 | 10 | clean:: 11 | rm -rf target 12 | 13 | binary-post-install/tigase-server:: 14 | mv debian/tigase-server/usr/share/tigase/database debian/tigase-server/usr/share/tigase/server-database 15 | sed -i 's#jars/\|libs/#lib/#g' debian/tigase-server/usr/share/tigase/scripts/*.sh 16 | sed -i 's#lib/tigase-server[^.]*.jar#lib/'`basename debian/tigase-server/usr/share/tigase/lib/tigase-server*.jar`'#g' debian/tigase-server/usr/share/tigase/scripts/*.sh 17 | sed -i 's#lib/derby#/usr/lib/jvm/java-6-sun/db/lib/derby#g' debian/tigase-server/usr/share/tigase/scripts/*.sh 18 | sed -i 's#database/#server-database/#g' debian/tigase-server/usr/share/tigase/scripts/*.sh 19 | chmod +x debian/tigase-server/usr/share/tigase/scripts/*.sh 20 | cat debian/init.properties >> debian/tigase-server/etc/tigase/init.properties 21 | find debian/tigase-server -depth -type d -name .svn -exec rm -rf {} \; 22 | -------------------------------------------------------------------------------- /src/main/izpack/java/TigaseConfigSavePanelConsoleHelper.java: -------------------------------------------------------------------------------- 1 | package com.izforge.izpack.panels; 2 | 3 | import java.io.PrintWriter; 4 | import java.util.Properties; 5 | 6 | import com.izforge.izpack.installer.AutomatedInstallData; 7 | import com.izforge.izpack.installer.PanelConsole; 8 | import com.izforge.izpack.installer.PanelConsoleHelper; 9 | 10 | public class TigaseConfigSavePanelConsoleHelper 11 | extends PanelConsoleHelper implements PanelConsole { 12 | 13 | public boolean runConsole(AutomatedInstallData installData) { 14 | TigaseConfigSaveHelper helper = new TigaseConfigSaveHelper(); 15 | 16 | String config = helper.showConfig( 17 | new IzPackInstallDataVariablesSource(installData)); 18 | helper.saveConfig(installData, config); 19 | 20 | return true; 21 | } 22 | 23 | 24 | 25 | public boolean runConsoleFromPropertiesFile( 26 | AutomatedInstallData installData, Properties p) { 27 | return false; 28 | } 29 | 30 | public boolean runGeneratePropertiesFile(AutomatedInstallData installData, 31 | PrintWriter printWriter) { 32 | return false; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /database/postgresql-schema-5-1-schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | 22 | -- Database stored procedures and fucntions for Tigase schema version 5.1 23 | 24 | -- QUERY START: 25 | \i database/postgresql-schema-4-schema.sql 26 | -- QUERY END: -------------------------------------------------------------------------------- /database/mysql-schema-5-1-schema.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- Database stored procedures and functions for Tigase schema version 5.1 24 | 25 | -- QUERY START: 26 | source database/mysql-schema-4-schema.sql; 27 | -- QUERY END: 28 | -------------------------------------------------------------------------------- /src/main/java/tigase/xmpp/impl/roster/RosterElementIfc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev: 2411 $ 19 | * Last modified by $Author: kobit $ 20 | * $Date: 2010-10-27 20:27:58 -0600 (Wed, 27 Oct 2010) $ 21 | * 22 | */ 23 | package tigase.xmpp.impl.roster; 24 | 25 | /** 26 | * @author kobit 27 | * Created Jan 9, 2012 28 | */ 29 | public interface RosterElementIfc { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /scripts/config.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | ## Tigase Jabber/XMPP Server 4 | ## Copyright (C) 2004-2012 "Artur Hefczyc" 5 | ## 6 | ## This program is free software: you can redistribute it and/or modify 7 | ## it under the terms of the GNU Affero General Public License as published by 8 | ## the Free Software Foundation, either version 3 of the License. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU Affero General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU Affero General Public License 16 | ## along with this program. Look for COPYING file in the top folder. 17 | ## If not, see http://www.gnu.org/licenses/. 18 | ## 19 | ## $Rev: $ 20 | ## Last modified by $Author: $ 21 | ## $Date: $ 22 | ## 23 | 24 | CP="jars/tigase-server.jar:/usr/share/jdbc-mysql/lib/jdbc-mysql.jar:libs/tigase-xmltools.jar:libs/tigase-utils.jar" 25 | 26 | java -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -cp $CP tigase.conf.Configurator $* -------------------------------------------------------------------------------- /src/main/java/tigase/sys/CPULoadListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.sys; 24 | 25 | /** 26 | * Created: Feb 19, 2009 12:21:15 PM 27 | * 28 | * @author Artur Hefczyc 29 | * @version $Rev$ 30 | */ 31 | public interface CPULoadListener { 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/QueueType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.server; 24 | 25 | /** 26 | * Created: Jun 8, 2009 1:53:38 PM 27 | * 28 | * @author Artur Hefczyc 29 | * @version $Rev$ 30 | */ 31 | public enum QueueType { 32 | IN_QUEUE, OUT_QUEUE; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/tigase/sys/MemoryChangeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.sys; 24 | 25 | /** 26 | * Created: Feb 19, 2009 12:19:57 PM 27 | * 28 | * @author Artur Hefczyc 29 | * @version $Rev$ 30 | */ 31 | public interface MemoryChangeListener { 32 | 33 | } 34 | -------------------------------------------------------------------------------- /database/derby-schema-4-props.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- This is a dummy user who keeps all the database-properties 24 | -- QUERY START: 25 | call TigAddUserPlainPw('db-properties', NULL); 26 | -- QUERY END: 27 | 28 | -- QUERY START: 29 | call TigPutDBProperty('schema-version', '4.0'); 30 | -- QUERY END: 31 | -------------------------------------------------------------------------------- /database/derby-schema-4.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- QUERY START: 24 | run 'database/derby-schema-4-schema.sql'; 25 | -- QUERY END: 26 | 27 | -- QUERY START: 28 | run 'database/derby-schema-4-sp.sql'; 29 | -- QUERY END: 30 | 31 | -- QUERY START: 32 | run 'database/derby-schema-4-props.sql'; 33 | -- QUERY END: 34 | -------------------------------------------------------------------------------- /database/derby-schema-5-1-props.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- This is a dummy user who keeps all the database-properties 24 | -- QUERY START: 25 | call TigAddUserPlainPw('db-properties', NULL); 26 | -- QUERY END: 27 | 28 | -- QUERY START: 29 | call TigPutDBProperty('schema-version', '5.1'); 30 | -- QUERY END: 31 | -------------------------------------------------------------------------------- /database/derby-schema-5.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- QUERY START: 24 | run 'database/derby-schema-4-schema.sql'; 25 | -- QUERY END: 26 | 27 | -- QUERY START: 28 | run 'database/derby-schema-4-sp.sql'; 29 | -- QUERY END: 30 | 31 | -- QUERY START: 32 | run 'database/derby-schema-4-props.sql'; 33 | -- QUERY END: 34 | -------------------------------------------------------------------------------- /database/mysql-schema-4.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- QUERY START: 24 | source database/mysql-schema-4-schema.sql; 25 | -- QUERY END: 26 | 27 | -- QUERY START: 28 | source database/mysql-schema-4-sp.sql; 29 | -- QUERY END: 30 | 31 | -- QUERY START: 32 | source database/mysql-schema-4-props.sql; 33 | -- QUERY END: 34 | -------------------------------------------------------------------------------- /database/mysql-schema-5.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- QUERY START: 24 | source database/mysql-schema-4-schema.sql; 25 | -- QUERY END: 26 | 27 | -- QUERY START: 28 | source database/mysql-schema-4-sp.sql; 29 | -- QUERY END: 30 | 31 | -- QUERY START: 32 | source database/mysql-schema-4-props.sql; 33 | -- QUERY END: 34 | -------------------------------------------------------------------------------- /src/main/java/tigase/sys/ResourceState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.sys; 24 | 25 | /** 26 | * Created: Feb 19, 2009 12:22:55 PM 27 | * 28 | * @author Artur Hefczyc 29 | * @version $Rev$ 30 | */ 31 | public enum ResourceState { 32 | GREEN, 33 | YELLOW, 34 | RED; 35 | } 36 | -------------------------------------------------------------------------------- /database/derby-schema-5-1.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- QUERY START: 24 | run 'database/derby-schema-4-schema.sql'; 25 | -- QUERY END: 26 | 27 | -- QUERY START: 28 | run 'database/derby-schema-5-1-sp.sql'; 29 | -- QUERY END: 30 | 31 | -- QUERY START: 32 | run 'database/derby-schema-5-1-props.sql'; 33 | -- QUERY END: 34 | -------------------------------------------------------------------------------- /database/mysql-schema-5-1.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- QUERY START: 24 | source database/mysql-schema-4-schema.sql; 25 | -- QUERY END: 26 | 27 | -- QUERY START: 28 | source database/mysql-schema-5-1-sp.sql; 29 | -- QUERY END: 30 | 31 | -- QUERY START: 32 | source database/mysql-schema-5-1-props.sql; 33 | -- QUERY END: 34 | -------------------------------------------------------------------------------- /src/main/java/tigase/http/HttpServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.http; 24 | 25 | /** 26 | * Class HttpServer 27 | * 28 | */ 29 | public class HttpServer { 30 | // Fields 31 | // Methods 32 | // Constructors 33 | // Empty Constructor 34 | public HttpServer ( ) { } 35 | // Accessor Methods 36 | // Operations 37 | } 38 | -------------------------------------------------------------------------------- /scripts/debian/tigase.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postrm script for tigase 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `purge' 11 | # * `upgrade' 12 | # * `failed-upgrade' 13 | # * `abort-install' 14 | # * `abort-install' 15 | # * `abort-upgrade' 16 | # * `disappear' overwrit>r> 17 | # for details, see http://www.debian.org/doc/debian-policy/ or 18 | # the debian-policy package 19 | 20 | 21 | case "$1" in 22 | purge) 23 | rm -Rf /etc/tigase 24 | rm -Rf /var/log/tigase 25 | rm -Rf /var/lib/tigase 26 | rm -Rf /usr/share/tigase 27 | ;; 28 | 29 | remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 30 | 31 | 32 | ;; 33 | 34 | *) 35 | echo "postrm called with unknown argument \`$1'" >&2 36 | exit 1 37 | 38 | esac 39 | 40 | # dh_installdeb will replace this with shell code automatically 41 | # generated by other debhelper scripts. 42 | 43 | #DEBHELPER# 44 | 45 | exit 0 46 | 47 | -------------------------------------------------------------------------------- /src/main/java/tigase/sys/ShutdownHook.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.sys; 24 | 25 | /** 26 | * Created: Feb 19, 2009 12:17:03 PM 27 | * 28 | * @author Artur Hefczyc 29 | * @version $Rev$ 30 | */ 31 | public interface ShutdownHook { 32 | 33 | String getName(); 34 | 35 | String shutdown(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/tigase/net/SocketType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.net; 23 | 24 | /** 25 | * Describe class SocketType here. 26 | * 27 | * 28 | * Created: Sun Feb 5 09:27:34 2006 29 | * 30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public enum SocketType { 34 | 35 | plain, ssl; 36 | 37 | } // SocketType -------------------------------------------------------------------------------- /src/main/java/tigase/auth/AuthorisationSystem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.auth; 24 | 25 | /** 26 | * Class AuthorisationSystem 27 | * 28 | */ 29 | public class AuthorisationSystem { 30 | // Fields 31 | // Methods 32 | // Constructors 33 | // Empty Constructor 34 | public AuthorisationSystem ( ) { } 35 | // Accessor Methods 36 | // Operations 37 | } 38 | -------------------------------------------------------------------------------- /database/mysql-schema-4-props.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- QUERY START: 24 | -- This is a dummy user who keeps all the database-properties 25 | call TigAddUserPlainPw('db-properties', NULL); 26 | -- QUERY END: 27 | 28 | select NOW(), ' - Setting schema version to 4.0'; 29 | 30 | -- QUERY START: 31 | call TigPutDBProperty('schema-version', '4.0'); 32 | -- QUERY END: 33 | -------------------------------------------------------------------------------- /database/mysql-schema-5-1-props.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- QUERY START: 24 | -- This is a dummy user who keeps all the database-properties 25 | call TigAddUserPlainPw('db-properties', NULL); 26 | -- QUERY END: 27 | 28 | select NOW(), ' - Setting schema version to 5.1'; 29 | 30 | -- QUERY START: 31 | call TigPutDBProperty('schema-version', '5.1'); 32 | -- QUERY END: 33 | -------------------------------------------------------------------------------- /database/postgresql-schema-5-1-props.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | 22 | -- QUERY START: 23 | -- This is a dummy user who keeps all the database-properties 24 | select TigAddUserPlainPw('db-properties', NULL); 25 | -- QUERY END: 26 | 27 | select now(), ' - Setting schema version to 5.1'; 28 | 29 | -- QUERY START: 30 | select TigPutDBProperty('schema-version', '5.1'); 31 | -- QUERY END: 32 | 33 | -------------------------------------------------------------------------------- /scripts/db-create-derby.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [[ "$1" = "" ]] && \ 4 | echo "Give me a path to the location where you want to have the database created" && \ 5 | exit 1 6 | 7 | # for tigase 5.0 and below 8 | #java -Dij.protocol=jdbc:derby: -Dij.database="$1;create=true" \ 9 | # -Dderby.system.home=`pwd` \ 10 | # -cp libs/derby.jar:libs/derbytools.jar:jars/tigase-server.jar \ 11 | # org.apache.derby.tools.ij database/derby-schema-4.sql 12 | #java -Dij.protocol=jdbc:derby: -Dij.database="$1" \ 13 | # -Dderby.system.home=`pwd` \ 14 | # -cp libs/derby.jar:libs/derbytools.jar:jars/tigase-server.jar \ 15 | # org.apache.derby.tools.ij database/derby-schema-4-sp.schema 16 | #java -Dij.protocol=jdbc:derby: -Dij.database="$1" \ 17 | # -Dderby.system.home=`pwd` \ 18 | # -cp libs/derby.jar:libs/derbytools.jar:jars/tigase-server.jar \ 19 | # org.apache.derby.tools.ij database/derby-schema-4-props.sql 20 | 21 | # for Tigase 5.1 22 | 23 | java -Dij.protocol=jdbc:derby: -Dij.database="$1;create=true" \ 24 | -Dderby.system.home=`pwd` \ 25 | -cp libs/derby.jar:libs/derbytools.jar:jars/tigase-server.jar \ 26 | org.apache.derby.tools.ij database/derby-schema-5-1.sql &> derby-db-create.txt 27 | 28 | echo -e "\n\n\nconfiguration:\n\n--user-db=derby\n--user-db-uri=jdbc:derby:$1\n\n" 29 | -------------------------------------------------------------------------------- /src/main/java/tigase/net/ConnectionType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.net; 23 | 24 | /** 25 | * Describe class ConnectionType here. 26 | * 27 | * 28 | * Created: Sun Feb 5 09:26:44 2006 29 | * 30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public enum ConnectionType { 34 | 35 | accept, connect; 36 | 37 | } // ConnectionType -------------------------------------------------------------------------------- /src/main/java/tigase/server/Priority.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.server; 24 | 25 | /** 26 | * Created: Feb 13, 2009 9:44:53 PM 27 | * 28 | * @author Artur Hefczyc 29 | * @version $Rev$ 30 | */ 31 | public enum Priority { 32 | 33 | SYSTEM, 34 | CLUSTER, 35 | HIGH, 36 | NORMAL, 37 | LOW, 38 | PRESENCE, 39 | LOWEST; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /database/postgresql-schema-4-props.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- QUERY START: 24 | -- This is a dummy user who keeps all the database-properties 25 | select TigAddUserPlainPw('db-properties', NULL); 26 | -- QUERY END: 27 | 28 | select now(), ' - Setting schema version to 4.0'; 29 | 30 | -- QUERY START: 31 | select TigPutDBProperty('schema-version', '4.0'); 32 | -- QUERY END: 33 | 34 | -------------------------------------------------------------------------------- /src/main/java/tigase/stats/JMXProxyListenerOpt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev: 2411 $ 19 | * Last modified by $Author: kobit $ 20 | * $Date: 2010-10-27 20:27:58 -0600 (Wed, 27 Oct 2010) $ 21 | * 22 | */ 23 | package tigase.stats; 24 | 25 | /** 26 | * @author Artur Hefczyc Created Jun 3, 2011 27 | */ 28 | public interface JMXProxyListenerOpt { 29 | void connected(String id, JavaJMXProxyOpt bean); 30 | 31 | void disconnected(String id); 32 | 33 | String[] getDataIds(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/sreceiver/TaskCreationPolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.server.sreceiver; 23 | 24 | /** 25 | * Describe enum TaskCreationPolicy here. 26 | * 27 | * 28 | * Created: Mon May 28 08:53:40 2007 29 | * 30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public enum TaskCreationPolicy { 34 | 35 | ALL, LOCAL, ADMIN; 36 | 37 | } -------------------------------------------------------------------------------- /src/main/java/tigase/stats/JMXProxyListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.stats; 24 | 25 | /** 26 | * Created: Aug 24, 2009 1:02:08 PM 27 | * 28 | * @author Artur Hefczyc 29 | * @version $Rev$ 30 | */ 31 | public interface JMXProxyListener { 32 | 33 | void connected(String id, StatisticsProviderMBean bean); 34 | 35 | void disconnected(String id); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/php/drupal/modules/tigase_usrreg-5.x/tigase_usrreg.module: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. Look for COPYING file in the top folder. 17 | * If not, see http://www.gnu.org/licenses/. 18 | * 19 | * $Rev: $ 20 | * Last modified by $Author: $ 21 | * $Date: $ 22 | */ 23 | 24 | function tigase_usrreg_user($op, &$edit, &$user) { 25 | 26 | if ($op == 'insert') { 27 | $folder = 'users-list/'; 28 | $user_name = $user->name; 29 | $handle = fopen($folder . $user_name, "w+"); 30 | fwrite($handle, $user_name); 31 | fclose($handle); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/tigase/http/HttpService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.http; 24 | 25 | /** 26 | * Interface HttpService 27 | * 28 | * 29 | * Created: Tue Nov 22 07:07:11 2005 30 | * 31 | * @author Artur Hefczyc 32 | * @version $Rev$ 33 | */ 34 | public interface HttpService { 35 | // Methods 36 | // Constructors 37 | // Accessor Methods 38 | // Operations 39 | } -------------------------------------------------------------------------------- /src/main/java/tigase/io/TLSStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.io; 23 | 24 | /** 25 | * Describe class TLSStatus here. 26 | * 27 | * 28 | * Created: Sat Mar 5 09:28:45 2005 29 | * 30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public enum TLSStatus { 34 | 35 | NEED_WRITE, 36 | NEED_READ, 37 | UNDERFLOW, 38 | CLOSED, 39 | OK; 40 | 41 | } // TLSStatus -------------------------------------------------------------------------------- /src/main/java/tigase/server/ReceiverTimeoutHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.server; 24 | 25 | /** 26 | * Created: Feb 16, 2009 1:44:46 PM 27 | * 28 | * @author Artur Hefczyc 29 | * @version $Rev$ 30 | */ 31 | public interface ReceiverTimeoutHandler { 32 | 33 | void timeOutExpired(Packet data); 34 | 35 | void responseReceived(Packet data, Packet response); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/sreceiver/DefaultValues.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.server.sreceiver; 23 | 24 | /** 25 | * Describe interface DefaultValues here. 26 | * 27 | * 28 | * Created: Fri May 18 14:27:26 2007 29 | * 30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public interface DefaultValues { 34 | 35 | String[] strValues(); 36 | 37 | } // DefaultValues -------------------------------------------------------------------------------- /src/main/java/tigase/db/comp/RepositoryChangeListenerIfc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev: 2411 $ 19 | * Last modified by $Author: kobit $ 20 | * $Date: 2010-10-27 20:27:58 -0600 (Wed, 27 Oct 2010) $ 21 | * 22 | */ 23 | package tigase.db.comp; 24 | 25 | /** 26 | * @author Artur Hefczyc 27 | * Created May 23, 2011 28 | */ 29 | public interface RepositoryChangeListenerIfc { 30 | 31 | void itemAdded(Item item); 32 | 33 | void itemUpdated(Item item); 34 | 35 | void itemRemoved(Item item); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /scripts/mandriva/init.d/tigase: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Startup script for SER 4 | # 5 | # chkconfig: 345 85 15 6 | # description: Ser is a fast SIP Proxy. 7 | # 8 | # processname: ser 9 | # pidfile: /var/run/ser.pid 10 | # config: /etc/ser/ser.cfg 11 | 12 | # Source function library. 13 | . /etc/rc.d/init.d/functions 14 | 15 | export JAVA_HOME=/usr/java/jdk1.6.0 16 | export TIGASE_DIR=/opt/tigase/server/ 17 | tigase=$TIGASE_DIR/scripts/tigase.sh 18 | prog=tigase 19 | config=$TIGASE_DIR/etc/tigase.conf 20 | RETVAL=0 21 | 22 | start() { 23 | gprintf "Starting %s: " "$prog" 24 | daemon $tigase start $config 25 | RETVAL=$? 26 | echo 27 | [ $RETVAL = 0 ] 28 | return $RETVAL 29 | } 30 | 31 | stop() { 32 | gprintf "Stopping %s: " "$prog" 33 | daemon $tigase stop $config 34 | RETVAL=$? 35 | echo 36 | [ $RETVAL = 0 ] 37 | } 38 | 39 | 40 | # See how we were called. 41 | case "$1" in 42 | start) 43 | start 44 | ;; 45 | stop) 46 | stop 47 | ;; 48 | status) 49 | status $tigase 50 | RETVAL=$? 51 | ;; 52 | restart) 53 | stop 54 | start 55 | ;; 56 | condrestart) 57 | if [ -f /var/run/ser.pid ] ; then 58 | stop 59 | start 60 | fi 61 | ;; 62 | *) 63 | gprintf "Usage: %s {start|stop|restart|status|help}\n" "$prog" 64 | exit 1 65 | esac 66 | 67 | exit $RETVAL 68 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/MessageRouterIfc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.server; 24 | 25 | import tigase.conf.ConfiguratorAbstract; 26 | 27 | /** 28 | * Created: Dec 7, 2009 5:20:56 PM 29 | * 30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public interface MessageRouterIfc extends ServerComponent { 34 | 35 | void setConfig(ConfiguratorAbstract config); 36 | 37 | void start(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /scripts/debian/tigase-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | CURDIR=`pwd` 4 | TARGET=/usr/share/tigase 5 | ETCDIR=/etc/tigase 6 | LOGDIR=/var/log/tigase 7 | VARDIR=/var/lib/tigase 8 | 9 | if ! getent passwd tigase >/dev/null; then 10 | adduser --disabled-password --quiet --system \ 11 | --home $VARDIR \ 12 | --gecos "Tigase XMPP server" --group tigase 13 | fi 14 | if ! getent group tigase >/dev/null; then 15 | adduser --system tigase 16 | fi 17 | 18 | mkdir -p $TARGET 19 | mkdir -p $ETCDIR 20 | mkdir -p $LOGDIR 21 | mkdir -p $VARDIR/tigase-derbydb 22 | mkdir -p $TARGET/jars/ 23 | mkdir -p $TARGET/libs/ 24 | 25 | cp -f $CURDIR/jars/*.jar $TARGET/jars/ 26 | cp -f $CURDIR/libs/*.jar $TARGET/libs/ 27 | cp -fr $CURDIR/certs/ $TARGET/ 28 | cp -fr $CURDIR/database/ $TARGET/ 29 | cp -fr $CURDIR/scripts/ $TARGET/ 30 | 31 | chown -R tigase:tigase $TARGET 32 | chmod -R o-rwx $TARGET 33 | 34 | cp -f $CURDIR/scripts/debian/init-debian.properties $ETCDIR/init.properties 35 | cp -f $CURDIR/scripts/debian/tigase-debian.conf /etc/default/tigase 36 | cp -f $CURDIR/scripts/debian/tigase.init.d /etc/init.d/tigase 37 | 38 | chown -R tigase:tigase $ETCDIR 39 | chown -R tigase:tigase $LOGDIR 40 | chown -R tigase:tigase $VARDIR 41 | #chmod -R o-rwx $ETCDIR 42 | #chmod -R o-rwx $LOGDIR 43 | #chmod -R o-rwx $VARDIR 44 | chmod 755 /etc/init.d/tigase 45 | 46 | update-rc.d tigase defaults 47 | -------------------------------------------------------------------------------- /src/main/java/tigase/io/BufferUnderflowException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.io; 23 | 24 | import java.io.IOException; 25 | 26 | /** 27 | * Describe class BufferUnderflowException here. 28 | * 29 | * 30 | * Created: Sun Sep 24 22:32:37 2006 31 | * 32 | * @author Artur Hefczyc 33 | * @version $Rev$ 34 | */ 35 | public class BufferUnderflowException extends IOException { 36 | private static final long serialVersionUID = 1L; 37 | } -------------------------------------------------------------------------------- /database/derby-schema-upgrade-to-5-1.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | 24 | -- QUERY START: 25 | call TigPutDBProperty('schema-version','5.1'); 26 | -- QUERY END: 27 | 28 | -- QUERY START: 29 | CREATE procedure TigUpdatePairs(nid bigint, uid bigint, tkey varchar(255), tval varchar(32672)) 30 | PARAMETER STYLE JAVA 31 | LANGUAGE JAVA 32 | MODIFIES SQL DATA 33 | EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUpdatePairs'; 34 | -- QUERY END: 35 | 36 | -------------------------------------------------------------------------------- /src/main/java/tigase/net/Accept.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.net; 23 | 24 | import java.io.IOException; 25 | import java.nio.channels.SocketChannel; 26 | 27 | /** 28 | * Describe interface Accept here. 29 | * 30 | * 31 | * Created: Sat May 14 07:00:16 2005 32 | * 33 | * @author Artur Hefczyc 34 | * @version $Rev$ 35 | */ 36 | public interface Accept { 37 | 38 | void accept(final SocketChannel sc) throws IOException; 39 | 40 | } // Accept -------------------------------------------------------------------------------- /src/main/python/tigase/admin/PythonExample.py: -------------------------------------------------------------------------------- 1 | # Tigase Jabber/XMPP Server 2 | # Copyright (C) 2004-2012 "Artur Hefczyc" 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU Affero General Public License as published by 6 | # the Free Software Foundation, version 3 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU Affero General Public License 14 | # along with this program. Look for COPYING file in the top folder. 15 | # If not, see http://www.gnu.org/licenses/. 16 | # 17 | # $Rev: $ 18 | # Last modified by $Author: $ 19 | # $Date: $ 20 | 21 | from java.lang import * 22 | from tigase.server import * 23 | 24 | 25 | num1 = Command.getFieldValue(packet, "num1") 26 | num2 = Command.getFieldValue(packet, "num2") 27 | 28 | if num1 is None or num2 is None: 29 | res = Iq.commandResultForm(packet) 30 | Command.addTextField(res, "Note", "This is Python script!") 31 | Command.addFieldValue(res, "num1", "") 32 | Command.addFieldValue(res, "num2", "") 33 | packet = res 34 | else: 35 | result = num1 + num2 36 | -------------------------------------------------------------------------------- /debian/tigase-server.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | case "$1" in 4 | configure) 5 | if ! id tigase > /dev/null 2>&1 ; then 6 | adduser --system --home /usr/share/tigase --no-create-home \ 7 | --ingroup nogroup --disabled-password --shell /bin/false \ 8 | tigase 9 | fi 10 | chown tigase:adm /var/log/tigase 11 | chown tigase:root /etc/tigase /etc/tigase/certs \ 12 | /etc/tigase/certs/rsa-keystore /etc/tigase/certs/truststore \ 13 | /var/spool/tigase 14 | chmod 750 /var/log/tigase /var/spool/tigase \ 15 | /etc/tigase /etc/tigase/certs 16 | sed -i 's/$HOST_NAME/'`hostname --fqdn`'/g' /etc/tigase/init.properties* 17 | 18 | if grep -q 'db=derby$' /etc/tigase/init.properties 19 | DERBYDB=`sed -n 's/.*user-db-uri.*jdbc:derby://;s/;.*//p' /etc/tigase/init.properties` 20 | then 21 | if [ -n "$DERBYDB" ] && [ ! -d "$DERBYDB" ] && [ -r /usr/lib/jvm/java-6-sun/db/lib/derby.jar ] 22 | then 23 | echo "Creating Derby database for Tigase in \`$DERBYDB' ..." 24 | OLDCWD=`pwd` 25 | cd /usr/share/tigase 26 | scripts/derby-db-create.sh "$DERBYDB" >/dev/null 27 | [ -e derby.log ] && rm *.log 28 | chown -R tigase "$DERBYDB" 29 | cd $OLDCWD 30 | fi 31 | fi 32 | ;; 33 | 34 | abort-upgrade|abort-remove|abort-deconfigure) 35 | ;; 36 | 37 | *) 38 | echo "$0 called with unknown argument \`$1'" >&2 39 | exit 1 40 | ;; 41 | esac 42 | 43 | #DEBHELPER# 44 | -------------------------------------------------------------------------------- /src/main/java/tigase/conf/Configurator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.conf; 24 | 25 | /** 26 | * Created: Dec 7, 2009 4:09:52 PM 27 | * 28 | * @author Artur Hefczyc 29 | * @version $Rev$ 30 | */ 31 | public class Configurator extends ConfiguratorAbstract { 32 | 33 | @Override 34 | public String getDiscoDescription() { 35 | return "Configuration management"; 36 | } 37 | 38 | @Override 39 | public String getDiscoCategoryType() { 40 | return "generic"; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/tigase/util/PatternComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.util; 24 | 25 | import java.util.Comparator; 26 | import java.util.regex.Pattern; 27 | 28 | /** 29 | * Created: Oct 22, 2009 6:08:50 PM 30 | * 31 | * @author Artur Hefczyc 32 | * @version $Rev$ 33 | */ 34 | public class PatternComparator implements Comparator { 35 | 36 | @Override 37 | public int compare(Pattern o1, Pattern o2) { 38 | return o1.pattern().compareTo(o2.pattern()); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /win-stuff/scripts/Uninst.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | 5 | rem ***************************** 6 | rem This script runs on uninstall 7 | rem ***************************** 8 | 9 | if "%OS%"=="Windows_NT" goto nt 10 | echo This script only works with NT-based versions of Windows. 11 | goto :eof 12 | 13 | :nt 14 | rem 15 | rem Find the application home. 16 | rem 17 | rem %~dp0 is location of current script under NT 18 | set _REALPATH=%~dp0 19 | 20 | rem Decide on the wrapper binary. 21 | set _WRAPPER_BASE=wrapper 22 | set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe 23 | if exist "%_WRAPPER_EXE%" goto conf 24 | set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe 25 | if exist "%_WRAPPER_EXE%" goto conf 26 | set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe 27 | if exist "%_WRAPPER_EXE%" goto conf 28 | echo Unable to locate a Wrapper executable using any of the following names: 29 | echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe 30 | echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe 31 | echo %_REALPATH%%_WRAPPER_BASE%.exe 32 | goto :eof 33 | 34 | rem 35 | rem Find the wrapper.conf 36 | rem 37 | :conf 38 | set _WRAPPER_CONF="%~f1" 39 | if not %_WRAPPER_CONF%=="" goto startup 40 | set _WRAPPER_CONF="%_REALPATH%wrapper.conf" 41 | 42 | rem 43 | rem Uninstall the Wrapper as an NT service. 44 | rem 45 | :startup 46 | "%_WRAPPER_EXE%" -r %_WRAPPER_CONF% 47 | 48 | -------------------------------------------------------------------------------- /database/postgresql-schema-4.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- To load schema to PostgreSQL database execute following commands: 24 | -- 25 | -- createuser tigase 26 | -- createdb -U tigase tigase 27 | -- psql -q -U tigase -d tigase -f postgresql-schema.sql 28 | 29 | -- QUERY START: 30 | \i database/postgresql-schema-4-schema.sql 31 | -- QUERY END: 32 | 33 | -- QUERY START: 34 | \i database/postgresql-schema-4-sp.sql 35 | -- QUERY END: 36 | 37 | -- QUERY START: 38 | \i database/postgresql-schema-4-props.sql 39 | -- QUERY END: 40 | -------------------------------------------------------------------------------- /database/postgresql-schema-5.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- To load schema to PostgreSQL database execute following commands: 24 | -- 25 | -- createuser tigase 26 | -- createdb -U tigase tigase 27 | -- psql -q -U tigase -d tigase -f postgresql-schema.sql 28 | 29 | -- QUERY START: 30 | \i database/postgresql-schema-4-schema.sql 31 | -- QUERY END: 32 | 33 | -- QUERY START: 34 | \i database/postgresql-schema-4-sp.sql 35 | -- QUERY END: 36 | 37 | -- QUERY START: 38 | \i database/postgresql-schema-4-props.sql 39 | -- QUERY END: 40 | -------------------------------------------------------------------------------- /database/postgresql-schema-5-1.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- To load schema to PostgreSQL database execute following commands: 24 | -- 25 | -- createuser tigase 26 | -- createdb -U tigase tigase 27 | -- psql -q -U tigase -d tigase -f postgresql-schema.sql 28 | 29 | -- QUERY START: 30 | \i database/postgresql-schema-4-schema.sql 31 | -- QUERY END: 32 | 33 | -- QUERY START: 34 | \i database/postgresql-schema-5-1-sp.sql 35 | -- QUERY END: 36 | 37 | -- QUERY START: 38 | \i database/postgresql-schema-5-1-props.sql 39 | -- QUERY END: 40 | -------------------------------------------------------------------------------- /database/postgresql-installer-create-db.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- QUERY START: create database 24 | create database ${dbName}; 25 | -- QUERY END: create database 26 | 27 | -- QUERY START: add user 28 | create user ${dbUser} with password '${dbPass}'; 29 | -- QUERY END: add user 30 | 31 | -- QUERY START: GRANT ALL 32 | GRANT ALL ON database ${dbName} TO ${dbUser}; 33 | -- QUERY END: GRANT ALL 34 | 35 | -- QUERY START: ALTER DATABASE 36 | ALTER DATABASE ${dbName} OWNER TO ${dbUser}; 37 | -- QUERY END: ALTER DATABASE 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/main/scala/tigase/admin/ScalaExample.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev: $ 19 | * Last modified by $Author: $ 20 | * $Date: $ 21 | */ 22 | 23 | package tigase.admin 24 | 25 | import tigase.server. { Command, Packet } 26 | 27 | val num1 = Command getFieldValue(packet, "num1") 28 | val num2 = Command getFieldValue(packet, "num2") 29 | 30 | scriptResult = if (num1 == null || num2 == null) { 31 | val cmd = Packet.commandResultForm(packet) 32 | Command.addTextField(cmd, "Note", "This is a Scala script!") 33 | Command.addFieldValue(cmd, "num1", "") 34 | Command.addFieldValue(cmd, "num2", "") 35 | cmd 36 | } else { 37 | num1 + num2 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/tigase/conf/MonitoringSetupIfc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.conf; 24 | 25 | /** 26 | * Created: Jan 10, 2009 8:43:04 PM 27 | * 28 | * @author Artur Hefczyc 29 | * @version $Rev$ 30 | */ 31 | public interface MonitoringSetupIfc { 32 | 33 | public enum MONITOR { jmx, http, snmp; } 34 | 35 | void initMonitoring(String settings, String configDir); 36 | 37 | void initializationCompleted(); 38 | 39 | void putMXBean(String objName, Object bean); 40 | 41 | Object getMXBean(String objName); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/ruby/tigase/admin/RubyExample.rb: -------------------------------------------------------------------------------- 1 | # Tigase Jabber/XMPP Server 2 | # Copyright (C) 2004-2012 "Artur Hefczyc" 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU Affero General Public License as published by 6 | # the Free Software Foundation, version 3 of the License. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU Affero General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU Affero General Public License 14 | # along with this program. Look for COPYING file in the top folder. 15 | # If not, see http://www.gnu.org/licenses/. 16 | # 17 | # $Rev: $ 18 | # Last modified by $Author: $ 19 | # $Date: $ 20 | 21 | require 'java' 22 | 23 | import java.lang.System 24 | 25 | include_class 'tigase.server.Command' 26 | include_class 'tigase.server.Packet' 27 | 28 | 29 | num1 = Command.getFieldValue($packet, "num1") 30 | num2 = Command.getFieldValue($packet, "num2") 31 | 32 | if num1.nil? || num2.nil? 33 | res = Packet.commandResultForm($packet) 34 | Command.addTextField(res, "Note", "This is JRuby script!") 35 | Command.addFieldValue(res, "num1", "") 36 | Command.addFieldValue(res, "num2", "") 37 | return res 38 | else 39 | return num1 + num2 40 | end 41 | -------------------------------------------------------------------------------- /src/main/java/tigase/util/IdentityComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.util; 24 | 25 | import java.util.Comparator; 26 | 27 | /** 28 | * Created: Jul 15, 2009 11:50:51 AM 29 | * 30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public class IdentityComparator implements Comparator { 34 | 35 | @Override 36 | public int compare(Object o1, Object o2) { 37 | if (o1 == o2) { 38 | return 0; 39 | } 40 | if (o1.hashCode() < o2.hashCode()) { 41 | return -1; 42 | } 43 | return 1; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/tigase/cluster/api/CommandListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev: 2411 $ 19 | * Last modified by $Author: kobit $ 20 | * $Date: 2010-10-27 20:27:58 -0600 (Wed, 27 Oct 2010) $ 21 | * 22 | */ 23 | package tigase.cluster.api; 24 | 25 | import java.util.Map; 26 | import java.util.Queue; 27 | import java.util.Set; 28 | 29 | import tigase.xml.Element; 30 | import tigase.xmpp.JID; 31 | 32 | /** 33 | * @author Artur Hefczyc Created Mar 16, 2011 34 | */ 35 | public interface CommandListener { 36 | 37 | void executeCommand(JID fromNode, Set visitedNodes, Map data, 38 | Queue packets) throws ClusterCommandException; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/ssender/StanzaHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.server.ssender; 23 | 24 | import java.util.Queue; 25 | import tigase.server.Packet; 26 | 27 | /** 28 | * Describe interface StanzaHandler here. 29 | * 30 | * 31 | * Created: Fri Apr 20 11:54:10 2007 32 | * 33 | * @author Artur Hefczyc 34 | * @version $Rev$ 35 | */ 36 | public interface StanzaHandler { 37 | 38 | void handleStanza(String stanza); 39 | 40 | void handleStanza(Packet stanza); 41 | 42 | void handleStanzas(Queue results); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /etc/init-mysql.properties: -------------------------------------------------------------------------------- 1 | # Load standard set of the server components. 2 | # Look at the http://www.tigase.org/configuration-wizards 3 | # document for other possible values. Normally you don't 4 | # need to change this line. 5 | config-type=--gen-config-def 6 | # List of administrator accounts, please replace them with 7 | # administrator accounts in your installation 8 | --admins=admin@devel.tigase.org,admin@test-d 9 | # The line says that the database used by the Tigase server is 'mysql' 10 | # Look at the configuration wizards article for different options 11 | # You can also put here a Java class name if you have a custom 12 | # implementation for a database connector. 13 | --user-db=mysql 14 | # The line contains the database connection string. This is database 15 | # specific string and for each kind of database it may look differently. 16 | # Below string is for MySQL database. Please modify it for your system. 17 | # MySQL connector requires connection string in the following format: 18 | # jdbc:mysql://[hostname]/[database name]?user=[user name]&password=[user password] 19 | --user-db-uri=jdbc:mysql://localhost/tigasedb?user=tigase_user&password=mypass 20 | # Virtual domains for your server installation, comma separated list of vhosts 21 | --virt-hosts=devel.tigase.org,test-d 22 | # Select what packages you want to have logging switched for 23 | # The below setting is recommended for the initail setup and it is required 24 | # when asking for help with setting the server up 25 | --debug=server 26 | -------------------------------------------------------------------------------- /scripts/repo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | ## Tigase Jabber/XMPP Server 4 | ## Copyright (C) 2004-2012 "Artur Hefczyc" 5 | ## 6 | ## This program is free software: you can redistribute it and/or modify 7 | ## it under the terms of the GNU Affero General Public License as published by 8 | ## the Free Software Foundation, either version 3 of the License. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU Affero General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU Affero General Public License 16 | ## along with this program. Look for COPYING file in the top folder. 17 | ## If not, see http://www.gnu.org/licenses/. 18 | ## 19 | ## $Rev: $ 20 | ## Last modified by $Author: $ 21 | ## $Date: $ 22 | ## 23 | 24 | CP="jars/tigase-server.jar:libs/jdbc-mysql.jar:libs/jdbc-postgresql.jar:libs/tigase-xmltools.jar:libs/tigase-utils.jar" 25 | 26 | D="-server -Xms100M -Xmx1500M -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver" 27 | 28 | MYSQL_REP="-sc tigase.db.jdbc.JDBCRepository -su jdbc:mysql://localhost/nk_200k?user=root&password=mypass" 29 | PGSQL_REP="-sc tigase.db.jdbc.JDBCRepository -su jdbc:postgresql://localhost/tigase?user=tigase" 30 | 31 | java $D -cp $CP tigase.util.RepositoryUtils $MYSQL_REP $* 32 | -------------------------------------------------------------------------------- /src/main/java/tigase/cluster/api/ClusteredComponentIfc.java: -------------------------------------------------------------------------------- 1 | /* Tigase Jabber/XMPP Server 2 | * Copyright (C) 2004-2012 "Artur Hefczyc" 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Affero General Public License as published by 6 | * the Free Software Foundation, version 3 of the License. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Affero General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Affero General Public License 14 | * along with this program. Look for COPYING file in the top folder. 15 | * If not, see http://www.gnu.org/licenses/. 16 | * 17 | * $Rev$ 18 | * Last modified by $Author$ 19 | * $Date$ 20 | */ 21 | package tigase.cluster.api; 22 | 23 | import tigase.server.ServerComponent; 24 | 25 | /** 26 | * Describe interface ClusteredComponent here. 27 | * 28 | * 29 | * Created: Mon Jun 9 20:00:46 2008 30 | * 31 | * @author Artur Hefczyc 32 | * @version $Rev$ 33 | */ 34 | public interface ClusteredComponentIfc extends ServerComponent { 35 | 36 | void setClusterController(ClusterControllerIfc cl_controller); 37 | 38 | void nodeConnected(String node); 39 | 40 | void nodeDisconnected(String node); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/tigase/io/TLSEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.io; 24 | 25 | //~--- interfaces ------------------------------------------------------------- 26 | 27 | /** 28 | * Describe interface TLSEventHandler here. 29 | * 30 | * 31 | * Created: Wed Feb 7 23:20:14 2007 32 | * 33 | * @author Artur Hefczyc 34 | * @version $Rev$ 35 | */ 36 | public interface TLSEventHandler { 37 | void handshakeCompleted(TLSWrapper wrapper); 38 | } 39 | 40 | 41 | //~ Formatted in Sun Code Convention 42 | 43 | 44 | //~ Formatted by Jindent --- http://www.jindent.com 45 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/ext/lb/LoadBalancerIfc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev: 2411 $ 19 | * Last modified by $Author: kobit $ 20 | * $Date: 2010-10-27 20:27:58 -0600 (Wed, 27 Oct 2010) $ 21 | * 22 | */ 23 | package tigase.server.ext.lb; 24 | 25 | import java.util.ArrayList; 26 | 27 | import tigase.server.Packet; 28 | import tigase.server.ext.ComponentConnection; 29 | import tigase.server.ext.ComponentIOService; 30 | 31 | /** 32 | * @author Artur Hefczyc 33 | * Created Jul 9, 2011 34 | */ 35 | public interface LoadBalancerIfc { 36 | 37 | /** 38 | * @param p 39 | * @param conns 40 | * @return 41 | */ 42 | ComponentIOService selectConnection(Packet p, ArrayList conns); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/gateways/GatewayException.java: -------------------------------------------------------------------------------- 1 | /* Tigase Jabber/XMPP Server 2 | * Copyright (C) 2004-2012 "Artur Hefczyc" 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Affero General Public License as published by 6 | * the Free Software Foundation, version 3 of the License. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Affero General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Affero General Public License 14 | * along with this program. Look for COPYING file in the top folder. 15 | * If not, see http://www.gnu.org/licenses/. 16 | * 17 | * $Rev$ 18 | * Last modified by $Author$ 19 | * $Date$ 20 | */ 21 | package tigase.server.gateways; 22 | 23 | /** 24 | * Describe class GatewayException here. 25 | * 26 | * 27 | * Created: Mon Nov 12 15:11:55 2007 28 | * 29 | * @author Artur Hefczyc 30 | * @version $Rev$ 31 | */ 32 | public class GatewayException extends Exception { 33 | 34 | private static final long serialVersionUID = 1L; 35 | 36 | /** 37 | * Creates a new GatewayException instance. 38 | * 39 | */ 40 | public GatewayException(String message) { 41 | super(message); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/tigase/db/DBInitException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.db; 23 | 24 | /** 25 | * Describe class DBInitException here. 26 | * 27 | * 28 | * Created: Thu Oct 26 12:18:05 2006 29 | * 30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public class DBInitException extends TigaseDBException { 34 | 35 | private static final long serialVersionUID = 1L; 36 | 37 | public DBInitException(String message) { super(message); } 38 | 39 | public DBInitException(String message, Throwable cause) { 40 | super(message, cause); 41 | } 42 | 43 | } // DBInitException -------------------------------------------------------------------------------- /src/main/java/tigase/util/OSUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.util; 24 | 25 | /** 26 | * Created: Dec 11, 2008 10:26:00 AM 27 | * 28 | * @author Artur Hefczyc 29 | * @version $Rev$ 30 | */ 31 | public class OSUtils { 32 | 33 | public enum OS { 34 | windows, linux, sunos, solaris, mac, unix, other; 35 | } 36 | 37 | public static OS getOSType() { 38 | String osName = System.getProperty("os.name").toLowerCase(); 39 | for (OS os : OS.values()) { 40 | if (osName.contains(os.toString())) { 41 | return os; 42 | } 43 | } 44 | return OS.other; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /win-stuff/scripts/InstallTigaseService.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | rem ****************************************************** 5 | rem Java Service Wrapper general NT service install script 6 | rem ****************************************************** 7 | 8 | if "%OS%"=="Windows_NT" goto nt 9 | echo This script only works with NT-based versions of Windows. 10 | goto :eof 11 | 12 | :nt 13 | rem 14 | rem Find the application home. 15 | rem 16 | rem %~dp0 is location of current script under NT 17 | set _REALPATH=%~dp0 18 | 19 | rem Decide on the wrapper binary. 20 | set _WRAPPER_BASE=wrapper 21 | set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe 22 | if exist "%_WRAPPER_EXE%" goto conf 23 | set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe 24 | if exist "%_WRAPPER_EXE%" goto conf 25 | set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe 26 | if exist "%_WRAPPER_EXE%" goto conf 27 | echo Unable to locate a Wrapper executable using any of the following names: 28 | echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe 29 | echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe 30 | echo %_REALPATH%%_WRAPPER_BASE%.exe 31 | pause 32 | goto :eof 33 | 34 | rem 35 | rem Find the wrapper.conf 36 | rem 37 | :conf 38 | set _WRAPPER_CONF="%~f1" 39 | if not %_WRAPPER_CONF%=="" goto startup 40 | set _WRAPPER_CONF="%_REALPATH%wrapper.conf" 41 | 42 | rem 43 | rem Install the Wrapper as an NT service. 44 | rem 45 | :startup 46 | "%_WRAPPER_EXE%" -i %_WRAPPER_CONF% 47 | pause 48 | 49 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/gateways/LoginGatewayException.java: -------------------------------------------------------------------------------- 1 | /* Tigase Jabber/XMPP Server 2 | * Copyright (C) 2004-2012 "Artur Hefczyc" 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Affero General Public License as published by 6 | * the Free Software Foundation, version 3 of the License. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Affero General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Affero General Public License 14 | * along with this program. Look for COPYING file in the top folder. 15 | * If not, see http://www.gnu.org/licenses/. 16 | * 17 | * $Rev$ 18 | * Last modified by $Author$ 19 | * $Date$ 20 | */ 21 | package tigase.server.gateways; 22 | 23 | /** 24 | * Describe class LoginGatewayException here. 25 | * 26 | * 27 | * Created: Mon Nov 12 15:13:09 2007 28 | * 29 | * @author Artur Hefczyc 30 | * @version $Rev$ 31 | */ 32 | public class LoginGatewayException extends GatewayException { 33 | 34 | private static final long serialVersionUID = 1L; 35 | 36 | /** 37 | * Creates a new LoginGatewayException instance. 38 | * 39 | */ 40 | public LoginGatewayException(String message) { 41 | super(message); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /win-stuff/scripts/UninstallTigaseService.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | 5 | rem ******************************************************** 6 | rem Java Service Wrapper general NT service uninstall script 7 | rem ******************************************************** 8 | 9 | if "%OS%"=="Windows_NT" goto nt 10 | echo This script only works with NT-based versions of Windows. 11 | goto :eof 12 | 13 | :nt 14 | rem 15 | rem Find the application home. 16 | rem 17 | rem %~dp0 is location of current script under NT 18 | set _REALPATH=%~dp0 19 | 20 | rem Decide on the wrapper binary. 21 | set _WRAPPER_BASE=wrapper 22 | set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe 23 | if exist "%_WRAPPER_EXE%" goto conf 24 | set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe 25 | if exist "%_WRAPPER_EXE%" goto conf 26 | set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe 27 | if exist "%_WRAPPER_EXE%" goto conf 28 | echo Unable to locate a Wrapper executable using any of the following names: 29 | echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe 30 | echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe 31 | echo %_REALPATH%%_WRAPPER_BASE%.exe 32 | pause 33 | goto :eof 34 | 35 | rem 36 | rem Find the wrapper.conf 37 | rem 38 | :conf 39 | set _WRAPPER_CONF="%~f1" 40 | if not %_WRAPPER_CONF%=="" goto startup 41 | set _WRAPPER_CONF="%_REALPATH%wrapper.conf" 42 | 43 | rem 44 | rem Uninstall the Wrapper as an NT service. 45 | rem 46 | :startup 47 | "%_WRAPPER_EXE%" -r %_WRAPPER_CONF% 48 | pause 49 | 50 | -------------------------------------------------------------------------------- /database/postgresql-installer-post.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- Permissions fix 24 | 25 | -- QUERY START: ALTER SCHEMA 26 | ALTER SCHEMA public OWNER TO ${dbUser}; 27 | -- QUERY END: ALTER SCHEMA 28 | 29 | -- QUERY START: GRANT ALL ON ALL TABLES 30 | GRANT ALL ON ALL TABLES IN SCHEMA public TO ${dbUser}; 31 | -- QUERY END: GRANT ALL ON ALL TABLES 32 | 33 | -- QUERY START: GRANT ALL ON ALL FUNCTIONS 34 | GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO ${dbUser}; 35 | -- QUERY END: GRANT ALL ON ALL FUNCTIONS 36 | 37 | -- QUERY START: GRANT ALL ON ALL SEQUENCES 38 | GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO ${dbUser}; 39 | -- QUERY END: GRANT ALL ON ALL SEQUENCES 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/Presence.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.server; 24 | 25 | import tigase.util.TigaseStringprepException; 26 | import tigase.xml.Element; 27 | import tigase.xmpp.JID; 28 | 29 | /** 30 | * Created: Dec 31, 2009 8:42:05 PM 31 | * 32 | * @author Artur Hefczyc 33 | * @version $Rev$ 34 | */ 35 | public class Presence extends Packet { 36 | 37 | public static final String ELEM_NAME = "presence"; 38 | 39 | public Presence(Element elem) throws TigaseStringprepException{ 40 | super(elem); 41 | } 42 | 43 | public Presence(Element elem, JID stanzaFrom, JID stanzaTo) { 44 | super(elem, stanzaFrom, stanzaTo); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/tigase/sys/OnlineJidsReporter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.sys; 24 | 25 | import tigase.xmpp.BareJID; 26 | import tigase.xmpp.JID; 27 | 28 | /** 29 | * Created: Apr 19, 2009 12:15:07 AM 30 | * 31 | * @author Artur Hefczyc 32 | * @version $Rev$ 33 | */ 34 | public interface OnlineJidsReporter { 35 | 36 | //Set getOnlineJids(); 37 | 38 | boolean hasCompleteJidsInfo(); 39 | 40 | /** 41 | * Checks whether there is an online session for the given user BareJID. 42 | * 43 | * @param jid 44 | * @return 45 | */ 46 | boolean containsJid(BareJID jid); 47 | 48 | JID[] getConnectionIdsForJid(BareJID jid); 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/groovy/tigase/admin/CompRepoReload.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev: $ 19 | * Last modified by $Author: $ 20 | * $Date: $ 21 | */ 22 | 23 | /* 24 | 25 | Reload a component repository: 26 | tigase.db.ComponentRepository 27 | Works only for some components which actually use the repository that way. 28 | 29 | AS:Description: Reload component repository 30 | AS:CommandId: comp-repo-reload 31 | AS:Component: vhost-man,ext 32 | */ 33 | 34 | package tigase.admin 35 | 36 | import tigase.db.* 37 | import tigase.db.comp.* 38 | 39 | def repo = (ComponentRepository)comp_repo 40 | repo.reload() 41 | 42 | def result = "Reloaded items: " + repo.size() 43 | def items = repo.allItems() 44 | if (items.size() > 0) { 45 | items.each { result += it.getKey() + "," } 46 | } 47 | 48 | return result 49 | -------------------------------------------------------------------------------- /src/main/java/tigase/db/TigaseDBException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.db; 23 | 24 | /** 25 | * Describe class TigaseDBException here. 26 | * 27 | * 28 | * Created: Thu Oct 26 12:15:36 2006 29 | * 30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public class TigaseDBException extends Exception { 34 | 35 | private static final long serialVersionUID = 1L; 36 | 37 | /** 38 | * Creates a new TigaseDBException instance. 39 | * 40 | */ 41 | public TigaseDBException(String message) { super(message); } 42 | 43 | public TigaseDBException(String message, Throwable cause) { 44 | super(message, cause); 45 | } 46 | 47 | } // TigaseDBException -------------------------------------------------------------------------------- /src/main/java/tigase/server/amp/ConditionIfc.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Tigase Jabber/XMPP Server 4 | * Copyright (C) 2004-2012 "Artur Hefczyc" 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, version 3 of the License. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. Look for COPYING file in the top folder. 17 | * If not, see http://www.gnu.org/licenses/. 18 | * 19 | * $Rev$ 20 | * Last modified by $Author$ 21 | * $Date$ 22 | */ 23 | package tigase.server.amp; 24 | 25 | //~--- non-JDK imports -------------------------------------------------------- 26 | 27 | import tigase.server.Packet; 28 | 29 | import tigase.xml.Element; 30 | 31 | //~--- interfaces ------------------------------------------------------------- 32 | 33 | /** 34 | * Created: Apr 26, 2010 5:06:13 PM 35 | * 36 | * @author Artur Hefczyc 37 | * @version $Rev$ 38 | */ 39 | public interface ConditionIfc extends AmpFeatureIfc { 40 | boolean match(Packet packet, Element rule); 41 | } 42 | 43 | 44 | //~ Formatted in Sun Code Convention 45 | 46 | 47 | //~ Formatted by Jindent --- http://www.jindent.com 48 | -------------------------------------------------------------------------------- /src/main/java/tigase/xmpp/XMPPProcessorIfc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.xmpp; 23 | 24 | import java.util.Queue; 25 | import java.util.Map; 26 | import tigase.server.Packet; 27 | import tigase.db.NonAuthUserRepository; 28 | 29 | /** 30 | * Describe interface XMPPProcessorIfc here. 31 | * 32 | * 33 | * Created: Wed Feb 8 13:47:56 2006 34 | * 35 | * @author Artur Hefczyc 36 | * @version $Rev$ 37 | */ 38 | public interface XMPPProcessorIfc extends XMPPImplIfc { 39 | 40 | void process(Packet packet, XMPPResourceConnection session, 41 | NonAuthUserRepository repo, Queue results, 42 | Map settings) throws XMPPException; 43 | 44 | } // XMPPProcessorIfc 45 | -------------------------------------------------------------------------------- /scripts/installer-generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## RUN from main tigase-server directory 4 | 5 | IZPACK_DIR="installer/izpack.patched" 6 | #IZPACK_DIR="/Applications/IzPack" 7 | 8 | # create packages directory 9 | if [ ! -e packages ] ; then 10 | mkdir packages || exit -1 11 | fi 12 | 13 | # create logs directory 14 | if [ ! -e logs ] ; then 15 | mkdir logs || exit -1 16 | fi 17 | 18 | # insert appropriate version information 19 | export TIGVER=`grep -m 1 "Tigase-Version:" MANIFEST.MF | sed -e "s/Tigase-Version: \(.*\)/\\1/"` 20 | sed -e "s/\([^<]*\)<\/appversion>/$TIGVER<\/appversion>/" \ 21 | src/main/izpack/install.xml > src/main/izpack/install_copy.xml 22 | 23 | #ant -verbose -f src/main/izpack/build.xml -Dinstaller.path=$IZPACK_DIR 24 | 25 | # generate javadocs 26 | export WINDOWTITLE=`grep -m 1 "javadoc-windowtitle=" build.properties | sed -e "s/javadoc-windowtitle=\(.*\)/\\1/"` 27 | export COPYRIGHT=`grep -m 1 "javadoc-copyright=" build.properties | sed -e "s/javadoc-copyright=\(.*\)/\\1/"` 28 | javadoc -d docs -sourcepath src/main/java/ -subpackages tigase -windowtitle "$WINDOWTITLE" -overview package.html -bottom "$COPYRIGHT" -use -author -version -protected 29 | 30 | # compile installer 31 | $IZPACK_DIR/bin/compile \ 32 | src/main/izpack/install_copy.xml \ 33 | -h $IZPACK_DIR/ \ 34 | -b . -o ./packages/tigase-server-$TIGVER.jar 35 | 36 | python $IZPACK_DIR/utils/wrappers/izpack2exe/izpack2exe.py \ 37 | --file=./packages/tigase-server-$TIGVER.jar --no-upx \ 38 | --output=./packages/tigase-server-$TIGVER.exe 39 | 40 | #rm -f src/main/izpack/install_copy.xml 41 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/Permissions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.server; 23 | 24 | /** 25 | * Describe class Permissions here. 26 | * 27 | * 28 | * Created: Tue Jan 23 22:52:45 2007 29 | * 30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public enum Permissions { 34 | 35 | NONE, // Unknown user JID 36 | ANONYM, // Anonymous user 37 | REMOTE, // Packet from a user from a different XMPP installation 38 | LOCAL, // This is local user JID but not authenticated yet 39 | AUTH, // Local authenticated and authorized user 40 | TRUSTED, // Trusted account, can broadcast packets 41 | ADMIN; // Admin account already authenticated 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/izpack/README.txt: -------------------------------------------------------------------------------- 1 | How to generate installer: 2 | --------------------------- 3 | 4 | Tigase installer modifications are of two kinds: 5 | 1. Tigase panels are provided in src/main/izpack/java directory for easy tracking in svn. 6 | 7 | 2. Modifications related to the IzPack installer are provided as a patch file. Unfortunately one of 8 | src/main/izpack/changes.patch 9 | 10 | important: build.xml for izpack has conflicting changes related to both TigasePanels and to generic IzPack 11 | functionality. This is why it is only provided in the patch. If you add/remove panels you will need to 12 | modify the patch too. 13 | 14 | 15 | The first time after checking Tigase server source code and after you change some installation code i.e. 16 | improve IzPack installer or add some panels, you will need to build the patched installer. 17 | You can use the scripts/prepare-installer.sh to download needed IzPack version, install it in a local 18 | directory, automaticaly patch it and build at the end. If the IzPack version of installer gets 19 | downloaded you can comment the svn checkout line to not download it every time when you prepare 20 | installer generator. 21 | 22 | 23 | After creating compiler generator it will sit in the installer/izpack.patched directory. You can use 24 | the script/generate-installer.sh to create TigaseInstaller from it without regeneratting installer 25 | generator every time. 26 | 27 | Requirements to build the installer (various steps): 28 | - git 29 | - python2 30 | - the docutils module (see http://docutils.sourceforge.net/) 31 | - a LaTeX distribution to invoke 'pdflatex' (MikTeX, TeXLive, teTeX, ...) -------------------------------------------------------------------------------- /src/main/java/tigase/stats/StatisticsContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.stats; 24 | 25 | import tigase.server.ServerComponent; 26 | 27 | /** 28 | * Interface StatisticsContainer 29 | * 30 | * Objects which inherits this type can return runtime statistics. Any object 31 | * can collect job statistics and implementing this interface guarantees that 32 | * statistics will be presented in configured way to user who wants to see them. 33 | * 34 | * Created: Tue Nov 22 07:07:11 2005 35 | * 36 | * @author Artur Hefczyc 37 | * @version $Rev$ 38 | */ 39 | public interface StatisticsContainer extends ServerComponent { 40 | 41 | public void getStatistics(StatisticsList list); 42 | 43 | } -------------------------------------------------------------------------------- /src/main/java/tigase/stats/StatisticsArchivizerIfc.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Tigase Jabber/XMPP Server 4 | * Copyright (C) 2004-2012 "Artur Hefczyc" 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, version 3 of the License. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. Look for COPYING file in the top folder. 17 | * If not, see http://www.gnu.org/licenses/. 18 | * 19 | * $Rev$ 20 | * Last modified by $Author$ 21 | * $Date$ 22 | */ 23 | package tigase.stats; 24 | 25 | //~--- JDK imports ------------------------------------------------------------ 26 | 27 | import java.util.Map; 28 | 29 | //~--- interfaces ------------------------------------------------------------- 30 | 31 | /** 32 | * Created: Mar 25, 2010 5:10:28 PM 33 | * 34 | * @author Artur Hefczyc 35 | * @version $Rev$ 36 | */ 37 | public interface StatisticsArchivizerIfc { 38 | void execute(StatisticsProvider sp); 39 | 40 | void init(Map archivizerConf); 41 | 42 | void release(); 43 | } 44 | 45 | 46 | //~ Formatted in Sun Code Convention 47 | 48 | 49 | //~ Formatted by Jindent --- http://www.jindent.com 50 | -------------------------------------------------------------------------------- /src/main/java/tigase/xmpp/PacketErrorTypeException.java: -------------------------------------------------------------------------------- 1 | /* Tigase Jabber/XMPP Server 2 | * Copyright (C) 2004-2012 "Artur Hefczyc" 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Affero General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Affero General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Affero General Public License 14 | * along with this program. Look for COPYING file in the top folder. 15 | * If not, see http://www.gnu.org/licenses/. 16 | * 17 | * $Rev$ 18 | * Last modified by $Author$ 19 | * $Date$ 20 | */ 21 | package tigase.xmpp; 22 | 23 | /** 24 | * Describe class PacketErrorTypeException here. 25 | * 26 | * 27 | * Created: Tue Oct 9 13:41:43 2007 28 | * 29 | * @author Artur Hefczyc 30 | * @version $Rev$ 31 | */ 32 | public class PacketErrorTypeException extends XMPPException { 33 | 34 | private static final long serialVersionUID = 1L; 35 | 36 | /** 37 | * Creates a new PacketErrorTypeException instance. 38 | * 39 | */ 40 | public PacketErrorTypeException(String message) { super(message); } 41 | 42 | public PacketErrorTypeException(String message, Throwable cause) { 43 | super(message, cause); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/groovy/tigase/admin/example_Tigase scripting guide.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2008 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev: $ 19 | * Last modified by $Author: $ 20 | * $Date: $ 21 | */ 22 | 23 | /* 24 | 25 | This is an example script for Tigase scripting support. 26 | 27 | AS:Description: [example] Tigase scripting guide 28 | AS:CommandId: groovy-example 29 | AS:Component: sess-man 30 | */ 31 | 32 | package tigase.admin 33 | 34 | import tigase.server.Command 35 | import tigase.server.Packet 36 | 37 | Packet p = (Packet)packet 38 | num1 = Command.getFieldValue(p, "num1") 39 | num2 = Command.getFieldValue(p, "num2") 40 | 41 | if (num1 == null || num2 == null) { 42 | Packet res = Packet.commandResultForm(p) 43 | Command.addTextField(res, "Note", "This is Groovy script!") 44 | Command.addFieldValue(res, "num1", "") 45 | Command.addFieldValue(res, "num2", "") 46 | return res 47 | } 48 | 49 | return num1 + num2 50 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/ServiceChecker.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.server; 24 | 25 | //~--- non-JDK imports -------------------------------------------------------- 26 | 27 | import tigase.xmpp.XMPPIOService; 28 | 29 | //~--- interfaces ------------------------------------------------------------- 30 | 31 | /** 32 | * Describe interface ServiceChecker here. 33 | * 34 | * 35 | * Created: Sat Jun 21 22:45:52 2008 36 | * 37 | * @param 38 | * @author Artur Hefczyc 39 | * @version $Rev$ 40 | */ 41 | public interface ServiceChecker> { 42 | void check(IO service); 43 | } 44 | 45 | 46 | //~ Formatted in Sun Code Convention 47 | 48 | 49 | //~ Formatted by Jindent --- http://www.jindent.com 50 | -------------------------------------------------------------------------------- /scripts/db-create-postgresql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo -e "\n\nusage: db-create-mysql.sh tigase_username tigase_password database_name database_host \n\n" 4 | 5 | if [ "${1}" = "-y" ] ; then 6 | NONINTERACTIVE=yes 7 | shift 8 | fi 9 | 10 | if [ -z "${1}" ] ; then 11 | echo "No username given. Using: tigase_user" 12 | USR_NAME=tigase_user 13 | else 14 | USR_NAME="${1}" 15 | fi 16 | 17 | if [ -z "${2}" ] ; then 18 | echo "No password given. Using: tigase_passwd" 19 | USR_PASS=tigase_passwd 20 | else 21 | USR_PASS="${2}" 22 | fi 23 | 24 | if [ -z "${3}" ] ; then 25 | echo "No DB name given. Using: tigasedb" 26 | DB_NAME=tigasedb 27 | else 28 | DB_NAME="${3}" 29 | fi 30 | 31 | 32 | if [ -z "${4}" ] ; then 33 | echo "No DB hostname given. Using: localhost" 34 | DB_HOST=localhost 35 | else 36 | DB_HOST="${4}" 37 | fi 38 | 39 | 40 | if [ -z "$NONINTERACTIVE" ] ; then 41 | echo "" 42 | echo "creating ${DB_NAME} database for user ${USR_NAME} identified by ${USR_PASS} password:" 43 | echo "" 44 | 45 | read -p "Press [Enter] key to start, otherwise abort..." 46 | else 47 | echo "User: $USR_NAME, Pass: $USR_PASS, Db: $DB_NAME, Host: $DB_HOST" 48 | fi 49 | 50 | echo "Creating user" 51 | createuser -d -S -R -h $DB_HOST -U postgres ${USR_NAME} 52 | echo "Creating database" 53 | createdb -h $DB_HOST -U ${USR_NAME} ${DB_NAME} 54 | echo "Loading DB schema" 55 | psql -h $DB_HOST -q -U ${USR_NAME} -d $DB_NAME -f database/postgresql-schema-5-1.sql 56 | 57 | echo -e "\n\n\nconfiguration:\n\n--user-db=pgsql\n--user-db-uri=jdbc:postgresql://$DB_HOST/$DB_NAME?user=$USR_NAME&password=$USR_PASS&useUnicode=true&characterEncoding=UTF-8&autoCreateUser=true\n\n" 58 | -------------------------------------------------------------------------------- /src/main/java/tigase/db/AuthorizationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.db; 23 | 24 | /** 25 | * Describe class AuthorizationException here. 26 | * 27 | * 28 | * Created: Fri Nov 10 18:07:21 2006 29 | * 30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public class AuthorizationException extends Exception { 34 | 35 | private static final long serialVersionUID = 1L; 36 | 37 | /** 38 | * Creates a new AuthorizationException instance. 39 | * 40 | */ 41 | public AuthorizationException() { super(); } 42 | 43 | public AuthorizationException(String message) { super(message); } 44 | 45 | public AuthorizationException(String message, Throwable cause) { 46 | super(message, cause); 47 | } 48 | 49 | } // AuthorizationException -------------------------------------------------------------------------------- /win-stuff/scripts/Tigase.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | 4 | 5 | rem ******************************************* 6 | rem Java Service Wrapper general startup script 7 | rem ******************************************* 8 | 9 | rem 10 | rem Resolve the real path of the wrapper.exe 11 | rem For non NT systems, the _REALPATH and _WRAPPER_CONF values 12 | rem can be hard-coded below and the following test removed. 13 | rem 14 | if "%OS%"=="Windows_NT" goto nt 15 | echo This script only works with NT-based versions of Windows. 16 | goto :eof 17 | 18 | :nt 19 | rem 20 | rem Find the application home. 21 | rem 22 | rem %~dp0 is location of current script under NT 23 | set _REALPATH=%~dp0 24 | 25 | rem Decide on the wrapper binary. 26 | set _WRAPPER_BASE=wrapper 27 | set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe 28 | if exist "%_WRAPPER_EXE%" goto conf 29 | set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe 30 | if exist "%_WRAPPER_EXE%" goto conf 31 | set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe 32 | if exist "%_WRAPPER_EXE%" goto conf 33 | echo Unable to locate a Wrapper executable using any of the following names: 34 | echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe 35 | echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe 36 | echo %_REALPATH%%_WRAPPER_BASE%.exe 37 | pause 38 | goto :eof 39 | 40 | rem 41 | rem Find the wrapper.conf 42 | rem 43 | :conf 44 | set _WRAPPER_CONF="%~f1" 45 | if not %_WRAPPER_CONF%=="" goto startup 46 | set _WRAPPER_CONF="%_REALPATH%wrapper.conf" 47 | 48 | rem 49 | rem Start the Wrapper 50 | rem 51 | :startup 52 | "%_WRAPPER_EXE%" -c %_WRAPPER_CONF% 53 | if not errorlevel 1 goto :eof 54 | pause 55 | 56 | -------------------------------------------------------------------------------- /src/main/groovy/tigase/admin/ListServiceKeys.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev: $ 19 | * Last modified by $Author: $ 20 | * $Date: $ 21 | */ 22 | 23 | /* 24 | 25 | List all keys for active IOServices from the connection manager. 26 | 27 | AS:Description: List Service Keys 28 | AS:CommandId: service-keys 29 | AS:Component: cl-comp 30 | */ 31 | 32 | package tigase.admin 33 | 34 | import tigase.server.* 35 | import tigase.server.xmppserver.* 36 | 37 | Map services = (Map)servicesMap 38 | 39 | def p = (Packet)packet 40 | def admins = (Set)adminsSet 41 | def stanzaFromBare = p.getStanzaFrom().getBareJID() 42 | def isServiceAdmin = admins.contains(stanzaFromBare) 43 | 44 | if (!isServiceAdmin) { 45 | def result = p.commandResult(Command.DataType.result); 46 | Command.addTextField(result, "Error", "You are not service administrator"); 47 | return result 48 | } 49 | 50 | return services.keySet().toString() 51 | -------------------------------------------------------------------------------- /src/main/java/tigase/auth/ResourceConnectionCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.auth; 23 | 24 | import javax.security.auth.callback.Callback; 25 | import tigase.xmpp.XMPPResourceConnection; 26 | 27 | /** 28 | * Describe class ResourceConnectionCallback here. 29 | * 30 | * 31 | * Created: Sat Feb 18 14:13:34 2006 32 | * 33 | * @author Artur Hefczyc 34 | * @version $Rev$ 35 | */ 36 | public class ResourceConnectionCallback implements Callback { 37 | 38 | private XMPPResourceConnection connection = null; 39 | 40 | public void setResourceConnection(final XMPPResourceConnection connection) { 41 | this.connection = connection; 42 | } 43 | 44 | public XMPPResourceConnection getResourceConnection() { 45 | return connection; 46 | } 47 | 48 | } // ResourceConnectionCallback -------------------------------------------------------------------------------- /scripts/user_roster.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## 3 | ## Tigase Jabber/XMPP Server 4 | ## Copyright (C) 2004-2012 "Artur Hefczyc" 5 | ## 6 | ## This program is free software: you can redistribute it and/or modify 7 | ## it under the terms of the GNU Affero General Public License as published by 8 | ## the Free Software Foundation, either version 3 of the License. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU Affero General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU Affero General Public License 16 | ## along with this program. Look for COPYING file in the top folder. 17 | ## If not, see http://www.gnu.org/licenses/. 18 | ## 19 | ## $Rev: $ 20 | ## Last modified by $Author: $ 21 | ## $Date: $ 22 | ## 23 | 24 | CP="jars/tigase-server.jar:libs/jdbc-mysql.jar:libs/tigase-xmltools.jar:libs/tigase-utils.jar" 25 | 26 | D="-server -Xms100M -Xmx1500M -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver" 27 | 28 | XML_REP="-sc tigase.db.xml.XMLRepository -su ../testsuite/user-repository.xml_200k_backup" 29 | D_MYSQL_REP="-dc tigase.db.jdbc.JDBCRepository -du jdbc:mysql://localhost/tigasetest200k?user=root&password=mypass" 30 | S_MYSQL_REP="-sc tigase.db.jdbc.JDBCRepository -su jdbc:mysql://localhost/tigasetest?user=root&password=mypass" 31 | S_PGSQL_REP="-sc tigase.db.jdbc.JDBCRepository -su jdbc:postgresql://localhost/tigase?user=tigase" 32 | 33 | java $D -cp $CP tigase.util.RepositoryUtils $S_MYSQL_REP -u "$1" -pr 34 | -------------------------------------------------------------------------------- /src/main/java/tigase/xmpp/XMPPException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.xmpp; 23 | 24 | /** 25 | * Base exception type used for other eceptions defined for XMPP 26 | * protocol. This type and all descendants are thrown by this package runtime. 27 | * 28 | *

29 | * Created: Sat Oct 30 08:38:18 2004 30 | *

31 | * @author Artur Hefczyc 32 | * @version $Rev$ 33 | */ 34 | public class XMPPException extends Exception { 35 | 36 | private static final long serialVersionUID = 1L; 37 | 38 | public XMPPException() { super(); } 39 | public XMPPException(String message) { super(message); } 40 | public XMPPException(String message, Throwable cause) { 41 | super(message, cause); 42 | } 43 | public XMPPException(Throwable cause) { super(cause); } 44 | 45 | } // XMPPException -------------------------------------------------------------------------------- /src/main/java/tigase/server/xmppserver/S2SConnectionSelector.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Tigase Jabber/XMPP Server 4 | * Copyright (C) 2004-2012 "Artur Hefczyc" 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, version 3 of the License. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. Look for COPYING file in the top folder. 17 | * If not, see http://www.gnu.org/licenses/. 18 | * 19 | * $Rev$ 20 | * Last modified by $Author$ 21 | * $Date$ 22 | */ 23 | package tigase.server.xmppserver; 24 | 25 | //~--- non-JDK imports -------------------------------------------------------- 26 | 27 | import tigase.server.Packet; 28 | 29 | //~--- JDK imports ------------------------------------------------------------ 30 | 31 | import java.util.Set; 32 | 33 | //~--- interfaces ------------------------------------------------------------- 34 | 35 | /** 36 | * Created: Jun 26, 2010 9:38:19 AM 37 | * 38 | * @author Artur Hefczyc 39 | * @version $Rev$ 40 | */ 41 | public interface S2SConnectionSelector { 42 | S2SConnection selectConnection(Packet packet, Set outgoing); 43 | } 44 | 45 | 46 | //~ Formatted in Sun Code Convention 47 | 48 | 49 | //~ Formatted by Jindent --- http://www.jindent.com 50 | -------------------------------------------------------------------------------- /src/main/java/tigase/conf/ConfigurationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.conf; 24 | 25 | import java.io.IOException; 26 | 27 | /** 28 | * 29 | * @author kobit 30 | */ 31 | public class ConfigurationException extends IOException { 32 | 33 | private static final long serialVersionUID = 1L; 34 | 35 | /** 36 | * Creates a new instance of ConfigurationException without detail message. 37 | */ 38 | public ConfigurationException() { 39 | super(); 40 | } 41 | 42 | 43 | /** 44 | * Constructs an instance of ConfigurationException with the specified detail message. 45 | * @param msg the detail message. 46 | */ 47 | public ConfigurationException(String msg) { 48 | super(msg); 49 | } 50 | 51 | ConfigurationException(String string, Exception e) { 52 | super(string, e); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /database/postgresql-schema-5-1-sp.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | 22 | -- Database stored procedures and fucntions for Tigase schema version 5.1 23 | 24 | -- QUERY START: 25 | \i database/postgresql-schema-4-sp.sql 26 | -- QUERY END: 27 | 28 | -- QUERY START: 29 | create or replace function TigUpdatePairs(bigint, bigint, varchar(255), text) returns void as ' 30 | declare 31 | _nid alias for $1; 32 | _uid alias for $2; 33 | _tkey alias for $3; 34 | _tval alias for $4; 35 | begin 36 | if exists(select 1 from tig_pairs where nid = _nid and uid = _uid and pkey = _tkey) 37 | then 38 | update tig_pairs set pval = _tval where nid = _nid and uid = _uid and pkey = _tkey; 39 | else 40 | insert into tig_pairs (nid, uid, pkey, pval) values (_nid, _uid, _tkey, _tval); 41 | end if; 42 | return; 43 | end; 44 | ' LANGUAGE 'plpgsql'; 45 | -- QUERY END: -------------------------------------------------------------------------------- /src/main/java/tigase/server/amp/ActionResultsHandlerIfc.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Tigase Jabber/XMPP Server 4 | * Copyright (C) 2004-2012 "Artur Hefczyc" 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Affero General Public License as published by 8 | * the Free Software Foundation, version 3 of the License. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Affero General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Affero General Public License 16 | * along with this program. Look for COPYING file in the top folder. 17 | * If not, see http://www.gnu.org/licenses/. 18 | * 19 | * $Rev$ 20 | * Last modified by $Author$ 21 | * $Date$ 22 | */ 23 | package tigase.server.amp; 24 | 25 | //~--- non-JDK imports -------------------------------------------------------- 26 | 27 | import tigase.server.Packet; 28 | 29 | //~--- JDK imports ------------------------------------------------------------ 30 | 31 | import java.util.Queue; 32 | 33 | //~--- interfaces ------------------------------------------------------------- 34 | 35 | /** 36 | * Created: May 1, 2010 3:26:50 PM 37 | * 38 | * @author Artur Hefczyc 39 | * @version $Rev$ 40 | */ 41 | public interface ActionResultsHandlerIfc { 42 | boolean addOutPacket(Packet packet); 43 | 44 | boolean addOutPackets(Queue packets); 45 | } 46 | 47 | 48 | //~ Formatted in Sun Code Convention 49 | 50 | 51 | //~ Formatted by Jindent --- http://www.jindent.com 52 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/bosh/BoshSessionTaskHandler.java: -------------------------------------------------------------------------------- 1 | /* Tigase Jabber/XMPP Server 2 | * Copyright (C) 2004-2012 "Artur Hefczyc" 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU Affero General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU Affero General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU Affero General Public License 14 | * along with this program. Look for COPYING file in the top folder. 15 | * If not, see http://www.gnu.org/licenses/. 16 | * 17 | * $Rev$ 18 | * Last modified by $Author$ 19 | * $Date$ 20 | */ 21 | package tigase.server.bosh; 22 | 23 | import java.util.TimerTask; 24 | import tigase.server.Packet; 25 | import tigase.xmpp.BareJID; 26 | 27 | /** 28 | * Describe interface BoshSessionTaskHandler here. 29 | * 30 | * 31 | * Created: Sat Aug 4 10:39:21 2007 32 | * 33 | * @author Artur Hefczyc 34 | * @version $Rev$ 35 | */ 36 | public interface BoshSessionTaskHandler { 37 | 38 | TimerTask scheduleTask(BoshSession bs, long delay); 39 | 40 | void cancelTask(TimerTask bs); 41 | 42 | void writeRawData(BoshIOService ios, String data); 43 | 44 | boolean addOutStreamOpen(Packet packet, BoshSession bs); 45 | 46 | boolean addOutStreamClosed(Packet packet, BoshSession bs); 47 | 48 | BareJID getSeeOtherHostForJID(BareJID userId); 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/ext/CompConfigRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.server.ext; 24 | 25 | import tigase.db.comp.ConfigRepository; 26 | 27 | /** 28 | * Created: Oct 3, 2009 2:00:30 PM 29 | * 30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public class CompConfigRepository extends ConfigRepository { 34 | 35 | @Override 36 | public String[] getDefaultPropetyItems() { 37 | return CompRepoDefaults.getDefaultPropetyItems(); 38 | } 39 | 40 | @Override 41 | public String getPropertyKey() { 42 | return CompRepoDefaults.getPropertyKey(); 43 | } 44 | 45 | @Override 46 | public String getConfigKey() { 47 | return CompRepoDefaults.getConfigKey(); 48 | } 49 | 50 | @Override 51 | public CompRepoItem getItemInstance() { 52 | return CompRepoDefaults.getItemInstance(); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/sreceiver/StanzaReceiverIfc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.server.sreceiver; 24 | 25 | //~--- non-JDK imports -------------------------------------------------------- 26 | 27 | import tigase.server.Packet; 28 | 29 | import tigase.xmpp.BareJID; 30 | 31 | //~--- interfaces ------------------------------------------------------------- 32 | 33 | /** 34 | * Created: Dec 6, 2008 8:03:35 PM 35 | * 36 | * @author Artur Hefczyc 37 | * @version $Rev$ 38 | */ 39 | public interface StanzaReceiverIfc { 40 | boolean addOutPacket(Packet packet); 41 | 42 | //~--- get methods ---------------------------------------------------------- 43 | 44 | BareJID getDefHostName(); 45 | 46 | String getName(); 47 | } 48 | 49 | 50 | //~ Formatted in Sun Code Convention 51 | 52 | 53 | //~ Formatted by Jindent --- http://www.jindent.com 54 | -------------------------------------------------------------------------------- /src/main/java/tigase/vhosts/VhostConfigRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.vhosts; 24 | 25 | 26 | import tigase.db.comp.ConfigRepository; 27 | 28 | /** 29 | * Created: Nov 27, 2008 1:53:58 PM 30 | * 31 | * @author Artur Hefczyc 32 | * @version $Rev$ 33 | */ 34 | public class VhostConfigRepository extends ConfigRepository { 35 | 36 | 37 | @Override 38 | public String[] getDefaultPropetyItems() { 39 | return VHostRepoDefaults.getDefaultPropetyItems(); 40 | } 41 | 42 | @Override 43 | public String getPropertyKey() { 44 | return VHostRepoDefaults.getPropertyKey(); 45 | } 46 | 47 | @Override 48 | public String getConfigKey() { 49 | return VHostRepoDefaults.getConfigKey(); 50 | } 51 | 52 | @Override 53 | public VHostItem getItemInstance() { 54 | return VHostRepoDefaults.getItemInstance(); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/tigase/cluster/api/ClusterCommandException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev: 2411 $ 19 | * Last modified by $Author: kobit $ 20 | * $Date: 2010-10-27 20:27:58 -0600 (Wed, 27 Oct 2010) $ 21 | * 22 | */ 23 | package tigase.cluster.api; 24 | 25 | /** 26 | * @author Artur Hefczyc 27 | * Created Mar 16, 2011 28 | */ 29 | public class ClusterCommandException extends Exception { 30 | 31 | /** 32 | * 33 | */ 34 | private static final long serialVersionUID = 1L; 35 | 36 | /** 37 | * 38 | */ 39 | public ClusterCommandException() { 40 | super(); 41 | } 42 | 43 | /** 44 | * @param arg0 45 | */ 46 | public ClusterCommandException(String arg0) { 47 | super(arg0); 48 | } 49 | 50 | /** 51 | * @param arg0 52 | */ 53 | public ClusterCommandException(Throwable arg0) { 54 | super(arg0); 55 | } 56 | 57 | /** 58 | * @param arg0 59 | * @param arg1 60 | */ 61 | public ClusterCommandException(String arg0, Throwable arg1) { 62 | super(arg0, arg1); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/sreceiver/NewsDistributor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.server.sreceiver; 23 | 24 | /** 25 | * Simple news distributor task. 26 | * 27 | * Created: Fri May 11 08:53:16 2007 28 | * 29 | * @author Artur Hefczyc 30 | * @version $Rev$ 31 | */ 32 | public class NewsDistributor extends RepoRosterTask { 33 | 34 | private static final String TASK_TYPE = "News Distribution"; 35 | private static final String TASK_HELP = 36 | "The task acts as a newsletter over Jabber/XMPP protocol." 37 | + " Users can subscribe to the news just by adding task JID" 38 | + " to their roster, unsubscribing is equally simple - remove" 39 | + " JID from roster to stop receiving news."; 40 | 41 | public String getType() { 42 | return TASK_TYPE; 43 | } 44 | 45 | public String getHelp() { 46 | return TASK_HELP; 47 | } 48 | 49 | } // NewsDistributor -------------------------------------------------------------------------------- /src/main/java/tigase/server/ext/lb/ReceiverBareJidLB.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev: 2411 $ 19 | * Last modified by $Author: kobit $ 20 | * $Date: 2010-10-27 20:27:58 -0600 (Wed, 27 Oct 2010) $ 21 | * 22 | */ 23 | package tigase.server.ext.lb; 24 | 25 | import java.util.ArrayList; 26 | 27 | import tigase.server.Packet; 28 | import tigase.server.ext.ComponentConnection; 29 | import tigase.server.ext.ComponentIOService; 30 | 31 | /** 32 | * @author Artur Hefczyc Created Jul 9, 2011 33 | */ 34 | public class ReceiverBareJidLB implements LoadBalancerIfc { 35 | 36 | public ComponentIOService selectConnection(Packet p, 37 | ArrayList conns) { 38 | ComponentIOService result = null; 39 | int idx = Math.abs(p.getStanzaTo().getBareJID().hashCode() % conns.size()); 40 | ComponentConnection conn = conns.get(idx); 41 | if (conn.getService() != null && conn.getService().isConnected()) { 42 | result = conn.getService(); 43 | } 44 | return result; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/groovy/tigase/admin/example_HelloWorld.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev: $ 19 | * Last modified by $Author: $ 20 | * $Date: $ 21 | */ 22 | 23 | /* 24 | Example Hello World admin script for the script development guide. 25 | 26 | AS:Description: [example] Hello World Script. 27 | AS:CommandId: hello 28 | AS:Component: sess-man 29 | */ 30 | 31 | package tigase.admin 32 | 33 | import tigase.server.* 34 | 35 | def p = (Packet)packet 36 | 37 | def name = Command.getFieldValue(packet, "name") 38 | 39 | if (name == null) { 40 | def res = p.commandResult(Command.DataType.form) 41 | Command.addTitle(res, "Hello World Script") 42 | Command.addInstructions(res, "Please provide some details") 43 | Command.addFieldValue(res, "name", name ?: "", "text-single", 44 | "Your name") 45 | return res 46 | } 47 | 48 | def res = p.commandResult(Command.DataType.result) 49 | Command.addTitle(res, "Hello World Script") 50 | Command.addInstructions(res, "Hello ${name}, how are you?") 51 | 52 | return res 53 | -------------------------------------------------------------------------------- /src/main/java/tigase/net/IOServiceListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.net; 24 | 25 | //~--- JDK imports ------------------------------------------------------------ 26 | 27 | import java.io.IOException; 28 | 29 | //~--- interfaces ------------------------------------------------------------- 30 | 31 | /** 32 | * Describe interface IOServiceListener here. 33 | * 34 | * 35 | * Created: Mon Jan 30 22:37:51 2006 36 | * 37 | * @param 38 | * @author Artur Hefczyc 39 | * @version $Rev$ 40 | */ 41 | public interface IOServiceListener> { 42 | void packetsReady(IO service) throws IOException; 43 | 44 | boolean serviceStopped(IO service); 45 | 46 | void tlsHandshakeCompleted(IO service); 47 | } // IOServiceListener 48 | 49 | 50 | //~ Formatted in Sun Code Convention 51 | 52 | 53 | //~ Formatted by Jindent --- http://www.jindent.com 54 | -------------------------------------------------------------------------------- /database/mysql-schema-5-1-sp.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | -- Database stored procedures and functions for Tigase schema version 5.1 24 | 25 | -- QUERY START: 26 | source database/mysql-schema-4-sp.sql; 27 | -- QUERY END: 28 | 29 | 30 | -- QUERY START: 31 | drop procedure if exists TigUpdatePairs; 32 | -- QUERY END: 33 | 34 | delimiter // 35 | 36 | -- QUERY START: 37 | -- Procedure to efficiently and safely update data in tig_pairs table 38 | create procedure TigUpdatePairs(_nid bigint, _uid bigint, _tkey varchar(255) CHARSET utf8, _tval mediumtext CHARSET utf8) 39 | begin 40 | if exists(SELECT 1 FROM tig_pairs WHERE nid = _nid AND uid = _uid AND pkey = _tkey) 41 | then 42 | UPDATE tig_pairs SET pval = _tval WHERE nid = _nid AND uid = _uid AND pkey = _tkey; 43 | ELSE 44 | INSERT INTO tig_pairs (nid, uid, pkey, pval) VALUES (_nid, _uid, _tkey, _tval); 45 | END IF; 46 | end // 47 | -- QUERY END: 48 | 49 | delimiter ; 50 | -------------------------------------------------------------------------------- /database/postgresql-schema-upgrade-to-5-1.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | 22 | 23 | select NOW(), ' - Installing missing stored procedures'; 24 | 25 | -- QUERY START: 26 | create or replace function TigUpdatePairs(bigint, bigint, varchar(255), text) returns void as ' 27 | declare 28 | _nid alias for $1; 29 | _uid alias for $2; 30 | _tkey alias for $3; 31 | _tval alias for $4; 32 | begin 33 | if exists(select 1 from tig_pairs where nid = _nid and uid = _uid and pkey = _tkey) 34 | then 35 | update tig_pairs set pval = _tval where nid = _nid and uid = _uid and pkey = _tkey; 36 | else 37 | insert into tig_pairs (nid, uid, pkey, pval) values (_nid, _uid, _tkey, _tval); 38 | end if; 39 | return; 40 | end; 41 | ' LANGUAGE 'plpgsql'; 42 | -- QUERY END: 43 | 44 | 45 | -- QUERY START: 46 | select TigPutDBProperty('schema-version', '5.1'); 47 | -- QUERY END: 48 | 49 | select NOW(), ' - All done, database ver 5.1 ready to use!'; -------------------------------------------------------------------------------- /src/main/groovy/tigase/converter/Feeder.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009 "Tomasz Sterna" 3 | * License: (either of) 4 | * a. Creative Commons Attribution-Share Alike 3.0 Unported 5 | * http://creativecommons.org/licenses/by-sa/3.0/ 6 | * b. GNU Lesser General Public License v3 7 | * http://www.gnu.org/licenses/lgpl-3.0.html 8 | */ 9 | import groovy.sql.Sql 10 | import tigase.util.* 11 | 12 | def sql 13 | def sourceSQL = [:] 14 | 15 | def Feeder(jdbc) { 16 | println "INFO: Source database connection: $jdbc" 17 | sql = Sql.newInstance(jdbc) 18 | sql.execute(sourceSQL["PRE"]) 19 | } 20 | 21 | def eachUser(DOMAIN, closure) { 22 | sql.eachRow(sourceSQL["users"], [DOMAIN], { 23 | def JID = JIDUtils.getNodeID(it.jid) 24 | print "$JID -- " 25 | closure(it.jid, JID, it.password, it.email) 26 | println "--" 27 | }) 28 | } 29 | 30 | def eachRoster(UID, closure) { 31 | sql.eachRow(sourceSQL["rosteritems"], [UID], { 32 | closure(it.jid, it.name, getRosterGroups(UID, it.jid), it.s10n) 33 | }) 34 | } 35 | 36 | def getRosterGroups(UID, ITEM) { 37 | return sql.rows(sourceSQL["rostergroups"], [UID, ITEM]).collect{it.group} 38 | } 39 | 40 | def eachVcard(UID, closure) { 41 | def vcard = sql.firstRow(sourceSQL["vCard"], [UID]) 42 | if(vcard != null) { 43 | closure(vcard.vcard) 44 | } 45 | } 46 | 47 | def eachPrivacy(UID, closure) { 48 | sql.eachRow(sourceSQL["privacylists"], [UID], { 49 | closure(it.name, it.list) 50 | }) 51 | } 52 | 53 | def setPrivacyDefault(UID, closure) { 54 | def prdef = sql.firstRow(sourceSQL["privacydefault"], [UID]) 55 | if (prdef != null) closure(prdef.name) 56 | } 57 | 58 | def eachPrivate(UID, closure) { 59 | sql.eachRow(sourceSQL["privatestorage"], [UID], { 60 | closure(it.ns, it.xml) 61 | }) 62 | } 63 | 64 | def Finish() { 65 | sql.execute(sourceSQL["POST"]) 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/tigase/server/ComponentRegistrator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.server; 24 | 25 | /** 26 | * Interface ComponentRegistrator 27 | * 28 | * Collects information about all ServerComponents connected to MessageRouter 29 | * 30 | * Created: Tue Nov 22 07:07:11 2005 31 | * 32 | * @author Artur Hefczyc 33 | * @version $Rev$ 34 | */ 35 | public interface ComponentRegistrator extends ServerComponent { 36 | 37 | /** 38 | * 39 | * @param component 40 | * @return a boolean value indicating whehether component has 41 | * been successfuly added or not. 42 | */ 43 | boolean addComponent(ServerComponent component); 44 | 45 | /** 46 | * 47 | * @param component 48 | * @return a boolean value indicating whehether component has 49 | * been successfuly removed or not. 50 | */ 51 | boolean deleteComponent(ServerComponent component); 52 | 53 | } -------------------------------------------------------------------------------- /src/main/java/tigase/xmpp/XMPPPacketFilterIfc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.xmpp; 24 | 25 | //~--- non-JDK imports -------------------------------------------------------- 26 | 27 | import tigase.db.NonAuthUserRepository; 28 | 29 | import tigase.server.Packet; 30 | 31 | //~--- JDK imports ------------------------------------------------------------ 32 | 33 | import java.util.Queue; 34 | 35 | //~--- interfaces ------------------------------------------------------------- 36 | 37 | /** 38 | * Created: Dec 30, 2008 12:53:16 PM 39 | * 40 | * @author Artur Hefczyc 41 | * @version $Rev$ 42 | */ 43 | public interface XMPPPacketFilterIfc extends XMPPImplIfc { 44 | void filter(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, 45 | Queue results); 46 | } 47 | 48 | 49 | //~ Formatted in Sun Code Convention 50 | 51 | 52 | //~ Formatted by Jindent --- http://www.jindent.com 53 | -------------------------------------------------------------------------------- /src/main/java/tigase/util/LogFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev: 2411 $ 19 | * Last modified by $Author: kobit $ 20 | * $Date: 2010-10-27 20:27:58 -0600 (Wed, 27 Oct 2010) $ 21 | * 22 | */ 23 | package tigase.util; 24 | 25 | import java.util.logging.Filter; 26 | import java.util.logging.LogRecord; 27 | 28 | /** 29 | * @author kobit Created Dec 20, 2011 30 | */ 31 | public class LogFilter implements Filter { 32 | 33 | private String[] trackers = null; 34 | private String id = null; 35 | 36 | public LogFilter(String id, String ... trackers) { 37 | this.id = id; 38 | this.trackers = trackers; 39 | } 40 | 41 | public String getId() { 42 | return id; 43 | } 44 | 45 | @Override 46 | public boolean isLoggable(LogRecord record) { 47 | boolean matchTracker = false; 48 | String msg = record.getMessage(); 49 | if (msg != null) { 50 | int i = 0; 51 | while (!matchTracker && i < trackers.length) { 52 | matchTracker = msg.contains(trackers[i++]); 53 | } 54 | } 55 | return matchTracker; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/tigase/xmpp/NotAuthorizedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.xmpp; 23 | 24 | /** 25 | * This exception is usually trown when there is kind of access violation error. 26 | * If some code try to access data to which it doesn't have permission to or if 27 | * try to access data before successful authorization process. 28 | * 29 | *

30 | * Created: Sat Oct 30 08:44:37 2004 31 | *

32 | * @author Artur Hefczyc 33 | * @version $Rev$ 34 | */ 35 | public class NotAuthorizedException extends XMPPException { 36 | 37 | private static final long serialVersionUID = 1L; 38 | 39 | /** 40 | * Creates a new NotAuthorizedException instance. 41 | * 42 | */ 43 | public NotAuthorizedException(String message) { super(message); } 44 | 45 | public NotAuthorizedException(String message, Throwable cause) { 46 | super(message, cause); 47 | } 48 | 49 | } // NotAuthorizedException -------------------------------------------------------------------------------- /src/main/java/tigase/db/UserNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.db; 23 | 24 | /** 25 | * The UserNotFoundException exception is thrown when application 26 | * tries to access data for user which does not exist in repository. 27 | *

28 | * Created: Wed Oct 27 14:17:44 2004 29 | *

30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public class UserNotFoundException extends TigaseDBException { 34 | 35 | private static final long serialVersionUID = 1L; 36 | 37 | /** 38 | * Creates a new UserNotFoundException instance. 39 | * 40 | */ 41 | public UserNotFoundException(String message) { super(message); } 42 | 43 | /** 44 | * Creates a new UserNotFoundException instance. 45 | * 46 | */ 47 | public UserNotFoundException(String message, Throwable cause) { 48 | super(message, cause); 49 | } 50 | 51 | } // UserNotFoundException -------------------------------------------------------------------------------- /src/main/java/tigase/db/DataOverwriteException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | package tigase.db; 23 | 24 | /** 25 | * The DataOverwriteException exception is thrown when application 26 | * tries to ovrewrite data in repository but does not have permission to do so. 27 | *

28 | * Created: Wed Oct 27 14:17:44 2004 29 | *

30 | * @author Artur Hefczyc 31 | * @version $Rev$ 32 | */ 33 | public class DataOverwriteException extends TigaseDBException { 34 | 35 | private static final long serialVersionUID = 1L; 36 | 37 | /** 38 | * Creates a new DataOverwriteException instance. 39 | * 40 | */ 41 | public DataOverwriteException(String message) { super(message); } 42 | 43 | /** 44 | * Creates a new DataOverwriteException instance. 45 | * 46 | */ 47 | public DataOverwriteException(String message, Throwable cause) { 48 | super(message, cause); 49 | } 50 | 51 | } // DataOverwriteException -------------------------------------------------------------------------------- /src/main/java/tigase/util/IntHistoryCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.util; 24 | 25 | /** 26 | * Created: Sep 8, 2009 7:39:27 PM 27 | * 28 | * @author Artur Hefczyc 29 | * @version $Rev$ 30 | */ 31 | public class IntHistoryCache { 32 | 33 | private int[] buffer = null; 34 | private int start = 0; 35 | private int count = 0; 36 | 37 | public IntHistoryCache(int limit) { 38 | buffer = new int[limit]; 39 | } 40 | 41 | public synchronized void addItem(int item) { 42 | int ix = (start + count) % buffer.length; 43 | buffer[ix] = item; 44 | if (count < buffer.length) { 45 | count++; 46 | } else { 47 | start++; 48 | start %= buffer.length; 49 | } 50 | } 51 | 52 | public synchronized int[] getCurrentHistory() { 53 | int[] result = new int[count]; 54 | for (int i = 0; i < count; i++) { 55 | int ix = (start + i) % buffer.length; 56 | result[i] = buffer[ix]; 57 | } 58 | return result; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/tigase/xmpp/XMPPStopListenerIfc.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.xmpp; 24 | 25 | //~--- non-JDK imports -------------------------------------------------------- 26 | 27 | import tigase.server.Packet; 28 | 29 | //~--- JDK imports ------------------------------------------------------------ 30 | 31 | import java.util.Map; 32 | import java.util.Queue; 33 | 34 | //~--- interfaces ------------------------------------------------------------- 35 | 36 | /** 37 | * Describe interface XMPPStopListener here. 38 | * 39 | * 40 | * Created: Sat Oct 14 16:14:18 2006 41 | * 42 | * @author Artur Hefczyc 43 | * @version $Rev$ 44 | */ 45 | public interface XMPPStopListenerIfc extends XMPPImplIfc { 46 | void stopped(XMPPResourceConnection session, Queue results, Map settings); 47 | } // XMPPStopListener 48 | 49 | 50 | //~ Formatted in Sun Code Convention 51 | 52 | 53 | //~ Formatted by Jindent --- http://www.jindent.com 54 | -------------------------------------------------------------------------------- /database/mysql-schema-upgrade-to-5-1.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Tigase Jabber/XMPP Server 3 | -- Copyright (C) 2004-2012 "Artur Hefczyc" 4 | -- 5 | -- This program is free software: you can redistribute it and/or modify 6 | -- it under the terms of the GNU Affero General Public License as published by 7 | -- the Free Software Foundation, either version 3 of the License. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU Affero General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU Affero General Public License 15 | -- along with this program. Look for COPYING file in the top folder. 16 | -- If not, see http://www.gnu.org/licenses/. 17 | -- 18 | -- $Rev: $ 19 | -- Last modified by $Author: $ 20 | -- $Date: $ 21 | -- 22 | 23 | select NOW(), ' - Installing missing stored procedures'; 24 | 25 | -- QUERY START: 26 | drop procedure if exists TigUpdatePairs; 27 | -- QUERY END: 28 | 29 | delimiter // 30 | 31 | -- QUERY START: 32 | -- Procedure to efficiently and safely update data in tig_pairs table 33 | create procedure TigUpdatePairs(_nid bigint, _uid bigint, _tkey varchar(255) CHARSET utf8, _tval mediumtext CHARSET utf8) 34 | begin 35 | if exists(SELECT 1 FROM tig_pairs WHERE nid = _nid AND uid = _uid AND pkey = _tkey) 36 | then 37 | UPDATE tig_pairs SET pval = _tval WHERE nid = _nid AND uid = _uid AND pkey = _tkey; 38 | ELSE 39 | INSERT INTO tig_pairs (nid, uid, pkey, pval) VALUES (_nid, _uid, _tkey, _tval); 40 | END IF; 41 | end // 42 | -- QUERY END: 43 | 44 | delimiter ; 45 | 46 | 47 | -- QUERY START: 48 | call TigPutDBProperty('schema-version', '5.1'); 49 | -- QUERY END: 50 | 51 | select NOW(), ' - All done, database ver 5.1 ready to use!'; -------------------------------------------------------------------------------- /src/main/java/tigase/util/FloatHistoryCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Tigase Jabber/XMPP Server 3 | * Copyright (C) 2004-2012 "Artur Hefczyc" 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Affero General Public License as published by 7 | * the Free Software Foundation, version 3 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU Affero General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Affero General Public License 15 | * along with this program. Look for COPYING file in the top folder. 16 | * If not, see http://www.gnu.org/licenses/. 17 | * 18 | * $Rev$ 19 | * Last modified by $Author$ 20 | * $Date$ 21 | */ 22 | 23 | package tigase.util; 24 | 25 | /** 26 | * Created: Sep 8, 2009 7:32:09 PM 27 | * 28 | * @author Artur Hefczyc 29 | * @version $Rev$ 30 | */ 31 | public class FloatHistoryCache { 32 | 33 | private float[] buffer = null; 34 | private int start = 0; 35 | private int count = 0; 36 | 37 | public FloatHistoryCache(int limit) { 38 | buffer = new float[limit]; 39 | } 40 | 41 | public synchronized void addItem(float item) { 42 | int ix = (start + count) % buffer.length; 43 | buffer[ix] = item; 44 | if (count < buffer.length) { 45 | count++; 46 | } else { 47 | start++; 48 | start %= buffer.length; 49 | } 50 | } 51 | 52 | public synchronized float[] getCurrentHistory() { 53 | float[] result = new float[count]; 54 | for (int i = 0; i < count; i++) { 55 | int ix = (start + i) % buffer.length; 56 | result[i] = buffer[ix]; 57 | } 58 | return result; 59 | } 60 | 61 | } 62 | --------------------------------------------------------------------------------