Repository: tigase/tigase-server
Branch: master
Commit: 13350beea24c
Files: 1407
Total size: 11.7 MB
Directory structure:
gitextract_qvbqx23a/
├── .github/
│ ├── FUNDING.yml
│ └── ISSUE_TEMPLATE/
│ ├── bug_report.md
│ ├── feature_request.md
│ └── question.md
├── .gitignore
├── .mvn/
│ └── extensions.xml
├── .onedev-buildspec.yml
├── .readthedocs.yaml
├── COPYING
├── License.html
├── README.md
├── etc/
│ ├── bosh-extra-headers.txt
│ ├── client-access-policy.xml
│ ├── config.properties
│ ├── config.tdsl
│ ├── cross-domain-policy.xml
│ ├── init-debian.properties
│ ├── init-mysql.properties
│ ├── jmx.access
│ ├── jmx.password
│ ├── logback.xml
│ ├── snmp.acl
│ └── tigase.conf
├── licenseheader.txt
├── package.html
├── pom.xml
├── prj.el
├── scripts/
│ ├── config.sh
│ ├── db-create.cmd
│ ├── db-create.sh
│ ├── db-derby-connect.sh
│ ├── debian/
│ │ ├── changelog
│ │ ├── compat
│ │ ├── control
│ │ ├── copyright
│ │ ├── init-debian.properties
│ │ ├── rules
│ │ ├── tigase-debian.conf
│ │ ├── tigase-install.sh
│ │ ├── tigase.default
│ │ ├── tigase.dirs
│ │ ├── tigase.init.d
│ │ ├── tigase.postinst
│ │ └── tigase.postrm
│ ├── gentoo/
│ │ ├── conf.d/
│ │ │ └── tigase
│ │ └── init.d/
│ │ └── tigase
│ ├── machine-check.sh
│ ├── mandriva/
│ │ └── init.d/
│ │ └── tigase
│ ├── redhat/
│ │ └── init.d/
│ │ └── tigase
│ ├── repo.sh
│ ├── restart-all-servers.sh
│ ├── stop-all-servers.sh
│ ├── systemd/
│ │ ├── tigase-server
│ │ └── tigase-server.service
│ ├── tigase.sh
│ ├── update-all-servers.sh
│ ├── update-code-functions.sh
│ ├── update-code.sh
│ ├── user_roster.sh
│ └── wait-for-it.sh
├── src/
│ ├── main/
│ │ ├── bash/
│ │ │ ├── cron-dnotify-check.sh
│ │ │ └── users-list-moitor.sh
│ │ ├── database/
│ │ │ ├── derby-common-0.0.1.sql
│ │ │ ├── derby-common-0.0.2.sql
│ │ │ ├── derby-common-0.0.3.sql
│ │ │ ├── derby-counter_data_logger-0.0.1.sql
│ │ │ ├── derby-installer-create-db.sql
│ │ │ ├── derby-installer-post.sql
│ │ │ ├── derby-server-8.0.0-props.sql
│ │ │ ├── derby-server-8.0.0-schema.sql
│ │ │ ├── derby-server-8.0.0-sp.sql
│ │ │ ├── derby-server-8.0.0.sql
│ │ │ ├── derby-server-8.1.0-props.sql
│ │ │ ├── derby-server-8.1.0.sql
│ │ │ ├── derby-server-8.2.0-props.sql
│ │ │ ├── derby-server-8.2.0-schema.sql
│ │ │ ├── derby-server-8.2.0-sp.sql
│ │ │ ├── derby-server-8.2.0.sql
│ │ │ ├── derby-server-8.3.0-props.sql
│ │ │ ├── derby-server-8.3.0-schema.sql
│ │ │ ├── derby-server-8.3.0-sp.sql
│ │ │ ├── derby-server-8.3.0.sql
│ │ │ ├── derby-server-8.4.0.sql
│ │ │ ├── derby-server-8.5.0.sql
│ │ │ ├── mssql-server-8.5.0.sql
│ │ │ ├── mysql-common-0.0.1.sql
│ │ │ ├── mysql-common-0.0.2.sql
│ │ │ ├── mysql-common-0.0.3.sql
│ │ │ ├── mysql-counter_data_logger-0.0.1.sql
│ │ │ ├── mysql-installer-create-db.sql
│ │ │ ├── mysql-installer-post.sql
│ │ │ ├── mysql-server-8.0.0-props.sql
│ │ │ ├── mysql-server-8.0.0-schema.sql
│ │ │ ├── mysql-server-8.0.0-sp.sql
│ │ │ ├── mysql-server-8.0.0.sql
│ │ │ ├── mysql-server-8.1.0-props.sql
│ │ │ ├── mysql-server-8.1.0.sql
│ │ │ ├── mysql-server-8.2.0-props.sql
│ │ │ ├── mysql-server-8.2.0-schema.sql
│ │ │ ├── mysql-server-8.2.0-sp.sql
│ │ │ ├── mysql-server-8.2.0.sql
│ │ │ ├── mysql-server-8.3.0-props.sql
│ │ │ ├── mysql-server-8.3.0-schema.sql
│ │ │ ├── mysql-server-8.3.0-sp.sql
│ │ │ ├── mysql-server-8.3.0.sql
│ │ │ ├── mysql-server-8.4.0-props.sql
│ │ │ ├── mysql-server-8.4.0-schema.sql
│ │ │ ├── mysql-server-8.4.0-sp.sql
│ │ │ ├── mysql-server-8.4.0.sql
│ │ │ ├── mysql-server-8.5.0-schema.sql
│ │ │ ├── mysql-server-8.5.0-sp.sql
│ │ │ ├── mysql-server-8.5.0.sql
│ │ │ ├── postgresql-common-0.0.1.sql
│ │ │ ├── postgresql-common-0.0.2.sql
│ │ │ ├── postgresql-common-0.0.3.sql
│ │ │ ├── postgresql-counter_data_logger-0.0.1.sql
│ │ │ ├── postgresql-installer-create-db.sql
│ │ │ ├── postgresql-installer-post.sql
│ │ │ ├── postgresql-server-8.0.0-props.sql
│ │ │ ├── postgresql-server-8.0.0-schema.sql
│ │ │ ├── postgresql-server-8.0.0-sp.sql
│ │ │ ├── postgresql-server-8.0.0.sql
│ │ │ ├── postgresql-server-8.1.0-props.sql
│ │ │ ├── postgresql-server-8.1.0.sql
│ │ │ ├── postgresql-server-8.2.0-props.sql
│ │ │ ├── postgresql-server-8.2.0-schema.sql
│ │ │ ├── postgresql-server-8.2.0-sp.sql
│ │ │ ├── postgresql-server-8.2.0.sql
│ │ │ ├── postgresql-server-8.3.0-props.sql
│ │ │ ├── postgresql-server-8.3.0-schema.sql
│ │ │ ├── postgresql-server-8.3.0-sp.sql
│ │ │ ├── postgresql-server-8.3.0.sql
│ │ │ ├── postgresql-server-8.4.0.sql
│ │ │ ├── postgresql-server-8.5.0-schema.sql
│ │ │ ├── postgresql-server-8.5.0-sp.sql
│ │ │ ├── postgresql-server-8.5.0.sql
│ │ │ ├── sqlserver-common-0.0.1.sql
│ │ │ ├── sqlserver-common-0.0.2.sql
│ │ │ ├── sqlserver-common-0.0.3.sql
│ │ │ ├── sqlserver-counter_data_logger-0.0.1.sql
│ │ │ ├── sqlserver-create_database.sql
│ │ │ ├── sqlserver-installer-create-db.sql
│ │ │ ├── sqlserver-installer-post.sql
│ │ │ ├── sqlserver-server-8.0.0-props.sql
│ │ │ ├── sqlserver-server-8.0.0-schema.sql
│ │ │ ├── sqlserver-server-8.0.0-sp.sql
│ │ │ ├── sqlserver-server-8.0.0.sql
│ │ │ ├── sqlserver-server-8.1.0-props.sql
│ │ │ ├── sqlserver-server-8.1.0.sql
│ │ │ ├── sqlserver-server-8.2.0-props.sql
│ │ │ ├── sqlserver-server-8.2.0-schema.sql
│ │ │ ├── sqlserver-server-8.2.0-sp.sql
│ │ │ ├── sqlserver-server-8.2.0.sql
│ │ │ ├── sqlserver-server-8.3.0-props.sql
│ │ │ ├── sqlserver-server-8.3.0-schema.sql
│ │ │ ├── sqlserver-server-8.3.0-sp.sql
│ │ │ ├── sqlserver-server-8.3.0.sql
│ │ │ ├── sqlserver-server-8.4.0.sql
│ │ │ ├── sqlserver-server-8.5.0-schema.sql
│ │ │ ├── sqlserver-server-8.5.0-sp.sql
│ │ │ └── sqlserver-server-8.5.0.sql
│ │ ├── groovy/
│ │ │ └── tigase/
│ │ │ └── admin/
│ │ │ ├── AddUser.groovy
│ │ │ ├── AddUserTracker.groovy
│ │ │ ├── BoshPreBindSession.groovy
│ │ │ ├── BroadcastToOnline.groovy
│ │ │ ├── ChangeUserPassword.groovy
│ │ │ ├── CompManager.groovy
│ │ │ ├── CompRepoItemAdd.groovy
│ │ │ ├── CompRepoItemRemove.groovy
│ │ │ ├── CompRepoItemUpdate.groovy
│ │ │ ├── CompRepoReload.groovy
│ │ │ ├── ConnectionTime.groovy
│ │ │ ├── DNSQuery.groovy
│ │ │ ├── DeleteMOTD.groovy
│ │ │ ├── DeleteUser.groovy
│ │ │ ├── DeleteWelcomeMessage.groovy
│ │ │ ├── DisableUser.groovy
│ │ │ ├── EditMOTD.groovy
│ │ │ ├── EditUser.groovy
│ │ │ ├── EndUserSession.groovy
│ │ │ ├── ForceStopServiceForKey.groovy
│ │ │ ├── GetAnyFile.groovy
│ │ │ ├── GetConfigFile.groovy
│ │ │ ├── GetConfigTDSLFromMemory.groovy
│ │ │ ├── GetListOfActiveUsers.groovy
│ │ │ ├── GetListOfClusterNodes.groovy
│ │ │ ├── GetListOfIdleUsers.groovy
│ │ │ ├── GetListOfOnlineUsers.groovy
│ │ │ ├── GetNumberOfActiveUsers.groovy
│ │ │ ├── GetNumberOfIdleUsers.groovy
│ │ │ ├── GetRegisteredUserList.groovy
│ │ │ ├── GetTopActiveUsers.groovy
│ │ │ ├── GetUserInfo.groovy
│ │ │ ├── GetUserRoster.groovy
│ │ │ ├── ListCommands.groovy
│ │ │ ├── ListServiceKeys.groovy
│ │ │ ├── LoadErrors.groovy
│ │ │ ├── OAuthCredentials.groovy
│ │ │ ├── PluginManager.groovy
│ │ │ ├── ReEnableUser.groovy
│ │ │ ├── RemoveUserTracker.groovy
│ │ │ ├── RosterFixer.groovy
│ │ │ ├── RosterFixerCluster.groovy
│ │ │ ├── S2SBadConnectionStates.groovy
│ │ │ ├── S2SCIDState.groovy
│ │ │ ├── S2SGetAllConnectionStates.groovy
│ │ │ ├── S2SResetBadConnections.groovy
│ │ │ ├── SSLCertificateAdd.groovy
│ │ │ ├── SetMOTD.groovy
│ │ │ ├── SetWelcomeMessage.groovy
│ │ │ ├── Shutdown.groovy
│ │ │ ├── SimServiceStopped.groovy
│ │ │ ├── UpdateConfig.groovy
│ │ │ ├── UserDomainFilter.groovy
│ │ │ ├── UserRosterManagement.groovy
│ │ │ ├── UserRosterManagementExt.groovy
│ │ │ ├── UserStatistics.groovy
│ │ │ ├── example_HelloWorld.groovy
│ │ │ ├── example_TigaseScriptingGuide.groovy
│ │ │ └── template.html
│ │ ├── java/
│ │ │ └── tigase/
│ │ │ ├── auth/
│ │ │ │ ├── AuthRepositoryAware.java
│ │ │ │ ├── Aware.java
│ │ │ │ ├── BruteForceLockerBean.java
│ │ │ │ ├── CallbackHandlerFactory.java
│ │ │ │ ├── CredentialsDecoderBean.java
│ │ │ │ ├── CredentialsEncoderBean.java
│ │ │ │ ├── DefaultMechanismSelector.java
│ │ │ │ ├── DomainAware.java
│ │ │ │ ├── MechanismNameAware.java
│ │ │ │ ├── MechanismSelector.java
│ │ │ │ ├── NonAuthUserRepositoryAware.java
│ │ │ │ ├── PasswordResetterIfc.java
│ │ │ │ ├── PluginSettingsAware.java
│ │ │ │ ├── SaslInvalidLoginExcepion.java
│ │ │ │ ├── SessionAware.java
│ │ │ │ ├── TigaseSaslProvider.java
│ │ │ │ ├── XmppSaslException.java
│ │ │ │ ├── adhoc/
│ │ │ │ │ ├── AbstractCredentialsCommand.java
│ │ │ │ │ ├── AddUserCredentials.java
│ │ │ │ │ ├── DeleteUserCredentials.java
│ │ │ │ │ └── ShowUserCredentials.java
│ │ │ │ ├── callbacks/
│ │ │ │ │ ├── AuthorizationIdCallback.java
│ │ │ │ │ ├── CallbackHandlerFactoryIfc.java
│ │ │ │ │ ├── ChannelBindingCallback.java
│ │ │ │ │ ├── PBKDIterationsCallback.java
│ │ │ │ │ ├── ReplaceServerKeyCallback.java
│ │ │ │ │ ├── SaltCallback.java
│ │ │ │ │ ├── ServerKeyCallback.java
│ │ │ │ │ ├── SharedSecretKeyCallback.java
│ │ │ │ │ ├── StoredKeyCallback.java
│ │ │ │ │ ├── ValidateCertificateData.java
│ │ │ │ │ ├── VerifyPasswordCallback.java
│ │ │ │ │ └── XMPPSessionCallback.java
│ │ │ │ ├── credentials/
│ │ │ │ │ ├── Credentials.java
│ │ │ │ │ └── entries/
│ │ │ │ │ ├── MD5PasswordCredentialsEntry.java
│ │ │ │ │ ├── MD5UserIdPasswordCredentialsEntry.java
│ │ │ │ │ ├── MD5UsernamePasswordCredentialsEntry.java
│ │ │ │ │ ├── PlainCredentialsEntry.java
│ │ │ │ │ ├── ScramCredentialsEntry.java
│ │ │ │ │ ├── ScramSha1CredentialsEntry.java
│ │ │ │ │ ├── ScramSha256CredentialsEntry.java
│ │ │ │ │ ├── ScramSha512CredentialsEntry.java
│ │ │ │ │ └── XTokenCredentialsEntry.java
│ │ │ │ ├── impl/
│ │ │ │ │ ├── AuthRepoPlainCallbackHandler.java
│ │ │ │ │ ├── CertBasedCallbackHandler.java
│ │ │ │ │ ├── PlainCallbackHandler.java
│ │ │ │ │ ├── PlainSPCallbackHandler.java
│ │ │ │ │ ├── ScramCallbackHandler.java
│ │ │ │ │ └── XTokenCallbackHandler.java
│ │ │ │ └── mechanisms/
│ │ │ │ ├── AbstractSasl.java
│ │ │ │ ├── AbstractSaslSCRAM.java
│ │ │ │ ├── SCRAMHelper.java
│ │ │ │ ├── SaslANONYMOUS.java
│ │ │ │ ├── SaslEXTERNAL.java
│ │ │ │ ├── SaslPLAIN.java
│ │ │ │ ├── SaslSCRAM.java
│ │ │ │ ├── SaslSCRAMPlus.java
│ │ │ │ ├── SaslSCRAMSha256.java
│ │ │ │ ├── SaslSCRAMSha256Plus.java
│ │ │ │ ├── SaslSCRAMSha512.java
│ │ │ │ ├── SaslSCRAMSha512Plus.java
│ │ │ │ ├── SaslXTOKEN.java
│ │ │ │ └── TigaseSaslServerFactory.java
│ │ │ ├── cluster/
│ │ │ │ ├── AmpComponentClustered.java
│ │ │ │ ├── BoshConnectionClustered.java
│ │ │ │ ├── ClientConnectionClustered.java
│ │ │ │ ├── ClusterConnection.java
│ │ │ │ ├── ClusterConnectionManager.java
│ │ │ │ ├── ClusterConnectionSelector.java
│ │ │ │ ├── ClusterConnectionSelectorOld.java
│ │ │ │ ├── ClusterController.java
│ │ │ │ ├── SessionManagerClustered.java
│ │ │ │ ├── VirtualComponent.java
│ │ │ │ ├── WebSocketClientConnectionClustered.java
│ │ │ │ ├── api/
│ │ │ │ │ ├── ClusterCommandException.java
│ │ │ │ │ ├── ClusterConnectionHandler.java
│ │ │ │ │ ├── ClusterConnectionSelectorIfc.java
│ │ │ │ │ ├── ClusterControllerIfc.java
│ │ │ │ │ ├── ClusterElement.java
│ │ │ │ │ ├── ClusteredComponentIfc.java
│ │ │ │ │ ├── CommandListener.java
│ │ │ │ │ ├── CommandListenerAbstract.java
│ │ │ │ │ └── SessionManagerClusteredIfc.java
│ │ │ │ ├── repo/
│ │ │ │ │ ├── ClConConfigRepository.java
│ │ │ │ │ ├── ClConDirRepository.java
│ │ │ │ │ ├── ClConRepoDefaults.java
│ │ │ │ │ ├── ClConSQLRepository.java
│ │ │ │ │ ├── ClusterRepoConstants.java
│ │ │ │ │ ├── ClusterRepoItem.java
│ │ │ │ │ └── ClusterRepoItemEvent.java
│ │ │ │ └── strategy/
│ │ │ │ ├── ClusteringStrategyIfc.java
│ │ │ │ ├── ConnectionRecord.java
│ │ │ │ ├── ConnectionRecordIfc.java
│ │ │ │ ├── DefaultClusteringStrategy.java
│ │ │ │ ├── DefaultClusteringStrategyAbstract.java
│ │ │ │ ├── SMNonCachingAllNodes.java
│ │ │ │ └── cmd/
│ │ │ │ └── PacketForwardCmd.java
│ │ │ ├── component/
│ │ │ │ ├── AbstractComponent.java
│ │ │ │ ├── AbstractKernelBasedComponent.java
│ │ │ │ ├── BackwardCompatibilityHelper.java
│ │ │ │ ├── BindingsKernel.java
│ │ │ │ ├── ComponenScriptCommandProcessor.java
│ │ │ │ ├── DSLBeanConfigurator.java
│ │ │ │ ├── DSLBeanConfiguratorWithBackwardCompatibility.java
│ │ │ │ ├── PacketWriter.java
│ │ │ │ ├── ScheduledTask.java
│ │ │ │ ├── adhoc/
│ │ │ │ │ ├── AdHocCommand.java
│ │ │ │ │ ├── AdHocCommandException.java
│ │ │ │ │ ├── AdHocCommandManager.java
│ │ │ │ │ ├── AdHocResponse.java
│ │ │ │ │ ├── AdHocScriptCommandManager.java
│ │ │ │ │ ├── AdHocSession.java
│ │ │ │ │ └── AdhHocRequest.java
│ │ │ │ ├── exceptions/
│ │ │ │ │ ├── ComponentException.java
│ │ │ │ │ └── RepositoryException.java
│ │ │ │ ├── modules/
│ │ │ │ │ ├── AbstractModule.java
│ │ │ │ │ ├── Module.java
│ │ │ │ │ ├── StanzaProcessor.java
│ │ │ │ │ └── impl/
│ │ │ │ │ ├── AdHocCommandModule.java
│ │ │ │ │ ├── DiscoveryModule.java
│ │ │ │ │ ├── JabberVersionModule.java
│ │ │ │ │ ├── XmppPingModule.java
│ │ │ │ │ └── config/
│ │ │ │ │ └── ConfiguratorCommand.java
│ │ │ │ └── responses/
│ │ │ │ ├── AsyncCallback.java
│ │ │ │ ├── DefaultResponseHandler.java
│ │ │ │ └── ResponseManager.java
│ │ │ ├── conf/
│ │ │ │ ├── AbstractConfigBuilder.java
│ │ │ │ ├── ConfigBuilder.java
│ │ │ │ ├── ConfigHelper.java
│ │ │ │ ├── ConfigHolder.java
│ │ │ │ ├── ConfigItem.java
│ │ │ │ ├── ConfigReader.java
│ │ │ │ ├── ConfigRepositoryIfc.java
│ │ │ │ ├── ConfigSQLRepository.java
│ │ │ │ ├── ConfigWriter.java
│ │ │ │ ├── ConfigXMLRepository.java
│ │ │ │ ├── Configurable.java
│ │ │ │ ├── ConfigurationCache.java
│ │ │ │ ├── ConfigurationException.java
│ │ │ │ ├── Configurator.java
│ │ │ │ ├── ConfiguratorAbstract.java
│ │ │ │ ├── ConfiguratorOld.java
│ │ │ │ ├── LoggingBean.java
│ │ │ │ ├── MonitoringBeanIfc.java
│ │ │ │ ├── MonitoringSetupIfc.java
│ │ │ │ ├── OldConfigHolder.java
│ │ │ │ └── SetLoggingCommand.java
│ │ │ ├── db/
│ │ │ │ ├── AbstractAuthRepositoryWithCredentials.java
│ │ │ │ ├── AuthRepository.java
│ │ │ │ ├── AuthRepositoryImpl.java
│ │ │ │ ├── AuthRepositoryMDImpl.java
│ │ │ │ ├── AuthRepositoryPool.java
│ │ │ │ ├── AuthorizationException.java
│ │ │ │ ├── DBInitException.java
│ │ │ │ ├── DataOverwriteException.java
│ │ │ │ ├── DataRepository.java
│ │ │ │ ├── DataRepositoryPool.java
│ │ │ │ ├── DataSource.java
│ │ │ │ ├── DataSourceAware.java
│ │ │ │ ├── DataSourceHelper.java
│ │ │ │ ├── DataSourcePool.java
│ │ │ │ ├── DummyRepository.java
│ │ │ │ ├── MsgRepositoryIfc.java
│ │ │ │ ├── NonAuthUserRepository.java
│ │ │ │ ├── NonAuthUserRepositoryImpl.java
│ │ │ │ ├── OfflineMsgRepositoryIfc.java
│ │ │ │ ├── Repository.java
│ │ │ │ ├── RepositoryFactory.java
│ │ │ │ ├── RepositoryPool.java
│ │ │ │ ├── Schema.java
│ │ │ │ ├── TigaseDBException.java
│ │ │ │ ├── UserExistsException.java
│ │ │ │ ├── UserNotFoundException.java
│ │ │ │ ├── UserRepository.java
│ │ │ │ ├── UserRepositoryMDImpl.java
│ │ │ │ ├── UserRepositoryPool.java
│ │ │ │ ├── beans/
│ │ │ │ │ ├── AuthRepositoryMDPoolBean.java
│ │ │ │ │ ├── AuthUserRepositoryConfigBean.java
│ │ │ │ │ ├── DataSourceBean.java
│ │ │ │ │ ├── MDPoolBean.java
│ │ │ │ │ ├── MDPoolBeanWithStatistics.java
│ │ │ │ │ ├── MDPoolConfigBean.java
│ │ │ │ │ ├── MDRepositoryBean.java
│ │ │ │ │ ├── MDRepositoryBeanWithStatistics.java
│ │ │ │ │ ├── SDRepositoryBean.java
│ │ │ │ │ ├── SDRepositoryBeanWithStatistics.java
│ │ │ │ │ └── UserRepositoryMDPoolBean.java
│ │ │ │ ├── comp/
│ │ │ │ │ ├── AbstractSDComponentRepositoryBean.java
│ │ │ │ │ ├── ComponentRepository.java
│ │ │ │ │ ├── ComponentRepositoryDataSourceAware.java
│ │ │ │ │ ├── ConfigRepository.java
│ │ │ │ │ ├── RepositoryChangeListenerIfc.java
│ │ │ │ │ ├── RepositoryItem.java
│ │ │ │ │ ├── RepositoryItemAbstract.java
│ │ │ │ │ └── UserRepoRepository.java
│ │ │ │ ├── derby/
│ │ │ │ │ ├── MsgBroadcastRepositoryStoredProcedures.java
│ │ │ │ │ ├── MsgRepositoryStoredProcedures.java
│ │ │ │ │ └── StoredProcedures.java
│ │ │ │ ├── jdbc/
│ │ │ │ │ ├── DataRepositoryImpl.java
│ │ │ │ │ ├── JDBCRepository.java
│ │ │ │ │ ├── PreparedStatementInvocationHandler.java
│ │ │ │ │ ├── TigaseAuth.java
│ │ │ │ │ ├── TigaseCustomAuth.java
│ │ │ │ │ └── TigaseSPAuth.java
│ │ │ │ ├── ldap/
│ │ │ │ │ └── LdapAuthProvider.java
│ │ │ │ ├── services/
│ │ │ │ │ └── AccountExpirationService.java
│ │ │ │ ├── util/
│ │ │ │ │ ├── DBInitForkJoinPoolCache.java
│ │ │ │ │ ├── DBSchemaLoader.java
│ │ │ │ │ ├── JDBCPasswordObfuscator.java
│ │ │ │ │ ├── RepositoryVersionAware.java
│ │ │ │ │ ├── SchemaLoader.java
│ │ │ │ │ ├── SchemaManager.java
│ │ │ │ │ ├── SchemaManagerLogHandler.java
│ │ │ │ │ ├── SchemaVersionCheckerLogger.java
│ │ │ │ │ ├── importexport/
│ │ │ │ │ │ ├── AbstractImporterExtension.java
│ │ │ │ │ │ ├── CredentialsExtension.java
│ │ │ │ │ │ ├── DataSourceHelper.java
│ │ │ │ │ │ ├── Exporter.java
│ │ │ │ │ │ ├── ImportXMLHandler.java
│ │ │ │ │ │ ├── Importer.java
│ │ │ │ │ │ ├── ImporterExtension.java
│ │ │ │ │ │ ├── JabberIqPrivateExtension.java
│ │ │ │ │ │ ├── RepositoryHolder.java
│ │ │ │ │ │ ├── RepositoryManager.java
│ │ │ │ │ │ ├── RepositoryManagerExtension.java
│ │ │ │ │ │ └── RepositoryManagerExtensionBase.java
│ │ │ │ │ └── locker/
│ │ │ │ │ ├── ConnectionLock.java
│ │ │ │ │ ├── MssqlConnectionLock.java
│ │ │ │ │ ├── MysqlConnectionLock.java
│ │ │ │ │ └── PostgresqlConnectionLock.java
│ │ │ │ └── xml/
│ │ │ │ ├── XMLDataSource.java
│ │ │ │ ├── XMLMsgRepository.java
│ │ │ │ └── XMLRepository.java
│ │ │ ├── disco/
│ │ │ │ ├── ServiceEntity.java
│ │ │ │ ├── ServiceIdentity.java
│ │ │ │ ├── XMPPService.java
│ │ │ │ └── XMPPServiceCollector.java
│ │ │ ├── disteventbus/
│ │ │ │ └── component/
│ │ │ │ └── EventBusComponent.java
│ │ │ ├── eventbus/
│ │ │ │ ├── EventBus.java
│ │ │ │ ├── EventBusAction.java
│ │ │ │ ├── EventBusEvent.java
│ │ │ │ ├── EventBusException.java
│ │ │ │ ├── EventBusFactory.java
│ │ │ │ ├── EventListener.java
│ │ │ │ ├── EventRoutedTransientFiller.java
│ │ │ │ ├── EventRoutingSelector.java
│ │ │ │ ├── EventSourceListener.java
│ │ │ │ ├── FillRoutedEvent.java
│ │ │ │ ├── HandleEvent.java
│ │ │ │ ├── RegistrationException.java
│ │ │ │ ├── RouteEvent.java
│ │ │ │ ├── TickMinuteEvent.java
│ │ │ │ ├── XMLEventBusEvent.java
│ │ │ │ ├── component/
│ │ │ │ │ ├── AbstractEventBusModule.java
│ │ │ │ │ ├── ElemPathCriteria.java
│ │ │ │ │ ├── EventBusComponent.java
│ │ │ │ │ ├── EventPublisherModule.java
│ │ │ │ │ ├── EventReceiverModule.java
│ │ │ │ │ ├── EventbusDiscoveryModule.java
│ │ │ │ │ ├── SubscribeModule.java
│ │ │ │ │ ├── UnsubscribeModule.java
│ │ │ │ │ └── stores/
│ │ │ │ │ ├── Affiliation.java
│ │ │ │ │ ├── AffiliationStore.java
│ │ │ │ │ ├── Subscription.java
│ │ │ │ │ └── SubscriptionStore.java
│ │ │ │ ├── events/
│ │ │ │ │ ├── ShutdownEvent.java
│ │ │ │ │ └── StartupFinishedEvent.java
│ │ │ │ └── impl/
│ │ │ │ ├── AbstractHandler.java
│ │ │ │ ├── AbstractListenerHandler.java
│ │ │ │ ├── ElementListenerHandler.java
│ │ │ │ ├── ElementSourceListenerHandler.java
│ │ │ │ ├── EventBusImplementation.java
│ │ │ │ ├── EventBusSerializer.java
│ │ │ │ ├── EventName.java
│ │ │ │ ├── EventsNameMap.java
│ │ │ │ ├── EventsRegistrar.java
│ │ │ │ ├── ObjectEventsListenerHandler.java
│ │ │ │ ├── ObjectEventsSourceListenerHandler.java
│ │ │ │ ├── ReflectEventListenerHandler.java
│ │ │ │ ├── ReflectEventListenerHandlerFactory.java
│ │ │ │ ├── ReflectEventRoutedTransientFiller.java
│ │ │ │ ├── ReflectEventRoutedTransientFillerFactory.java
│ │ │ │ ├── ReflectEventRoutingSelector.java
│ │ │ │ ├── ReflectEventRoutingSelectorFactory.java
│ │ │ │ ├── ReflectEventSourceListenerHandler.java
│ │ │ │ └── Serializer.java
│ │ │ ├── examples/
│ │ │ │ ├── ExampleUsingDataRepository.java
│ │ │ │ └── SampleCustomAuthRepository.java
│ │ │ ├── io/
│ │ │ │ ├── BufferUnderflowException.java
│ │ │ │ ├── CertFilesTrustManager.java
│ │ │ │ ├── CertificateContainer.java
│ │ │ │ ├── CertificateContainerIfc.java
│ │ │ │ ├── IOInterface.java
│ │ │ │ ├── JcaTLSWrapper.java
│ │ │ │ ├── ProxyIO.java
│ │ │ │ ├── SSLContextContainer.java
│ │ │ │ ├── SSLContextContainerAbstract.java
│ │ │ │ ├── SSLContextContainerIfc.java
│ │ │ │ ├── SampleSocketThread.java
│ │ │ │ ├── SocketIO.java
│ │ │ │ ├── TLSEventHandler.java
│ │ │ │ ├── TLSIO.java
│ │ │ │ ├── TLSIOIfc.java
│ │ │ │ ├── TLSStatus.java
│ │ │ │ ├── TLSUtil.java
│ │ │ │ ├── TLSWrapper.java
│ │ │ │ ├── TelnetClient.java
│ │ │ │ ├── TelnetServer.java
│ │ │ │ ├── ZLibIO.java
│ │ │ │ └── repo/
│ │ │ │ ├── CertificateItem.java
│ │ │ │ └── CertificateRepository.java
│ │ │ ├── kernel/
│ │ │ │ ├── BeanUtils.java
│ │ │ │ ├── DefaultTypesConverter.java
│ │ │ │ ├── KernelException.java
│ │ │ │ ├── TypesConverter.java
│ │ │ │ ├── beans/
│ │ │ │ │ ├── Autostart.java
│ │ │ │ │ ├── Bean.java
│ │ │ │ │ ├── BeanFactory.java
│ │ │ │ │ ├── BeanSelector.java
│ │ │ │ │ ├── Converter.java
│ │ │ │ │ ├── Initializable.java
│ │ │ │ │ ├── Inject.java
│ │ │ │ │ ├── RegistrarBean.java
│ │ │ │ │ ├── RegistrarBeanWithDefaultBeanClass.java
│ │ │ │ │ ├── UnregisterAware.java
│ │ │ │ │ ├── config/
│ │ │ │ │ │ ├── AbstractBeanConfigurator.java
│ │ │ │ │ │ ├── BeanConfigurator.java
│ │ │ │ │ │ ├── ConfigAlias.java
│ │ │ │ │ │ ├── ConfigAliases.java
│ │ │ │ │ │ ├── ConfigField.java
│ │ │ │ │ │ ├── ConfigFieldType.java
│ │ │ │ │ │ └── ConfigurationChangedAware.java
│ │ │ │ │ └── selector/
│ │ │ │ │ ├── ClusterModeRequired.java
│ │ │ │ │ ├── ConfigType.java
│ │ │ │ │ ├── ConfigTypeEnum.java
│ │ │ │ │ └── ServerBeanSelector.java
│ │ │ │ └── core/
│ │ │ │ ├── BeanConfig.java
│ │ │ │ ├── BeanConfigBuilder.java
│ │ │ │ ├── Dependency.java
│ │ │ │ ├── DependencyGrapher.java
│ │ │ │ ├── DependencyManager.java
│ │ │ │ ├── Kernel.java
│ │ │ │ ├── PlantUMLGrapher.java
│ │ │ │ └── RegistrarKernel.java
│ │ │ ├── map/
│ │ │ │ ├── ClusterMapFactory.java
│ │ │ │ ├── CollectionWrapper.java
│ │ │ │ ├── DMap.java
│ │ │ │ ├── DMapListener.java
│ │ │ │ ├── IteratorWrapper.java
│ │ │ │ ├── MapCreatedEvent.java
│ │ │ │ ├── MapDestroyedEvent.java
│ │ │ │ └── SetWrapper.java
│ │ │ ├── monitor/
│ │ │ │ ├── AdHocTask.java
│ │ │ │ ├── ConfigurableTask.java
│ │ │ │ ├── InfoTask.java
│ │ │ │ ├── MonitorComponent.java
│ │ │ │ ├── MonitorExtension.java
│ │ │ │ ├── MonitorTask.java
│ │ │ │ ├── TaskConfigItem.java
│ │ │ │ ├── TaskConfigItemJDBCRepository.java
│ │ │ │ ├── TasksScriptRegistrar.java
│ │ │ │ ├── TimerTaskService.java
│ │ │ │ ├── modules/
│ │ │ │ │ ├── AdHocCommandMonitorModule.java
│ │ │ │ │ ├── AddScriptTaskCommand.java
│ │ │ │ │ ├── AddTimerScriptTaskCommand.java
│ │ │ │ │ ├── ConfigureTaskCommand.java
│ │ │ │ │ ├── DeleteScriptTaskCommand.java
│ │ │ │ │ ├── DiscoveryMonitorModule.java
│ │ │ │ │ └── InfoTaskCommand.java
│ │ │ │ └── tasks/
│ │ │ │ ├── AbstractConfigurableTask.java
│ │ │ │ ├── AbstractConfigurableTimerTask.java
│ │ │ │ ├── ConnectionsTask.java
│ │ │ │ ├── CpuTempTask.java
│ │ │ │ ├── DiskTask.java
│ │ │ │ ├── LoadCheckerTask.java
│ │ │ │ ├── LoggerTask.java
│ │ │ │ ├── MemoryCheckerTask.java
│ │ │ │ ├── SampleTask.java
│ │ │ │ ├── ScriptTask.java
│ │ │ │ ├── ScriptTimerTask.java
│ │ │ │ └── TasksEvent.java
│ │ │ ├── net/
│ │ │ │ ├── Accept.java
│ │ │ │ ├── ConnectionOpenListener.java
│ │ │ │ ├── ConnectionOpenThread.java
│ │ │ │ ├── ConnectionType.java
│ │ │ │ ├── IOService.java
│ │ │ │ ├── IOServiceListener.java
│ │ │ │ ├── IOUtil.java
│ │ │ │ ├── ServiceCommand.java
│ │ │ │ ├── SocketThread.java
│ │ │ │ └── SocketType.java
│ │ │ ├── osgi/
│ │ │ │ ├── AbstractActivator.java
│ │ │ │ ├── Activator.java
│ │ │ │ ├── ModulesManager.java
│ │ │ │ ├── ModulesManagerImpl.java
│ │ │ │ ├── OSGiScriptEngine.java
│ │ │ │ ├── OSGiScriptEngineFactory.java
│ │ │ │ ├── OSGiScriptEngineManager.java
│ │ │ │ └── util/
│ │ │ │ ├── ClassUtil.java
│ │ │ │ └── ClassUtilBean.java
│ │ │ ├── server/
│ │ │ │ ├── AbstractComponentRegistrator.java
│ │ │ │ ├── AbstractMessageReceiver.java
│ │ │ │ ├── BasicComponent.java
│ │ │ │ ├── Bootstrap.java
│ │ │ │ ├── CmdAcl.java
│ │ │ │ ├── Command.java
│ │ │ │ ├── ComponentInfo.java
│ │ │ │ ├── ComponentRegistrator.java
│ │ │ │ ├── ConnectionManager.java
│ │ │ │ ├── DataForm.java
│ │ │ │ ├── DisableDisco.java
│ │ │ │ ├── Iq.java
│ │ │ │ ├── Lifecycle.java
│ │ │ │ ├── Message.java
│ │ │ │ ├── MessageReceiver.java
│ │ │ │ ├── MessageRouter.java
│ │ │ │ ├── MessageRouterConfig.java
│ │ │ │ ├── MessageRouterIfc.java
│ │ │ │ ├── Packet.java
│ │ │ │ ├── PacketFilterIfc.java
│ │ │ │ ├── PacketWriterWithTimeout.java
│ │ │ │ ├── Permissions.java
│ │ │ │ ├── PolicyViolationException.java
│ │ │ │ ├── Presence.java
│ │ │ │ ├── Priority.java
│ │ │ │ ├── QueueType.java
│ │ │ │ ├── ReceiverTimeoutHandler.java
│ │ │ │ ├── ServerComponent.java
│ │ │ │ ├── ServiceChecker.java
│ │ │ │ ├── StanzaSourceChecker.java
│ │ │ │ ├── ThreadExceptionHandler.java
│ │ │ │ ├── XMPPServer.java
│ │ │ │ ├── amp/
│ │ │ │ │ ├── ActionAbstract.java
│ │ │ │ │ ├── ActionIfc.java
│ │ │ │ │ ├── ActionResultsHandlerIfc.java
│ │ │ │ │ ├── AmpComponent.java
│ │ │ │ │ ├── AmpFeatureIfc.java
│ │ │ │ │ ├── ConditionIfc.java
│ │ │ │ │ ├── JidResourceMap.java
│ │ │ │ │ ├── action/
│ │ │ │ │ │ ├── Alert.java
│ │ │ │ │ │ ├── Broadcast.java
│ │ │ │ │ │ ├── Deliver.java
│ │ │ │ │ │ ├── Drop.java
│ │ │ │ │ │ ├── Error.java
│ │ │ │ │ │ ├── Notify.java
│ │ │ │ │ │ └── Store.java
│ │ │ │ │ ├── cond/
│ │ │ │ │ │ ├── Deliver.java
│ │ │ │ │ │ ├── ExpireAt.java
│ │ │ │ │ │ └── MatchResource.java
│ │ │ │ │ └── db/
│ │ │ │ │ ├── JDBCMsgBroadcastRepository.java
│ │ │ │ │ ├── JDBCMsgRepository.java
│ │ │ │ │ ├── MsgBroadcastRepository.java
│ │ │ │ │ ├── MsgBroadcastRepositoryIfc.java
│ │ │ │ │ └── MsgRepository.java
│ │ │ │ ├── bosh/
│ │ │ │ │ ├── BoshConnectionManager.java
│ │ │ │ │ ├── BoshIOService.java
│ │ │ │ │ ├── BoshSendQueueTask.java
│ │ │ │ │ ├── BoshSession.java
│ │ │ │ │ ├── BoshSessionCache.java
│ │ │ │ │ ├── BoshSessionTaskHandler.java
│ │ │ │ │ ├── BoshSidLoggerFilter.java
│ │ │ │ │ ├── BoshTask.java
│ │ │ │ │ └── Constants.java
│ │ │ │ ├── ext/
│ │ │ │ │ ├── AbstractCompDBRepository.java
│ │ │ │ │ ├── CompCompDBRepository.java
│ │ │ │ │ ├── CompConfigRepository.java
│ │ │ │ │ ├── CompRepoDefaults.java
│ │ │ │ │ ├── CompRepoItem.java
│ │ │ │ │ ├── CompSQLRepository.java
│ │ │ │ │ ├── ComponentConnection.java
│ │ │ │ │ ├── ComponentIOService.java
│ │ │ │ │ ├── ComponentProtocol.java
│ │ │ │ │ ├── ComponentProtocolHandler.java
│ │ │ │ │ ├── ComponentProtocolManager.java
│ │ │ │ │ ├── ExtProcessor.java
│ │ │ │ │ ├── ManagerCompDBRepository.java
│ │ │ │ │ ├── ServerCompDBRepository.java
│ │ │ │ │ ├── StreamOpenHandler.java
│ │ │ │ │ ├── handlers/
│ │ │ │ │ │ ├── BindProcessor.java
│ │ │ │ │ │ ├── ComponentAcceptStreamOpenHandler.java
│ │ │ │ │ │ ├── ComponentConnectStreamOpenHandler.java
│ │ │ │ │ │ ├── HandshakeProcessor.java
│ │ │ │ │ │ ├── JabberClientStreamOpenHandler.java
│ │ │ │ │ │ ├── SASLProcessor.java
│ │ │ │ │ │ ├── StartTLSProcessor.java
│ │ │ │ │ │ ├── StreamFeaturesProcessor.java
│ │ │ │ │ │ └── UnknownXMLNSStreamOpenHandler.java
│ │ │ │ │ └── lb/
│ │ │ │ │ ├── LoadBalancerIfc.java
│ │ │ │ │ ├── ReceiverBareJidLB.java
│ │ │ │ │ ├── ReceiverFullJidLB.java
│ │ │ │ │ ├── SenderBareJidLB.java
│ │ │ │ │ └── SenderFullJidLB.java
│ │ │ │ ├── extdisco/
│ │ │ │ │ ├── ExtServiceDiscoItem.java
│ │ │ │ │ ├── ExtServiceDiscoveryUserRepoRepository.java
│ │ │ │ │ ├── ExternalServiceDiscoveryComponent.java
│ │ │ │ │ ├── ExternalServiceDiscoveryModule.java
│ │ │ │ │ └── ExternalServiceDiscoveryProcessor.java
│ │ │ │ ├── filters/
│ │ │ │ │ ├── PacketCounter.java
│ │ │ │ │ └── PacketFiltersBean.java
│ │ │ │ ├── monitor/
│ │ │ │ │ ├── MonitorComponent.java
│ │ │ │ │ ├── MonitorPluginIfc.java
│ │ │ │ │ ├── MonitorRuntime.java
│ │ │ │ │ └── StatusReportGenerator.java
│ │ │ │ ├── package-info.java
│ │ │ │ ├── rtbl/
│ │ │ │ │ ├── RTBL.java
│ │ │ │ │ ├── RTBLComponent.java
│ │ │ │ │ ├── RTBLEventModule.java
│ │ │ │ │ ├── RTBLFetchModule.java
│ │ │ │ │ ├── RTBLIqModule.java
│ │ │ │ │ ├── RTBLRepository.java
│ │ │ │ │ ├── RTBLSubscribeModule.java
│ │ │ │ │ └── adhoc/
│ │ │ │ │ ├── AbstractAdHocCommand.java
│ │ │ │ │ ├── RTBLAddCommand.java
│ │ │ │ │ └── RTBLDeleteCommand.java
│ │ │ │ ├── script/
│ │ │ │ │ ├── AbstractScriptCommand.java
│ │ │ │ │ ├── AddScriptCommand.java
│ │ │ │ │ ├── CommandIfc.java
│ │ │ │ │ ├── RemoveScriptCommand.java
│ │ │ │ │ └── Script.java
│ │ │ │ ├── test/
│ │ │ │ │ ├── EchoComponent.java
│ │ │ │ │ ├── TestComponent.java
│ │ │ │ │ ├── TestGeneratorModule.java
│ │ │ │ │ └── TestSpamModule.java
│ │ │ │ ├── websocket/
│ │ │ │ │ ├── WebSocketClientConnectionManager.java
│ │ │ │ │ ├── WebSocketHixie76.java
│ │ │ │ │ ├── WebSocketHybi.java
│ │ │ │ │ ├── WebSocketProtocolIfc.java
│ │ │ │ │ └── WebSocketXMPPIOService.java
│ │ │ │ ├── xmppclient/
│ │ │ │ │ ├── C2SIOService.java
│ │ │ │ │ ├── ClientConnectionManager.java
│ │ │ │ │ ├── ClientTrustManagerFactory.java
│ │ │ │ │ ├── IPMonitor.java
│ │ │ │ │ ├── RegistrationThrottling.java
│ │ │ │ │ ├── RegistrationThrottlingProcessor.java
│ │ │ │ │ ├── SeeOtherHost.java
│ │ │ │ │ ├── SeeOtherHostDB.java
│ │ │ │ │ ├── SeeOtherHostDualIP.java
│ │ │ │ │ ├── SeeOtherHostDualIPSQLRepository.java
│ │ │ │ │ ├── SeeOtherHostHashed.java
│ │ │ │ │ ├── SeeOtherHostIfc.java
│ │ │ │ │ ├── StreamErrorCounterIOProcessor.java
│ │ │ │ │ ├── StreamManagementCommand.java
│ │ │ │ │ ├── StreamManagementIOProcessor.java
│ │ │ │ │ └── XMPPIOProcessor.java
│ │ │ │ ├── xmppcomponent/
│ │ │ │ │ └── ComponentConnectionManager.java
│ │ │ │ ├── xmppserver/
│ │ │ │ │ ├── CID.java
│ │ │ │ │ ├── CIDConnections.java
│ │ │ │ │ ├── KnownDomainsListProvider.java
│ │ │ │ │ ├── LocalhostException.java
│ │ │ │ │ ├── NotLocalhostException.java
│ │ │ │ │ ├── OutgoingState.java
│ │ │ │ │ ├── S2SConnection.java
│ │ │ │ │ ├── S2SConnectionHandlerIfc.java
│ │ │ │ │ ├── S2SConnectionManager.java
│ │ │ │ │ ├── S2SConnectionSelector.java
│ │ │ │ │ ├── S2SFilterIfc.java
│ │ │ │ │ ├── S2SIOService.java
│ │ │ │ │ ├── S2SProcessor.java
│ │ │ │ │ ├── S2SRandomSelector.java
│ │ │ │ │ └── proc/
│ │ │ │ │ ├── AuthenticationProcessor.java
│ │ │ │ │ ├── AuthenticatorSelectorManager.java
│ │ │ │ │ ├── Dialback.java
│ │ │ │ │ ├── PacketChecker.java
│ │ │ │ │ ├── S2SAbstract.java
│ │ │ │ │ ├── S2SAbstractFilter.java
│ │ │ │ │ ├── S2SAbstractProcessor.java
│ │ │ │ │ ├── SaslExternal.java
│ │ │ │ │ ├── StartTLS.java
│ │ │ │ │ ├── StartZlib.java
│ │ │ │ │ ├── StreamError.java
│ │ │ │ │ ├── StreamFeatures.java
│ │ │ │ │ └── StreamOpen.java
│ │ │ │ └── xmppsession/
│ │ │ │ ├── DisconnectUserEBAction.java
│ │ │ │ ├── PacketDefaultHandler.java
│ │ │ │ ├── SMResourceConnection.java
│ │ │ │ ├── SessionManager.java
│ │ │ │ ├── SessionManagerConfig.java
│ │ │ │ ├── SessionManagerHandler.java
│ │ │ │ ├── UserConnectedEvent.java
│ │ │ │ ├── UserPresenceChangedEvent.java
│ │ │ │ ├── UserSessionEvent.java
│ │ │ │ ├── UserSessionEventWithProcessorResultWriter.java
│ │ │ │ └── adhoc/
│ │ │ │ └── SuggestedDomainsListAdhoc.java
│ │ │ ├── stats/
│ │ │ │ ├── ComponentStatisticsProvider.java
│ │ │ │ ├── Counter.java
│ │ │ │ ├── CounterDataArchivizer.java
│ │ │ │ ├── CounterDataFileLogger.java
│ │ │ │ ├── CounterDataLogger.java
│ │ │ │ ├── CounterPerSecond.java
│ │ │ │ ├── CounterValue.java
│ │ │ │ ├── ErrorsStatisticsProvider.java
│ │ │ │ ├── JMXProxyListener.java
│ │ │ │ ├── JMXProxyListenerOpt.java
│ │ │ │ ├── JavaJMXProxyOpt.java
│ │ │ │ ├── MaxDailyCounterQueue.java
│ │ │ │ ├── StatRecord.java
│ │ │ │ ├── StatisticHolder.java
│ │ │ │ ├── StatisticHolderImpl.java
│ │ │ │ ├── StatisticType.java
│ │ │ │ ├── StatisticsArchivizerIfc.java
│ │ │ │ ├── StatisticsCollector.java
│ │ │ │ ├── StatisticsContainer.java
│ │ │ │ ├── StatisticsContainerIfc.java
│ │ │ │ ├── StatisticsInvocationHandler.java
│ │ │ │ ├── StatisticsList.java
│ │ │ │ ├── StatisticsProvider.java
│ │ │ │ ├── StatisticsProviderIfc.java
│ │ │ │ ├── StatisticsProviderMBean.java
│ │ │ │ └── db/
│ │ │ │ ├── CounterDataLoggerRepoBean.java
│ │ │ │ ├── CounterDataLoggerRepository.java
│ │ │ │ └── CounterDataLoggerRepositoryIfc.java
│ │ │ ├── sys/
│ │ │ │ ├── CPULoadListener.java
│ │ │ │ ├── MemoryChangeListener.java
│ │ │ │ ├── NMTScope.java
│ │ │ │ ├── NativeMemoryTracking.java
│ │ │ │ ├── OnlineJidsReporter.java
│ │ │ │ ├── ResourceState.java
│ │ │ │ ├── ShutdownHook.java
│ │ │ │ └── TigaseRuntime.java
│ │ │ ├── util/
│ │ │ │ ├── common/
│ │ │ │ │ ├── DependencyChecker.java
│ │ │ │ │ ├── OSUtils.java
│ │ │ │ │ └── TimerTask.java
│ │ │ │ ├── historyCache/
│ │ │ │ │ ├── AllHistoryCache.java
│ │ │ │ │ ├── FloatHistoryCache.java
│ │ │ │ │ ├── IntHistoryCache.java
│ │ │ │ │ └── LongHistoryCache.java
│ │ │ │ ├── log/
│ │ │ │ │ ├── LogFilter.java
│ │ │ │ │ ├── LogFormatter.java
│ │ │ │ │ ├── LogUserFilter.java
│ │ │ │ │ └── LogWithStackTraceEntry.java
│ │ │ │ ├── processing/
│ │ │ │ │ ├── ProcessingThreads.java
│ │ │ │ │ ├── QueueItem.java
│ │ │ │ │ └── WorkerThread.java
│ │ │ │ ├── reflection/
│ │ │ │ │ ├── ClassUtilBean.java
│ │ │ │ │ └── ReflectionHelper.java
│ │ │ │ ├── repository/
│ │ │ │ │ ├── DataTypes.java
│ │ │ │ │ └── RepositoryUtils.java
│ │ │ │ ├── routing/
│ │ │ │ │ ├── PatternComparator.java
│ │ │ │ │ └── RoutingsContainer.java
│ │ │ │ ├── setup/
│ │ │ │ │ ├── BeanDefinition.java
│ │ │ │ │ └── SetupHelper.java
│ │ │ │ ├── tracer/
│ │ │ │ │ └── TigaseTracer.java
│ │ │ │ ├── updater/
│ │ │ │ │ └── UpdatesChecker.java
│ │ │ │ └── workqueue/
│ │ │ │ ├── NonpriorityQueue.java
│ │ │ │ ├── PriorityQueueAbstract.java
│ │ │ │ ├── PriorityQueueRelaxed.java
│ │ │ │ └── PriorityQueueStrict.java
│ │ │ ├── vhosts/
│ │ │ │ ├── AbstractVHostItemExtension.java
│ │ │ │ ├── DefaultAwareVHostManagerIfc.java
│ │ │ │ ├── VHostComponentRepository.java
│ │ │ │ ├── VHostComponentRepositoryDataSourceAware.java
│ │ │ │ ├── VHostItem.java
│ │ │ │ ├── VHostItemDefaults.java
│ │ │ │ ├── VHostItemExtension.java
│ │ │ │ ├── VHostItemExtensionBackwardCompatible.java
│ │ │ │ ├── VHostItemExtensionIfc.java
│ │ │ │ ├── VHostItemExtensionManager.java
│ │ │ │ ├── VHostItemExtensionProvider.java
│ │ │ │ ├── VHostItemImpl.java
│ │ │ │ ├── VHostJDBCRepository.java
│ │ │ │ ├── VHostListener.java
│ │ │ │ ├── VHostManager.java
│ │ │ │ ├── VHostManagerIfc.java
│ │ │ │ ├── VHostRepoDefaults.java
│ │ │ │ └── filter/
│ │ │ │ ├── CustomDomainFilter.java
│ │ │ │ ├── DomainFilterPolicy.java
│ │ │ │ └── Rule.java
│ │ │ └── xmpp/
│ │ │ ├── Authorization.java
│ │ │ ├── ElementMatcher.java
│ │ │ ├── InvalidPacketException.java
│ │ │ ├── NoConnectionIdException.java
│ │ │ ├── NotAuthorizedException.java
│ │ │ ├── PacketErrorTypeException.java
│ │ │ ├── PacketInvalidAddressException.java
│ │ │ ├── PacketInvalidTypeException.java
│ │ │ ├── RepositoryAccess.java
│ │ │ ├── SpamReportsConsumer.java
│ │ │ ├── StanzaType.java
│ │ │ ├── StreamError.java
│ │ │ ├── XMPPDomBuilderHandler.java
│ │ │ ├── XMPPException.java
│ │ │ ├── XMPPIOService.java
│ │ │ ├── XMPPIOServiceListener.java
│ │ │ ├── XMPPImplIfc.java
│ │ │ ├── XMPPPacketFilterIfc.java
│ │ │ ├── XMPPParserException.java
│ │ │ ├── XMPPPostprocessorIfc.java
│ │ │ ├── XMPPPreprocessorIfc.java
│ │ │ ├── XMPPProcessor.java
│ │ │ ├── XMPPProcessorAbstract.java
│ │ │ ├── XMPPProcessorConcurrencyAwareIfc.java
│ │ │ ├── XMPPProcessorException.java
│ │ │ ├── XMPPProcessorIfc.java
│ │ │ ├── XMPPResourceConnection.java
│ │ │ ├── XMPPSession.java
│ │ │ ├── XMPPStopListenerIfc.java
│ │ │ ├── impl/
│ │ │ │ ├── AbstractAuthPreprocessor.java
│ │ │ │ ├── AddressingSanitizer.java
│ │ │ │ ├── Bind2.java
│ │ │ │ ├── BindResource.java
│ │ │ │ ├── BlockingCommand.java
│ │ │ │ ├── C2SDeliveryErrorProcessor.java
│ │ │ │ ├── CAPS.java
│ │ │ │ ├── CaptchaProvider.java
│ │ │ │ ├── ClientStateIndication.java
│ │ │ │ ├── DomainFilter.java
│ │ │ │ ├── EntityTime.java
│ │ │ │ ├── ErrorCounter.java
│ │ │ │ ├── FlexibleOfflineMessageRetrieval.java
│ │ │ │ ├── InvisibleCommand.java
│ │ │ │ ├── JabberIqAuth.java
│ │ │ │ ├── JabberIqCommand.java
│ │ │ │ ├── JabberIqIq.java
│ │ │ │ ├── JabberIqPrivacy.java
│ │ │ │ ├── JabberIqPrivate.java
│ │ │ │ ├── JabberIqRegister.java
│ │ │ │ ├── JabberIqRoster.java
│ │ │ │ ├── JabberIqStats.java
│ │ │ │ ├── JabberIqVersion.java
│ │ │ │ ├── Jingle.java
│ │ │ │ ├── LastActivity.java
│ │ │ │ ├── LastActivityAbstract.java
│ │ │ │ ├── LastActivityMarker.java
│ │ │ │ ├── LastActivityRetriever.java
│ │ │ │ ├── MIXProcessor.java
│ │ │ │ ├── Message.java
│ │ │ │ ├── MessageAll.java
│ │ │ │ ├── MessageAmp.java
│ │ │ │ ├── MessageCarbons.java
│ │ │ │ ├── MessageDeliveryLogic.java
│ │ │ │ ├── MessageDeliveryProviderIfc.java
│ │ │ │ ├── MessageForwarding.java
│ │ │ │ ├── MobileV1.java
│ │ │ │ ├── MobileV2.java
│ │ │ │ ├── MobileV3.java
│ │ │ │ ├── MotdProcessor.java
│ │ │ │ ├── OfflineMessages.java
│ │ │ │ ├── PepPlugin.java
│ │ │ │ ├── PresenceAbstract.java
│ │ │ │ ├── PresenceCapabilitiesManager.java
│ │ │ │ ├── PresenceOffline.java
│ │ │ │ ├── PresenceState.java
│ │ │ │ ├── PresenceSubscription.java
│ │ │ │ ├── Privacy.java
│ │ │ │ ├── PrivacyList.java
│ │ │ │ ├── RemoteRosterManagement.java
│ │ │ │ ├── SaslAuth.java
│ │ │ │ ├── SaslAuth2.java
│ │ │ │ ├── SaslAuthAbstract.java
│ │ │ │ ├── SaslChannelBinding.java
│ │ │ │ ├── ServerInfo.java
│ │ │ │ ├── ServiceDiscovery.java
│ │ │ │ ├── SessionBind.java
│ │ │ │ ├── SimpleForwarder.java
│ │ │ │ ├── StartTLS.java
│ │ │ │ ├── StartZLib.java
│ │ │ │ ├── StreamManagementInline.java
│ │ │ │ ├── TokenBucketPool.java
│ │ │ │ ├── UrnXmppPing.java
│ │ │ │ ├── VCard4.java
│ │ │ │ ├── VCardTemp.java
│ │ │ │ ├── VCardXMPPProcessorAbstract.java
│ │ │ │ ├── annotation/
│ │ │ │ │ ├── AnnotatedXMPPProcessor.java
│ │ │ │ │ ├── DiscoFeatures.java
│ │ │ │ │ ├── Handle.java
│ │ │ │ │ ├── HandleStanzaTypes.java
│ │ │ │ │ ├── Handles.java
│ │ │ │ │ ├── Id.java
│ │ │ │ │ ├── StreamFeature.java
│ │ │ │ │ └── StreamFeatures.java
│ │ │ │ ├── package-info.java
│ │ │ │ ├── push/
│ │ │ │ │ ├── AbstractPushNotifications.java
│ │ │ │ │ ├── AwayPushNotificationsExtension.java
│ │ │ │ │ ├── EncryptedPushNotificationExtension.java
│ │ │ │ │ ├── GroupchatFilter.java
│ │ │ │ │ ├── GroupchatPushNotificationsExtension.java
│ │ │ │ │ ├── IgnoreFromUnknownFilter.java
│ │ │ │ │ ├── JinglePushNotificationsExtension.java
│ │ │ │ │ ├── MeetPushNotificationExtension.java
│ │ │ │ │ ├── MutedFilter.java
│ │ │ │ │ ├── PriorityExtension.java
│ │ │ │ │ ├── PushNotificationCause.java
│ │ │ │ │ ├── PushNotifications.java
│ │ │ │ │ ├── PushNotificationsAware.java
│ │ │ │ │ ├── PushNotificationsExtension.java
│ │ │ │ │ ├── PushNotificationsFilter.java
│ │ │ │ │ └── PushPresence.java
│ │ │ │ └── roster/
│ │ │ │ ├── AnonymousRoster.java
│ │ │ │ ├── DynamicRoster.java
│ │ │ │ ├── DynamicRosterIfc.java
│ │ │ │ ├── DynamicRosterTest.java
│ │ │ │ ├── DynamicRosterTest123.java
│ │ │ │ ├── RepositoryAccessException.java
│ │ │ │ ├── RosterAbstract.java
│ │ │ │ ├── RosterElement.java
│ │ │ │ ├── RosterFactory.java
│ │ │ │ ├── RosterFlat.java
│ │ │ │ └── RosterRetrievingException.java
│ │ │ └── mam/
│ │ │ ├── ExtendedQuery.java
│ │ │ ├── ExtendedQueryImpl.java
│ │ │ ├── MAM2ExtendedQueryParser.java
│ │ │ ├── MAM2QueryParser.java
│ │ │ ├── MAMItemHandler.java
│ │ │ ├── MAMQueryParser.java
│ │ │ ├── MAMRepository.java
│ │ │ ├── Query.java
│ │ │ ├── QueryImpl.java
│ │ │ ├── QueryParser.java
│ │ │ ├── modules/
│ │ │ │ ├── GetFormModule.java
│ │ │ │ └── QueryModule.java
│ │ │ └── util/
│ │ │ ├── MAMRepositoryManagerExtensionHelper.java
│ │ │ ├── MAMUtil.java
│ │ │ └── Range.java
│ │ ├── php/
│ │ │ └── drupal/
│ │ │ └── modules/
│ │ │ ├── tigase.module
│ │ │ ├── tigase_monitor-5.x/
│ │ │ │ ├── tigase_monitor.info
│ │ │ │ └── tigase_monitor.module
│ │ │ ├── tigase_monitor.module
│ │ │ └── tigase_usrreg-5.x/
│ │ │ ├── tigase_usrreg.info
│ │ │ └── tigase_usrreg.module
│ │ ├── python/
│ │ │ └── tigase/
│ │ │ └── admin/
│ │ │ └── PythonExample.py
│ │ ├── resources/
│ │ │ ├── META-INF/
│ │ │ │ └── java.security.Provider
│ │ │ ├── assembly/
│ │ │ │ └── resources.xml
│ │ │ ├── mib/
│ │ │ │ └── JVM-MANAGEMENT-MIB.mib
│ │ │ ├── templates/
│ │ │ │ └── StatusReportTemplate.html
│ │ │ └── win-stuff/
│ │ │ ├── Licence.txt
│ │ │ ├── Setup.bat
│ │ │ ├── Tigase-minimal.iss
│ │ │ ├── Tigase.iss
│ │ │ ├── scripts/
│ │ │ │ ├── InstallTigaseService.bat
│ │ │ │ ├── Run.bat
│ │ │ │ ├── Tigase.bat
│ │ │ │ ├── Uninst.bat
│ │ │ │ └── UninstallTigaseService.bat
│ │ │ └── wrapper/
│ │ │ ├── wrapper-community-license-1.2.txt
│ │ │ ├── wrapper.conf
│ │ │ └── wrapper.jar
│ │ ├── restructured/
│ │ │ ├── Makefile
│ │ │ ├── Tigase_Administration/
│ │ │ │ ├── Components/
│ │ │ │ │ ├── Advanced_Message_Processing.inc
│ │ │ │ │ ├── C2S.inc
│ │ │ │ │ ├── Components.inc
│ │ │ │ │ ├── External_Component_Configuration/
│ │ │ │ │ │ ├── Configuration.inc
│ │ │ │ │ │ ├── Intro.inc
│ │ │ │ │ │ ├── Load_Balancing.inc
│ │ │ │ │ │ └── Tigase_as_External.inc
│ │ │ │ │ ├── External_Service_Discovery_Component.inc
│ │ │ │ │ ├── Load_Balancing.inc
│ │ │ │ │ ├── Monitoring/
│ │ │ │ │ │ ├── MonitorComponent.inc
│ │ │ │ │ │ ├── Monitoring.inc
│ │ │ │ │ │ ├── Retrieving_statistics.inc
│ │ │ │ │ │ ├── Setting_up.inc
│ │ │ │ │ │ └── Statistics_Logger_Config.inc
│ │ │ │ │ ├── Server_to_Server_Protocol.inc
│ │ │ │ │ └── _Components.rst
│ │ │ │ ├── Configuration/
│ │ │ │ │ ├── Advanced_Options.inc
│ │ │ │ │ ├── DSL_configuration.inc
│ │ │ │ │ ├── JVM_settings.inc
│ │ │ │ │ ├── Logging.inc
│ │ │ │ │ ├── Session_Manager.inc
│ │ │ │ │ ├── Settings_for_High_Load_Systems.inc
│ │ │ │ │ ├── Startup_Files.inc
│ │ │ │ │ ├── Vhosts.inc
│ │ │ │ │ └── _Configuration.rst
│ │ │ │ ├── Database_Management/
│ │ │ │ │ ├── Database_Preparation/
│ │ │ │ │ │ ├── DbSchemaLoader.inc
│ │ │ │ │ │ ├── Derby.inc
│ │ │ │ │ │ ├── MSSQL.inc
│ │ │ │ │ │ ├── MongoDB.inc
│ │ │ │ │ │ ├── MySQL.inc
│ │ │ │ │ │ └── PostGRE.inc
│ │ │ │ │ ├── Database_Preparation.inc
│ │ │ │ │ ├── Existing_Databases.inc
│ │ │ │ │ ├── Hashed_User_Passwords_in_Database.inc
│ │ │ │ │ ├── Importing_Exporting_User_Data.inc
│ │ │ │ │ ├── Management.rst
│ │ │ │ │ ├── Multiple_Databases.inc
│ │ │ │ │ └── Schema_Updates.inc
│ │ │ │ ├── Licensing_Open_Source.rst
│ │ │ │ ├── Properties/
│ │ │ │ │ ├── _cluster.inc
│ │ │ │ │ ├── _external.inc
│ │ │ │ │ ├── _general.inc
│ │ │ │ │ ├── _performance.inc
│ │ │ │ │ ├── _properties.rst
│ │ │ │ │ ├── _repository.inc
│ │ │ │ │ ├── _user_connectivity.inc
│ │ │ │ │ └── _vhost.inc
│ │ │ │ ├── Quick_Start_Guide/
│ │ │ │ │ ├── Installation_Using_Web_Installer.inc
│ │ │ │ │ ├── Intro.rst
│ │ │ │ │ ├── Manual_Installation_in_Console_Mode.inc
│ │ │ │ │ ├── Script_Selection.inc
│ │ │ │ │ ├── Shutting_Down.inc
│ │ │ │ │ ├── Tigase_Server_Network_Instructions.inc
│ │ │ │ │ ├── Upgrading_from_Older_versions.inc
│ │ │ │ │ └── Windows_Installation.inc
│ │ │ │ ├── Release_Notes/
│ │ │ │ │ ├── Tigase_Release_Notes.rst
│ │ │ │ │ ├── Tigase_v8.0.0.inc
│ │ │ │ │ ├── Tigase_v8.1.0.inc
│ │ │ │ │ ├── Tigase_v8.2.0.inc
│ │ │ │ │ ├── Tigase_v8.3.0.inc
│ │ │ │ │ └── tigase-server-current.inc
│ │ │ │ ├── Security/
│ │ │ │ │ ├── Access_Control_List.inc
│ │ │ │ │ ├── Account_Registration_Limits.inc
│ │ │ │ │ ├── Application_Passwords.inc
│ │ │ │ │ ├── Auth_Connectors/
│ │ │ │ │ │ ├── Custom_Auth_Connector.inc
│ │ │ │ │ │ ├── LDAP_Auth.inc
│ │ │ │ │ │ ├── SASL_EXTERNAL.inc
│ │ │ │ │ │ └── Tigase_Auth_Connector.inc
│ │ │ │ │ ├── Auth_Connectors.inc
│ │ │ │ │ ├── Brute-force_attack_prevention.inc
│ │ │ │ │ ├── Packet_Filtering.inc
│ │ │ │ │ ├── RealTimeBlockList.inc
│ │ │ │ │ ├── SASL_Mechanisms.inc
│ │ │ │ │ ├── Server_Certificates.inc
│ │ │ │ │ ├── TLS_Features_Configuration.inc
│ │ │ │ │ ├── XEP-0191_Blocking_Command.inc
│ │ │ │ │ └── _Security.rst
│ │ │ │ ├── Statistics_Description.rst
│ │ │ │ ├── Tigase_Server_Binary_Updates.rst
│ │ │ │ ├── Tigase_User_Guide/
│ │ │ │ │ ├── Configuration_Instructions.inc
│ │ │ │ │ ├── How_to_Use.inc
│ │ │ │ │ ├── Introduction.inc
│ │ │ │ │ └── User_Guide.rst
│ │ │ │ ├── Using_Tigase/
│ │ │ │ │ ├── Anonymous_Users.inc
│ │ │ │ │ ├── Basic_System_Checks.inc
│ │ │ │ │ ├── Clustering.inc
│ │ │ │ │ ├── Debugging_Tigase.inc
│ │ │ │ │ ├── Intro.inc
│ │ │ │ │ ├── LastActivity.inc
│ │ │ │ │ ├── Licensing.inc
│ │ │ │ │ ├── Log_Guide.inc
│ │ │ │ │ ├── Offline_Messages.inc
│ │ │ │ │ ├── Presence_Forwarding.inc
│ │ │ │ │ ├── PubSub_Server_Information.inc
│ │ │ │ │ ├── Scripting/
│ │ │ │ │ │ ├── Introduction.inc
│ │ │ │ │ │ ├── Python.inc
│ │ │ │ │ │ ├── Scripting_Support.inc
│ │ │ │ │ │ └── v4.4.x_Update.inc
│ │ │ │ │ ├── Tips_and_Tricks.inc
│ │ │ │ │ ├── Virtual_Domains.inc
│ │ │ │ │ ├── Watchdog.inc
│ │ │ │ │ └── _using_tigase.rst
│ │ │ │ ├── XMPP_Server/
│ │ │ │ │ ├── About_Tigase_XMPP_Server.rst
│ │ │ │ │ ├── Custom_Extensions.inc
│ │ │ │ │ └── Supported_Extension.inc
│ │ │ │ └── index.rst
│ │ │ ├── Tigase_Development/
│ │ │ │ ├── Basic_Information.rst
│ │ │ │ ├── Cluster_Map_Interface.rst
│ │ │ │ ├── CodeStyleGuide.rst
│ │ │ │ ├── Component_Implementation.rst
│ │ │ │ ├── CustomAuthRepository.rst
│ │ │ │ ├── Data_Sources_And_Repositories.rst
│ │ │ │ ├── EventBus_API.rst
│ │ │ │ ├── Experimental.rst
│ │ │ │ ├── Hack_Tigase_Jabber-XMPP_Server_in_Eclipse.rst
│ │ │ │ ├── Old_Stuff.rst
│ │ │ │ ├── Packet_Filtering_in_Component.rst
│ │ │ │ ├── Plugin_Development.rst
│ │ │ │ ├── Server_Compilation.rst
│ │ │ │ ├── Tests.rst
│ │ │ │ ├── Tigase_Kernel.rst
│ │ │ │ ├── UsingDataRepository.rst
│ │ │ │ ├── Using_Maven.rst
│ │ │ │ └── index.rst
│ │ │ ├── conf.py
│ │ │ ├── files/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── StatsDumper.groovy
│ │ │ │ └── tigase-upgrade.sh
│ │ │ ├── images/
│ │ │ │ └── devguide/
│ │ │ │ └── tigase-architecture-draw.io.xml
│ │ │ ├── index.rst
│ │ │ ├── locale/
│ │ │ │ ├── es/
│ │ │ │ │ └── LC_MESSAGES/
│ │ │ │ │ └── Tigase_Administration/
│ │ │ │ │ └── Release_Notes/
│ │ │ │ │ └── Tigase_Release_Notes.po
│ │ │ │ ├── pl/
│ │ │ │ │ └── LC_MESSAGES/
│ │ │ │ │ ├── Tigase_Administration/
│ │ │ │ │ │ ├── Components/
│ │ │ │ │ │ │ └── _Components.po
│ │ │ │ │ │ ├── Configuration/
│ │ │ │ │ │ │ └── _Configuration.po
│ │ │ │ │ │ ├── Database_Management/
│ │ │ │ │ │ │ └── Management.po
│ │ │ │ │ │ ├── Licensing_Open_Source.po
│ │ │ │ │ │ ├── Properties/
│ │ │ │ │ │ │ └── _properties.po
│ │ │ │ │ │ ├── Quick_Start_Guide/
│ │ │ │ │ │ │ └── Intro.po
│ │ │ │ │ │ ├── Release_Notes/
│ │ │ │ │ │ │ └── Tigase_Release_Notes.po
│ │ │ │ │ │ ├── Security/
│ │ │ │ │ │ │ └── _Security.po
│ │ │ │ │ │ ├── Statistics_Description.po
│ │ │ │ │ │ ├── Tigase_Server_Binary_Updates.po
│ │ │ │ │ │ ├── Tigase_User_Guide/
│ │ │ │ │ │ │ └── User_Guide.po
│ │ │ │ │ │ ├── Using_Tigase/
│ │ │ │ │ │ │ └── _using_tigase.po
│ │ │ │ │ │ ├── XMPP_Server/
│ │ │ │ │ │ │ └── About_Tigase_XMPP_Server.po
│ │ │ │ │ │ └── index.po
│ │ │ │ │ ├── Tigase_Development/
│ │ │ │ │ │ ├── Basic_Information.po
│ │ │ │ │ │ ├── Cluster_Map_Interface.po
│ │ │ │ │ │ ├── CodeStyleGuide.po
│ │ │ │ │ │ ├── Component_Implementation.po
│ │ │ │ │ │ ├── Data_Sources_And_Repositories.po
│ │ │ │ │ │ ├── EventBus_API.po
│ │ │ │ │ │ ├── Experimental.po
│ │ │ │ │ │ ├── Hack_Tigase_Jabber-XMPP_Server_in_Eclipse.po
│ │ │ │ │ │ ├── Old_Stuff.po
│ │ │ │ │ │ ├── Packet_Filtering_in_Component.po
│ │ │ │ │ │ ├── Plugin_Development.po
│ │ │ │ │ │ ├── Server_Compilation.po
│ │ │ │ │ │ ├── Tests.po
│ │ │ │ │ │ ├── Tigase_Kernel.po
│ │ │ │ │ │ ├── Using_Maven.po
│ │ │ │ │ │ └── index.po
│ │ │ │ │ └── index.po
│ │ │ │ └── zh_CN/
│ │ │ │ └── LC_MESSAGES/
│ │ │ │ ├── Tigase_Administration/
│ │ │ │ │ ├── Components/
│ │ │ │ │ │ └── _Components.po
│ │ │ │ │ ├── Configuration/
│ │ │ │ │ │ └── _Configuration.po
│ │ │ │ │ ├── Database_Management/
│ │ │ │ │ │ └── Management.po
│ │ │ │ │ ├── Licensing_Open_Source.po
│ │ │ │ │ ├── Properties/
│ │ │ │ │ │ └── _properties.po
│ │ │ │ │ ├── Quick_Start_Guide/
│ │ │ │ │ │ └── Intro.po
│ │ │ │ │ ├── Release_Notes/
│ │ │ │ │ │ └── Tigase_Release_Notes.po
│ │ │ │ │ ├── Security/
│ │ │ │ │ │ └── _Security.po
│ │ │ │ │ ├── Statistics_Description.po
│ │ │ │ │ ├── Tigase_Server_Binary_Updates.po
│ │ │ │ │ ├── Tigase_User_Guide/
│ │ │ │ │ │ └── User_Guide.po
│ │ │ │ │ ├── Using_Tigase/
│ │ │ │ │ │ └── _using_tigase.po
│ │ │ │ │ ├── XMPP_Server/
│ │ │ │ │ │ └── About_Tigase_XMPP_Server.po
│ │ │ │ │ └── index.po
│ │ │ │ ├── Tigase_Development/
│ │ │ │ │ ├── Basic_Information.po
│ │ │ │ │ ├── Cluster_Map_Interface.po
│ │ │ │ │ ├── CodeStyleGuide.po
│ │ │ │ │ ├── Component_Implementation.po
│ │ │ │ │ ├── Data_Sources_And_Repositories.po
│ │ │ │ │ ├── EventBus_API.po
│ │ │ │ │ ├── Experimental.po
│ │ │ │ │ ├── Hack_Tigase_Jabber-XMPP_Server_in_Eclipse.po
│ │ │ │ │ ├── Old_Stuff.po
│ │ │ │ │ ├── Packet_Filtering_in_Component.po
│ │ │ │ │ ├── Plugin_Development.po
│ │ │ │ │ ├── Server_Compilation.po
│ │ │ │ │ ├── Tests.po
│ │ │ │ │ ├── Tigase_Kernel.po
│ │ │ │ │ ├── Using_Maven.po
│ │ │ │ │ └── index.po
│ │ │ │ └── index.po
│ │ │ ├── make.bat
│ │ │ ├── readme.md
│ │ │ └── requirements.txt
│ │ ├── ruby/
│ │ │ └── tigase/
│ │ │ └── admin/
│ │ │ └── RubyExample.rb
│ │ └── scala/
│ │ └── tigase/
│ │ └── admin/
│ │ └── ScalaExample.scala
│ └── test/
│ ├── java/
│ │ └── tigase/
│ │ ├── Assert.java
│ │ ├── TestLogger.java
│ │ ├── auth/
│ │ │ ├── BruteForceLockerBeanTest.java
│ │ │ ├── credentials/
│ │ │ │ └── entries/
│ │ │ │ ├── MD5PasswordCredentialsEntryTest.java
│ │ │ │ ├── MD5UserIdPasswordCredentialsEntryTest.java
│ │ │ │ ├── MD5UsernamePasswordCredentialsEntryTest.java
│ │ │ │ ├── PlainCredentialsEntryTest.java
│ │ │ │ └── ScramCredentialsEntryTest.java
│ │ │ └── mechanisms/
│ │ │ ├── SCRAMHelperTest.java
│ │ │ ├── SaslANONYMOUSTest.java
│ │ │ ├── SaslPLAINTest.java
│ │ │ ├── SaslSCRAMPlusTest.java
│ │ │ ├── SaslSCRAMTest.java
│ │ │ └── SaslXTOKENTest.java
│ │ ├── cluster/
│ │ │ ├── ClusterConnectionSelectorTest.java
│ │ │ ├── api/
│ │ │ │ └── ClusterElementTest.java
│ │ │ └── strategy/
│ │ │ └── DefaultClusterStrategyTest.java
│ │ ├── component/
│ │ │ ├── Bean1.java
│ │ │ └── DSLBeanConfiguratorTest.java
│ │ ├── conf/
│ │ │ ├── ConfigHelperTest.java
│ │ │ ├── ConfigHolderTest.java
│ │ │ └── ConfigReaderTest.java
│ │ ├── db/
│ │ │ ├── AbstractDataSourceAwareTestCase.java
│ │ │ ├── AbstractDataSourceTestCase.java
│ │ │ ├── AbstractUserRepositoryTest.java
│ │ │ ├── jdbc/
│ │ │ │ └── JDBCRepositoryTest.java
│ │ │ └── util/
│ │ │ ├── DBSchemaLoaderTest.java
│ │ │ ├── JDBCPasswordObfuscatorTest.java
│ │ │ └── locker/
│ │ │ └── ConnectionLockTest.java
│ │ ├── disco/
│ │ │ └── ServiceIdentityTest.java
│ │ ├── eventbus/
│ │ │ ├── component/
│ │ │ │ └── stores/
│ │ │ │ └── AffiliationStoreTest.java
│ │ │ └── impl/
│ │ │ ├── Event1.java
│ │ │ ├── Event12.java
│ │ │ ├── Event2.java
│ │ │ ├── EventBusImplementationTest.java
│ │ │ ├── EventBusSerializerTest.java
│ │ │ ├── EventNameTest.java
│ │ │ ├── EventsNameMapTest.java
│ │ │ └── ReflectEventListenerHandlerFactoryTest.java
│ │ ├── io/
│ │ │ ├── CertificateContainerTest.java
│ │ │ └── SSLContextContainerTest.java
│ │ ├── kernel/
│ │ │ ├── AbstractKernelTestCase.java
│ │ │ ├── AbstractKernelWithUserRepositoryTestCase.java
│ │ │ ├── Bean1.java
│ │ │ ├── Bean10.java
│ │ │ ├── Bean2.java
│ │ │ ├── Bean3.java
│ │ │ ├── Bean4.java
│ │ │ ├── Bean5.java
│ │ │ ├── Bean5Factory.java
│ │ │ ├── Bean6.java
│ │ │ ├── Bean7.java
│ │ │ ├── Bean8.java
│ │ │ ├── DefaultTypesConverterTest.java
│ │ │ ├── GenericBeanKernelTest.java
│ │ │ ├── KernelTest.java
│ │ │ ├── RegistrarBeanKernelTest.java
│ │ │ ├── RegistratBeanCyclicTest.java
│ │ │ ├── Special.java
│ │ │ └── modular/
│ │ │ ├── ApplicationTest.java
│ │ │ ├── Component.java
│ │ │ ├── ComponentsManager.java
│ │ │ ├── c1/
│ │ │ │ ├── Component1.java
│ │ │ │ ├── Component1Registrar.java
│ │ │ │ └── Helper.java
│ │ │ └── c2/
│ │ │ ├── Component2.java
│ │ │ └── Component2Registrar.java
│ │ ├── map/
│ │ │ ├── ClusterMapFactoryTest.java
│ │ │ └── DMapTest.java
│ │ ├── monitor/
│ │ │ └── tasks/
│ │ │ └── UsersDisconnectTaskTest.java
│ │ ├── server/
│ │ │ ├── BasicComponentTest.java
│ │ │ ├── BootstrapTest.java
│ │ │ ├── CmdAclTest.java
│ │ │ ├── ConnectionManagerTest.java
│ │ │ ├── MessageRouterTest.java
│ │ │ ├── PacketTest.java
│ │ │ ├── amp/
│ │ │ │ └── db/
│ │ │ │ ├── AbstractMsgBroadcastRepositoryTest.java
│ │ │ │ ├── AbstractMsgRepositoryTest.java
│ │ │ │ ├── JDBCMsgBroadcastRepositoryTest.java
│ │ │ │ └── JDBCMsgRepositoryTest.java
│ │ │ ├── bosh/
│ │ │ │ └── BoshIOServiceTest.java
│ │ │ ├── rtbl/
│ │ │ │ ├── RTBLRepositoryTest.java
│ │ │ │ └── RTBLTest.java
│ │ │ ├── websocket/
│ │ │ │ ├── WebSocketHixie76Test.java
│ │ │ │ ├── WebSocketHybiTest.java
│ │ │ │ └── WebSocketXMPPIOServiceTest.java
│ │ │ ├── xmppclient/
│ │ │ │ └── StreamManagementIOProcessorTest.java
│ │ │ ├── xmppserver/
│ │ │ │ ├── S2SConnManAbstractTest.java
│ │ │ │ ├── S2SConnManDomainTest.java
│ │ │ │ ├── S2SConnManTest.java
│ │ │ │ ├── S2SConnectionManagerDomainServerNameMapperTest.java
│ │ │ │ ├── SSLSocketDirectTest.java
│ │ │ │ ├── SSLTestAbstract.java
│ │ │ │ └── proc/
│ │ │ │ └── DialbackTest.java
│ │ │ └── xmppsession/
│ │ │ └── adhoc/
│ │ │ └── SuggestedDomainsListAdhocTest.java
│ │ ├── stats/
│ │ │ ├── MaxDailyCounterQueueTest.java
│ │ │ └── StatisticsListTest.java
│ │ ├── sys/
│ │ │ └── NativeMemoryTrackingTest.java
│ │ ├── tests/
│ │ │ └── SlowTest.java
│ │ ├── util/
│ │ │ ├── AllHistoryCacheTest.java
│ │ │ ├── DataTypesTest.java
│ │ │ ├── ReflectionHelperTest.java
│ │ │ └── updater/
│ │ │ └── UpdatesCheckerTest.java
│ │ ├── vhosts/
│ │ │ ├── DummyVHostManager.java
│ │ │ ├── VHostItemTest.java
│ │ │ ├── VHostJDBCRepositoryTest.java
│ │ │ └── filter/
│ │ │ ├── CustomDomainFilterTest.java
│ │ │ └── DomainFilterPolicyTest.java
│ │ └── xmpp/
│ │ ├── ElementMatcherTest.java
│ │ ├── XMPPDomBuilderHandlerTest.java
│ │ ├── XMPPIOServiceTest_Proxy.java
│ │ ├── XMPPProcessorAbstractTest.java
│ │ └── impl/
│ │ ├── AbstractProcessorWithDataSourceAwareTestCase.java
│ │ ├── AbstractProcessorWithDataSourceTestCase.java
│ │ ├── AddressingSanitizerTest.java
│ │ ├── BindResourceTest.java
│ │ ├── BlockingCommandTest.java
│ │ ├── C2SDeliveryErrorProcessorTest.java
│ │ ├── DomainFilterTest.java
│ │ ├── JabberIqAuthTest.java
│ │ ├── JabberIqCommandTest.java
│ │ ├── JabberIqPrivacyTest.java
│ │ ├── JabberIqRegisterTest.java
│ │ ├── JabberIqRegisterWhitelistTest.java
│ │ ├── MIXProcessorTest.java
│ │ ├── MessageAmpTest.java
│ │ ├── MessageCarbonsTest.java
│ │ ├── MessageDeliveryLogicTest.java
│ │ ├── MessageTest.java
│ │ ├── MobileV3Test.java
│ │ ├── OfflineMessagesTest.java
│ │ ├── OfflineMessages_StampComparatorTest.java
│ │ ├── PresenceCapabilitiesManagerTest.java
│ │ ├── PrivacyListTest.java
│ │ ├── ProcessorTestCase.java
│ │ ├── SaslAuth2Test.java
│ │ ├── SaslAuthTest.java
│ │ ├── TokenBucketPoolTest.java
│ │ ├── VCardHelperTest.java
│ │ ├── annotation/
│ │ │ ├── AnnotatedXMPPProcessorTest.java
│ │ │ ├── TestAnnotatedXMPPProcessor.java
│ │ │ └── TestAnnotatedXMPPProcessor2.java
│ │ ├── push/
│ │ │ ├── EncryptedPushNotificationExtensionTest.java
│ │ │ ├── PushNotificationHelper.java
│ │ │ ├── PushNotificationsTest.java
│ │ │ ├── PushNotificationsWithAwayTest.java
│ │ │ └── PushPresenceTest.java
│ │ └── roster/
│ │ ├── PresenceSubscriptionPreApprovalTest.java
│ │ └── RosterElementTest.java
│ └── resources/
│ ├── TestScript.groovy
│ └── logging.properties
└── tigase-server.doap
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: [tigase]
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'bug'
assignees: ''
---
> # NOTE: Tigase has new home at [tigase.dev](https://tigase.dev/) - please submit all issues/pull-requests there in the relevant sub-project!
For main Tigase Server please submit it here: https://tigase.dev/tigase/_server/server-core/~issues/
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: 'enhancement'
assignees: ''
---
> # NOTE: Tigase has new home at [tigase.dev](https://tigase.dev/) - please submit all issues/pull-requests there in the relevant sub-project!
For main Tigase Server please submit it here: https://tigase.dev/tigase/_server/server-core/~issues/
================================================
FILE: .github/ISSUE_TEMPLATE/question.md
================================================
---
name: General question
about: Just a question
title: ''
labels: 'question'
assignees: ''
---
> # NOTE: Tigase has new home at [tigase.dev](https://tigase.dev/) - please submit all issues/pull-requests there in the relevant sub-project!
For main Tigase Server please submit it here: https://tigase.dev/tigase/_server/server-core/~issues/
================================================
FILE: .gitignore
================================================
.settings
target
init.properties
.classpath
.project
scripts/admin
all-production-servers.txt
MANIFEST.MF
cluster-1-servers.txt
cluster-2-servers.txt
jars/**
logs/**
libs/**
!logs/server-info.html
config.txt
docs
packages
certs/*
certs/default.pem
certs/test-d.pem
certs/tls-required.com.pem
scripts/update-code-config.sh
etc/config-dump.properties
distribution/ChangeLog
distribution/License.html
distribution/README
distribution/package.html
etc/META-INF/maven/tigase/tigase-http-api/pom.xml
scripts/pubsub/repository_migrator.groovy
database/README.txt
database/pubsub-*
database/*-pubsub-*
database/*-muc-*
database/*-message-archiving-*
database/*-unified-archive-*
database/muc-db-migrate.*derby.log
tigase/setup
.idea/
*.iml
/bin/
/out/
src/main/groovy/tigase/admin/DeleteItem.groovy
src/main/groovy/tigase/admin/ListItems.groovy
src/main/groovy/tigase/admin/ListNodes.groovy
src/main/groovy/tigase/admin/RetrieveItem.groovy
etc/installation-id
etc/*.licence*
documentation/text/components
documentation/devguide/text/components
distribution-docs
distribution-packages
logs
etc/acs.licence
etc/config-dump.properties
etc/installation-id
src/main/restructured/locale/*/LC_MESSAGES/Tigase_Administration/*.mo
src/main/restructured/locale/*/LC_MESSAGES/Tigase_Development/*.mo
src/main/restructured/locale/*/LC_MESSAGES/Tigase_Administration/*/*.mo
src/main/restructured/locale/*/LC_MESSAGES/Tigase_Development/*/*.mo
src/main/restructured/locale/*/LC_MESSAGES/*.mo
src/main/restructured/locale/*/LC_MESSAGES/*.mo
src/main/restructured/_build/
================================================
FILE: .mvn/extensions.xml
================================================
co.leantechniquesmaven-buildtime-extension3.0.5com.soebes.maven.extensionsmaven-buildtime-profiler0.5.0fr.jcgay.mavenmaven-profiler3.3
================================================
FILE: .onedev-buildspec.yml
================================================
version: 40
imports:
- projectPath: Templates
revision: 0.0.8
jobs:
- name: Maven CI
jobExecutor: linux
steps:
- !UseTemplateStep
name: maven build & deploy
templateName: Tigase Server - Maven build & deploy
paramMatrix:
- name: timestamp-to-make-distinct
valuesProvider: !ScriptingValues
scriptName: getDateTimestamp
secret: false
condition: SUCCESSFUL
optional: false
triggers:
- !BranchUpdateTrigger {}
projectDependencies:
- projectPath: tigase/_server/tigase-utils
buildProvider: !LastFinishedBuild
jobName: Maven CI
artifacts: '**'
- projectPath: tigase/_server/tigase-xmltools
buildProvider: !LastFinishedBuild
jobName: Maven CI
artifacts: '**'
retryCondition: never
maxRetries: 3
retryDelay: 30
timeout: 3600
postBuildActions:
- !SendNotificationAction
condition: failed
receivers: group(TigaseCoreTeam)
================================================
FILE: .readthedocs.yaml
================================================
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
python:
install:
- requirements: src/main/restructured/requirements.txt
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: src/main/restructured/conf.py
================================================
FILE: COPYING
================================================
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
.
================================================
FILE: License.html
================================================
GNU Affero General Public License - GNU Project - Free Software Foundation (FSF)
The GNU Affero General Public License is a free, copyleft license
for software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are
designed to take away your freedom to share and change the works. By
contrast, our General Public Licenses are intended to guarantee your
freedom to share and change all versions of a program--to make sure it
remains free software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public
License.
"Copyright" also means copyright-like laws that apply to other kinds
of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further restriction,
you may remove that term. If a license document contains a further
restriction but permits relicensing or conveying under this License, you
may add to a covered work material governed by the terms of that license
document, provided that the further restriction does not survive such
relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have permission
to link or combine any covered work with a work licensed under version 3
of the GNU General Public License into a single combined work, and to
convey the resulting work. The terms of this License will continue to
apply to the part which is the covered work, but the work with which it is
combined will remain governed by version 3 of the GNU General Public
License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may differ
in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero
General Public License "or any later version" applies to it, you have
the option of following the terms and conditions either of that
numbered version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number
of the GNU Affero General Public License, you may choose any version
ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that
proxy's public statement of acceptance of a version permanently
authorizes you to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
================================================
FILE: README.md
================================================
> # NOTE: Tigase has new home at [tigase.dev](https://tigase.dev/) - please submit all issues/pull-requests there in the relevant sub-project!
Highly optimized, extremely modular and very flexible XMPP/Jabber server
# What it is
Tigase XMPP Server is highly optimized, extremely modular and very flexible XMPP/Jabber server written in Java.
This repository contains source code of the main part of the Tigase XMPP Server.
*The project exists since 2004 and we have recently moved it over to GitHub.*
Other Tigase projects related to XMPP:
Tigase XMPP Server addons:
* [MUC Component](https://github.com/tigase/tigase-muc) - Multi-User Chat: [XEP-0045](https://xmpp.org/extensions/xep-0045.html)
* [PubSub Component](https://github.com/tigase/tigase-pubsub) - Publish-Subscribe: [XEP-0060](https://xmpp.org/extensions/xep-0060.html) and Personal Eventing Protocol: [XEP-0163](https://xmpp.org/extensions/xep-0163.html)
* [Socks5 Proxy Component](https://github.com/tigase/tigase-socks5) - SOCKS5 Bytestreams: [XEP-0065](https://xmpp.org/extensions/xep-0065.html)
* [STUN Component](https://github.com/tigase/tigase-stun) - [STUN](https://en.wikipedia.org/wiki/STUN) Component for Tigase
* [HTTP API Component](https://github.com/tigase/tigase-http-api) - Component providing easy to use HTTP endpoints for server management and integration based on JDK built-in HTTP server.
* [Jetty HTTP API Component](https://github.com/tigase/tigase-http-api-jetty) - High performance and high load component providing easy to use HTTP endpoints for server management and integration based on [Jetty HTTP Server](https://www.eclipse.org/jetty/).
* [MongoDB Connector](https://github.com/tigase/tigase-mongodb) - Connector adding support for [MongoDB](https://www.mongodb.com) database to Tigase server.
* [Message Archiving Component](https://github.com/tigase/tigase-message-archiving) - Component providing Message Archiving [XEP-0136](https://xmpp.org/extensions/xep-0136.html) and Message Archive Management [XEP-0313](https://xmpp.org/extensions/xep-0313.html) support.
Tools:
* [Database Migrator Tool](https://github.com/tigase/tigase-database-migrator) - Tools helping with migration from other XMPP servers to Tigase based system.
* [TTS-NG Test Suite](https://github.com/tigase/tigase-tts-ng) - Test Suite to run automated tests for the Tigase XMPP Server
* [Tigase Monitor Console](https://github.com/tigase/tigase-monitor) - Stand-alone application for the Tigase XMPP Server monitoring and management console.
* [Atom DSL Syntax](https://github.com/tigase/tigase-dsl-syntax-highlighter-for-atom) - [Atom](https://atom.io/) DSL syntex highlighter for Tigase XMPP Server configuration files.
* [IntelliJ IDEA DSL Syntax](https://github.com/tigase/tigase-dsl-syntax-highlighter-for-atom) - [IntelliJ IDEA IDE](https://www.jetbrains.com/idea/) DSL syntex highlighter for Tigase XMPP Server configuration files.
Tigase XMPP Clients:
* [StorkIM Client](https://github.com/tigase/stork) - Android XMPP Client
* [SiskinIM Client](https://github.com/tigase/siskin-im) - iOS XMPP Client
* [BeagleIM Client](https://github.com/tigase/beagle-im) - MacOS XMPP Client
* [Swift Library](https://github.com/tigase/tigase-swift) - Tigase Swift XMPP Library
* [Swift OMEMO Plugin](https://github.com/tigase/tigase-swift-omemo) - OMEMO support for Tigase Swift XMPP library
Tigase based IoT:
* [Tigase IoT Framework](https://github.com/tigase/tigase-iot-framework) - Easy to use IoT framework to communicate and control Iot devices over XMPP
* [Tigase IoT Framework - Examples](https://github.com/tigase/tigase-iot-framework-examples) - Examples on how to extend the Tigase IoT Framework with support for different devices
* [Tigase RPi Library](https://github.com/tigase/tigase-rpi) - Java low-level library to control sensors and devices connected to RasperryPi.
# Features
Tigase XMPP Server contains full support for [RFC 6120 - XMPP CORE](http://xmpp.org/rfcs/rfc6120.html), [RFC 6121 - XMPP IM](http://xmpp.org/rfcs/rfc6120.html) and [RFC 7395 - XMPP over WebSockets](https://tools.ietf.org/html/rfc7395) making it accessible using XMPP client connections:
* over TCP
* over HTTP/HTTPS (BOSH)
* over WebSockets
and over server-to-server connections as well as over XMPP component connections.
Additionally Tigase XMPP Server provides HTTP API for integration with other services unable to communicate over XMPP.
Moveover, Tigase XMPP Server comes with support for Push Notifications making it possible to push notification to mobile devices.
Following features are supported by Tigase XMPP Server:
* [XEP-0016: Flexible Offline Message Retrieval](http://xmpp.org/extensions/xep-0016.html)
* [XEP-0030: Service Discovery](http://xmpp.org/extensions/xep-0030.html)
* [XEP-0045: Multi User Chat](http://xmpp.org/extensions/xep-0045.html)
* [XEP-0060: Publish-Subscribe](http://xmpp.org/extensions/xep-0060.html)
* [XEP-0079: Advanced Message Processing](http://xmpp.org/extensions/xep-0079.html)
* [XEP-0114: Jabber Component Protocol](http://xmpp.org/extensions/xep-0114.html)
* [XEP-0115: Entity Capabilities](http://xmpp.org/extensions/xep-0115.html)
* [XEP-0133: Service Administration](http://xmpp.org/extensions/xep-0133.html)
* [XEP-0136: Message Archiving](http://xmpp.org/extensions/xep-0136.html)
* [XEP-0163: Personal Eventing Protocol](http://xmpp.org/extensions/xep-0163.html)
* [XEP-0198: Stream Management](http://xmpp.org/extensions/xep-0198.html)
* [XEP-0199: XMPP Ping](http://xmpp.org/extensions/xep-0199.html)
* [XEP-0206: XMPP over BOSH](http://xmpp.org/extensions/xep-0206.html)
* [XEP-0225: Component Connections](http://xmpp.org/extensions/xep-0225.html)
* [XEP-0237: Roster Versioning](http://xmpp.org/extensions/xep-0237.html)
* [XEP-0280: Message Carbons](http://xmpp.org/extensions/xep-0280.html)
* [XEP-0313: Message Archive Management](http://xmpp.org/extensions/xep-0313.html)
* [XEP-0357: Push Notifications](http://xmpp.org/extensions/xep-0357.html)
* [XEP-0363: HTTP File Upload](http://xmpp.org/extensions/xep-0363.html)
* and many more...
# Support
When looking for support, please first search for answers to your question in the available online channels:
* Our online documentation: [Tigase Docs](https://docs.tigase.net)
* Existing issues in relevant project, for Tigase Server it's: [Tigase XMPP Server GitHub issues](https://github.com/tigase/tigase-server/issues)
If you didn't find an answer in the resources above, feel free to submit your question as [new issue on GitHub](https://github.com/tigase/tigase-server/issues/new/choose) or, if you have valid support subscription, open [new support ticket](https://tigase.net/technical-support).
# Downloads
You can download distribution version of the Tigase XMPP Server directly from [here](https://github.com/tigase/tigase-server/releases).
If you wish to downloand SNAPSHOT build of the development version of Tigase XMPP Server you can grab it from [here](https://build.tigase.net/nightlies/dists/latest/tigase-server-dist-max.zip).
# Installation and usage
Documentation of the project is part of the Tigase XMPP Server distribution package. Quickstart guide is also available [here](https://docs.tigase.net/en/latest/Tigase_Administration/Quick_Start_Guide/Intro.html).
# Compilation
Compilation of the project is very easy as it is typical Maven project. All you need to do is to execute
````bash
mvn package test
````
to compile the project and run unit tests.
# License
Official Tigase repository is available at: https://github.com/tigase/tigase-server/.
Copyright (c) 2004 Tigase, Inc.
Licensed under AGPL License Version 3. Other licensing options available upon request.
================================================
FILE: etc/bosh-extra-headers.txt
================================================
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-Type
Access-Control-Max-Age: 86400
================================================
FILE: etc/client-access-policy.xml
================================================
================================================
FILE: etc/config.properties
================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Framework config properties.
#
# To override the packages the framework exports by default from the
# class path, set this variable.
#org.osgi.framework.system.packages=
# To append packages to the default set of exported system packages,
# set this value.
#org.osgi.framework.system.packages.extra=javax.*
# The following property makes specified packages from the class path
# available to all bundles. You should avoid using this property.
org.osgi.framework.bootdelegation=sun.*,com.sun.*,org.xml.sax.*
# Felix tries to guess when to implicitly boot delegate in certain
# situations to ease integration without outside code. This feature
# is enabled by default, uncomment the following line to disable it.
#felix.bootdelegation.implicit=false
# The following property explicitly specifies the location of the bundle
# cache, which defaults to "felix-cache" in the current working directory.
# If this value is not absolute, then the felix.cache.rootdir controls
# how the absolute location is calculated. (See next property)
#org.osgi.framework.storage=${dollar}{felix.cache.rootdir}/felix-cache
# The following property is used to convert a relative bundle cache
# location into an absolute one by specifying the root to prepend to
# the relative cache path. The default for this property is the
# current working directory.
#felix.cache.rootdir=${dollar}{user.dir}
# The following property controls whether the bundle cache is flushed
# the first time the framework is initialized. Possible values are
# "none" and "onFirstInit"; the default is "none".
org.osgi.framework.storage.clean=onFirstInit
# The following property determines which actions are performed when
# processing the auto-deploy directory. It is a comma-delimited list of
# the following values: 'install', 'start', 'update', and 'uninstall'.
# An undefined or blank value is equivalent to disabling auto-deploy
# processing.
felix.auto.deploy.action=install,start
# The following property specifies the directory to use as the bundle
# auto-deploy directory; the default is 'bundle' in the working directory.
felix.auto.deploy.dir=jars
# The following property is a space-delimited list of bundle URLs
# to install when the framework starts. The ending numerical component
# is the target start level. Any number of these properties may be
# specified for different start levels.
#felix.auto.install.1=
# The following property is a space-delimited list of bundle URLs
# to install and start when the framework starts. The ending numerical
# component is the target start level. Any number of these properties
# may be specified for different start levels.
#felix.auto.start.1=
felix.log.level=1
# Sets the initial start level of the framework upon startup.
#org.osgi.framework.startlevel.beginning=1
# Sets the start level of newly installed bundles.
#felix.startlevel.bundle=1
# Felix installs a stream and content handler factories by default,
# uncomment the following line to not install them.
#felix.service.urlhandlers=false
# The launcher registers a shutdown hook to cleanly stop the framework
# by default, uncomment the following line to disable it.
felix.shutdown.hook=true
#
# Bundle config properties.
#
osgi.shell.telnet.ip=127.0.0.1
osgi.shell.telnet.port=9070
osgi.shell.telnet.maxconn=2
osgi.shell.telnet.socketTimeout=0
# debugging
#felix.log.level=4
#org.apache.felix.http.debug=true
================================================
FILE: etc/config.tdsl
================================================
'config-type' = 'setup'
http () {
setup () {
'admin-user' = 'admin'
'admin-password' = 'tigase'
}
}
================================================
FILE: etc/cross-domain-policy.xml
================================================
================================================
FILE: etc/init-debian.properties
================================================
config-type = --gen-config-def
--admins = admin@$HOST_NAME
--virt-hosts = $HOST_NAME
--debug=server
--user-db-uri = jdbc:derby:/var/lib/tigase/tigase-derbydb;create=true;logDevice=/var/log/tigase
basic-conf/logging/java.util.logging.FileHandler.pattern = /var/log/tigase/tigase.log
vhost-man/vhost-repo-uri = jdbc:derby:/var/lib/tigase/tigase-derbydb;create=true;logDevice=/var/log/tigase
================================================
FILE: etc/init-mysql.properties
================================================
# Load standard set of the server components.
# Look at the http://www.tigase.org/configuration-wizards
# document for other possible values. Normally you don't
# need to change this line.
config-type=--gen-config-def
# List of administrator accounts, please replace them with
# administrator accounts in your installation
--admins=admin@devel.tigase.org,admin@test-d
# The line says that the database used by the Tigase server is 'mysql'
# Look at the configuration wizards article for different options
# You can also put here a Java class name if you have a custom
# implementation for a database connector.
--user-db=mysql
# The line contains the database connection string. This is database
# specific string and for each kind of database it may look differently.
# Below string is for MySQL database. Please modify it for your system.
# MySQL connector requires connection string in the following format:
# jdbc:mysql://[hostname]/[database name]?user=[user name]&password=[user password]
--user-db-uri=jdbc:mysql://localhost/tigasedb?user=tigase_user&password=mypass
# Virtual domains for your server installation, comma separated list of vhosts
--virt-hosts=devel.tigase.org,test-d
# Select what packages you want to have logging switched for
# The below setting is recommended for the initail setup and it is required
# when asking for help with setting the server up
--debug=server
# Activate HTTP API component for web based configuration and installation
--comp-name-1=http
--comp-class-1=tigase.http.HttpMessageReceiver
================================================
FILE: etc/jmx.access
================================================
######################################################################
# Default Access Control File for Remote JMX(TM) Monitoring
######################################################################
#
# Access control file for Remote JMX API access to monitoring.
# This file defines the allowed access for different roles. The
# password file (jmxremote.password by default) defines the roles and their
# passwords. To be functional, a role must have an entry in
# both the password and the access files.
#
# Default location of this file is $JRE/lib/management/jmxremote.access
# You can specify an alternate location by specifying a property in
# the management config file $JRE/lib/management/management.properties
# (See that file for details)
#
# The file format for password and access files is syntactically the same
# as the Properties file format. The syntax is described in the Javadoc
# for java.util.Properties.load.
# Typical access file has multiple lines, where each line is blank,
# a comment (like this one), or an access control entry.
#
# An access control entry consists of a role name, and an
# associated access level. The role name is any string that does not
# itself contain spaces or tabs. It corresponds to an entry in the
# password file (jmxremote.password). The access level is one of the
# following:
# "readonly" grants access to read attributes of MBeans.
# For monitoring, this means that a remote client in this
# role can read measurements but cannot perform any action
# that changes the environment of the running program.
# "readwrite" grants access to read and write attributes of MBeans,
# to invoke operations on them, and to create or remove them.
# This access should be granted to only trusted clients,
# since they can potentially interfere with the smooth
# operation of a running program
#
# A given role should have at most one entry in this file. If a role
# has no entry, it has no access.
# If multiple entries are found for the same role name, then the last
# access entry is used.
#
#
# Default access control entries:
# o The "monitorRole" role has readonly access.
# o The "controlRole" role has readwrite access.
monitor readonly
admin readwrite
================================================
FILE: etc/jmx.password
================================================
# ----------------------------------------------------------------------
# Template for jmxremote.password
#
# o Copy this template to jmxremote.password
# o Set the user/password entries in jmxremote.password
# o Change the permission of jmxremote.password to read-only
# by the owner.
#
# See below for the location of jmxremote.password file.
# ----------------------------------------------------------------------
##############################################################
# Password File for Remote JMX Monitoring
##############################################################
#
# Password file for Remote JMX API access to monitoring. This
# file defines the different roles and their passwords. The access
# control file (jmxremote.access by default) defines the allowed
# access for each role. To be functional, a role must have an entry
# in both the password and the access files.
#
# Default location of this file is $JRE/lib/management/jmxremote.password
# You can specify an alternate location by specifying a property in
# the management config file $JRE/lib/management/management.properties
# or by specifying a system property (See that file for details).
##############################################################
# File permissions of the jmxremote.password file
##############################################################
# Since there are cleartext passwords stored in this file,
# this file must be readable by ONLY the owner,
# otherwise the program will exit with an error.
#
# The file format for password and access files is syntactically the same
# as the Properties file format. The syntax is described in the Javadoc
# for java.util.Properties.load.
# Typical password file has multiple lines, where each line is blank,
# a comment (like this one), or a password entry.
#
#
# A password entry consists of a role name and an associated
# password. The role name is any string that does not itself contain
# spaces or tabs. The password is again any string that does not
# contain spaces or tabs. Note that passwords appear in the clear in
# this file, so it is a good idea not to use valuable passwords.
#
# A given role should have at most one entry in this file. If a role
# has no entry, it has no access.
# If multiple entries are found for the same role name, then the last one
# is used.
#
# In a typical installation, this file can be read by anybody on the
# local machine, and possibly by people on other machines.
# For # security, you should either restrict the access to this file,
# or specify another, less accessible file in the management config file
# as described above.
#
# Following are two commented-out entries. The "measureRole" role has
# password "QED". The "controlRole" role has password "R&D".
#
# monitorRole QED
# controlRole R&D
admin admin_pass
monitor monitor_pass
================================================
FILE: etc/logback.xml
================================================
logs/${HOSTNAME}/tigase.logback.logfalselogs/${HOSTNAME}/tigase.logback.%d{yyyy-MM-dd}.%i.log.gz250MB71GBtrue%-125(%yellow([%d{yyyy-MM-dd HH:mm:ss.SSS}]) [%highlight(%-5level)] [%20(%thread)] %blue(%logger{5}.%method\(\))): %msg %n
================================================
FILE: etc/snmp.acl
================================================
# ----------------------------------------------------------------------
# Template for SNMP Access Control List File
#
# o Copy this template to snmp.acl
# o Set access control for SNMP support
# o Change the permission of snmp.acl to be read-only
# by the owner.
#
# See below for the location of snmp.acl file.
# ----------------------------------------------------------------------
############################################################
# SNMP Access Control List File
############################################################
#
# Default location of this file is $JRE/lib/management/snmp.acl.
# You can specify an alternate location by specifying a property in
# the management config file $JRE/lib/management/management.properties
# or by specifying a system property (See that file for details).
#
##############################################################
# File permissions of the snmp.acl file
##############################################################
#
# Since there are cleartext community strings stored in this file,
# this ACL file must be readable by ONLY the owner,
# otherwise the program will exit with an error.
#
##############################################################
# Format of the acl group
##############################################################
#
# communities: a list of SNMP community strings to which the
# access control applies separated by commas.
#
# access: either "read-only" or "read-write".
#
# managers: a list of hosts to be granted the access rights.
# Each can be expressed as any one of the following:
# - hostname: hubble
# - ip v4 and v6 addresses: 123.456.789.12 , fe80::a00:20ff:fe9b:ea82
# - ip v4 and v6 netmask prefix notation: 123.456.789.0/24,
# fe80::a00:20ff:fe9b:ea82/64
# see RFC 2373 (http://www.ietf.org/rfc/rfc2373.txt)
#
# An example of two community groups for multiple hosts:
# acl = {
# {
# communities = public, private
# access = read-only
# managers = hubble, snowbell, nanak
# }
# {
# communities = jerry
# access = read-write
# managers = hubble, telescope
# }
# }
#
##############################################################
# Format of the trap group
##############################################################
#
# trap-community: a single SNMP community string that will be included
# in the traps sent to the hosts.
#
# hosts: a list of hosts to which the SNMP agent will send traps.
#
# An example of two trap community definitions for multiple hosts:
# trap = {
# {
# trap-community = public
# hosts = hubble, snowbell
# }
# {
# trap-community = private
# hosts = telescope
# }
# }
#
############################################################
#
# Update the community strings (public and private) below
# before copying this template file
#
# Common SNMP ACL Example
# ------------------------
#
# o Only localhost can connect, and access rights
# are limited to read-only
# o Traps are sent to localhost only
#
#
acl = {
{
communities = public, private
access = read-write
managers = localhost, devel.tigase.org
}
}
#
#
# trap = {
# {
# trap-community = public
# hosts = localhost
# }
# }
================================================
FILE: etc/tigase.conf
================================================
#osgiEnabled=(true|false)
#osgiEnabled=false
OSGI=${osgiEnabled}
ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8"
#GC=" -XX:NewRatio=2 -XX:-ReduceInitialCardMarks "
#EX="-XX:+OptimizeStringConcat -XX:+DoEscapeAnalysis -XX:+UseNUMA -XX:+UseCompressedOops -XX:+ShowCodeDetailsInExceptionMessages -XX:+UseCompactObjectHeaders "
#FULL_STACKTRACES=" -XX:-OmitStackTraceInFastThrow "
#REMOTE_DEBUG=" -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n "
#GC_DEBUG=" -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -Xloggc:logs/jvm.log -verbose:gc "
#JVM_DEBUG=" -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/tigase/heapdump.bin "
#JVM_RESTART_ON_OOM=" -XX:+CrashOnOutOfMemoryError " #it may be preferred to restart JVM when OOM happens to restore service to operational state
#TLS_DEBUG=" -Djavax.net.debug=ssl:handshake:session:defaultctx "
## Note:Enabling NMT causes a 5% -10% performance overhead!
#JVM_MEMORY=" -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics "
#JMX_REMOTE_IP="-Djava.rmi.server.hostname=0.0.0.0"
## AWS hostname resolver
#export INTERNAL_IP="$(curl -s http://169.254.169.254/latest/meta-data/local-hostname)"
#export EXTERNAL_IP="$(curl -s http://169.254.169.254/latest/meta-data/public-hostname)"
#JAVA_HOME="${JDKPath}"
CLASSPATH=""
#DISABLE_LOGGER_COLOR=" -Ddisable_logger_color=true "
#### Variables used to specify hostname and port of the database instance; can be used in conjunction
#### with scripts/wait-for-it.sh script, that checks if the given coordinates are ready
#DB_HOST=
#DB_PORT=
## Possible memory allocation improvements on some CentOS/RHEL systems
## https://www.ibm.com/developerworks/community/blogs/kevgrig/entry/linux_glibc_2_10_rhel_6_malloc_may_show_excessive_virtual_memory_usage?lang=en
# export MALLOC_ARENA_MAX=4
## You should explicitly set Young Generation size only if you know what
## you are doing and only after running Load Tests that confirms the assumption!
#JAVA_YOUNG_GEN_EXPLICIT_SIZE=" -Xmn[g|m|k] "
## Heap memory settings should be adjusted on per deployment basis to utilize all resources!
## When configuring consider total of: Xmx/HEAP + (Xss * number of threads)
#PRODUCTION_HEAP_SETTINGS=" -XX:MaxRAMPercentage=80 " # dynamic sizing, *preferred* and more universal
#PRODUCTION_HEAP_SETTINGS=" -Xms5g -Xmx5g " # setting fixed size of HEAP
## Per-thread stack size on top of HEAP!
JAVA_XSS=" -Xss228k "
## Uncomment and adjust if needed (most likely only on servers with more than 64 cores)
#JAVA_DIRECT_MEMORY=" -XX:MaxDirectMemorySize=128m "
JAVA_METASPACE=" -XX:MaxMetaspaceSize=160m " # because of aws/s3
JAVA_OPTIONS="${GC} ${GC_DEBUG} ${JVM_DEBUG} ${JVM_RESTART_ON_OOM} ${TLS_DEBUG} ${JVM_MEMORY} ${REMOTE_DEBUG} ${EX} ${ENC} ${FULL_STACKTRACES} ${JMX_REMOTE_IP} ${DISABLE_LOGGER_COLOR} -server ${PRODUCTION_HEAP_SETTINGS} ${JAVA_YOUNG_GEN_EXPLICIT_SIZE} ${JAVA_XSS} ${JAVA_DIRECT_MEMORY} ${JAVA_METASPACE} "
TIGASE_OPTIONS=" "
================================================
FILE: licenseheader.txt
================================================
<#if licenseFirst??>
${licenseFirst}
#if>
${licensePrefix}Tigase Jabber/XMPP Server
${licensePrefix}Copyright (C) 2004-${date?date?string("yyyy")}, ${project.organization}
${licensePrefix?replace(" +$", "", "r")}
${licensePrefix}This program is free software: you can redistribute it and/or modify
${licensePrefix}it under the terms of the GNU Affero General Public License as published by
${licensePrefix}the Free Software Foundation, either version 3 of the License,
${licensePrefix}or (at your option) any later version.
${licensePrefix?replace(" +$", "", "r")}
${licensePrefix}This program is distributed in the hope that it will be useful,
${licensePrefix}but WITHOUT ANY WARRANTY; without even the implied warranty of
${licensePrefix}MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
${licensePrefix}GNU Affero General Public License for more details.
${licensePrefix?replace(" +$", "", "r")}
${licensePrefix}You should have received a copy of the GNU Affero General Public License
${licensePrefix}along with this program. Look for COPYING file in the top folder.
${licensePrefix}If not, see http://www.gnu.org/licenses/.
<#if licenseLast??>
${licenseLast}
#if>
================================================
FILE: package.html
================================================
Tigase XMPP (Jabber) server ver ${APP_VER}
The Tigase Jabber/XMPP Server is Open Source and Free (AGPLv3)Java based server.
The server offers complete implementation of the XMPP protocol with a long list
of extensions. Effcient, reliable and very extensible can be easily integrated
it with your systems.
The unique features of the Tigase server are
High performance and scalability. Was tested with up to 500 000 concurrent
users connected to a single machine and in cluster with over 1mln online users.
High reliability. Tries to run as long as possible and tried to automaticaly
recover from detected problems.
Built-in many self monitoring functions. You can check your systems statistics
via XMPP, JMX, HTTP, SNMP or you can automatically receive notifications about
possible problems.
Scripting support - scripts can be loaded/reloaded at run time.
Many scripting languages are supported
Virtual hosts support. You can have virtually unlimited virtual hosts which
can be added/removed at runtime. You can temporarily block vhost or limit
number of users per vhost.
There is much more... check the official change log and the project website.
Contributions to Tigase have been made by the following people:
Tigase Team
Eric Dziwea
Artur Hefczyc (kobit)
Wojciech Kapcia (wojtek)
Bartosz Małkowski (bmalkow)
Daniel Wisnewski
Andrzej Wojcik
Other Contributors
Mateusz Fiołka
Tomasz Sterna (smoku)
Daniele Ricci
... and many others.
Installtion, configuration and compilation
The most recent documentation on all these topics is always available in the
project documentation website: www.tigase.org. Please
refer to the website for all the details and always up to date guides.
You would probably want to start with Quick Start:
Tigase Quick Start documentation.
It is recommended that if you run into any issues, visit Tigase Projects website to visit forums
and view trouble tickets that may already have an answer to your question. Different components may be in different sections of the projects website.
Please ask general questions in the forum section of each project.
For example, the Tigase XMPP Server forums are located here.
The website also contains lots of other useful information like load tests
results, user discussions and online support and help always available to
you.
This is ${APP_VER} release of the server. Please include the exact version
number in all correspondence regarding the server.
================================================
FILE: pom.xml
================================================
4.0.0tigasetigase-projects-parent1.0.7-SNAPSHOTtigase.tests.SlowTest${inlineHeader_agpl3}packagegenerate-resourcestigase-serverbundle8.5.0-SNAPSHOTTigase XMPP ServerThe instant messaging serverRedminehttps://projects.tigase.org/projects/tigase-server2004kobitArtur Hefczyckobit@tigase.orghttp://www.tigase.org/architectdeveloperGNU Affero General Public License GPLv3http://www.gnu.org/licenses/agpl.txtscm:git:${scm_repo_server_base}/server-core.gitscm:git:${scm_repo_server_base}/server-core.git${scm_repo_server_base}/server-coreHEADosgitruebundletruejarjartruedistbundlefalseTigase_Serverorg.apache.maven.pluginsmaven-javadoc-pluginattach-javadocspackagejartruetigase:*512mmaven-assembly-plugin3.1.0resourcespackageorg.apache.maven.pluginsmaven-jarsigner-pluginorg.asciidoctorasciidoctor-maven-pluginoutput-html${documentation_phases.html}./src/main/asciidoc/admin${guide_path}_-_Admin/htmlhtml5output-html-dev${documentation_phases.html}process-asciidoc./src/main/asciidoc/devguide${guide_path}_-_Developer/htmlhtml5output-docbook${documentation_phases.docbook}./src/main/asciidoc/admin${project.build.directory}/docbook-admin/output-docbook-dev${documentation_phases.docbook}process-asciidoc./src/main/asciidoc/devguide${project.build.directory}/docbook-devguide/com.agilejava.docbkxdocbkx-maven-plugingenerate-webhelp${documentation_phases.webhelp}${guide_path}_-_Admin/webhelp/${project.build.directory}/docbook-admin/generate-pdf${documentation_phases.pdf}${guide_path}_-_Admin/pdf/${project.build.directory}/docbook-admin/${project.build.directory}/docbook-admin/generate-html${documentation_phases.html_chunked}${guide_path}_-_Admin/html_chunk/${project.build.directory}/docbook-admin/generate-webhelp-devguide${documentation_phases.webhelp}generate-webhelp${guide_path}_-_Developer/webhelp/${project.build.directory}/docbook-devguide/generate-pdf-devguide${documentation_phases.pdf}generate-pdf${guide_path}_-_Developer/pdf/${project.build.directory}/docbook-devguide/trueOFF${project.build.directory}/docbook-devguide/generate-html-devguide${documentation_phases.html_chunked}generate-htmltrue${project.build.directory}/docbook-devguide/${guide_path}_-_Developer/html_chunk/truetruetruetruecss/docbook-xsl.css${project.artifactId}org.apache.felixmaven-bundle-plugintigase.osgi.Activator
tigase.auth.*;version=${project.version},tigase.cluster.*;version=${project.version},tigase.component.*;version=${project.version},tigase.conf.*;version=${project.version},tigase.db.*;version=${project.version},tigase.disco.*;version=${project.version},tigase.disteventbus.*;version=${project.version},tigase.eventbus.*;version=${project.version},tigase.io.*;version=${project.version},tigase.kernel.*;version=${project.version},tigase.map.*;version=${project.version},tigase.monitor.*;version=${project.version},tigase.net.*;version=${project.version},tigase.osgi.*;version=${project.version},tigase.server.*;version=${project.version},tigase.stats.*;version=${project.version},tigase.sys.*;version=${project.version},tigase.util.common.*;version=${project.version},tigase.util.historyCache.*;version=${project.version},tigase.util.log.*;version=${project.version},tigase.util.processing.*;version=${project.version},tigase.util.reflection.*;version=${project.version},tigase.util.routing.*;version=${project.version},tigase.util.setup.*;version=${project.version},tigase.util.updater.*;version=${project.version},tigase.util.workqueue.*;version=${project.version},tigase.vhosts.*;version=${project.version},!tigase.xmpp.jid,!tigase.xmpp.rsm,tigase.xmpp.*;version=${project.version}
!junit.*,!sun.*,!com.sun.*,**
*;scope=compile|runtime;artifactId=!junit|org.osgi.core|slf4j-api|tigase-xmltools|tigase-utils
${project.artifactId};singleton=trueorg.apache.maven.pluginsmaven-jar-pluginorg.apache.maven.pluginsmaven-surefire-pluginorg.codehaus.mojobuild-helper-maven-pluginadd-resourcenonedatabasesrc/main/database**/*.sql**/*.sh**/*.cmd**/*.txttemplatessrc/main/resources/templates**/*.*tigasetigase-utils4.5.0-SNAPSHOTcompiletigasetigase-utils4.5.0-SNAPSHOTtestteststigasetigase-xmltools4.3.0compileorg.apache.felixorg.osgi.core1.4.0providedorg.osgiorg.osgi.compendium5.0.0providedorg.slf4jjul-to-slf4j${slf4j.version}providedtruejunitjunit4.12testorg.codehaus.groovygroovy${groovyVersion}providedorg.codehaus.groovygroovy-json${groovyVersion}providedorg.codehaus.groovygroovy-jsr223${groovyVersion}providedorg.codehaus.groovygroovy-templates${groovyVersion}providedorg.codehaus.groovygroovy-xml${groovyVersion}providedcom.mysqlmysql-connector-j8.1.0testcom.microsoft.sqlservermssql-jdbc10.2.1.jre17testorg.postgresqlpostgresql42.3.8testorg.apache.derbyderby10.15.2.0testorg.apache.derbyderbyshared10.15.2.0testtigasehttps://maven-repo.tigase.org/repository/tigase
================================================
FILE: prj.el
================================================
!!!
!!! Tigase XMPP Server - The instant messaging server
!!! Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
!!!
!!! This program is free software: you can redistribute it and/or modify
!!! it under the terms of the GNU Affero General Public License as published by
!!! the Free Software Foundation, version 3 of the License.
!!!
!!! This program is distributed in the hope that it will be useful,
!!! but WITHOUT ANY WARRANTY; without even the implied warranty of
!!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
!!! GNU Affero General Public License for more details.
!!!
!!! You should have received a copy of the GNU Affero General Public License
!!! along with this program. Look for COPYING file in the top folder.
!!! If not, see http://www.gnu.org/licenses/.
!!!
(jde-project-file-version "1.0")
(jde-set-variables
'(jde-electric-return-p t)
'(jde-enable-abbrev-mode t)
'(jde-gen-k&r t)
'(indent-tabs-mode t)
'(user-mail-address "artur.hefczyc@tigase.org")
'(jde-import-auto-collapse-imports nil)
'(jde-import-auto-sort t)
'(jde-auto-parse-buffer-interval 600)
'(jde-global-classpath
(quote
(
"$JAVA_HOME/jre/lib/rt.jar"
"/tmp/classes/"
"$PROJECTS_HOME/tigase/server/libs/junit.jar"
"$PROJECTS_HOME/tigase/server/libs/jdbc-mysql.jar"
"$PROJECTS_HOME/tigase/server/libs/tigase-xmltools.jar"
"$PROJECTS_HOME/tigase/server/libs/tigase-utils.jar"
"$PROJECTS_HOME/tigase/server/libs/jml-1.0b2.jar"
)))
'(jde-sourcepath
(quote
(
"$PROJECTS_HOME/tigase/server/src/main/java"
"$PROJECTS_HOME/tigase/xmltools/src/main/java"
"$PROJECTS_HOME/tigase/utils/src/main/java"
"$PROJECTS_HOME/tigase/server/tests/unittests/src"
"$JAVA_HOME/share/src"
"$JAVA_HOME/share/tests/src"
)))
'(jde-gen-buffer-boilerplate
(quote
(
"/* Tigase Jabber/XMPP Server"
" * Copyright (C) 2004-2012 \"Artur Hefczyc\" "
" *"
" * This program is free software: you can redistribute it and/or modify"
" * it under the terms of the GNU Affero General Public License as published by"
" * the Free Software Foundation, version 3 of the License."
" *"
" * This program is distributed in the hope that it will be useful,"
" * but WITHOUT ANY WARRANTY; without even the implied warranty of"
" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"
" * GNU Affero General Public License for more details."
" *"
" * You should have received a copy of the GNU Affero General Public License"
" * along with this program. Look for COPYING file in the top folder."
" * If not, see http://www.gnu.org/licenses/."
" *"
" * $Rev: $"
" * Last modified by $Author: $"
" * $Date: $"
" */"
)))
)
================================================
FILE: scripts/config.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
CP="jars/tigase-server.jar:/usr/share/jdbc-mysql/lib/jdbc-mysql.jar:libs/tigase-xmltools.jar:libs/tigase-utils.jar"
java -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -cp $CP tigase.conf.Configurator $*
================================================
FILE: scripts/db-create.cmd
================================================
@REM
@REM Tigase XMPP Server - The instant messaging server
@REM Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
@REM
@REM This program is free software: you can redistribute it and/or modify
@REM it under the terms of the GNU Affero General Public License as published by
@REM the Free Software Foundation, version 3 of the License.
@REM
@REM This program is distributed in the hope that it will be useful,
@REM but WITHOUT ANY WARRANTY; without even the implied warranty of
@REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@REM GNU Affero General Public License for more details.
@REM
@REM You should have received a copy of the GNU Affero General Public License
@REM along with this program. Look for COPYING file in the top folder.
@REM If not, see http://www.gnu.org/licenses/.
@REM
@echo off
java -cp "jars/*" tigase.db.util.DBSchemaLoader %*
================================================
FILE: scripts/db-create.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
java -cp "jars/*" tigase.db.util.DBSchemaLoader "$@"
================================================
FILE: scripts/db-derby-connect.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
[[ "$1" = "" ]] && \
echo "Give me a path to the location where you want to have the database created" && \
exit 1
java -Dij.protocol=jdbc:derby: -Dij.database="$1;create=true" \
-Dderby.system.home=`pwd` \
-cp jars/derby.jar:jars/derbytools.jar:jars/tigase-server.jar \
org.apache.derby.tools.ij
================================================
FILE: scripts/debian/changelog
================================================
tigase (@version@) unstable; urgency=medium
* For full changelog, see
http://www.tigase.org/
-- Sergey Nazarov @builddate@
2008-11-07 13:38 kobit
* build.xml, package.html, src/main/izpack/install.xml,
src/main/izpack/java/TigaseConfigLoadPanel.java,
src/main/izpack/java/TigaseConfigSavePanel.java,
src/main/izpack/java/TigaseDBCheckPanel.java,
src/main/izpack/resources/pics/tigase-install-logo.png,
src/main/izpack/userInputSpec.xml: A few installer fixes, added
unix scripts
2008-11-07 13:38 kobit
* etc/tigase.conf, win-stuff/wrapper/wrapper.conf: Added jdbc
drivers for all 3 supported databases: derby, mysql, pgsql
2008-11-06 11:37 kobit
* License.html: GPLv3 license copy in HTML frmat
2008-11-06 11:37 kobit
* database/mysql-schema-4-props.sql, src/main/izpack,
src/main/izpack/install.xml, src/main/izpack/java,
src/main/izpack/java/DerbyPathPanel.java,
src/main/izpack/java/TigaseConfigConst.java,
src/main/izpack/java/TigaseConfigLoadPanel.java,
src/main/izpack/java/TigaseConfigSavePanel.java,
src/main/izpack/java/TigaseDBCheckPanel.java,
src/main/izpack/resources,
src/main/izpack/resources/packsLang.xml,
src/main/izpack/resources/pics,
src/main/izpack/resources/pics/tigase-install-logo.png,
src/main/izpack/resources/pics/tiger.png,
src/main/izpack/userInputSpec.xml: Installer files added
2008-11-06 11:13 kobit
* database/derby-create-db.sql, database/derby-schema-4-props.sql,
database/derby-schema-4-sp.schema, database/derby-schema-4.sql,
database/mysql-create-db.sql, database/mysql-schema-4-sp.schema,
database/mysql-schema-4.sql,
database/mysql-schema-upgrade-to-4.sql,
database/postgresql-create-db.sql,
database/postgresql-schema-4-props.sql,
database/postgresql-schema-4-sp.schema,
database/postgresql-schema-4.sql, etc/tigase.conf: Changes for
the installer
2008-11-04 12:28 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Added more detailed logging for session closing event
2008-10-30 12:54 kobit
* src/main/java/tigase/xmpp/impl/roster/RosterFlat.java: Fixed a
bug in RosterFlat that the code didn't remove the resource part
2008-10-30 11:48 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Added patch from Yate guys for the user status command containing
presence info
2008-10-30 11:24 kobit
* src/main/java/tigase/net/IOService.java,
src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/util/RepositoryUtils.java,
src/main/java/tigase/xmpp/impl/AnonymousRoster.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/Roster.java,
src/main/java/tigase/xmpp/impl/RosterAbstract.java,
src/main/java/tigase/xmpp/impl/RosterFactory.java,
src/main/java/tigase/xmpp/impl/RosterFlat.java,
src/main/java/tigase/xmpp/impl/roster,
src/main/java/tigase/xmpp/impl/roster/Roster.java,
src/main/java/tigase/xmpp/impl/roster/RosterAbstract.java,
src/main/java/tigase/xmpp/impl/roster/RosterElement.java,
src/main/java/tigase/xmpp/impl/roster/RosterFactory.java,
src/main/java/tigase/xmpp/impl/roster/RosterFlat.java:
Implemented roster flat storage
2008-10-28 22:42 kobit
* src/main/java/tigase/net/IOService.java: Disconnection monitoring
and debugging added
2008-10-28 22:27 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java:
Disconnection monitoring and debugging added
2008-10-28 22:20 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Disconnection monitoring and debugging added
2008-10-28 22:16 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java:
Disconnection monitoring and debugging added
2008-10-28 21:43 kobit
* etc/init.properties, package.html,
src/main/java/tigase/cluster/ClusterConnectionManager.java,
src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/net/IOService.java,
src/main/java/tigase/net/SocketReadThread.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/util/TimeUtils.java: Disconnection
monitoring and debugging added
2008-10-22 19:35 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java,
src/main/java/tigase/db/jdbc/TigaseAuth.java,
src/main/java/tigase/db/jdbc/TigaseCustomAuth.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Fixed deadlock problem occuring in derby database, if a query
returns results it must be read and freed....
2008-10-22 17:20 bmalkow
* src/main/java/tigase/db/derby/StoredProcedures.java: add
connection closing
2008-10-22 15:25 bmalkow
* src/main/java/tigase/db/derby/StoredProcedures.java: fixed
problem with login user. I don't know why, but now it works
2008-10-22 13:32 kobit
* database/derby-schema-4.sql,
src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/db/derby/StoredProcedures.java,
src/main/java/tigase/db/jdbc/JDBCRepository.java,
src/main/java/tigase/db/jdbc/TigaseAuth.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Fixes and changes for Derby database
2008-10-21 20:15 kobit
* src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/db/jdbc/TigaseCustomAuth.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
TigaseCustomAuth is finished, tested and added as a standard
authentication connector to the system
2008-10-21 20:14 kobit
* database/mysql-schema-4-sp.schema,
database/postgresql-schema-4-sp.schema: Fixed problem with the SP
incorrectly removing users from the database
2008-10-21 17:33 kobit
* src/main/java/tigase/db/jdbc/TigaseCustomAuth.java: Custom auth
implementation finished, not tested yet
2008-10-21 17:16 kobit
* database/mysql-schema-4-sp.schema,
database/postgresql-schema-4-sp.schema: Added new SP for password
update with procedure parameters in reverse order
2008-10-21 16:32 kobit
* src/main/java/tigase/db/jdbc/TigaseCustomAuth.java: JavaDoc
documentation updated
2008-10-21 13:43 kobit
* src/main/java/tigase/db/jdbc/TigaseCustomAuth.java: User
authentication connector allowing to use custom SQL queries
2008-10-21 08:47 kobit
* database/postgresql-schema-4-sp.schema: Added
MD5-USERNAME-PASSWORD password encoding support
2008-10-20 23:40 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java,
src/main/java/tigase/cluster/ClusterElement.java,
src/main/java/tigase/cluster/ServerConnectionClustered.java,
src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/ConnectionStatus.java,
src/main/java/tigase/xmpp/RepositoryAccess.java,
src/main/java/tigase/xmpp/XMPPIOService.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/XMPPSession.java: Reimplementation of
the clustering code in the SM and lots of improvements in other
areas, all related to the clustering and user session management
for multiple user connections
2008-10-16 12:02 kobit
* database/mysql-schema-4-sp.schema: Added a new password encoding
option: MD5_USERNAME_PASSWORD
2008-10-09 20:35 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Offline presence is
not now broadcasted if the client didn't send initial presence
before
2008-10-08 22:41 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Attempt to solve the first TLS problem
2008-10-08 22:39 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Attempt to solve the first TLS problem
2008-10-08 22:31 kobit
* src/main/java/tigase/io/TLSIO.java: Attempt to solve the first
TLS problem
2008-10-08 22:26 kobit
* src/main/java/tigase/io/SocketIO.java,
src/main/java/tigase/net/IOService.java: Attempt to solve the
first TLS problem
2008-10-08 22:21 kobit
* src/main/java/tigase/io/SocketIO.java: Attempt to solve the first
TLS problem
2008-10-08 22:18 kobit
* src/main/java/tigase/io/TLSIO.java,
src/main/java/tigase/net/IOService.java: Attempt to solve the
first TLS problem
2008-10-08 22:14 kobit
* src/main/java/tigase/net/IOService.java: Attempt to solve the
first TLS problem
2008-10-08 22:10 kobit
* src/main/java/tigase/io/TLSIO.java,
src/main/java/tigase/io/TLSWrapper.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Attempt to solve the first TLS problem
2008-10-08 20:35 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Server vhosts session has now resource bond
2008-10-08 17:11 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java: Fixed
a problem with not releasing hold on session in some cases
2008-10-08 15:35 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
sendAllOnHold can now process packet locally if there is no
packet rdirection address
2008-10-08 15:25 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/xmpp/XMPPSession.java: The session is put on
hold just after successful authentication
2008-10-08 11:13 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Presence broadcast
sends only unavailable presence to all entities to which user
sent direct presence
2008-10-03 15:51 kobit
* src/main/java/tigase/server/bosh/BoshSession.java: Removed
inserting HTML tags around http links detected in the message,
this is client side stuff
2008-10-03 11:25 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Presence
subscription flow changed to match last changes in the RFC
2008-10-01 22:12 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Added responses either the 'result' or 'error' to all USER_STATUS
commands
2008-10-01 17:52 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/XMPPSession.java,
src/main/java/tigase/xmpp/impl/Presence.java: Fixed problem with
the USER_STATUS command
2008-10-01 15:47 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/impl/Presence.java: Now the server
requires user to bind the resource first before sending any other
packet
2008-10-01 12:05 kobit
* src/main/java/tigase/xmpp/XMPPDomBuilderHandler.java: Added more
logging infor
2008-09-30 20:51 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
IsBrokenPacket detection fixed
2008-09-30 16:05 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java:
CHECK_USER_SESSION result may arrive when the user session is
gone already, added a code to handle this
2008-09-30 07:13 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java,
src/main/java/tigase/xmpp/XMPPIOService.java: Added read/write
locking mechanism, apparently in certain cases multiple threads
may try to read/write on a single socket
2008-09-29 20:06 kobit
* src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/xmpp/XMPPIOService.java: Removed silly
logging messages
2008-09-29 18:41 kobit
* src/main/java/tigase/xmpp/XMPPIOService.java: XML parser
exception printed to a log file
2008-09-29 14:11 kobit
* src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/RosterAbstract.java: Fixed a bug
with presence subscription when contact replies with unsubscribed
to the subscription request
2008-09-29 12:57 bmalkow
* database/derby-schema-4.sql: fix
2008-09-29 12:57 bmalkow
* src/main/java/tigase/db/derby/StoredProcedures.java: fix
2008-09-26 21:56 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Subscription
management has been simplified to meet requirements from
RFC-3921bis-5
2008-09-26 14:10 kobit
* src/main/java/tigase/db/UserAuthRepository.java: Comment fixed
for the digestAuth method
2008-09-26 07:46 bmalkow
* database/derby-schema-4.sql, src/main/java/tigase/db/derby,
src/main/java/tigase/db/derby/StoredProcedures.java: add: JavaDB
(Derby) DDL and Stored Procedures
2008-09-24 13:03 kobit
* src/main/java/tigase/xmpp/impl/OfflineMessages.java: Fixed
problem with sorting off-line presence packets, corrected offline
message removal and changes the time stamp from the xep-0091 to
xep-0203
2008-09-20 17:57 kobit
* src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshIOService.java,
src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/xmpp/XMPPIOService.java: Fixes in the Bosh
protocol for clustering supoprt - the BoshConnectionManager
exyends now ClientConnectionManager
2008-09-18 18:29 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: getUserUID now
expects result greater then 0
2008-09-18 17:53 kobit
* database/postgresql-schema-4-sp.schema: Removed returning from
the stored procedures for compatibility with postgresql 8.0
2008-09-18 17:04 kobit
* database/mysql-schema-4-sp.schema,
database/postgresql-schema-4-sp.schema,
src/main/java/tigase/db/jdbc/TigaseAuth.java: Removed OUT
parameters from stored procedures for compatibility with
postgresql 8.0. These parameters were not used in normal
operation anyway. Only in SQL database test script.
2008-09-17 17:20 kobit
* src/main/java/tigase/xmpp/RepositoryAccess.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/impl/JabberIqIq.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivate.java,
src/main/java/tigase/xmpp/impl/JabberIqRegister.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/OfflineMessages.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/Privacy.java,
src/main/java/tigase/xmpp/impl/Roster.java,
src/main/java/tigase/xmpp/impl/RosterAbstract.java,
src/main/java/tigase/xmpp/impl/RosterFlat.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java: The repository
access code no longer catches and hides database exceptions, they
are passed out to the calling code allowing for proper error
singaling
2008-09-17 11:51 kobit
* src/main/java/tigase/server/XMPPServer.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java: In some cases
strange characters cause database to throw error as en effect the
whole roster can not be loaded properly as well as it also
impacts presence, the fix should hangel it properly
2008-09-17 08:59 kobit
* pom.xml, src/main/java/tigase/conf/ConfigRepository.java,
src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/server/XMPPServer.java: Fixed a bug when the
server is run with incorrect (non-xml) configuration file, now
the server discovers it and terminates it's work with a proper
message
2008-09-16 14:02 kobit
* database/postgresql-schema-4-sp.schema: Fixed a bug in the stored
function
2008-09-16 11:06 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Fixed a bug
where prepared statement was used instead of callable statement,
apparently MySQL can handle it, PostreSQL throws an error
2008-09-16 11:06 kobit
* database/postgresql-schema-4-sp.schema: Fixed a problem with
returing query results
2008-09-16 09:58 kobit
* database/postgresql-schema-4-sp.schema,
database/postgresql-schema-4.sql,
database/postgresql-schema-upgrade-to-4.sql: The first complete
(untested) version of the schema 4 and upgrade script for
postgresql
2008-09-16 00:37 kobit
* database/mysql-schema-4-sp.schema,
database/postgresql-schema-4-sp.schema,
database/postgresql-schema-4.sql: PostgreSQL schema ver 4.0
updated
2008-09-15 20:48 kobit
* database/postgresql-schema-4.sql: postgresql schema definition
updated to version 4.0
2008-09-11 18:04 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
filter processing condition changed
2008-09-11 16:38 kobit
* database/mysql-schema-upgrade-to-4.sql: Fixed problem with
tig_nodes table upgrade
2008-09-11 16:29 kobit
* database/mysql-schema-upgrade-to-4.sql: Fixed tig_nodes
conversion
2008-09-11 15:18 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Added code to
online fix the database and adding root node when missing
2008-09-11 13:42 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Revertet back a
fix causing problems with database - the case with null submode
2008-09-11 09:36 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Fixed problem
when the subnode is null
2008-09-10 19:16 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Removed dumping
stack trace on the db schema version conflict
2008-09-10 18:56 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
serverSession object initialization added
2008-09-10 18:56 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Added support for TigaseAuth connector
2008-09-10 18:55 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Changed log level for statistics from finest to info
2008-09-10 18:54 kobit
* src/main/java/tigase/xmpp/XMPPImplIfc.java: init(UserRepository
rep) method added to allow custom repository configuration by
plugins
2008-09-10 18:53 kobit
* src/main/java/tigase/xmpp/XMPPProcessor.java: init(UserRepository
rep) method added to allow custom repository configuration by
plugins
2008-09-10 18:52 kobit
* src/main/java/tigase/xmpp/impl/UrnXmppPing.java: Added proper
response on user session missing - which means the user is not
connected and can not respond to the ping
2008-09-10 18:51 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRoster.java: Added roster
abstract to allow different Roster storage implementations
2008-09-10 18:51 kobit
* src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java: Added roster
abstract to allow different Roster storage implementations
2008-09-10 18:50 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Added roster
abstract to allow different Roster storage implementations
2008-09-10 18:50 kobit
* src/main/java/tigase/xmpp/impl/Roster.java,
src/main/java/tigase/xmpp/impl/RosterAbstract.java,
src/main/java/tigase/xmpp/impl/RosterFactory.java,
src/main/java/tigase/xmpp/impl/RosterFlat.java: Added roster
abstract to allow different Roster storage implementations
2008-09-10 18:49 kobit
* src/main/java/tigase/db/jdbc/TigaseAuth.java: A new
authentication connector whish can base on the stored procedures
in the database
2008-09-10 18:48 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Database schema
upgrade to version 4.0
2008-09-10 18:47 kobit
* database/mysql-schema-4-sp.schema, database/mysql-schema-4.sql,
database/mysql-schema-upgrade-to-4.sql: A few fixes to stored
procedures and schema upgrade process
2008-09-09 16:24 kobit
* database/mysql-schema-4-sp.schema, database/mysql-schema-4.sql:
Added missing drop stored procedure expression and changed the
order of the table creation
2008-09-08 13:51 kobit
* database/mysql-schema-4-sp.schema, database/mysql-schema-4.sql,
database/mysql-schema-upgrade-to-4.sql: Improved schema upgrade
script, it correctly copies tables to new one with
auto-incrementing IDs and it should work with any database now
2008-09-06 16:33 kobit
* database/mysql-schema-4-sp.schema,
database/mysql-schema-4-test.sql, database/mysql-schema-4.sql,
database/mysql-schema-upgrade-to-4.sql: Proper schema upgrade
procedure which converts also UIDs and NIDs to autoincrementing
fields
2008-09-05 16:38 kobit
* database/mysql-schema-4-sp.schema: TigGetDBProperty funciton is
READS SQL DATA now
2008-09-05 12:13 kobit
* database/mysql-schema-4-sp.schema, database/mysql-schema-4.sql,
database/mysql-schema-upgrade-to-4.sql: MySQL Schema for Tigase
4.0 and schema upgarde scripts are ready
2008-09-03 22:26 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: More detailed
logging in case of exception
2008-09-03 20:09 kobit
* src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/db/UserAuthRepository.java,
src/main/java/tigase/db/jdbc/DrupalAuth.java,
src/main/java/tigase/db/jdbc/TigaseAuth.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Added TigaseAuth - generic connector which can authenticate users
agains any SQL (JDBC) database if the database offers specific
stored procedures
2008-09-03 13:02 kobit
* pom.xml: utils dependency changed to 3.1.1
2008-09-02 17:43 kobit
* src/main/java/tigase/db/DummyRepository.java,
src/main/java/tigase/db/UserRepository.java,
src/main/java/tigase/db/jdbc/JDBCRepository.java,
src/main/java/tigase/db/xml/XMLRepository.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Blocked automatic adding anonymous users to the database when
userAutoCreate property is set to true
2008-09-02 13:19 kobit
* etc/init-mysql.properties, etc/tigase-mysql.conf: Changed default
vhost name from tigase.org to devel.tigase.org and added line to
clear the default classpath to reduce number of classes loaded at
runtime and avoid conflicts
2008-09-02 13:17 kobit
* database/mysql-schema-4.sql,
database/mysql-schema-upgrade-to-4.sql: Adjusted database schema
to handle JID of size according to XMPP spec - 2048
2008-09-02 13:16 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Fixed problem with redirect result arriving before cluster
session_transfer result
2008-09-02 13:16 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java: Fixed
problem with redirect result arriving before cluster
session_transfer result
2008-09-01 21:17 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Added support for
nickname for anonymous user connection
2008-09-01 16:02 kobit
* etc/init.properties: Removed anonymouse roster line which is not
needed anymore
2008-08-29 15:01 kobit
* src/main/java/tigase/xmpp/impl/JabberIqAuth.java,
src/main/java/tigase/xmpp/impl/SaslAuth.java: The authentication
plugin allows now for 3 tries before the user gets disconnected
2008-08-29 14:17 kobit
* src/main/java/tigase/xmpp/RepositoryAccess.java: Intendation
corrected
2008-08-27 17:00 kobit
* src/main/java/tigase/db/jdbc/DrupalAuth.java: drupal users table
is automatically altered if online_status field is missing
2008-08-27 09:08 kobit
* src/main/java/tigase/server/gateways/Gateway.java: Incorrect
VHost initalization bug fixed
2008-08-27 07:32 kobit
* src/main/java/tigase/xmpp/impl/BindResource.java: Fixed a bug
with the resource part incorrectly send to the client
2008-08-27 07:31 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Performance
improvements - the dynamic roster is queried first and if it
returns null then the static roster is queried
2008-08-22 16:57 kobit
* database/mysql-schema-4.sql,
database/mysql-schema-upgrade-to-4.sql: Upgrade to the Tigase db
schema version 4.0
2008-08-22 16:44 kobit
* database/mysql-schema-4.sql,
database/mysql-schema-upgrade-to-4.sql,
database/postgresql-schema-4.sql,
database/sqlserver-schema-4.sql: Upgrade to the Tigase db schema
version 4.0
2008-08-19 12:28 kobit
* pom.xml, src/main/java/tigase/cluster/MethodCall.java,
src/main/java/tigase/cluster/MethodCallCriteria.java,
src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/cluster/methodcalls,
src/main/java/tigase/cluster/methodcalls/SessionTransferMC.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/ConnectionStatus.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java: Initial
fix for the session transfer bug
2008-08-07 06:13 kobit
* src/main/java/tigase/server/gateways/Gateway.java: Temp code just
compilable but not finished yet
2008-08-07 06:12 kobit
* src/main/java/tigase/cluster/ServerConnectionClustered.java:
Replaced DEF_S2S_NAME with getName()
2008-08-07 06:12 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java: Fixed
bug causing NPE for 'onHold()' connection mode
2008-08-07 06:11 kobit
* win-stuff/scripts/Run.bat: Changed loading initial.properties to
init.properties
2008-08-07 05:22 bmalkow
* src/main/java/tigase/server/DisableDisco.java,
src/main/java/tigase/server/MessageRouter.java: this ugly patch
allows to process Disco stanzas as normal stanzas, not by
getDisco*() methods
2008-08-07 05:18 bmalkow
* src/main/java/tigase/server/XMPPServer.java:
getImplementationVersion() should return '0.0.0-0' if manifest is
unavailable
2008-08-07 05:17 bmalkow
* src/main/java/tigase/server/Packet.java: add copying xmlns from
source stanza to error stanza
2008-07-03 15:53 kobit
* src/main/java/tigase/server/ssender/DrupalCommentsTask.java,
src/main/java/tigase/server/ssender/StanzaSender.java: Added
drupal comments notifier task
2008-07-03 10:35 kobit
* src/main/bash/users-list-moitor.sh: Corrected wording in the
welcome email
2008-07-03 10:35 kobit
* src/main/java/tigase/server/gateways/Gateway.java: is_moderated
better handling
2008-07-03 00:27 kobit
* src/main/java/tigase/server/gateways/Gateway.java: Fixes for the
Gateway to work with the new API
2008-07-02 17:29 kobit
* src/main/bash/users-list-moitor.sh: Added full path to adduser
program which is needed when run from the cron job and also mail
program is used to send the first greetings message to newly
created user account
2008-07-02 09:08 kobit
* src/main/php/drupal/modules/tigase_usrreg-5.x/tigase_usrreg.module:
Added missing semicolon
2008-07-02 09:07 kobit
* src/main/php/drupal/modules/short_news-5.x/short_news.module,
src/main/php/drupal/modules/tigase_usrreg-5.x,
src/main/php/drupal/modules/tigase_usrreg-5.x/tigase_usrreg.info,
src/main/php/drupal/modules/tigase_usrreg-5.x/tigase_usrreg.module:
Module used for adding user directories when the account is
created
2008-07-01 23:10 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java: Ad-hoc
commands for task managemebt work again
2008-07-01 23:04 kobit
* src/main/bash, src/main/bash/cron-dnotify-check.sh,
src/main/bash/users-list-moitor.sh: User accounts from drupal to
system scripts
2008-07-01 22:41 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/impl/JabberIqCommand.java,
src/main/java/tigase/xmpp/impl/JabberIqVersion.java,
src/main/java/tigase/xmpp/impl/ServiceDiscovery.java,
src/main/java/tigase/xmpp/impl/UrnXmppPing.java: Fixed a bug when
some packets were not routed correctly between different user
connections (resources), instead they were send back to the
sender
2008-07-01 06:32 kobit
* src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshIOService.java,
src/main/java/tigase/server/bosh/BoshSession.java: Added more
control over packets received from the client, if body element
name is incorrect or xmlns is incorrect or to=hostname is
incorrect the bosh returns an error message to the client and
terminates connection
2008-07-01 06:31 kobit
* src/main/java/tigase/server/sreceiver/ShortNewsPublisher.java:
Accept news without subject and put 'No subject' string if the
subject is missing
2008-07-01 06:30 kobit
* src/main/java/tigase/server/Packet.java: Added getXMLNS
convenience method
2008-06-23 22:13 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java: A fix
for slow database update in cluster mode when the user session
trasfer arrives to the node before database has been updated with
the authorization token - 2 secs for now....
2008-06-21 22:14 kobit
* src/main/java/tigase/cluster/ClientConnectionClustered.java:
Added logging information
2008-06-21 22:08 kobit
* src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/server/MessageRouterConfig.java: Added c2s
clustered implementation
2008-06-21 22:06 kobit
* src/main/java/tigase/cluster/ClientConnectionClustered.java,
src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/ServiceChecker.java: Added support
for disconnecting all connections when cluster node with
corresponding SM has been disconnected
2008-06-21 16:39 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java: user
session transfer is run with 1/2 sec delay to allow all queued
packet to be processed
2008-06-21 15:42 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Cluster notifications are sent now from default (the first) vhost
2008-06-21 15:31 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/XMPPSession.java: Better calculation
session life time and added also packets forwarding for the
session being transfered
2008-06-21 12:53 kobit
* src/main/java/tigase/xmpp/XMPPIOService.java: Added XML parser
error better handling
2008-06-21 12:51 kobit
* src/main/java/tigase/xmpp/XMPPDomBuilderHandler.java,
src/main/java/tigase/xmpp/XMPPIOService.java: Added XML parser
error better handling
2008-06-21 12:31 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Added log message on sending connection verify result
2008-06-21 06:59 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java,
src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Session closed after the session tranfser doesn't send unavilable
packet
2008-06-20 22:37 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
handleLogin is not now called on user session transfer
2008-06-20 22:04 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java:
droping check_user_session packet when all nodes are checked
2008-06-20 21:54 kobit
* src/main/java/tigase/cluster/ClusterElement.java: Added more
logging messages and improved calculation of the next cluster
node
2008-06-20 21:54 kobit
* src/main/java/tigase/cluster/ClusterElement.java: Added more
logging messages and improved calculation of the next cluster
node
2008-06-20 21:40 kobit
* src/main/java/tigase/cluster/ClusterElement.java,
src/main/java/tigase/cluster/SessionManagerClustered.java:
Corrected stanza type settings
2008-06-20 21:30 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java: Added
detailed logging information
2008-06-20 16:01 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java:
Changed cluster notifications from headline to normal to make
them archivizable by offline message plugin
2008-06-20 15:53 kobit
* src/main/java/tigase/cluster/ClusterElement.java,
src/main/java/tigase/server/xmppsession/SessionManager.java: Try
without serverSession loaded
2008-06-20 15:32 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java:
Commented out packet-from usage, for now
2008-06-20 15:12 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java:
Changed code to not pack clustered packets
2008-06-20 14:57 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Changed logging parameters
2008-06-20 09:29 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnections.java:
New s2s implementation supporting reuse of the incoming
connection
2008-06-20 07:37 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Started support for reusing s2s connection by... google?
2008-06-20 06:45 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnections.java:
Added detection for adding incoming connection when this is
outgoing in fact
2008-06-19 23:58 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java,
src/main/java/tigase/cluster/ClusterElement.java,
src/main/java/tigase/cluster/ServerConnectionClustered.java,
src/main/java/tigase/cluster/SessionManagerClustered.java: Fixed
problem with user session transfer
2008-06-19 23:35 kobit
* src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Added calculation s2s connections for debugging
2008-06-19 23:35 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Handling properly case when the IOService for REDIRECT command
does not exist
2008-06-19 18:57 kobit
* src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/stats/StatisticsCollector.java: Fixed
retrieving disco items from components
2008-06-19 14:04 kobit
* src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/stats/StatisticsCollector.java: Service
disovery processing corrected to call for all components based on
component id
2008-06-19 13:33 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnections.java:
Fixed problem with statistics - number of open s2s connections
2008-06-19 12:57 kobit
* src/main/java/tigase/server/xmppserver/ServerConnections.java:
Added extra logging information
2008-06-19 12:42 kobit
* src/main/java/tigase/server/MessageRouter.java: Added support for
configurable components IDs
2008-06-19 10:51 kobit
* src/main/java/tigase/server/MessageRouter.java: Fixed service
discovery problem when asking non-local domain or entity
2008-06-19 10:01 kobit
* pom.xml: tigase-utils dependency set to version 3.0.12 - opendns
workaround
2008-06-19 07:13 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnections.java:
Added more loggin for s2s connections
2008-06-18 06:24 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/net/IOService.java,
src/main/java/tigase/server/Command.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java: User
session inter-node transfer
2008-06-18 05:43 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java: User
session inter-node transfer
2008-06-18 05:41 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java,
src/main/java/tigase/cluster/ClusterController.java,
src/main/java/tigase/cluster/ClusterMethods.java,
src/main/java/tigase/cluster/ServerConnectionClustered.java,
src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/RepositoryAccess.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/XMPPSession.java: Added support for
cluster method calls and querying other cluster nodes for
dialback key
2008-06-17 11:21 bmalkow
* src/main/java/tigase/xmpp/impl/PubSub.java: Plugin has moved to
tigase-pubsub project
2008-06-17 09:38 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java,
src/main/java/tigase/cluster/ClusterController.java,
src/main/java/tigase/cluster/ClusterElement.java,
src/main/java/tigase/cluster/ClusterMethods.java,
src/main/java/tigase/cluster/ServerConnectionClustered.java,
src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Added support for cluster method calls and querying other cluster
nodes for dialback key
2008-06-16 10:56 kobit
* src/main/java/tigase/server/MessageRouter.java: Infinite loop
detecting logic has changed a bit to block packets with 'error'
type only
2008-06-16 09:56 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Added pubsub plugin to the list of default plugins
2008-06-16 09:53 bmalkow
* src/main/java/tigase/xmpp/impl/PubSub.java: PEP: add notification
to account owner
2008-06-16 09:51 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Fixed problem with storing incoming connections with incorrect
session id
2008-06-16 09:50 kobit
* src/main/php/drupal/modules/tigase_monitor-5.x/tigase_monitor.module:
Added statistics for s2s component
2008-06-16 09:50 kobit
* src/main/java/tigase/server/ConnectionManager.java: Connection is
now tested evert 29 minutes instead of 60
2008-06-16 09:38 bmalkow
* src/main/java/tigase/xmpp/impl/PubSub.java: first simple
implementation of PEP
2008-06-14 00:47 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnections.java:
Statistics added
2008-06-13 19:59 kobit
* src/main/java/tigase/cluster/ServerConnectionClustered.java,
src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/net/IOService.java,
src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/MessageRouterConfig.java,
src/main/java/tigase/server/xmppserver/ConnectionHandlerIfc.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManagerOLD.java,
src/main/java/tigase/server/xmppserver/ServerConnections.java,
src/main/java/tigase/xmpp/XMPPIOService.java: New implementation
of s2s protocol, initial version suitable for clustering
2008-06-10 17:24 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java: Fixed
a bug with adding new cluster node
2008-06-10 17:14 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java: Fixed
a bug with adding new cluster node
2008-06-10 16:02 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java,
src/main/java/tigase/conf/Configurable.java: Changed wording in
messages and parameters
2008-06-10 15:38 kobit
* src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/server/MessageRouterConfig.java:
ClusterController it loaded automatically in cluster mode
2008-06-10 14:01 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java,
src/main/java/tigase/cluster/ClusterElement.java,
src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Added cluster components registrator and notifications mechanism
2008-06-10 14:00 kobit
* src/main/java/tigase/cluster/ClusterController.java,
src/main/java/tigase/cluster/ClusteredComponent.java: Added
cluster components registrator and notifications mechanism
2008-06-09 14:09 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java:
Connect all parameter name change to --cluster-connect-all
2008-06-09 14:07 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java:
Connect all parameter added
2008-06-09 13:22 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java: Fixed
a bug with multiple cluser nodes connections
2008-06-09 13:22 kobit
* pom.xml: Updated tigase-utils version dependency
2008-06-09 12:20 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java: Allows
for multiple cluster nodes connection on single connection
manager
2008-06-09 12:19 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java:
Allows for multiple cluster nodes connection on single connection
manager
2008-06-06 09:11 kobit
* src/main/java/tigase/server/Packet.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java: Removed direct
usage of errorResult method
2008-06-06 09:06 bmalkow
* src/main/java/tigase/server/Packet.java: add deprecated
annotation to errorResult
2008-06-06 09:05 bmalkow
* src/main/java/tigase/xmpp/impl/VCardTemp.java: change error
stanza generation way
2008-06-06 09:02 bmalkow
* src/main/java/tigase/xmpp/impl/VCardTemp.java: change error
stanza generation way
2008-06-06 08:46 bmalkow
* src/main/java/tigase/server/ErrorCondition.java,
src/main/java/tigase/server/Packet.java,
src/main/java/tigase/xmpp/Authorization.java: fix: remove
reduntant code
2008-06-06 08:25 bmalkow
* src/main/java/tigase/server/ErrorCondition.java,
src/main/java/tigase/server/Packet.java: add XEP-0086 (Error
Condition) implementation
2008-06-05 19:52 kobit
* src/main/java/tigase/cluster/ClusterElement.java,
src/main/java/tigase/cluster/SessionManagerClustered.java:
Cluster packets processing fixes
2008-06-05 19:52 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Added XMLNS for all
created presence stanzas
2008-06-05 18:42 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java: Fixed
routings for cluster connection manager bug
2008-06-05 18:25 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java: New
routings for cluster connection manager are set properly
2008-06-05 16:42 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java:
Setting correct remote host address for a node to connect to
2008-06-05 16:39 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java,
src/main/java/tigase/server/ConnectionManager.java: Setting
correct remote host address for a node to connect to
2008-06-05 13:54 kobit
* src/main/java/tigase/server/ConnectionManager.java: Added more
detailed logging info
2008-06-05 13:42 kobit
* src/main/java/tigase/server/ConnectionManager.java: Added more
detailed logging info
2008-06-05 13:35 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java:
Cleaned up the removing routing for disconnected service
2008-06-05 12:41 kobit
* src/main/java/tigase/server/ConnectionManager.java: Replaced
integer numbers with constatnts
2008-06-05 12:41 kobit
* src/main/java/tigase/server/MessageRouterConfig.java: Moved
default component names to this interface to make it easier to
access them from other code places
2008-06-05 12:40 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Moved cluster-nodes parameter out to Configurable ifc for use in
other places
2008-06-05 12:39 kobit
* src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Moved default component names to this interface to make it easier
to access them from other code places
2008-06-05 12:39 kobit
* src/main/java/tigase/server/Packet.java: Setting
isServiceDiscovery flag for packet to speed packet processing up
2008-06-05 12:38 kobit
* src/main/java/tigase/conf/Configurable.java: Moved default
component names to this interface to make it easier to access
them from other code places
2008-06-05 12:37 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java:
Loading default cluster nodes list from properties file
2008-06-05 12:37 kobit
* src/main/java/tigase/cluster/ClusterConnectionManager.java:
Cluster nodes connectivity component
2008-06-05 12:36 kobit
* src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/stats/StatisticsCollector.java: Service
Discovery handling improvements
2008-06-04 17:55 kobit
* src/main/java/tigase/server/bosh/BoshSession.java: Changed links
generation from _top to _blank
2008-06-04 15:19 kobit
* src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/stats/StatisticsCollector.java: Fixed
service discovert and ad-hoc command processing
2008-06-04 12:22 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Fixed incorreclty handled writeRawData method
2008-06-04 12:22 kobit
* src/main/java/tigase/server/ConnectionManager.java: Added proper
handling for writing raw data to the socket and fixed method:
writePacketsToSocket
2008-06-04 12:21 kobit
* src/main/java/tigase/server/ServerComponent.java: Added
getComponentId() method
2008-06-04 12:20 kobit
* src/main/java/tigase/server/MessageRouter.java: Major code
cleanup and improved routing selecting logic
2008-06-04 12:20 kobit
* src/main/java/tigase/server/AbstractComponentRegistrator.java:
Added component ID support
2008-06-04 12:19 kobit
* src/main/java/tigase/server/MessageRouterConfig.java: Added
cluster mode stuff
2008-06-04 12:19 kobit
* src/main/java/tigase/server/bosh/BoshConnectionManager.java:
Added writeRawData(...) method to the handler
2008-06-04 12:19 kobit
* src/main/java/tigase/server/bosh/BoshSessionTaskHandler.java:
Added writeRawData(...) method to the handler
2008-06-04 12:18 kobit
* src/main/java/tigase/server/bosh/BoshSession.java: Fixed
incorrectly called writeRawData(...)
2008-06-04 12:17 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java: Code
changes to reflect API changes, processPacket(packet, results)
can not be overwritten anymore, all stuff must be done in
processPacket(packet) now
2008-06-04 12:17 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java: Code
changes to reflect API changes, processPacket(packet, results)
can not be overwritten anymore, all stuff must be done in
processPacket(packet) now
2008-06-04 12:15 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Removed tricky stuff done when activating TLS mode, they are not
needed anymore
2008-06-04 12:14 kobit
* src/main/java/tigase/net/SocketReadThread.java: selectNow() is
only called now if there was a key canceled for the selector,
fixes old bug with infinite loop
2008-06-04 12:13 kobit
* src/main/java/tigase/conf/Configurator.java: Added support for
cluster mode parameters and triming configuration parameters
2008-06-04 12:12 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java: Added
suport for component ID and processPacket(packet, results) is now
final
2008-06-04 12:11 kobit
* src/main/java/tigase/xmpp/impl/SimpleForwarder.java: Removed,
commented out, unused code
2008-06-04 12:10 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java:
Loading cluster nodes configuration
2008-06-04 12:09 kobit
* src/main/java/tigase/conf/Configurable.java: Added constants for
cluster mode parameters
2008-06-04 11:32 kobit
* src/main/php/drupal/modules/tigase_monitor-5.x/tigase_monitor.module:
Fixed path to binary files from other than frontpage
2008-05-16 08:11 kobit
* src/main/java/tigase/cluster/ClusterElement.java,
src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Cluster initial implementation ready, not tested yet, doesn't
support multiple connections for the same user yet
2008-05-15 10:23 kobit
* etc/init-mysql.properties: Added comments to the init properties
file
2008-05-14 19:22 kobit
* src/main/java/tigase/cluster/ClusterElement.java,
src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/gateways/Gateway.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/ssender/StanzaSender.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Refactoring and routing improvements continued..., may stop
working now but it compiles
2008-05-14 14:56 kobit
* src/main/java/tigase/cluster/SessionManagerClustered.java,
src/main/java/tigase/server/xmppsession/SessionManagerClustered.java:
Class moved to different package
2008-05-14 14:55 kobit
* src/main/java/tigase/cluster/ClusterElement.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerClustered.java:
Cluster mode initial development
2008-05-14 13:56 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerClustered.java:
Further improvements and code cleaning up to prepare sources for
cluster mode implementation
2008-05-14 13:55 kobit
* src/main/java/tigase/server/Packet.java: Further improvements and
code cleaning up to prepare sources for cluster mode
implementation
2008-05-14 13:53 kobit
* src/main/java/tigase/cluster/ClusterElement.java,
src/main/java/tigase/net/SocketReadThread.java,
src/main/java/tigase/server/Packet.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerClustered.java,
src/main/java/tigase/xmpp/impl/OfflineMessages.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java: Further
improvements and code cleaning up to prepare sources for cluster
mode implementation
2008-05-13 15:42 kobit
* src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/ServerComponent.java,
src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerClustered.java,
src/main/java/tigase/stats/StatisticsCollector.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java: Message routing
code cleanup and performance improvements, breaks the current/old
config filessvn status
2008-05-13 10:17 bmalkow
* src/main/java/tigase/xmpp/impl/VCardTemp.java: add: returning IQ
error when vcard not found
2008-05-12 21:40 kobit
* pom.xml: tigase-utils dependencies updated
2008-05-12 10:50 kobit
* src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/bosh/BoshSessionCache.java:
Implementation of keeping chat history in the Bosh cache
2008-05-12 10:50 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Replaces presence
string with constant
2008-05-12 09:16 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerClustered.java:
Cluster code cleanup
2008-05-09 18:01 kobit
* src/main/java/tigase/xmpp/impl/OfflineMessages.java: Fixed
compilation error
2008-05-09 17:58 kobit
* src/main/java/tigase/xmpp/impl/OfflineMessages.java: Fixed a bug
with saving messages with an empty body
2008-05-07 19:39 kobit
* etc/tigase-mysql.conf: Updated sample configuration for mysql
database
2008-05-07 19:31 kobit
* etc/init-mysql.properties, etc/tigase-mysql.conf: Updated sample
configuration for mysql database
2008-05-07 19:30 kobit
* src/main/java/tigase/net/SocketReadThread.java: Corrected logging
messages slightly
2008-05-02 13:43 kobit
* src/main/java/tigase/net/SocketReadThread.java: Recreating
selector on IO error
2008-05-02 13:43 kobit
* src/main/java/tigase/xmpp/impl/AnonymousRoster.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java: Proper handling
error type packets
2008-05-02 13:42 kobit
* src/main/java/tigase/cluster,
src/main/java/tigase/cluster/ClusterElement.java,
src/main/java/tigase/server/Packet.java,
src/main/java/tigase/server/xmppsession/SessionManagerClustered.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Initial full cluster mode implementation
2008-05-01 16:49 kobit
* src/main/java/tigase/net/SocketReadThread.java: Recreating the
selector on empty selection loop
2008-05-01 08:17 kobit
* src/main/java/tigase/net/SocketReadThread.java: A fix for
concurrent modification exception
2008-05-01 08:06 kobit
* src/main/java/tigase/net/SocketReadThread.java: A fix for
concurrent modification exception
2008-04-30 22:10 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Anonymous messages can not go outside the server installation
2008-04-30 21:16 kobit
* src/main/java/tigase/net/SocketReadThread.java: Selector select 0
keys, workaround for JVM bugs:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4850373 and
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6403933
2008-04-30 08:12 kobit
* src/main/java/tigase/net/SocketReadThread.java: Better handling
for CanceledKeyException
2008-04-29 16:45 kobit
* src/main/php/drupal/modules/tigase_monitor-5.x/tigase_monitor.module:
Added running server version displaying to the monitor
2008-04-29 16:45 kobit
* src/main/java/tigase/net/SocketReadThread.java:
CancelledKeyException proper handling
2008-04-27 15:13 kobit
* src/main/java/tigase/net/IOService.java: Force stop on write data
exception
2008-04-25 21:28 kobit
* pom.xml: xmltools dependencies updated
2008-04-25 16:45 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/Presence.java: Fixed problem with
returning not real-online presence to anonymouse user
2008-04-25 16:35 kobit
* src/main/java/tigase/net/SocketReadThread.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java: Sending
initial presence to anonymouse user and added some more logging
info
2008-04-25 16:08 kobit
* src/main/java/tigase/net/IOService.java: Infinite loop with empty
read calls fix - network problems?
2008-04-25 14:41 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/impl/AnonymousRoster.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/Roster.java: Anonymous roster and
presence changed, they are now based on the direct presence and
can be easily adjusted to use for different users
2008-04-24 22:01 kobit
* src/main/java/tigase/net/SocketReadThread.java: Added handling
issue described here:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4850373
2008-04-23 23:20 kobit
* src/main/java/tigase/xmpp/XMPPIOService.java: Added forceStop()
when socket read was called but the service is not connected
2008-04-23 23:12 kobit
* src/main/java/tigase/xmpp/impl/DynamicRosterIfc.java: Added
JavaDoc documentationf or the interfacce
2008-04-23 23:11 kobit
* src/main/java/tigase/util/RepositoryUtils.java,
src/main/java/tigase/xmpp/impl/Roster.java: Added roster
export/import functionality
2008-04-23 07:34 kobit
* src/main/java/tigase/net/IOService.java,
src/main/java/tigase/net/SocketReadThread.java,
src/main/java/tigase/xmpp/XMPPIOService.java: Replaced stop()
with forceStop() on exception catch
2008-04-22 21:44 kobit
* etc/init.properties: Added anonymous roster handler
2008-04-22 21:32 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/impl/AnonymousRoster.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/Presence.java: Implemented online
status sending between anonymous users and anonymous peers
2008-04-22 20:15 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/RosterPresence.java: Anonymous
login - dynamic roster update and presence sending
2008-04-22 20:14 kobit
* src/main/java/tigase/net/SocketReadThread.java: more detailed
logging to see what is really going on in there
2008-04-21 11:02 kobit
* pom.xml: Dependency for xmltools updated
2008-04-21 09:19 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Ignoring certain packet to avoid processing them -
stream:features with error type which came back from the
connection manager component after the connection has been lost
but before the features has been delivered
2008-04-19 20:13 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Fixed a bug when message sent to the domain address was not
forwarded automaticaly to the server admins
2008-04-19 20:12 kobit
* src/main/php/drupal/modules/tigase_monitor-5.x/tigase_monitor.module:
Removed double forward slash from the download link
2008-04-19 20:12 kobit
* src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/MessageRouterConfig.java,
src/main/java/tigase/util/UpdatesChecker.java: Updates checker
initial implementation
2008-04-17 10:44 kobit
* src/main/java/tigase/xmpp/RepositoryAccess.java: Fixed bug with
missing ANONYMOUS mech
2008-04-17 10:31 kobit
* src/main/java/tigase/xmpp/XMPPIOService.java: Added missing
import statement
2008-04-17 10:30 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Fixed the bug causing infinite stream of packets sent to the
client and Checking isLoggable before running expensive
packet.toString for a better performance
2008-04-17 10:29 kobit
* src/main/java/tigase/server/MessageRouter.java: Checking
isLoggable before running expensive packet.toString for a better
performance
2008-04-17 10:29 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java:
Checking isLoggable before running expensive packet.toString for
a better performance
2008-04-17 10:28 kobit
* src/main/java/tigase/net/IOService.java: Added one more log
message
2008-04-17 10:28 kobit
* src/main/java/tigase/xmpp/XMPPIOService.java: Checking isLoggable
before running expensive packet.toString for a better performance
2008-04-17 10:25 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Checking isLoggable
before running expensive packet.toString for a better performance
2008-04-16 20:39 kobit
* build.properties, src/main/java/tigase/db/jdbc/DrupalAuth.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Anonymous login added
2008-04-16 11:16 kobit
* pom.xml: Dependency for tigase-utils updated
2008-04-16 08:48 kobit
* pom.xml: XMLTools depedency change
2008-04-15 21:27 kobit
* pom.xml: [maven-release-plugin] prepare for next development
iteration
2008-04-15 21:27 kobit
* pom.xml: [maven-release-plugin] prepare release
tigase-server-3.3.2
2008-04-15 21:22 kobit
* src/main/java/tigase/auth/SaslAnonymous.java,
src/main/java/tigase/auth/TigaseSaslProvider.java,
src/main/java/tigase/auth/TigaseSaslServerFactory.java,
src/main/java/tigase/server/Permissions.java,
src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java,
src/main/java/tigase/xmpp/RepositoryAccess.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/impl/SaslAuth.java: SASL anonymous
added and the whole support for anonymous users - still in
development
2008-04-15 21:20 kobit
* src/main/java/tigase/server/gateways/Gateway.java,
src/main/java/tigase/server/gateways/GatewayConnection.java,
src/main/java/tigase/server/gateways/GatewayListener.java: Added
javadoc
2008-04-03 08:40 kobit
* src/main/java/tigase/db/jdbc/DrupalAuth.java,
src/main/java/tigase/db/jdbc/JDBCRepository.java,
src/main/java/tigase/db/jdbc/LibreSourceAuth.java,
src/main/java/tigase/server/sreceiver/ShortNewsPublisher.java,
src/main/java/tigase/server/ssender/DrupalForumTask.java,
src/main/java/tigase/server/ssender/JDBCTask.java: changes select
localtime to select 1
2008-04-02 13:28 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Changed attributes order in a stream open element in order to
make it compatible with nagios monitoring tool
2008-03-31 20:11 kobit
* src/main/java/tigase/xmpp/impl/Roster.java: Properly handle the
case when buddy name is not set, is it possible at all???
2008-03-27 07:07 kobit
* src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshIOService.java: On SID not
found error, the bosh component now sends 404 error code
2008-03-27 07:07 kobit
* src/main/java/tigase/net/IOService.java: Graceful stop
implemented - the actual stop is performed when all data have
been sent
2008-03-27 06:37 kobit
* scripts/repo.sh: Slightly modified initial parameters in the
script
2008-03-27 06:36 kobit
* ant-definitions.xml, win-stuff/Tigase.iss,
win-stuff/wrapper/wrapper.conf: Modified binary build scripts in
order to add all new files, libraries, certificates and scripts
2008-03-27 06:35 kobit
* src/main/java/tigase/util/RepositoryUtils.java: Trimming data
before loading to database
2008-03-27 06:30 kobit
* src/main/java/tigase/util/RepositoryUtils.java: Added import user
data (roster) function from comma separated flat file, format is:
user_jid, password, roser_jid, roster_nick, subscription, group
2008-03-20 17:19 kobit
* src/main/java/tigase/server/Packet.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/XMPPDomBuilderHandler.java,
src/main/java/tigase/xmpp/XMPPProcessor.java: Changed code to
properly handle and use new xmltools with intern() strings
2008-03-20 17:18 kobit
* src/main/java/tigase/xmpp/impl/VCardTemp.java: Fixed log message
content
2008-03-19 11:15 kobit
* pom.xml, src/main/java/tigase/db/jdbc/JDBCRepository.java:
Changes to work with SimpleCache when it is turned off
2008-03-18 23:05 kobit
* scripts/tigase.sh: Fixed a bug for the case when TIGASE_HOME is
set manually
2008-03-18 14:40 kobit
* src/main/java/tigase/io/SocketIO.java,
src/main/java/tigase/io/TLSIO.java,
src/main/java/tigase/net/IOService.java,
src/main/java/tigase/net/SocketReadThread.java: Fixed an issue
with never ending loop when the server couldn't write the rest
portion of data to the network socket
2008-03-18 14:39 kobit
* src/main/java/tigase/server/bosh/BoshIOService.java: Added
'Server' header to make it easier to identify that the data come
from tigase bosh component
2008-03-17 12:59 kobit
* src/main/java/tigase/server/MessageRouter.java: Added statistics
to display memory usage by the server
2008-03-16 08:14 kobit
* src/main/java/tigase/net/ConnectionOpenThread.java,
src/main/java/tigase/net/SocketReadThread.java: Main worker
threads are now protected from unexpected finishing work on
exception
2008-03-15 15:33 kobit
* src/main/java/tigase/net/SocketReadThread.java: Catchinh all
exceptions happening at Selector.select() on 64bit arch
2008-03-14 20:25 kobit
* src/main/java/tigase/net/SocketReadThread.java: Catching up
CancelledKeyException which should not happen according to JAVA
API but it happens on Apple JVM, a bug?
2008-03-14 20:23 kobit
* src/main/java/tigase/xmpp/impl/SaslAuth.java: Closing connection
after unsuccessful authentication
2008-03-14 20:23 kobit
* src/main/java/tigase/xmpp/impl/JabberIqAuth.java: Closing
connection after unsuccessful authentication
2008-03-13 21:44 kobit
* database/mysql-message-archive-schema.sql,
src/main/java/tigase/xmpp/impl/xep0136/MessageArchiveDB.java:
Message archive under development
2008-03-07 16:42 kobit
* src/main/java/tigase/db/RepositoryFactory.java: XMLRepository
initialization bug, it was loaded twice, once by UserRepo and
another by UserAuthRepo, accessing the same file from different
threads
2008-03-07 16:41 kobit
* src/main/java/tigase/net/ConnectionOpenThread.java: Catching up
socket exception in case it is closed immediately after it had
been opened before we start configuring the socket
2008-03-05 17:28 kobit
* src/main/java/tigase/util/RepositoryUtils.java: Rosetr cleaning
up function added
2008-03-05 17:28 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java: Added
xml:lang default stream value to the user session
2008-03-05 17:26 kobit
* src/main/java/tigase/server/bosh/BoshIOService.java,
src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/bosh/BoshSessionCache.java,
src/main/java/tigase/server/bosh/Constants.java: Added resource
binding to the automatic Bosh caching
2008-03-05 08:04 kobit
* pom.xml: tigase-utils dependency update for version 3.0.5
2008-03-05 07:59 kobit
* pom.xml: tigase-utils dependency update for version 3.0.4
2008-03-04 16:21 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Initial presence
processing bug fixed - the server didn't look in the dynamic
roster
2008-03-04 11:36 kobit
* database/mysql-message-archive-schema.sql,
src/main/java/tigase/xmpp/impl/xep0136/MessageArchiveDB.java:
MessageArchive in development
2008-03-04 11:36 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: New, improved
SimpleCache in use, caching data for 1minute only
2008-03-04 11:35 kobit
* pom.xml: Dependecy for tigase-utils change
2008-03-03 13:23 kobit
* pom.xml: Dependency for tigase-utils updated to utils ver. 3.0.2
2008-03-03 13:13 kobit
* src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/impl/JabberIqRegister.java: Commented
out user logout after calling unregister, instead the plugin
sends 'stop' to c2s component and then the disconnection finishes
correctly informing the client about successul unregistration
frst
2008-03-02 10:08 kobit
* database/mysql-schema.sql, etc/init.properties,
etc/initial.properties: Fixed sample files
2008-03-02 10:08 kobit
* database/mysql-message-archive-schema.sql,
scripts/user_roster.sh, src/main/java/tigase/xmpp/impl/xep0136,
src/main/java/tigase/xmpp/impl/xep0136/MessageArchive.java,
src/main/java/tigase/xmpp/impl/xep0136/MessageArchiveDB.java:
Message Archiving initial code
2008-03-02 10:07 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRoster.java: Fixed problem
with displaying roster entries which are not in any group
2008-02-26 21:02 kobit
* src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/bosh/BoshSessionCache.java,
src/main/java/tigase/server/bosh/Constants.java: Added Bosh
Session cache implementation
2008-02-21 12:27 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Fixed a bug related
to presence probe and dynamic roster - tigase used to send
forbidden
2008-02-21 10:31 kobit
* src/main/java/tigase/server/ConnectionManager.java: Initial port
open delay increased to 10sec
2008-02-21 09:50 kobit
* src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java: Fixed NPE
when it tried to retrieve contact groups and the contact wasn't
in any group
2008-02-19 23:27 kobit
* src/main/java/tigase/server/MessageRouter.java: Fixed problem
with responding to service disco for error type packets
2008-02-15 08:58 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Fixed the problem with incorrect loading multiple parameters to
the Map for initRepository
2008-02-14 17:55 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Subscription to
yourself problem fixed - ticket #84
2008-02-14 10:22 kobit
* src/main/java/tigase/db/DummyRepository.java,
src/main/java/tigase/db/RepositoryFactory.java,
src/main/java/tigase/db/UserAuthRepository.java,
src/main/java/tigase/db/UserAuthRepositoryImpl.java,
src/main/java/tigase/db/UserRepository.java,
src/main/java/tigase/db/jdbc/DrupalAuth.java,
src/main/java/tigase/db/jdbc/JDBCRepository.java,
src/main/java/tigase/db/jdbc/LibreSourceAuth.java,
src/main/java/tigase/db/xml/XMLRepository.java,
src/main/java/tigase/server/gateways/Gateway.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java,
src/main/java/tigase/util/RepositoryUtils.java: Added an extra
Map parameter to the UserRepository and AuthRepository interfaces
2008-02-14 10:20 kobit
* src/main/java/tigase/server/bosh/BoshSession.java: To speed up
processing the bosh session remembers now last received RID to
compare it with the next rid
2008-02-10 16:29 kobit
* src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/XMPPSession.java,
src/main/java/tigase/xmpp/impl/RosterPresence.java: On page
reload in Bosh session disapears, actually it happens every time
there is anotherconnection made with the same resource while the
old connection hasn't been closed yet
2008-02-08 13:21 kobit
* src/main/java/tigase/server/bosh/BoshIOService.java,
src/main/java/tigase/server/bosh/BoshSession.java: Proper RID
handling and ACK implementation added
2008-02-08 13:21 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRoster.java: A workaround
for the static roster, it is now ignoring all contacts which are
in 'Upline Support' group or is not in any group at all
2008-02-08 13:20 kobit
* src/main/java/tigase/xmpp/impl/Roster.java: Performance
improvement - isSubscribed static method which now takes a single
parameter SubscriptionType and determines whether it is
subscribedfrom type
2008-02-08 13:18 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: A fix for the case
when the same contact appears in the static and dynamic roster,
the dynamic roster should and now does it, overwrite settings in
the static roster
2008-02-02 14:15 kobit
* prj.el,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java,
src/main/java/tigase/xmpp/impl/BindResource.java,
src/main/java/tigase/xmpp/impl/IBB.java,
src/main/java/tigase/xmpp/impl/JabberIqAuth.java,
src/main/java/tigase/xmpp/impl/JabberIqCommand.java,
src/main/java/tigase/xmpp/impl/JabberIqIq.java,
src/main/java/tigase/xmpp/impl/JabberIqOOB.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivate.java,
src/main/java/tigase/xmpp/impl/JabberIqRegister.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/JabberIqSi.java,
src/main/java/tigase/xmpp/impl/JabberIqSocks5Bytestreams.java,
src/main/java/tigase/xmpp/impl/JabberIqStats.java,
src/main/java/tigase/xmpp/impl/JabberIqVersion.java,
src/main/java/tigase/xmpp/impl/Jingle.java,
src/main/java/tigase/xmpp/impl/Message.java,
src/main/java/tigase/xmpp/impl/OfflineMessages.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/Roster.java,
src/main/java/tigase/xmpp/impl/RosterPresence.java,
src/main/java/tigase/xmpp/impl/SaslAuth.java,
src/main/java/tigase/xmpp/impl/ServiceDiscovery.java,
src/main/java/tigase/xmpp/impl/SessionBind.java,
src/main/java/tigase/xmpp/impl/StartTLS.java,
src/main/java/tigase/xmpp/impl/UrnXmppPing.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java: Added new plugin -
RosterPresence which replaces two old plugins: Presence and
JabberIqRoster to avoid concurrent execution of those 2 stanza
types. This solves the problem with adding new contacts on
multi-cpu or multi-core machines, Arrays.copyOf statement has
been removed from all plugins and it is not needed and affect
performance
2008-01-29 18:13 kobit
* src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/MessageRouterConfig.java: Disco name
is now configurable and you can turn off showing the server
version
2008-01-29 17:12 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: The subscription
presence is now send with correct 'from' address without resource
part which caused adding the user with resource to the roster in
some client/server combination
2008-01-26 18:43 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Fixed the problem
with missing unavailable presence from the server when the user
is unsubscribed and the default available presence sent when user
has been subscribed
2008-01-26 15:26 kobit
* build.properties, pom.xml: Version number change to 3.3.2
2008-01-26 14:33 kobit
* src/main/java/tigase/server/bosh/BoshSession.java:
connections.size() is tested against 'hold_requests' variable
instead of 'concurrent_reuqests'
2008-01-26 14:20 kobit
* src/main/java/tigase/server/bosh/BoshSession.java:
connections.size() is tested against 'concurrent_requests'
variable instead of '1'
2008-01-26 14:02 kobit
* src/main/java/tigase/server/bosh/BoshSession.java: Closing the
session after received terminate from the client
2008-01-26 13:34 kobit
* src/main/java/tigase/server/bosh/BoshSession.java: Corrected a
timeout bug - server was using incorrect inactivity timeout
2008-01-26 11:48 kobit
* src/main/java/tigase/server/bosh/Constants.java,
src/main/java/tigase/xmpp/impl/Roster.java: For broken data in
database there might be no buddy subscription info, in such case
the subscription is updated to none
2008-01-26 10:27 kobit
* pom.xml, src/main/java/tigase/server/bosh/Constants.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java: Updated
xmltools dependency for version 3.0.4
2008-01-25 11:16 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Added support for
pending_in subscriptions
2008-01-25 11:16 kobit
* src/main/java/tigase/xmpp/impl/Roster.java: Added support for
pending_in subscriptions
2008-01-21 12:04 kobit
* src/main/java/tigase/xmpp/impl/OfflineMessages.java: Null pointer
catched
2008-01-21 10:46 kobit
* src/main/java/tigase/server/bosh/BoshConnectionManager.java:
Stopping connection with invalid SID
2008-01-21 10:30 kobit
* src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshSession.java: Closing
connection on logout implemented
2008-01-21 10:24 kobit
* src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Closing connection on logout implemented
2008-01-21 09:41 kobit
* src/main/java/tigase/xmpp/XMPPSession.java: Old resource
connection logout corrected
2008-01-20 02:40 kobit
* src/main/java/tigase/server/bosh/BoshSession.java: Links target
set to _top
2008-01-19 16:20 kobit
* src/main/java/tigase/server/bosh/BoshSession.java: Added links
conversion to clickable URLs
2008-01-17 23:18 kobit
* build.properties, pom.xml: Version number change to 3.3.1
2008-01-15 22:15 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Added one more logging message
2008-01-15 22:15 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Fixed problem with system commands send to incorrect session
manager
2008-01-15 22:14 kobit
* src/main/java/tigase/xmpp/XMPPResourceConnection.java: Added
stanza ID generator in resource session to use by all plugins and
processors
2008-01-15 09:22 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Modified default configuration generator to not add default
routings if routing table already exist
2008-01-15 00:44 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Fixed an old bug with routings resolution, the old code tried to
resolve routings based on packet address while it should look at
the domain settings for the connection
2008-01-14 22:19 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/impl/Presence.java: Moved
synchronization on connection resource from SM to Presence
plugin, to not blog the whole processing because of Presence
plugin constraints
2008-01-14 13:16 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Fixed permission for result packets problem which prevented
admins to access the ad-hoc commands
2008-01-13 23:40 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Fixed a bug with synchronization on connection resource
2008-01-13 23:32 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Added proper synchronization on connection resource to avoid
conflict with accessing the object during logout by many threads
concurrently
2008-01-13 23:31 kobit
* src/main/java/tigase/server/gateways/Gateway.java: Added removal
of gateway connection on logout
2008-01-13 23:31 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Corrected wrong log
message
2008-01-13 22:41 kobit
* src/main/java/tigase/server/gateways/Gateway.java: Added proper
handling multiple user connections to the transport
2008-01-13 22:28 kobit
* src/main/java/tigase/server/gateways/Gateway.java: Optimized
logout handler
2008-01-13 22:07 kobit
* build.properties, pom.xml,
src/main/java/tigase/server/gateways/Gateway.java,
src/main/java/tigase/server/gateways/GatewayConnection.java,
src/main/java/tigase/server/gateways/GatewayListener.java:
Gateway API has been changed, version change to 3.3.0
2008-01-13 21:03 kobit
* pom.xml: Version number change to 3.2.1
2008-01-13 21:02 kobit
* build.properties,
src/main/java/tigase/server/gateways/Gateway.java: Indentation
corrected
2008-01-13 21:02 kobit
* src/main/java/tigase/net/SocketReadThread.java,
src/main/java/tigase/server/ConnectionManager.java: Fixed problem
with sending packets in multithreading code
2008-01-10 07:09 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Reverted back code,
now presences from not-subscribed IDs are NOT ignored
2008-01-09 00:11 kobit
* src/main/java/tigase/net/IOService.java,
src/main/java/tigase/server/bosh/BoshSession.java: Deadlock
problem solved, replaced all synchronized methods with
synchronized blocks
2008-01-08 11:03 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/xmppsession/SessionManager.java: Each
plugin - XMPPProcessorIfc is now executed in separate thread to
avoid slowdowns if one plugin runs slowlu due to resource
availability delays
2008-01-08 11:02 kobit
* src/main/java/tigase/db/jdbc/DrupalAuth.java,
src/main/java/tigase/db/jdbc/JDBCRepository.java,
src/main/java/tigase/db/jdbc/LibreSourceAuth.java: Changed code
to allow multithreading support
2008-01-08 11:01 kobit
* src/main/java/tigase/xmpp/RepositoryAccess.java: Removed final
keyword from methods definition, it is not needed anymore
2007-12-22 23:43 kobit
* build.properties, pom.xml: Version number change to 3.2.0
2007-12-22 18:51 kobit
* win-stuff/Tigase-minimal.iss: Configuration for minimal tigase
package
2007-12-22 18:51 kobit
* etc/tigase-mysql.conf: Initial properties moved to a property
file
2007-12-22 18:48 kobit
* prj.el: Code indetation corrected
2007-12-22 18:47 kobit
* src/main/java/tigase/io/CertFilesTrustManager.java,
src/main/java/tigase/io/SSLContextContainer.java,
src/main/java/tigase/io/SSLContextContainerIfc.java,
src/main/java/tigase/io/TLSUtil.java,
src/main/java/tigase/io/TelnetClient.java,
src/main/java/tigase/io/TelnetServer.java,
src/main/java/tigase/server/ConnectionManager.java: Added support
for pluggable SSLContextContainers for network layer
2007-12-22 18:46 kobit
* src/main/java/tigase/server/ssender/StanzaHandler.java,
src/main/java/tigase/server/ssender/StanzaSender.java: Added
handler for a single stanza packet
2007-12-22 18:45 kobit
* src/main/java/tigase/server/gateways/MsnConnection.java: Moved to
extras package
2007-12-22 18:45 kobit
* src/main/java/tigase/io/IOInterface.java,
src/main/java/tigase/io/SocketIO.java,
src/main/java/tigase/io/TLSIO.java,
src/main/java/tigase/net/IOService.java,
src/main/java/tigase/net/SocketReadThread.java: Implement fully
asynchronous communication over Java NIO
2007-12-22 18:44 kobit
* src/main/java/tigase/conf/Configurator.java: Added support for
multiple extra components in initial.properties file, added
support for parameters types in initial.properties file
2007-12-22 18:42 kobit
* src/main/java/tigase/xmpp/impl/OfflineMessages.java: Fixed a bug
with incorrect order for off-line messages: #74
2007-12-14 10:23 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Support for plugins list in property file added
2007-12-14 10:22 kobit
* src/main/java/tigase/server/gateways/MsnConnection.java: Due to
library version change p2pMessageReceived listener had to be
added
2007-12-14 10:21 kobit
* src/main/java/tigase/conf/Configurable.java: Added --sm-plugins
parameter, so you can list plugins in property file for
configuration initialization
2007-12-14 10:20 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRoster.java: Changed xmlns
raw string to variable use
2007-12-11 23:24 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Removed unused import
2007-12-11 22:55 kobit
* src/main/java/tigase/server/Command.java: Added new, predefined
commands: BROADCAST_TO_ONLINE and BROADCAST_TO_ALL
2007-12-11 22:54 kobit
* src/main/java/tigase/server/bosh/Constants.java: Added
MAX_PACKETS number to set the maximum number of queuet packets to
be send to the client
2007-12-11 22:54 kobit
* src/main/java/tigase/server/bosh/BoshSession.java: If there is
huge number of packets waiting, they are sent in MAX_PACKETS
number at a time
2007-12-11 22:52 kobit
* src/main/java/tigase/server/Permissions.java: Added trusted user
permission
2007-12-11 22:51 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Added message broadcating and trusted user permission support
2007-12-11 22:50 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Added trusted configuration settings for trusted permission which
allows user to do certain actions like broadcasting messages
2007-12-11 22:50 kobit
* src/main/java/tigase/server/gateways/MsnConnection.java: Improved
logging and roster synchronization
2007-12-11 22:49 kobit
* src/main/java/tigase/server/gateways/UserStatus.java: Corrected
user status translation, show message now contain correct XMPP
values
2007-12-11 22:48 kobit
* src/main/java/tigase/server/gateways/Gateway.java: Changed
registration message
2007-12-11 22:47 kobit
* src/main/java/tigase/conf/Configurable.java: Added trusted
configuration settings for trusted permission which allows user
to do certain actions like broadcasting messages
2007-12-11 22:46 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRoster.java: Dynamic,
large rosters are now sent in packets, 20 roster items in a
signle packet
2007-12-03 13:33 kobit
* src/main/java/tigase/xmpp/XMPPResourceConnection.java: Fixed
problem with temporary resource setting
2007-12-01 22:04 kobit
* src/main/java/tigase/server/bosh/BoshSession.java: Added another
log entry to monitor restart command processing
2007-12-01 21:45 kobit
* src/main/java/tigase/server/ConnectionManager.java: Removed an
instruction for service.stop() if there was a problem with
starting the servicce
2007-12-01 21:31 kobit
* src/main/java/tigase/server/ConnectionManager.java: Added more
logging information to investigate problem with: 'attempt to stop
incorrect service: null' message
2007-12-01 21:30 kobit
* src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/bosh/Constants.java: Added support
for stream restart functionality
2007-12-01 21:30 kobit
* src/main/java/tigase/xmpp/impl/SaslAuth.java: Stream features are
now returned correctly in all cases
2007-12-01 21:30 kobit
* src/main/java/tigase/xmpp/impl/BindResource.java: Stream features
are now returned correctly in all cases
2007-12-01 21:29 kobit
* src/main/java/tigase/xmpp/impl/JabberIqAuth.java: Stream features
are now correctly returned in all cases
2007-12-01 21:28 kobit
* src/main/java/tigase/xmpp/XMPPResourceConnection.java: userJid is
now properly set after authentication
2007-12-01 20:31 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java: Is it
really possible that getJID() returns null? let's try to catch it
2007-12-01 20:30 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Added one log
message for a case when from attribute is null and commented out
initial presence delivery if the buddy is not subscribed....
2007-11-30 12:30 kobit
* src/main/java/tigase/xmpp/XMPPSession.java,
src/main/java/tigase/xmpp/impl/BindResource.java: Fix for a
problem with a new connection established for the same resource
name, the old connection wasn't properly closed and that caused
confusion on the server
2007-11-28 21:29 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRoster.java: Fixed problem
with roster requests with empty group element - group name is
empty
2007-11-24 08:54 kobit
* src/main/java/tigase/xmpp/impl/Roster.java: Fixed the problem
with sending roster items with resource part
2007-11-23 20:52 kobit
* database/sqlserver-schema.sql: Index for tig_node table has been
changed to keep 3 fields
2007-11-23 20:39 kobit
* src/main/java/tigase/server/gateways/MsnConnection.java: On
gateway disconnection all roster elements from the gateway are
automaticaly marked as off-line now
2007-11-23 20:38 kobit
* src/main/java/tigase/server/gateways/Gateway.java: If gateway is
not connected, message received is sent back with an error
2007-11-23 20:37 kobit
* database/mysql-schema.sql, database/postgresql-schema.sql:
Modified unique index for tig_node to keep 3 fields instead of 2
2007-11-23 20:37 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Added one more
log instruction
2007-11-23 11:09 kobit
* src/main/java/tigase/server/gateways/MsnConnection.java: Finally
fixed the problem with user status, bocking/unblocking
2007-11-23 09:12 kobit
* src/main/java/tigase/server/gateways/MsnConnection.java: Added
missing import and fixed compilation error
2007-11-23 00:29 kobit
* src/main/java/tigase/server/gateways/MsnConnection.java,
win-stuff/Tigase.iss: Suport for MsnList added
2007-11-22 14:44 kobit
* src/main/java/tigase/server/gateways/Gateway.java,
src/main/java/tigase/server/gateways/MsnConnection.java: Added
full support for adding, removing buddies in roster
2007-11-22 14:43 kobit
* src/main/java/tigase/server/gateways/GatewayListener.java:
formatJID, decodeLegacyName methods added
2007-11-22 14:43 kobit
* src/main/java/tigase/db/xml/XMLRepository.java: Added
synchronization and support for multithreaded use
2007-11-22 14:42 kobit
* src/main/java/tigase/server/gateways/GatewayConnection.java:
addBuddy, removeBuddy, getPromptMessage methods added
2007-11-22 14:42 kobit
* src/main/java/tigase/db/RepositoryFactory.java: Fixed a bug with
accessing XML repository by different components
2007-11-22 14:32 kobit
* src/main/java/tigase/conf/Configurator.java: Commented out
System.out.printlns
2007-11-22 14:28 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Fixed a bug with
Tigase sending available presence with unsubscribed presence
2007-11-22 14:27 kobit
* win-stuff/Tigase.iss: Character case changed
2007-11-21 18:03 kobit
* database/sqlserver-schema.sql: Database schema definition for
SQLServer
2007-11-20 17:10 kobit
* src/main/java/tigase/io/SSLContextContainerIfc.java: SSL
container interface to allow use of different container
implementation, for example implementation capable of loading
certificates from *.pem files
2007-11-14 10:20 kobit
* win-stuff/Tigase.iss: Now gateway stores roster buddy last status
in database
2007-11-14 10:20 kobit
* src/main/java/tigase/server/gateways/Gateway.java,
src/main/java/tigase/server/gateways/GatewayListener.java,
src/main/java/tigase/server/gateways/MsnConnection.java: Now
gateway stores roster buddy last status in database
2007-11-14 10:19 kobit
* src/main/java/tigase/xmpp/impl/Roster.java: Fix for missing
subscriptions in roster coming for transports
2007-11-13 23:53 kobit
* src/main/java/tigase/server/gateways,
src/main/java/tigase/server/gateways/Gateway.java,
src/main/java/tigase/server/gateways/GatewayConnection.java,
src/main/java/tigase/server/gateways/GatewayException.java,
src/main/java/tigase/server/gateways/GatewayListener.java,
src/main/java/tigase/server/gateways/LoginGatewayException.java,
src/main/java/tigase/server/gateways/MsnConnection.java,
src/main/java/tigase/server/gateways/RosterItem.java,
src/main/java/tigase/server/gateways/UserStatus.java: Transports
initial implementation with MSN gateway
2007-11-13 23:36 kobit
* prj.el: Added more jar files
2007-11-13 23:36 kobit
* src/main/java/tigase/io/SSLContextContainer.java: Removed
System.exit(1) instruction
2007-11-13 23:35 kobit
* src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Added more logging information
2007-11-13 23:35 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Removed System.exit(1) instruction
2007-11-13 23:34 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java:
Removed System.exit(1) instruction
2007-11-13 23:34 kobit
* src/main/java/tigase/net/SocketReadThread.java: Removed
System.exit(1) instruction
2007-11-13 23:33 kobit
* src/main/java/tigase/net/ConnectionOpenThread.java: Removed
System.exit(1) instruction
2007-11-13 23:33 kobit
* src/main/java/tigase/db/xml/XMLRepository.java: Added support for
user autocreate mode
2007-11-13 23:32 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRegister.java: Fix for
internal transport support
2007-11-13 23:31 kobit
* src/main/java/tigase/xmpp/impl/Roster.java: A few fixes for a
case when nick part does not exist and when current_subscription
is null
2007-11-13 23:30 kobit
* etc/tigase.conf: By default now it loads init.properties file
2007-11-13 23:27 kobit
* src/main/java/tigase/xmpp/ProcessorFactory.java: Full stack trace
output to the console as logs are not working at this stage
2007-11-13 23:26 kobit
* src/main/java/tigase/util/DBUtils.java: A few convenience methods
for repository initialization
2007-11-07 22:43 kobit
* win-stuff/Tigase.iss: Version change and etc/ content corrected
2007-11-07 22:42 kobit
* etc/initial.properties: Initial server properties, which can be
used for config generators
2007-11-07 22:42 kobit
* src/main/java/tigase/server/XMPPServer.java: Changed initial
logging configuration
2007-11-07 22:41 kobit
* win-stuff/scripts/Run.bat: Added parameter for initial properties
and changed classpath to use wildcards
2007-11-07 16:35 kobit
* src/main/java/tigase/server/XMPPServer.java: Initial
configuration generation is now outputed to the log file
correctly
2007-11-07 16:34 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Fixed initial configuration generation when database connector is
given as class name
2007-11-07 16:34 kobit
* src/main/java/tigase/conf/Configurator.java: Added support for
initial parameters read from property file which is useful
especially on windows
2007-11-07 12:30 kobit
* src/main/java/tigase/xmpp/impl/DynamicRoster.java: Dynamic roster
classes are now comma separated list instead of string array of
class names
2007-11-06 21:35 kobit
* build.properties, win-stuff/Tigase.iss: Version change to 3.1.1
2007-11-06 21:33 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Improvemements for plugins settings, plugins can share now the
same settings and stop listeners are receiving plugins settings
as a method parameter
2007-11-06 21:32 kobit
* src/main/java/tigase/xmpp/XMPPStopListenerIfc.java: Added plugin
settings to the method parameters list
2007-11-06 21:27 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRoster.java: Moved dynamic
roster initialization to separate class - DynamicRoster
2007-11-06 21:26 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Added support for
dynamic rosters
2007-11-06 21:26 kobit
* src/main/java/tigase/xmpp/impl/DynamicRoster.java: Static class
with static helper methods for accessing dynamic rosters' data
2007-11-03 16:49 kobit
* win-stuff/Tigase.iss: Changed default content of etc directory
2007-11-03 16:46 kobit
* win-stuff/Licence.txt: License change to GPLv3
2007-11-03 16:45 kobit
* src/main/java/tigase/db/DummyRepository.java: Dummy user
repository
2007-11-02 20:29 kobit
* src/main/java/tigase/db/jdbc/DrupalAuth.java: JavaDoc comments
added
2007-11-02 20:28 kobit
* src/main/java/tigase/db/UserAuthRepository.java: JavaDoc comments
added
2007-11-02 20:28 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRoster.java: Improved
handling dynamic rosters
2007-10-31 17:35 kobit
* src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Corrected generating default regex routing, '.' character is now
backslashed to avoid special treatment by regex engibe
2007-10-31 17:24 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRoster.java: Fixed null
pointer exception in case of missing plugin settings for roster
2007-10-31 17:12 kobit
* prj.el, src/main/java/tigase/auth/TigaseSaslProvider.java,
src/main/java/tigase/db/jdbc/DrupalAuth.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java,
src/main/java/tigase/xmpp/XMPPProcessorIfc.java,
src/main/java/tigase/xmpp/impl/BindResource.java,
src/main/java/tigase/xmpp/impl/DynamicRosterIfc.java,
src/main/java/tigase/xmpp/impl/JabberIqAuth.java,
src/main/java/tigase/xmpp/impl/JabberIqCommand.java,
src/main/java/tigase/xmpp/impl/JabberIqIq.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivate.java,
src/main/java/tigase/xmpp/impl/JabberIqRegister.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/JabberIqStats.java,
src/main/java/tigase/xmpp/impl/JabberIqVersion.java,
src/main/java/tigase/xmpp/impl/Jingle.java,
src/main/java/tigase/xmpp/impl/OfflineMessages.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/SaslAuth.java,
src/main/java/tigase/xmpp/impl/ServiceDiscovery.java,
src/main/java/tigase/xmpp/impl/SessionBind.java,
src/main/java/tigase/xmpp/impl/SimpleForwarder.java,
src/main/java/tigase/xmpp/impl/StartTLS.java,
src/main/java/tigase/xmpp/impl/UrnXmppPing.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java: MNodifications for
dynamic rosters functionality
2007-10-23 06:52 bmalkow
* pom.xml, src/main/resources, src/main/resources/META-INF,
src/main/resources/META-INF/MANIFEST.MF: Add creating manifest by
maven (with version number)
2007-10-18 09:03 kobit
* pom.xml: [maven-release-plugin] prepare for next development
iteration
2007-10-18 09:03 kobit
* pom.xml: Dependencies update
2007-10-18 08:57 kobit
* scripts/repo.sh, win-stuff/Tigase.iss: Version change
2007-10-17 13:08 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Corrected logic mistake in the s2s
2007-10-17 12:56 kobit
* src/main/java/tigase/server/bosh/BoshIOService.java: Changed
strings literals to constants, might improve performance/resource
consumption slightly
2007-10-17 12:54 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java: Yet
another fix to packet counters for last second, minute, hour
2007-10-17 12:54 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Changed code slightly to allow multiple s2s connections from
other servers, apparently this is correct
2007-10-13 18:07 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java:
Improved calculating number of last packets sent
2007-10-13 18:06 kobit
* src/main/java/tigase/net/ConnectionOpenThread.java: Changed
default TCP/IP packet size to 2k
2007-10-13 18:06 kobit
* src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java: Improved
retrieving privacy lists
2007-10-11 23:53 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java:
Corrected calculation of the number of packets in last second
2007-10-11 23:37 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java:
Corrected calculation of the number of packets in last second
2007-10-09 16:36 kobit
* src/main/php/drupal/modules/tigase_monitor-5.x/tigase_monitor.info,
src/main/php/drupal/modules/tigase_monitor-5.x/tigase_monitor.module:
tigase monitor updated for drupal 5.x
2007-10-09 13:01 kobit
* src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/Authorization.java,
src/main/java/tigase/xmpp/PacketErrorTypeException.java,
src/main/java/tigase/xmpp/XMPPProcessorIfc.java,
src/main/java/tigase/xmpp/impl/BindResource.java,
src/main/java/tigase/xmpp/impl/JabberIqAuth.java,
src/main/java/tigase/xmpp/impl/JabberIqCommand.java,
src/main/java/tigase/xmpp/impl/JabberIqIq.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivate.java,
src/main/java/tigase/xmpp/impl/JabberIqRegister.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/JabberIqStats.java,
src/main/java/tigase/xmpp/impl/Jingle.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/ServiceDiscovery.java,
src/main/java/tigase/xmpp/impl/SessionBind.java,
src/main/java/tigase/xmpp/impl/SimpleForwarder.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java,
src/main/php/drupal/modules/short_news-5.x/short_news.module,
win-stuff/Tigase.iss: Authorization throws now exception if you
try to assing error type to the packet which is already an error,
it used to cause infinite loops in the server in many places.
This change aims to kill infinite loops in the server for
ever....
2007-10-08 09:41 kobit
* src/main/php/drupal/modules/short_news-5.x/short_news.module:
Modifications for compatibility with drupal-5.x
2007-10-06 16:34 kobit
* etc/tigase-mysql.conf,
src/main/php/drupal/modules/short_news-5.x,
src/main/php/drupal/modules/short_news-5.x/short_news.info,
src/main/php/drupal/modules/short_news-5.x/short_news.module,
src/main/php/drupal/modules/tigase_monitor-5.x,
src/main/php/drupal/modules/tigase_monitor-5.x/tigase_monitor.module:
Drupal v5.x modules
2007-10-02 13:26 kobit
* src/main/php/drupal/modules/tigase_monitor.module: Corrected link
description to detailed statistics
2007-10-02 13:26 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java: Added
statisics for packets processed in last second, minute and hour
2007-10-02 13:25 kobit
* src/main/java/tigase/server/ConnectionManager.java: Increased
watchdog timeout from 1 min to 30 minutes, it cleans up
connections which are iddle for an hour, so there is no need for
running it every minute
2007-10-02 13:24 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Catching possible authorization exception during resource set and
returning def for max queue size
2007-10-02 13:23 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java:
Checking whether the session is authorized before processing,
eliminates generating authorization exceptions and improves
performance
2007-10-02 13:22 kobit
* src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java: Checking
whether the session is authorized before processing, eliminates
generating authorization exceptions and improves performance
2007-10-02 13:21 kobit
* src/main/java/tigase/xmpp/XMPPResourceConnection.java: userID and
userJID is cached now so it doesn't need to be generated on each
call, performance improvement
2007-10-01 11:06 kobit
* src/main/php/drupal/modules/tigase_monitor.module: Added details
and configuration page
2007-09-29 22:55 kobit
* src/main/php/drupal/modules/tigase_monitor.module: Rewriten
module to display number of registered account from the server
statistics rather than from drupal database and number of active
sessions
2007-09-29 22:54 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Fixed a bug when s2s received packet without 'to' attribute due
to missconfiguration
2007-09-29 22:54 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Added statustics for registered accounts number
2007-09-29 22:53 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java: Fixed
a bug with task names in upper case
2007-09-29 22:53 kobit
* src/main/java/tigase/db/UserRepository.java,
src/main/java/tigase/db/jdbc/JDBCRepository.java,
src/main/java/tigase/db/xml/XMLRepository.java: Added method
returning number of user accounts in database
2007-09-24 18:43 kobit
* src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Fixed problem with packets addresses to the component which can
not be processed by the component
2007-09-22 14:41 kobit
* build.properties: Version change
2007-09-22 13:24 kobit
* src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/xmpp/StanzaType.java: Added proper session
termination code for Bosh component
2007-09-21 21:31 kobit
* src/main/php/drupal/modules/tigase_monitor.module: Fixed problem
with calculating uptime in some cases
2007-09-21 21:31 kobit
* src/main/java/tigase/server/bosh/BoshIOService.java: Fixed
problem with incorrectly calculated content length if data
contains multibyte UTF-8 characters
2007-09-21 08:44 kobit
* src/main/java/tigase/server/bosh/BoshSession.java: Fixed problem
with missing version and xmlns attributes in body element
2007-09-19 08:08 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java: Changed
from HashSet to CopyOnWriteArraySet for routings tables
2007-09-18 08:56 kobit
* src/main/java/tigase/server/sreceiver/TesterTask.java: Tester
task for testing server functionality
2007-09-18 08:56 kobit
* src/main/java/tigase/conf/Configurator.java: Spelling corrected
2007-09-17 09:46 kobit
* src/main/java/tigase/server/sreceiver/RepoRosterTask.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Fixed the problem when repository is not set or can't support
user autocreate mode
2007-09-16 07:06 bmalkow
* pom.xml: [maven-release-plugin] prepare for next development
iteration
2007-09-16 07:06 bmalkow
* pom.xml: [maven-release-plugin] prepare release
tigase-server-3.0.1-beta
2007-09-16 01:33 kobit
* src/main/php/drupal/modules/tigase_monitor.module: Added bosh
connections
2007-09-15 16:02 kobit
* src/main/php/drupal/modules/tigase_monitor.module: Fixed problem
with uptime when uptime is shorter than 1day
2007-09-15 15:29 kobit
* src/main/php/drupal/modules/tigase_monitor.module: Fixed problem
with uptime when uptime is shorter than 1day
2007-09-15 14:06 kobit
* win-stuff/Tigase.iss: Version change
2007-09-15 14:06 kobit
* build.properties, win-stuff/Tigase.iss: Version change
2007-09-15 14:04 kobit
* src/main/java/tigase/server/Packet.java,
src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Packet.toString() changed to display XMLNS
2007-09-15 14:04 kobit
* src/main/java/tigase/xmpp/XMPPDomBuilderHandler.java: Fixed minor
bug with default XMLNS settings for many children with different
XMLNSes
2007-09-15 11:41 bmalkow
* pom.xml: update dependecies
2007-09-14 22:59 kobit
* src/main/java/tigase/server/bosh/BoshSession.java: Bosh is now
completed but untested...
2007-09-14 22:03 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: presence
unavailable removes now jid from directpresence set
2007-09-12 10:16 bmalkow
* pom.xml: changes in maven group and version
2007-09-12 10:04 bmalkow
* pom.xml: changes in maven group and version
2007-09-11 21:58 kobit
* src/main/java/tigase/server/MessageRouterConfig.java: You can now
add components during configuration generation with parameters:
--comp-name and --comp-class
2007-09-11 17:55 kobit
* etc/tigase-mysql.conf,
src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/bosh/Constants.java: Bosh - timeouts
implemented, untested
2007-09-04 20:02 bmalkow
* src/main/java/tigase/io/CertFilesTrustManager.java: Add
TrustManager based on PEM files, stored in (for example)
/etc/ssl/certs
2007-08-09 09:03 kobit
* src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshIOService.java,
src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/bosh/BoshSessionTaskHandler.java:
Added max_pause support, untested
2007-08-03 17:45 kobit
* src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/bosh/Constants.java: Initial, working
version of Bosh implementation
2007-08-03 17:45 kobit
* prj.el: License text changed
2007-08-03 17:44 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Packet id changed to be different from other commands
2007-08-03 17:44 kobit
* src/main/java/tigase/xmpp/impl/JabberIqStats.java: Fixed problem
with ID retrieving in incorrect place of code
2007-07-25 15:06 kobit
* src/main/php/drupal/modules/tigase_monitor.module: Added real
statistics from tigase jabber server, these statistics are
updated every minute
2007-07-21 16:36 kobit
* src/main/php/drupal/modules/tigase_monitor.module: Link to all
downloads fixed
2007-07-21 15:13 kobit
* src/main/php/drupal/modules/short_news.module,
src/main/php/drupal/modules/tigase.module: Spelling corrections +
license update
2007-07-21 15:12 kobit
* src/main/php/drupal/modules/tigase_monitor.module: Real Tigase
monitor as a separate module with online_status and all other
stuff
2007-07-21 15:12 kobit
* src/main/java/tigase/db/jdbc/DrupalAuth.java: Added online_status
support
2007-07-18 18:13 kobit
* pom.xml: [maven-release-plugin] prepare for next development
iteration
2007-07-18 18:13 kobit
* pom.xml: [maven-release-plugin] prepare release
tigase-server-3.0.0
2007-07-18 18:12 kobit
* pom.xml: Dependencies change to libraries which also use GPLv3
2007-07-18 18:10 kobit
* build.properties: Version change to 3.0.1 - license change to
GPLv3
2007-07-18 18:09 kobit
* COPYING: Initial version of file with license GPLv3
2007-07-18 17:38 kobit
* database/mysql-schema.sql, database/postgresql-schema.sql,
scripts/config.sh, scripts/repo.sh, scripts/tigase.sh,
src/main/java/tigase/annotations/TODO.java,
src/main/java/tigase/auth/AuthorisationSystem.java,
src/main/java/tigase/auth/LoginHandler.java,
src/main/java/tigase/auth/ResourceConnectionCallback.java,
src/main/java/tigase/auth/SaslPLAIN.java,
src/main/java/tigase/auth/TigaseSaslProvider.java,
src/main/java/tigase/auth/TigaseSaslServerFactory.java,
src/main/java/tigase/conf/ConfigComponent.java,
src/main/java/tigase/conf/ConfigRepository.java,
src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/db/AuthorizationException.java,
src/main/java/tigase/db/ConfigurationDB.java,
src/main/java/tigase/db/DBInitException.java,
src/main/java/tigase/db/DataOverwriteException.java,
src/main/java/tigase/db/MessageHistoryDB.java,
src/main/java/tigase/db/MessageOfflineDB.java,
src/main/java/tigase/db/NonAuthUserRepository.java,
src/main/java/tigase/db/RepositoryFactory.java,
src/main/java/tigase/db/TigaseDBException.java,
src/main/java/tigase/db/UserAuthRepository.java,
src/main/java/tigase/db/UserAuthRepositoryImpl.java,
src/main/java/tigase/db/UserDB.java,
src/main/java/tigase/db/UserExistsException.java,
src/main/java/tigase/db/UserNotFoundException.java,
src/main/java/tigase/db/UserRepository.java,
src/main/java/tigase/db/jdbc/DrupalAuth.java,
src/main/java/tigase/db/jdbc/JDBCRepository.java,
src/main/java/tigase/db/jdbc/LibreSourceAuth.java,
src/main/java/tigase/db/xml/XMLRepository.java,
src/main/java/tigase/disco/ServiceEntity.java,
src/main/java/tigase/disco/ServiceIdentity.java,
src/main/java/tigase/disco/XMPPService.java,
src/main/java/tigase/disco/XMPPServiceCollector.java,
src/main/java/tigase/http/HttpServer.java,
src/main/java/tigase/http/HttpService.java,
src/main/java/tigase/io/BufferUnderflowException.java,
src/main/java/tigase/io/IOInterface.java,
src/main/java/tigase/io/SSLContextContainer.java,
src/main/java/tigase/io/SampleSocketThread.java,
src/main/java/tigase/io/SocketIO.java,
src/main/java/tigase/io/TLSEventHandler.java,
src/main/java/tigase/io/TLSIO.java,
src/main/java/tigase/io/TLSStatus.java,
src/main/java/tigase/io/TLSUtil.java,
src/main/java/tigase/io/TLSWrapper.java,
src/main/java/tigase/io/TelnetClient.java,
src/main/java/tigase/io/TelnetServer.java,
src/main/java/tigase/net/Accept.java,
src/main/java/tigase/net/ConnectionOpenListener.java,
src/main/java/tigase/net/ConnectionOpenThread.java,
src/main/java/tigase/net/ConnectionType.java,
src/main/java/tigase/net/IOService.java,
src/main/java/tigase/net/IOServiceListener.java,
src/main/java/tigase/net/ServiceCommand.java,
src/main/java/tigase/net/SocketReadThread.java,
src/main/java/tigase/net/SocketType.java,
src/main/java/tigase/server/AbstractComponentRegistrator.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/Command.java,
src/main/java/tigase/server/ComponentRegistrator.java,
src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/MessageReceiver.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/MessageRouterConfig.java,
src/main/java/tigase/server/Packet.java,
src/main/java/tigase/server/Permissions.java,
src/main/java/tigase/server/ServerComponent.java,
src/main/java/tigase/server/ThreadExceptionHandler.java,
src/main/java/tigase/server/XMPPServer.java,
src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshIOService.java,
src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/bosh/Constants.java,
src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/sreceiver/DefaultValues.java,
src/main/java/tigase/server/sreceiver/NewTaskCommand.java,
src/main/java/tigase/server/sreceiver/NewsDistributor.java,
src/main/java/tigase/server/sreceiver/PropertyConstants.java,
src/main/java/tigase/server/sreceiver/PropertyItem.java,
src/main/java/tigase/server/sreceiver/ReceiverTaskIfc.java,
src/main/java/tigase/server/sreceiver/RepoRosterTask.java,
src/main/java/tigase/server/sreceiver/RosterItem.java,
src/main/java/tigase/server/sreceiver/ShortNewsPublisher.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/sreceiver/TaskCommandIfc.java,
src/main/java/tigase/server/sreceiver/TaskCommons.java,
src/main/java/tigase/server/sreceiver/TaskCreationPolicy.java,
src/main/java/tigase/server/sreceiver/TaskInstanceCommand.java,
src/main/java/tigase/server/sreceiver/TaskType.java,
src/main/java/tigase/server/ssender/DrupalForumTask.java,
src/main/java/tigase/server/ssender/FileTask.java,
src/main/java/tigase/server/ssender/JDBCTask.java,
src/main/java/tigase/server/ssender/SenderTask.java,
src/main/java/tigase/server/ssender/StanzaHandler.java,
src/main/java/tigase/server/ssender/StanzaSender.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java,
src/main/java/tigase/stats/StatRecord.java,
src/main/java/tigase/stats/StatisticType.java,
src/main/java/tigase/stats/StatisticsCollector.java,
src/main/java/tigase/stats/StatisticsContainer.java,
src/main/java/tigase/stats/StatsComponent.java,
src/main/java/tigase/ui/UIComponent.java,
src/main/java/tigase/ui/WebUI.java,
src/main/java/tigase/ui/XMPPServiceComponent.java,
src/main/java/tigase/util/ElementUtils.java,
src/main/java/tigase/util/LogFormatter.java,
src/main/java/tigase/util/RepositoryUtils.java,
src/main/java/tigase/util/RoutingsContainer.java,
src/main/java/tigase/xmpp/Authorization.java,
src/main/java/tigase/xmpp/NotAuthorizedException.java,
src/main/java/tigase/xmpp/ProcessorFactory.java,
src/main/java/tigase/xmpp/RepositoryAccess.java,
src/main/java/tigase/xmpp/StanzaType.java,
src/main/java/tigase/xmpp/XMPPDomBuilderHandler.java,
src/main/java/tigase/xmpp/XMPPException.java,
src/main/java/tigase/xmpp/XMPPIOService.java,
src/main/java/tigase/xmpp/XMPPIOServiceListener.java,
src/main/java/tigase/xmpp/XMPPImplIfc.java,
src/main/java/tigase/xmpp/XMPPPostprocessorIfc.java,
src/main/java/tigase/xmpp/XMPPPreprocessorIfc.java,
src/main/java/tigase/xmpp/XMPPProcessor.java,
src/main/java/tigase/xmpp/XMPPProcessorIfc.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/XMPPSession.java,
src/main/java/tigase/xmpp/XMPPStopListenerIfc.java,
src/main/java/tigase/xmpp/impl/BindResource.java,
src/main/java/tigase/xmpp/impl/IBB.java,
src/main/java/tigase/xmpp/impl/JabberIqAuth.java,
src/main/java/tigase/xmpp/impl/JabberIqCommand.java,
src/main/java/tigase/xmpp/impl/JabberIqIq.java,
src/main/java/tigase/xmpp/impl/JabberIqOOB.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivate.java,
src/main/java/tigase/xmpp/impl/JabberIqRegister.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/JabberIqSi.java,
src/main/java/tigase/xmpp/impl/JabberIqSocks5Bytestreams.java,
src/main/java/tigase/xmpp/impl/JabberIqStats.java,
src/main/java/tigase/xmpp/impl/JabberIqVersion.java,
src/main/java/tigase/xmpp/impl/Jingle.java,
src/main/java/tigase/xmpp/impl/Message.java,
src/main/java/tigase/xmpp/impl/OfflineMessages.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/Privacy.java,
src/main/java/tigase/xmpp/impl/Roster.java,
src/main/java/tigase/xmpp/impl/SaslAuth.java,
src/main/java/tigase/xmpp/impl/ServiceDiscovery.java,
src/main/java/tigase/xmpp/impl/SessionBind.java,
src/main/java/tigase/xmpp/impl/SimpleForwarder.java,
src/main/java/tigase/xmpp/impl/StartTLS.java,
src/main/java/tigase/xmpp/impl/UrnXmppPing.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java: License change to
GPLv3
2007-07-13 12:48 kobit
* src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshIOService.java,
src/main/java/tigase/server/bosh/BoshSession.java: Bosh
implementation in progress
2007-07-13 12:48 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Changed public constants to private constants
2007-06-27 16:03 kobit
* src/main/java/tigase/xmpp/impl/JabberIqCommand.java,
src/main/java/tigase/xmpp/impl/JabberIqIq.java,
src/main/java/tigase/xmpp/impl/JabberIqRegister.java,
src/main/java/tigase/xmpp/impl/JabberIqStats.java,
src/main/java/tigase/xmpp/impl/JabberIqVersion.java,
src/main/java/tigase/xmpp/impl/Jingle.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/ServiceDiscovery.java,
src/main/java/tigase/xmpp/impl/SimpleForwarder.java,
src/main/java/tigase/xmpp/impl/UrnXmppPing.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java: Removed redundand
'from' attribute setting which is already done in PacketFilter
2007-06-27 15:24 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java: Changed
access modifier from protected to private because this variable
is now accessible through public method for component
2007-06-27 15:22 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java:
Removed 'forward' processing completely as it was conflicting
with all plugins processing stanzas on behalf of the user
2007-06-27 15:21 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java:
Replaced custom code with more generic code accessing default
hostname
2007-06-27 15:21 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Replaced custom code with more generic code accessing default
hostname
2007-06-27 15:20 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Fixed null pointer
exception in case of closing not authenticated session
2007-06-18 16:21 kobit
* etc/tigase-mysql.conf, src/main/java/tigase/net/IOService.java,
src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/bosh/Constants.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/xmpp/XMPPIOService.java,
src/main/java/tigase/xmpp/XMPPIOServiceListener.java: Each
component can now provide own implementation/extension of
XMPPIOService. The specific component using this feature is Bosh
2007-06-18 16:20 kobit
* src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/server/MessageRouter.java: Added NULL
routing which is dummy routing used for domain names hosted on
the server
2007-06-18 16:19 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Fixed bug when user could inject a stanza to the system before
the session has been authenticated
2007-06-09 09:27 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/ssender/StanzaSender.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Moved defHostname code to abstract class to make it automatically
available for all message receivers and set proper default
routing for all components
2007-06-08 19:18 kobit
* src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Added default hostname for c2s component as using the first
hostname as default from the list doesn't work correctly,
elements often gets reordered
2007-06-08 18:55 kobit
* src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java:
Fixed problem with error stanza received sometimes from s2s
component in case of problem with deivery
2007-06-08 18:20 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java: Fixed
problem with default policies for task types and added
defHostname config parameter
2007-06-08 18:20 kobit
* build.properties: Version change to 2.9.6
2007-06-08 17:05 kobit
* pom.xml: [maven-release-plugin] prepare for next development
iteration
2007-06-08 17:05 kobit
* pom.xml: [maven-release-plugin] prepare release
tigase-server-2.9.5
2007-06-08 11:43 kobit
* build.properties, win-stuff/Tigase.iss: Version change to 2.9.5
2007-06-08 11:41 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java: Fixed
bug with presence probe processing
2007-06-08 11:00 kobit
* pom.xml: [maven-release-plugin] prepare for next development
iteration
2007-06-08 11:00 kobit
* pom.xml: [maven-release-plugin] prepare release
tigase-server-2.9.4
2007-06-08 11:00 kobit
* pom.xml: changed xmltools version dependcy
2007-06-08 10:59 kobit
* ant-definitions.xml: Added Mandriva script to binary releases
2007-06-08 07:49 kobit
* win-stuff/Tigase.iss: Version number update to 2.9.4
2007-06-07 23:57 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java: Corrected
packet forwarding addressed to domain
2007-06-07 23:37 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java: Fixed
problem with packet forwarding
2007-06-07 23:16 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java:
Commented out some extra logging
2007-06-07 23:15 kobit
* src/main/java/tigase/server/MessageRouter.java: Improved
processing of lost packet to local component
2007-06-07 23:14 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Improved packet filter - added default forwarder
2007-06-07 23:13 kobit
* src/main/java/tigase/conf/Configurator.java: Increased default
log size to 10MB
2007-06-07 23:12 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRegister.java: Improved
authorization checking
2007-06-06 23:06 kobit
* scripts/mandriva, scripts/mandriva/init.d,
scripts/mandriva/init.d/tigase: Startup script for Mandriva
2007-06-06 23:06 kobit
* src/main/java/tigase/disco/ServiceEntity.java,
src/main/java/tigase/net/ConnectionOpenThread.java,
src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/MessageRouterConfig.java,
src/main/java/tigase/server/sreceiver/PropertyItem.java,
src/main/java/tigase/server/sreceiver/TaskCommons.java,
src/main/java/tigase/server/ssender/StanzaSender.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java,
src/main/java/tigase/xmpp/impl/BindResource.java,
src/main/java/tigase/xmpp/impl/IBB.java,
src/main/java/tigase/xmpp/impl/JabberIqAuth.java,
src/main/java/tigase/xmpp/impl/JabberIqCommand.java,
src/main/java/tigase/xmpp/impl/JabberIqIq.java,
src/main/java/tigase/xmpp/impl/JabberIqOOB.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivate.java,
src/main/java/tigase/xmpp/impl/JabberIqRegister.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/JabberIqSi.java,
src/main/java/tigase/xmpp/impl/JabberIqSocks5Bytestreams.java,
src/main/java/tigase/xmpp/impl/JabberIqStats.java,
src/main/java/tigase/xmpp/impl/JabberIqVersion.java,
src/main/java/tigase/xmpp/impl/Jingle.java,
src/main/java/tigase/xmpp/impl/Message.java,
src/main/java/tigase/xmpp/impl/OfflineMessages.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/SaslAuth.java,
src/main/java/tigase/xmpp/impl/ServiceDiscovery.java,
src/main/java/tigase/xmpp/impl/SessionBind.java,
src/main/java/tigase/xmpp/impl/StartTLS.java,
src/main/java/tigase/xmpp/impl/UrnXmppPing.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java: Code cleanup
2007-06-06 20:29 kobit
* src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshIOService.java,
src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/bosh/Constants.java: Stream
initialization - implementation in progress
2007-06-06 20:28 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
c2s component now first sends stream initialization back to
client and then sends requests for GETFEATURES to avoid sending
features before stream initialization
2007-06-06 20:27 kobit
* src/main/java/tigase/xmpp/XMPPIOService.java: Removed all locks
as now IOService is synchronized
2007-06-06 19:49 kobit
* src/main/java/tigase/xmpp/impl/UrnXmppPing.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java: Code cleanup
2007-06-06 16:27 kobit
* src/main/java/tigase/xmpp/impl/ServiceDiscovery.java,
src/main/java/tigase/xmpp/impl/SessionBind.java,
src/main/java/tigase/xmpp/impl/StartTLS.java: Code cleanup
2007-06-06 16:23 kobit
* src/main/java/tigase/xmpp/impl/BindResource.java,
src/main/java/tigase/xmpp/impl/IBB.java,
src/main/java/tigase/xmpp/impl/JabberIqAuth.java,
src/main/java/tigase/xmpp/impl/JabberIqCommand.java,
src/main/java/tigase/xmpp/impl/JabberIqIq.java,
src/main/java/tigase/xmpp/impl/JabberIqOOB.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivate.java,
src/main/java/tigase/xmpp/impl/JabberIqRegister.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/JabberIqSi.java,
src/main/java/tigase/xmpp/impl/JabberIqSocks5Bytestreams.java,
src/main/java/tigase/xmpp/impl/JabberIqStats.java,
src/main/java/tigase/xmpp/impl/JabberIqVersion.java,
src/main/java/tigase/xmpp/impl/Jingle.java,
src/main/java/tigase/xmpp/impl/Message.java,
src/main/java/tigase/xmpp/impl/OfflineMessages.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/SaslAuth.java: Code cleanup
2007-06-06 15:48 kobit
* src/main/java/tigase/net/IOService.java,
src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/sreceiver/PropertyItem.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/xmpp/XMPPProcessor.java,
src/main/java/tigase/xmpp/impl/OfflineMessages.java,
src/main/java/tigase/xmpp/impl/Presence.java: Code cleanup
2007-06-06 12:21 kobit
* src/main/java/tigase/auth/SaslPLAIN.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/impl/JabberIqAuth.java,
src/main/java/tigase/xmpp/impl/SaslAuth.java,
src/main/java/tigase/xmpp/impl/SessionBind.java: Code cleanup
2007-06-06 12:06 kobit
* src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/server/sreceiver/TaskInstanceCommand.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Performance optimizations
2007-06-06 11:55 kobit
* src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/db/jdbc/JDBCRepository.java,
src/main/java/tigase/db/jdbc/LibreSourceAuth.java,
src/main/java/tigase/io/SSLContextContainer.java,
src/main/java/tigase/io/TLSWrapper.java,
src/main/java/tigase/io/TelnetClient.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/Packet.java,
src/main/java/tigase/server/sreceiver/RepoRosterTask.java,
src/main/java/tigase/server/sreceiver/ShortNewsPublisher.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/sreceiver/TaskInstanceCommand.java,
src/main/java/tigase/server/ssender/FileTask.java,
src/main/java/tigase/server/ssender/StanzaSender.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/stats/StatRecord.java,
src/main/java/tigase/stats/StatisticsCollector.java,
src/main/java/tigase/util/RepositoryUtils.java,
src/main/java/tigase/util/RoutingsContainer.java,
src/main/java/tigase/xmpp/XMPPIOService.java,
src/main/java/tigase/xmpp/impl/JabberIqAuth.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java: Performance
optimizations
2007-06-06 11:54 kobit
* src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/Constants.java: Added
configuration settings
2007-06-06 11:54 kobit
* src/main/java/tigase/server/bosh/BoshSession.java: Added
configuration settings
2007-06-06 11:52 kobit
* src/main/java/tigase/server/MessageRouter.java: Protection
against infinite loop, server now doesn't send out any packet
which is addressed to local domain
2007-06-05 22:03 kobit
* etc/tigase-mysql.conf, src/main/java/tigase/server/bosh,
src/main/java/tigase/server/bosh/BoshConnectionManager.java,
src/main/java/tigase/server/bosh/BoshIOService.java,
src/main/java/tigase/server/bosh/BoshSession.java,
src/main/java/tigase/server/bosh/Constants.java: Initial version
of BOSH component - XEP-0124
2007-06-05 22:03 kobit
* src/main/java/tigase/util/RoutingsContainer.java: Replaced
HashMap with LinkedHashMap
2007-06-05 21:48 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java:
Replaced HashMap with LinkedHashMap
2007-06-05 21:47 kobit
* src/main/java/tigase/server/ConnectionManager.java: Moved
XMPPIOService creation to separate method so it can be
overwritten and return more specialized classes implementation
like BoshIOService
2007-06-05 21:46 kobit
* src/main/java/tigase/server/ssender/StanzaSender.java: Replaced
HashMap with LinkedHashMap
2007-06-05 21:46 kobit
* src/main/java/tigase/server/AbstractComponentRegistrator.java:
Replaced HashMap with LinkedHashMap
2007-06-05 21:46 kobit
* src/main/java/tigase/server/MessageRouterConfig.java: Replaced
HashMap with LinkedHashMap and added Bosh component to a list of
standard components
2007-06-05 21:45 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Removed extra, not used import
2007-06-05 21:44 kobit
* src/main/java/tigase/server/sreceiver/TaskInstanceCommand.java:
Replaced HashMap with LinkedHashMap
2007-06-05 21:44 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java:
Replaced HashMap with LinkedHashMap
2007-06-05 21:44 kobit
* src/main/java/tigase/server/sreceiver/NewTaskCommand.java:
Replaced HashMap with LinkedHashMap
2007-06-05 21:43 kobit
* src/main/java/tigase/conf/ConfigRepository.java: Replaced HashMap
with LinkedHashMap
2007-06-05 21:43 kobit
* src/main/java/tigase/conf/Configurator.java: 1. Replaced HashMap
with LinkedHashMap, 2. changed default logging level to console
to FINER from ALL, 3. added stanza type checking for commands
requests
2007-06-05 21:41 kobit
* src/main/java/tigase/conf/Configurable.java: Added Bosh
implementation to a list of default components
2007-06-05 21:41 kobit
* src/main/java/tigase/xmpp/XMPPIOService.java: Unified i/o
interface, all methods now use writeRawData method which can be
overwritten in descendant classes like in BoshIOService to write
some HTTP headers before content
2007-06-05 21:40 kobit
* src/main/java/tigase/xmpp/impl/Roster.java: Replaced HashMap with
LinkedHashMap
2007-06-05 09:43 kobit
* src/main/java/tigase/server/MessageRouter.java: Corrected service
discovery retrieving to work only for stanzas with 'get' type
2007-06-01 17:18 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
s2s component now refuses to process packets (send out) which are
addressed to one of local domains
2007-06-01 17:18 kobit
* src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Added another default routings: .*.hostname
2007-06-01 11:43 kobit
* build.properties: Version number update to 2.9.4
2007-06-01 11:43 kobit
* pom.xml: Utils dependency update for version 2.4.2
2007-06-01 11:43 kobit
* src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Corrected default routing table, to '.*@hostname' added also
'hostname'
2007-06-01 10:22 kobit
* src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Default routing is now set to: .*@hostname instead of .*hostname
2007-06-01 10:22 kobit
* src/main/java/tigase/server/MessageRouter.java: regex routings
are now checked agains whole node ID part not just hostame
2007-06-01 09:01 kobit
* pom.xml: [maven-release-plugin] prepare for next development
iteration
2007-06-01 09:01 kobit
* pom.xml: [maven-release-plugin] prepare release
tigase-server-2.9.3
2007-06-01 08:58 kobit
* win-stuff/Tigase.iss: Version change to 2.9.3
2007-05-31 21:32 kobit
* etc/tigase-mysql.conf,
src/main/java/tigase/server/ConnectionManager.java: Logging a bit
optimized
2007-05-31 21:31 kobit
* src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Added GEN_CONFIG_COMP parameter processing, special default
confiuration for single component like MUC and external
component, IOService id is now a constant which means this
component can server single connection only
2007-05-31 21:30 kobit
* src/main/java/tigase/server/MessageRouterConfig.java: Added
GEN_CONFIG_COMP parameter processing, special default
confiuration for single component like MUC and external component
2007-05-31 21:29 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
ADMINS and HOSTNAMES property key moved to Configurable
2007-05-31 21:29 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java: ADMINS
property key moved to Configurable
2007-05-31 21:28 kobit
* src/main/java/tigase/server/sreceiver/ShortNewsPublisher.java:
super.processMessage call moved so commands are not distributed
to all subscribers
2007-05-31 21:26 kobit
* src/main/java/tigase/conf/Configurator.java: Added GEN_COMP_NAME,
CLASS parameters processing
2007-05-31 21:26 kobit
* build.properties, pom.xml: Version change to 2.9.3
2007-05-31 21:24 kobit
* src/main/java/tigase/conf/Configurable.java: Added
--gen-config-comp parameter, added some more comments and moved
HOSTNAMES and ADMINS property key from SessionManager to this
class
2007-05-30 11:30 bmalkow
* pom.xml: make dependencies non-snapshot
2007-05-29 22:29 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Corrected command processing - now commands not processed can be
sent out
2007-05-29 21:36 kobit
* src/main/java/tigase/server/sreceiver/ShortNewsPublisher.java,
win-stuff/Tigase.iss: Improved adding post confirmation - it now
should return warning in case if message is not correctly
formatted
2007-05-29 21:06 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java: Added
non-blocking method for inserting 'out' packets
2007-05-29 21:05 kobit
* src/main/java/tigase/server/MessageRouter.java: Protection from
infinite loop and self-locking
2007-05-29 21:05 kobit
* src/main/java/tigase/xmpp/impl/JabberIqStats.java: Removed
replacing from address, now it is left as it was originally
2007-05-29 21:04 kobit
* src/main/java/tigase/stats/StatisticsCollector.java: Changed
GETSTATS result generation to just normal result sent directly to
requesting entity
2007-05-29 09:29 kobit
* scripts/tigase.sh: Fixed a problem with the script when it was
run on systems where /bin/sh was not a bash shell, now it
specifically requests that it must be run under bash, first line
modified to: #!/bin/bash
2007-05-29 07:05 kobit
* src/main/java/tigase/server/sreceiver/ShortNewsPublisher.java:
Added response feedback for new short news submition
2007-05-29 06:59 kobit
* build.properties, pom.xml: Version change to 2.9.2
2007-05-29 06:58 kobit
* src/main/java/tigase/stats/StatisticsCollector.java: Fixed
problem with infinite loop in MessageRouter for this GETSTATS
packet
2007-05-28 12:52 kobit
* src/main/java/tigase/server/MessageRouterConfig.java,
win-stuff/Tigase.iss: Fixed default configuration generation for
external compoentns
2007-05-28 12:51 kobit
* database/postgresql-schema.sql: Removed extra comma
2007-05-28 12:51 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Corrected the
order in which records are removed from database - according to
requirements of foreign keys constraints
2007-05-28 10:54 kobit
* win-stuff/Tigase.iss: Version update to 2.9.1
2007-05-28 10:52 kobit
* database/mysql-schema.sql,
src/main/java/tigase/server/sreceiver/NewTaskCommand.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/sreceiver/TaskCreationPolicy.java,
src/main/java/tigase/server/sreceiver/TaskType.java: Added task
creation configurable permissions
2007-05-27 19:44 kobit
* src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java:
Moved posting permission checking from processMessage to
processPacket
2007-05-27 19:43 kobit
* src/main/java/tigase/server/sreceiver/RepoRosterTask.java: Added
verification if RosterItem is null before trying to remove it
from repository
2007-05-27 19:42 kobit
* src/main/java/tigase/server/sreceiver/NewsDistributor.java:
Changed constants from public to private
2007-05-27 19:42 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java:
Corrected indendation
2007-05-27 19:41 kobit
* src/main/java/tigase/db/jdbc/DrupalAuth.java: Removed unnecesary
local variable rs and finally section
2007-05-27 19:40 kobit
* src/main/java/tigase/server/sreceiver/ShortNewsPublisher.java:
The first version of short news publishing module
2007-05-27 19:39 kobit
* src/main/php/drupal/modules/short_news.module: The first version
of short_news module
2007-05-27 19:39 kobit
* src/main/php/drupal/modules/tigase.module: Moved license
information to proper place
2007-05-27 19:37 kobit
* build.properties, pom.xml: Version number change to 2.9.1
2007-05-27 19:37 kobit
* database/mysql-schema.sql, database/postgresql-schema.sql:
publishing_date remabed to publishing_time and added news_type
field and key
2007-05-26 10:31 kobit
* src/main/java/tigase/server/Permissions.java,
src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/sreceiver/NewsDistributor.java,
src/main/java/tigase/server/sreceiver/ReceiverTaskIfc.java,
src/main/java/tigase/server/sreceiver/RepoRosterTask.java,
src/main/java/tigase/server/sreceiver/TaskInstanceCommand.java,
src/main/java/tigase/server/ssender/DrupalForumTask.java,
src/main/java/tigase/server/ssender/StanzaSender.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/XMPPSession.java,
src/main/java/tigase/xmpp/impl/Presence.java: Fixed comments and
texts containing JIDUtils instead of JID after JID class
refactoring
2007-05-26 10:30 kobit
* database/mysql-schema.sql, database/postgresql-schema.sql: Added
short_news table, comments and licence note
2007-05-25 20:18 bmalkow
* tigase-server:
2007-05-25 11:36 bmalkow
* src/main/java/tigase/auth/SaslPLAIN.java,
src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/db/UserAuthRepositoryImpl.java,
src/main/java/tigase/db/jdbc/DrupalAuth.java,
src/main/java/tigase/db/jdbc/LibreSourceAuth.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/Permissions.java,
src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/sreceiver/NewTaskCommand.java,
src/main/java/tigase/server/sreceiver/NewsDistributor.java,
src/main/java/tigase/server/sreceiver/ReceiverTaskIfc.java,
src/main/java/tigase/server/sreceiver/RepoRosterTask.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/sreceiver/TaskCommons.java,
src/main/java/tigase/server/sreceiver/TaskInstanceCommand.java,
src/main/java/tigase/server/ssender/DrupalForumTask.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/RepositoryAccess.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/XMPPSession.java,
src/main/java/tigase/xmpp/impl/JabberIqAuth.java,
src/main/java/tigase/xmpp/impl/JabberIqCommand.java,
src/main/java/tigase/xmpp/impl/JabberIqIq.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivate.java,
src/main/java/tigase/xmpp/impl/JabberIqRegister.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/JabberIqStats.java,
src/main/java/tigase/xmpp/impl/JabberIqVersion.java,
src/main/java/tigase/xmpp/impl/Jingle.java,
src/main/java/tigase/xmpp/impl/Message.java,
src/main/java/tigase/xmpp/impl/OfflineMessages.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/Roster.java,
src/main/java/tigase/xmpp/impl/ServiceDiscovery.java,
src/main/java/tigase/xmpp/impl/SimpleForwarder.java,
src/main/java/tigase/xmpp/impl/UrnXmppPing.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java: refactoring:
renaming java.util.JID to tigase.util.JIDUtils
2007-05-25 11:24 kobit
* etc/tigase-mysql.conf: Added drupal forum tasks
2007-05-25 11:24 kobit
* win-stuff/Tigase.iss: Version number change
2007-05-24 21:46 kobit
* src/main/java/tigase/server/ssender/DrupalForumTask.java: Task
implementation finished and seems to work fine
2007-05-24 21:45 kobit
* src/main/java/tigase/server/ssender/StanzaSender.java: Added
generator for forum tasks
2007-05-24 21:44 kobit
* src/main/java/tigase/server/sreceiver/TaskCommons.java: Added
more options for creating presence stanza: status, nick name
2007-05-24 21:44 kobit
* src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java:
Replaced sender address with more actions: REPLACE, LEAVE,
REMOVE, some tweaking to presence format (added status), added
error message sent back if not authorized user tries to post a
message
2007-05-24 21:43 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java: Added
forum tasks for automatic config generation
2007-05-24 21:42 kobit
* src/main/java/tigase/server/sreceiver/PropertyConstants.java:
Replaced sender address with more actions: REPLACE, LEAVE, REMOVE
2007-05-24 06:25 kobit
* src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Replaced all _ in component names with -
2007-05-24 06:25 kobit
* src/main/java/tigase/server/ssender/StanzaSender.java: Changed
task name from nickname to full JID
2007-05-24 06:25 kobit
* src/main/java/tigase/server/MessageRouterConfig.java: Replaced
all _ in component names with -
2007-05-24 06:24 kobit
* src/main/java/tigase/server/Packet.java: Added static method:
getMessage(...)
2007-05-24 06:24 kobit
* src/main/java/tigase/server/ssender/StanzaHandler.java: Added new
handler method: void handleStanzas(Queue results)
2007-05-24 06:23 kobit
* src/main/java/tigase/server/ssender/DrupalForumTask.java: New
task for sending notifications about new posts on drupal forum
2007-05-24 06:22 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Corrected
javadoc
2007-05-23 12:50 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Added some
javadoc comments.
2007-05-23 12:49 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Added some
javadoc comments.
2007-05-23 11:38 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: removed
system.out.println statements
2007-05-23 11:38 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: removed
printStackTrace statement
2007-05-23 11:37 kobit
* src/main/java/tigase/xmpp/RepositoryAccess.java: Indentation
corrected
2007-05-23 11:36 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Improved
max_uid, max_nid handling to make more suitable for distributed
environmane
2007-05-23 11:01 kobit
* database/mysql-schema.sql: Added missing commas
2007-05-22 22:25 kobit
* src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/sreceiver/NewTaskCommand.java,
src/main/java/tigase/server/sreceiver/RepoRosterTask.java,
src/main/java/tigase/server/sreceiver/RosterItem.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/sreceiver/TaskCommons.java,
src/main/java/tigase/server/sreceiver/TaskInstanceCommand.java:
Subscribers management commands have been implemented now...
2007-05-22 21:25 kobit
* src/main/java/tigase/server/sreceiver/TaskCommons.java: Fixed
class name and added 2 more methods for presence and message
packet creation
2007-05-22 21:23 kobit
* src/main/java/tigase/server/sreceiver/TaskCommandCommons.java,
src/main/java/tigase/server/sreceiver/TaskCommons.java: Renamed
as more stuff will be put there
2007-05-22 12:39 kobit
* src/main/java/tigase/server/Command.java,
src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/sreceiver/ReceiverTaskIfc.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/sreceiver/TaskInstanceCommand.java:
Subscription moderation is working now
2007-05-22 12:34 kobit
* src/main/java/tigase/auth/SaslPLAIN.java: Added some more
commends
2007-05-21 23:05 kobit
* src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/sreceiver/NewTaskCommand.java,
src/main/java/tigase/server/sreceiver/PropertyConstants.java,
src/main/java/tigase/server/sreceiver/PropertyItem.java,
src/main/java/tigase/server/sreceiver/RepoRosterTask.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/sreceiver/TaskInstanceCommand.java:
Task configuration editing command is now completed and working
fine
2007-05-21 21:36 kobit
* etc/tigase-mysql.conf,
src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/sreceiver/NewTaskCommand.java,
src/main/java/tigase/server/sreceiver/NewsDistributor.java,
src/main/java/tigase/server/sreceiver/PropertyConstants.java,
src/main/java/tigase/server/sreceiver/PropertyItem.java,
src/main/java/tigase/server/sreceiver/ReceiverTaskIfc.java,
src/main/java/tigase/server/sreceiver/RepoRosterTask.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/sreceiver/TaskCommandCommons.java:
Task adding, deleting works fine now...
2007-05-21 21:36 kobit
* database/mysql-schema.sql, database/postgresql-schema.sql: Added
foreig key constraints to the schema...
2007-05-21 21:35 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Fixed a serious
bug with database access when there were many instances of this
class trying to save data to database. max_uid, max_nid were out
of sync, hopefuly making them static solves the problem
2007-05-21 06:01 kobit
* src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/sreceiver/ReceiverTaskIfc.java,
src/main/java/tigase/server/sreceiver/RepoRosterTask.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/sreceiver/TaskInstanceCommand.java:
Added task deleting functionality
2007-05-21 05:59 kobit
* src/main/java/tigase/server/sreceiver/NewTaskCommand.java: Added
setting owner property to a value of the command sender
2007-05-21 05:58 kobit
* src/main/java/tigase/disco/ServiceEntity.java: Added removing
ServiceEntity node from the tree
2007-05-21 05:56 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java:
Replaced ArrayList with LinkedList for statistics list
2007-05-21 05:51 kobit
* src/main/java/tigase/disco/ServiceEntity.java: Added removing
ServiceEntity node from the tree
2007-05-19 08:34 kobit
* etc/tigase-mysql.conf,
src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/sreceiver/DefaultValues.java,
src/main/java/tigase/server/sreceiver/NewTaskCommand.java,
src/main/java/tigase/server/sreceiver/PropertyConstants.java,
src/main/java/tigase/server/sreceiver/PropertyItem.java,
src/main/java/tigase/server/sreceiver/ReceiverTaskIfc.java,
src/main/java/tigase/server/sreceiver/RepoRosterTask.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/sreceiver/TaskCommandIfc.java,
src/main/java/tigase/server/sreceiver/TaskInstanceCommand.java:
Command for adding new tasks has been fully implemented, task
management command has been started, a lot of minor improvements
2007-05-19 08:32 kobit
* src/main/java/tigase/conf/Configurator.java: --debug options is
aware now of multiple, comma separated packages, add component
command removes MessageRouter from the list of available
components, method checking validy of nickname has been moved to
JID class
2007-05-19 08:30 kobit
* scripts/tigase.sh: Improved 'run' command to behave similarly as
'start'- uses in the same way environment variables in quotes
2007-05-19 08:29 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Moved addOutPackets(...) method to abstract class for convenience
2007-05-19 08:28 kobit
* src/main/java/tigase/server/Command.java: Added label to command
field
2007-05-19 08:27 kobit
* src/main/java/tigase/stats/StatisticsCollector.java: Added label
to command field
2007-05-17 21:27 kobit
* src/main/java/tigase/conf/Configurator.java: A few fixes for
creating new component
2007-05-15 22:35 kobit
* ant-definitions.xml: Added gentoo startup files to build package
2007-05-15 22:34 kobit
* src/main/java/tigase/xmpp/impl/UrnXmppPing.java: Removed
whitespaces
2007-05-15 22:34 kobit
* src/main/java/tigase/server/XMPPServer.java: Renamed main
component from tigase-xmpp-server to message-router
2007-05-15 22:33 kobit
* src/main/java/tigase/server/sreceiver/ReceiverTaskIfc.java:
Corrected javadoc
2007-05-15 22:33 kobit
* src/main/java/tigase/xmpp/impl/Jingle.java: Corrected javadoc
2007-05-15 22:33 kobit
* scripts/gentoo/init.d/tigase: Removed redundant variables
settings
2007-05-15 22:13 kobit
* scripts/gentoo, scripts/gentoo/conf.d,
scripts/gentoo/conf.d/tigase, scripts/gentoo/init.d,
scripts/gentoo/init.d/tigase, scripts/tigase.sh: Added tigase
startup scripts for Gentoo system
2007-05-14 22:36 kobit
* etc/tigase-mysql.conf,
src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Adding components at runtime with ad-hoc commands is now
completed
2007-05-14 10:06 kobit
* src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/server/MessageRouterConfig.java: Defined
more constants for class names for components
2007-05-14 10:05 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java: Added
identity for task item service discovery
2007-05-13 12:53 kobit
* src/main/java/tigase/conf/Configurator.java: Fixed a bug with
--admins setting and now component parameters are sorted on the
ad-hoc command list
2007-05-12 23:59 kobit
* src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/sreceiver/NewsDistributor.java,
src/main/java/tigase/server/sreceiver/ReceiverTaskIfc.java,
src/main/java/tigase/server/sreceiver/RepoRosterTask.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java: Roster
and Tasks are now stored in database and all states are
persistent
2007-05-12 23:59 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Changed 'component' naming to 'plugin' naming which is more
appropriate and follows general naming convention in Tigase
project
2007-05-12 23:58 kobit
* src/main/java/tigase/db/RepositoryFactory.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/util/RepositoryUtils.java: Repository
instance is now stored separately for each component using it to
avoid multithreaded access to JDBC repository
2007-05-12 23:57 kobit
* src/main/java/tigase/conf/Configurator.java: Added command line
options loading for all starting with '--gen-'
2007-05-12 23:55 kobit
* src/main/java/tigase/conf/Configurable.java: Added more contants
commonly used by different components
2007-05-12 09:41 kobit
* src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/sreceiver/ReceiverTaskIfc.java,
src/main/java/tigase/server/sreceiver/RosterItem.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Subscription fully works, permissions for subscription and
posting messages work, posting and distributing messages works
2007-05-11 23:25 kobit
* build.properties, pom.xml: Version change to 2.9.0, this is kind
of alpha version with new features under development
2007-05-11 23:23 kobit
* src/main/java/tigase/server/Packet.java,
src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/sreceiver/NewsDistributor.java,
src/main/java/tigase/server/sreceiver/ReceiverTaskIfc.java,
src/main/java/tigase/server/sreceiver/RosterItem.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java:
Subscription via presence wors in both ways now
2007-05-11 18:58 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java: Basic
stuff related to service discovery for exiting task instances
works now
2007-05-11 18:57 kobit
* src/main/java/tigase/disco/ServiceEntity.java: Added a few dummy
javadoc comments, they will be filled with useful stuff later on
2007-05-11 18:57 kobit
* src/main/java/tigase/disco/XMPPService.java: Defined separate
constants for service discovery XMLNSes
2007-05-11 18:20 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java:
Initial code for service discovery for tasks instances
2007-05-11 08:58 kobit
* src/main/java/tigase/server/MessageRouterConfig.java,
src/main/java/tigase/server/sreceiver/AbstractReceiverTask.java,
src/main/java/tigase/server/sreceiver/NewsDistributor.java,
src/main/java/tigase/server/sreceiver/ReceiverTaskIfc.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java:
Initial implementation of receiver tasks
2007-05-10 22:36 kobit
* src/main/java/tigase/server/sreceiver/ReceiverTaskIfc.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java: Almost
API definition finished, some initial code for loading
configuration is done
2007-05-10 19:05 kobit
* src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/MessageRouterConfig.java,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java,
src/main/java/tigase/server/ssender/StanzaSender.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Added support in config generator for multiple external
components --ext-comp_1, --ext-comp_2 and so on...
2007-05-09 09:51 kobit
* src/main/java/tigase/server/sreceiver/StanzaReceiver.java: Added
more configuration options - replace sender address and message
type
2007-05-09 09:40 kobit
* src/main/java/tigase/server/sreceiver,
src/main/java/tigase/server/sreceiver/StanzaReceiver.java:
Initial version - just javadoc
2007-05-08 23:09 kobit
* win-stuff, win-stuff/Licence.txt, win-stuff/Tigase.ico,
win-stuff/Tigase.iss, win-stuff/scripts,
win-stuff/scripts/InstallTigaseService.bat,
win-stuff/scripts/Run.bat, win-stuff/scripts/Tigase.bat,
win-stuff/scripts/Uninst.bat,
win-stuff/scripts/UninstallTigaseService.bat, win-stuff/wrapper,
win-stuff/wrapper/wrapper.conf, win-stuff/wrapper/wrapper.dll,
win-stuff/wrapper/wrapper.exe: Windows installation packaging
files
2007-05-08 11:22 kobit
* build.properties, pom.xml: Version change to 2.8.7
2007-05-08 11:18 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRegister.java: Fixed a bug
when the pluging didn't add 'from' attribute for authenticated
sessions and when the registration request was sent to
third-party entity like transport
2007-05-07 21:44 kobit
* src/main/java/tigase/xmpp/impl/BindResource.java,
src/main/java/tigase/xmpp/impl/JabberIqAuth.java,
src/main/java/tigase/xmpp/impl/JabberIqIq.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivacy.java,
src/main/java/tigase/xmpp/impl/JabberIqPrivate.java,
src/main/java/tigase/xmpp/impl/JabberIqRoster.java,
src/main/java/tigase/xmpp/impl/SaslAuth.java,
src/main/java/tigase/xmpp/impl/SessionBind.java,
src/main/java/tigase/xmpp/impl/VCardTemp.java: Added missing
disco-features, ticket #65: http://server.tigase.org/ticket/65
2007-05-07 14:21 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRegister.java: Further
corrections to the fix for the transport registration
2007-05-07 13:16 kobit
* build.properties, etc/tigase-mysql.conf, pom.xml,
src/main/java/tigase/conf/Configurator.java: Version change to
2.8.6
2007-05-07 12:07 kobit
* src/main/java/tigase/server/Command.java: Fix for a bug for a
case when the command contains no node attribute
2007-05-07 12:07 kobit
* src/main/java/tigase/xmpp/impl/JabberIqRegister.java: Corrections
to make it possible to register user in external transport
2007-05-07 12:06 kobit
* src/main/java/tigase/xmpp/impl/UrnXmppPing.java: Added one extra
empty line to make it more readable
2007-05-04 09:38 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Corrected broken, not-compilable code
2007-05-04 09:18 kobit
* build.xml: Added UTF-8 encoding for the build file which is
default anyway
2007-05-04 09:18 kobit
* src/main/java/tigase/xmpp/impl/UrnXmppPing.java: Corrected UTF-8
character
2007-05-04 09:17 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Added autoCreateUser=true for connection string if Drupal or
LibreSource auth is used
2007-05-03 09:37 kobit
* src/main/php/drupal/modules/tigase.module: Corrected function
name
2007-05-03 08:56 kobit
* src/main/java/tigase/xmpp/impl/JabberIqAuth.java: Corrected
indendation for the code
2007-05-03 08:54 kobit
* src/main/java/tigase/xmpp/impl/JabberIqAuth.java: Corrected
indendation for the code
2007-05-02 17:50 kobit
* build.properties, pom.xml: Version change to 2.8.5
2007-05-02 17:49 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Changed default configuration generation - for Drupal and
LibreSource jabber:iq:register is not loaded
2007-05-01 16:20 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Fixed fix ;-), corrected condition statement which decided when
send remote-server-not-found error
2007-05-01 16:12 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Unknown domain error handling improved for dialback packets
2007-05-01 16:07 kobit
* src/main/java/tigase/server/Packet.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Fixed a bug in s2s implementation for a remote servers connecting
from domain which doesn't exist in DNS. It caused infinite loop
2007-05-01 08:57 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Direct presence bug
fixed - #63
2007-04-30 14:49 kobit
* src/main/java/tigase/auth/SaslPLAIN.java,
src/main/java/tigase/db/jdbc/LibreSourceAuth.java: Changed back
to use plain plain passwords in LS database
2007-04-30 14:29 kobit
* src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/disco/XMPPService.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/stats/StatisticsCollector.java: Solved
problem with missing features for top level service discovery
2007-04-30 14:29 kobit
* scripts/tigase.sh: Indentation corrections
2007-04-29 22:43 kobit
* build.properties, pom.xml: Version number change to 2.8.4
2007-04-29 22:38 kobit
* pom.xml, src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/XMPPResourceConnection.java,
src/main/java/tigase/xmpp/impl/Presence.java: Fixed a bug with
ping to virtual domain and error response to unsupported packets
2007-04-29 21:32 kobit
* ant-definitions.xml: Added ChangeLog file for binary distribution
2007-04-26 21:57 kobit
* ant-definitions.xml: Added database schema scripts for
distribution packages
2007-04-26 06:21 kobit
* build.properties, pom.xml: Version change to 2.8.3
2007-04-25 19:02 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Added urn:xmpp:ping plugin for standard loaded plugins
2007-04-25 18:32 kobit
* src/main/java/tigase/server/MessageRouter.java: Fixed a bug when
server was dropping unsupported stanzas addressed to the server
itself instead of returning feature-not-supported error
2007-04-25 17:12 kobit
* prj.el, src/main/java/tigase/xmpp/impl/JabberIqPrivate.java:
Fixed error message when user tries to access other user private
data
2007-04-25 17:12 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Removed some extra debug logs
2007-04-23 06:53 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Fixed problem with connecting to all other than google servers,
apparently google is the only one which processes XML names
spaces correctly, (and now Tigase server does it correctly too)
2007-04-23 06:13 kobit
* ant-definitions.xml,
src/main/java/tigase/xmpp/impl/UrnXmppPing.java: Attempt to
remove warnings related to redundant casting and UTF-8 encoding
2007-04-21 15:11 kobit
* src/main/php, src/main/php/drupal, src/main/php/drupal/modules,
src/main/php/drupal/modules/tigase.module: Drupal module for
better integration with Tigase system - adding real online-status
for drupal users
2007-04-21 15:10 kobit
* src/main/java/tigase/server/ssender,
src/main/java/tigase/server/ssender/FileTask.java,
src/main/java/tigase/server/ssender/JDBCTask.java,
src/main/java/tigase/server/ssender/SenderTask.java,
src/main/java/tigase/server/ssender/StanzaHandler.java,
src/main/java/tigase/server/ssender/StanzaSender.java: Initial
version of stanza sender framework - sending stanzas taken from
directory or database
2007-04-21 14:52 kobit
* database/mysql-schema.sql, database/postgresql-schema.sql,
etc/tigase-mysql.conf,
src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/MessageRouterConfig.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Added xmpp_stanza table for StanzaSender JDBC task
2007-04-18 07:00 bmalkow
* src/main/java/tigase/xmpp/impl/UrnXmppPing.java: Update
svn:keywords
2007-04-18 06:58 bmalkow
* src/main/java/tigase/xmpp/impl/UrnXmppPing.java: Add
implementation of XEP-0199 (XMPP Ping)
2007-04-16 18:59 kobit
* src/main/java/tigase/xmpp/impl/JabberIqPrivate.java: Improved
error handling and handling the case when user doesn't send any
child element in query
2007-04-16 10:03 kobit
* build.properties, pom.xml: Version change to 2.8.2
2007-04-16 10:03 kobit
* etc/tigase-mysql.conf,
src/main/java/tigase/xmpp/impl/VCardTemp.java: Minor cleanup and
refactoring - renamed mehtod parseVCard to parseXML
2007-04-16 10:02 kobit
* src/main/java/tigase/xmpp/impl/JabberIqPrivate.java: Initial
version of private storage implementation
2007-04-16 06:05 kobit
* build.properties, pom.xml: Version change to 2.8.1
2007-04-16 06:04 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Minor changes related to different namespace and prefixes
processing in xmltools
2007-04-15 22:13 kobit
* build.properties, pom.xml: Version change to 2.8.0
2007-04-15 22:13 kobit
* src/main/java/tigase/xmpp/XMPPDomBuilderHandler.java: Added
better handling for extra namespaces and element prefixes,
prefixes should be dripped now and default namespace should be
updated for element to correct one
2007-04-15 20:29 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Added problem
handling for the case when user sends subscribe to buddy before
adding him to his roster using Roster functionality
2007-04-15 19:15 kobit
* pom.xml: Dependency to 2.6.0 xmltools added
2007-04-13 22:40 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java:
Changed log message slightly to avoid confusing for packet which
don't have matching plugin and they don't have 'to' attribute
set, in such case error message is generated, instead of droping
packet
2007-04-13 21:47 kobit
* src/main/java/tigase/xmpp/impl/VCardTemp.java: Correct support
for old vCard protocol
2007-04-13 21:35 kobit
* build.properties, pom.xml: Version change
2007-04-13 21:35 kobit
* src/main/java/tigase/disco/XMPPServiceCollector.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/Packet.java,
src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/impl/JabberIqCommand.java,
src/main/java/tigase/xmpp/impl/JabberIqIq.java,
src/main/java/tigase/xmpp/impl/JabberIqStats.java,
src/main/java/tigase/xmpp/impl/JabberIqVersion.java,
src/main/java/tigase/xmpp/impl/Jingle.java,
src/main/java/tigase/xmpp/impl/OfflineMessages.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/Roster.java,
src/main/java/tigase/xmpp/impl/ServiceDiscovery.java,
src/main/java/tigase/xmpp/impl/SimpleForwarder.java: Minor
modifications related to clone() method change in xmltools which
now returns Element to avoid type casting
2007-04-13 21:28 kobit
* src/main/java/tigase/xmpp/impl/VCardTemp.java: Small change to
make it compatible with old vCard spec where element name was all
uppercase, clone() method in xmltools has been changed so the
class has been changed to reflect it
2007-04-12 13:31 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Added capabilities to presence information for USER_STATUS
command
2007-04-10 16:22 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
fixed problem with initial presence for session activated by
external component
2007-04-10 14:28 kobit
* database/postgresql-schema.sql, scripts/repo.sh: Updated user
repository access files
2007-04-10 14:27 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Fixed a bug where --test configuration was always generated
2007-04-04 21:39 kobit
* src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/server/MessageRouterConfig.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Fixed problem with default configuration generation for component
names session_1/sess_man
2007-04-04 21:27 kobit
* build.properties, pom.xml: Version change
2007-04-04 21:26 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java:
Fixed bug in generating default configuration, sess_man instead
of session_1
2007-04-04 20:05 kobit
* src/main/java/tigase/conf/Configurator.java: Changed default
logging level for console output
2007-04-04 20:00 kobit
* src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Removed remote_host global class variable
2007-04-04 07:53 kobit
* pom.xml: Dependecies updated for new xmltools version 2.5.0
2007-04-03 21:08 kobit
* etc/tigase-mysql.conf,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Modified default config generation, routing part is generated
automatically
2007-04-03 18:42 kobit
* build.properties, pom.xml: Version number change to 2.7.1
2007-04-03 18:42 kobit
* src/main/java/tigase/server/AbstractMessageReceiver.java: Moved
time constants to parent class
2007-04-03 18:42 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Added config wizard option to automaticly pick-up external
component domain
2007-04-03 18:41 kobit
* src/main/java/tigase/server/ConnectionManager.java: Moved time
constants to parent class
2007-04-03 18:40 kobit
* src/main/java/tigase/server/MessageRouter.java: Uptime statistics
added
2007-04-03 18:39 kobit
* src/main/java/tigase/conf/Configurator.java: Changed default
logging levels for normal mode, test and debug
2007-04-02 12:48 kobit
* prj.el,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
added test mode to SM so it loads different set of plugins in
test mode, this is necessary to avoid interfrence with other
functionalities during tests
2007-04-02 12:45 kobit
* src/main/java/tigase/conf/Configurator.java: Removed depreciated
and commented-out code
2007-03-31 21:47 kobit
* etc/tigase-mysql.conf,
src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/xmpp/impl/Presence.java: Spelling
corrections and default config params slightly changed
2007-03-30 22:50 kobit
* pom.xml: Version dependencies update
2007-03-30 22:48 kobit
* src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Added Long/long data types for configuration storage and max
waiting time for packet parameter is back in configuration
2007-03-30 22:21 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java,
src/main/java/tigase/xmpp/impl/ServiceDiscovery.java: Deprecated
ServiceDiscovery class and removed loading disco from default
configuration, it is no longer used and needed
2007-03-30 22:15 kobit
* build.properties, pom.xml,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Temporarly disabled configuration option to set timeout for
waiting packets in s2s component
2007-03-30 21:23 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Implemented timeout for packets sent through s2s, if Tigase can
not connect to remote server for some specified time it giveup
and returns all packages back to sender
2007-03-30 21:21 kobit
* src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Added 'XEP-0114' string to component name to avoid confusion
2007-03-30 09:12 kobit
* src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/disco/ServiceEntity.java,
src/main/java/tigase/disco/XMPPServiceCollector.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/MessageReceiver.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/MessageRouterConfig.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/stats/StatisticsCollector.java: Final fixes
for service discovery and cluster management framework
2007-03-28 06:18 kobit
* src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/disco/ServiceEntity.java,
src/main/java/tigase/disco/XMPPServiceCollector.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/MessageRouterConfig.java,
src/main/java/tigase/server/Packet.java,
src/main/java/tigase/server/ServerComponent.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/stats/StatisticsCollector.java: Changes in
service-disco layer to allow return correct info from instances
where SM is not available
2007-03-20 23:05 kobit
* src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Corrected max reconnects value handling
2007-03-20 22:53 kobit
* src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Added remote hostname information to service discovery
2007-03-20 22:52 kobit
* src/main/java/tigase/conf/Configurator.java: Fixed problem with
configuration file initialization
2007-03-20 20:50 kobit
* src/main/java/tigase/db/jdbc/DrupalAuth.java,
src/main/java/tigase/db/jdbc/JDBCRepository.java,
src/main/java/tigase/db/jdbc/LibreSourceAuth.java: Changed JDBC
connection validation query to some more efficient
2007-03-20 20:49 kobit
* src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Start of service-disco implementation for external component
2007-03-20 00:04 kobit
* src/main/java/tigase/db/jdbc/LibreSourceAuth.java: Added proper
code for add/remove user and update user password
2007-03-19 23:24 kobit
* src/main/java/tigase/db/UserAuthRepository.java,
src/main/java/tigase/db/UserAuthRepositoryImpl.java,
src/main/java/tigase/db/jdbc/DrupalAuth.java,
src/main/java/tigase/db/jdbc/JDBCRepository.java,
src/main/java/tigase/db/jdbc/LibreSourceAuth.java,
src/main/java/tigase/db/xml/XMLRepository.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Added support for logout() event to database backend so Tigase
may now write presence status to database. It allows other
systems display online status. Currently it is implemented in
LibreSource connector only
2007-03-19 17:21 kobit
* src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/net/ConnectionOpenThread.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/MessageRouterConfig.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Fixes for problems with reconfiguration at runtime, now it is
also even possible to switch on/off components, add new
components, add/remove TCP/IP port listeners and so on....
2007-03-14 12:06 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Added fix for proper handling malformed dialback requests sent by
very old jabber servers
2007-03-13 10:56 kobit
* src/main/java/tigase/auth/SaslPLAIN.java,
src/main/java/tigase/db/jdbc/LibreSourceAuth.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Implementation of authentication agains LibreSource database is
completed - this is simple implementation, just authentication
and nothing more
2007-03-13 10:55 kobit
* src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Started implementation for service-discovery support
2007-03-13 10:54 kobit
* src/main/java/tigase/server/ConnectionManager.java: Added fix for
a bug when service is stopped in accept method
2007-03-12 16:03 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Fixed a problem with connection stopped in accept method, no
retry was performed then
2007-03-12 15:55 kobit
* src/main/java/tigase/server/ConnectionManager.java: Fixed problem
when stop is called afer unssuccesful accept call
2007-03-12 15:48 kobit
* src/main/java/tigase/net/IOService.java: Fixed problem when stop
is called afer unssuccesful accept call
2007-03-12 15:41 kobit
* src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Added fix for the case when connection is lost before handshaking
has started, like exception in accept phase
2007-03-12 12:27 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java: Fixed
packet filter delivering packet to proper active resource - now
it behaves as described in RFC
2007-03-12 11:56 kobit
* src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Commented out code for stop-other service and added proper
handling for case when packet write to socket was unsuccessful
2007-03-10 22:50 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Added proper handling for the situation when accept connection is
closed before handshaking has been completed
2007-03-10 22:45 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Changed the order in which packets are sent, first all waiting
controll ackets, next db:result on connect
2007-03-10 15:53 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Added one more logging messgae to detect whether stopping old
connection is really an issue
2007-03-10 15:50 kobit
* src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Fixed problem with initializing new connection for remote server
when old connection still seems active
2007-03-07 11:28 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Another fix for asynchronous dialback processing
2007-03-07 11:14 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
BIG, BIG bug fixed finally
2007-03-07 09:54 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Even more logging to track down opening extra s2s connections
2007-03-06 22:35 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Fixed bug in processing results from processDialback method,
after this method is finished service may be available in either
handsahking or established Map
2007-03-06 22:12 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Added more logging for dialback verification results
2007-03-06 21:38 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Implementation for invalid dialback verification
2007-03-06 15:33 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Added diagnostic logs for stream opening - possible multiple
stream open calls
2007-03-06 15:08 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Added logging for all dialback handshaking
2007-03-06 14:38 kobit
* src/main/java/tigase/server/Packet.java,
src/main/java/tigase/xmpp/impl/Presence.java,
src/main/java/tigase/xmpp/impl/Roster.java: Proper handling of
presence error in case of s2s can't send it to destination
address (or it should be just ignored)
2007-03-06 13:46 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Added synchronization to service stopped handler
2007-03-05 23:01 kobit
* src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Fixed disconnection other dialback connection method and added
more logging info
2007-03-05 21:37 kobit
* src/main/java/tigase/server/ConnectionManager.java: Added logging
messages to watchdog
2007-03-05 21:03 kobit
* src/main/java/tigase/server/ConnectionManager.java: Fixed log
message position, put in wrong place by mistake
2007-03-05 20:51 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Added parameter about the maximum iddle time for connection
2007-03-05 20:51 kobit
* src/main/java/tigase/xmpp/XMPPIOService.java: Added last transfer
timestamp information
2007-03-05 20:49 kobit
* src/main/java/tigase/server/MessageRouter.java: Removed DNS
resolving from message router
2007-03-05 20:48 kobit
* src/main/java/tigase/server/ConnectionManager.java: Added
connection watchdog thread
2007-03-05 20:48 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Full support for stream:error, detecting improper hosts in
sender/receiver stanza addreses
2007-03-05 10:00 kobit
* src/main/java/tigase/net/IOService.java,
src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/xmpp/XMPPIOService.java: A few corrections
in IO/NET/SERVICES - check whether service ID is no duplicated
2007-03-02 13:58 kobit
* src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
All handshaking connections are now also dumped to log file on
request
2007-03-02 12:23 kobit
* src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/xmpp/XMPPIOService.java: Added extra logging
to detect s2s problems
2007-03-01 11:10 kobit
* src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Fixed a bug in s2s which caused automatic reconnecting s2s
connection even if it was not necessary
2007-03-01 04:02 kobit
* src/main/java/tigase/io/SocketIO.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/XMPPIOService.java: Fixed a bug with
logging data buffer which is NULL
2007-03-01 00:05 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Added extra log message
2007-02-28 23:54 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Proper handling of stream:error in s2s
2007-02-28 23:39 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
Proper error response added if user account does not exist
2007-02-28 23:25 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/impl/Presence.java: Proper error
response added if user account does not exist
2007-02-28 21:59 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
Fixed code for reconnecting s2s service if the first attempt was
unsuccessful
2007-02-28 21:27 kobit
* src/main/java/tigase/net/IOService.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/xmpp/XMPPIOService.java: Some fixes to s2s
implementation - retrying to connect if first try was
unsuccessfull and fixed a bug in IOService in stop() method -
handler is called in finally clausule
2007-02-28 13:31 kobit
* src/main/java/tigase/server/xmppserver/ServerConnectionManager.java:
List of connected servers is now sorted to make it easier to find
particular connection
2007-02-28 13:11 kobit
* src/main/java/tigase/server/Command.java,
src/main/java/tigase/server/ConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/stats/StatRecord.java,
src/main/java/tigase/stats/StatisticType.java,
src/main/java/tigase/stats/StatisticsCollector.java: More
statistics about network connections and packet waiting in s2s
queues
2007-02-27 23:04 kobit
* src/main/java/tigase/xmpp/impl/JabberIqIq.java: Just for fun
2007-02-22 23:04 kobit
* etc/tigase-mysql.conf,
src/main/java/tigase/xmpp/impl/Presence.java: Solved initial
presence broadcating problem for many resources connected
2007-02-22 00:07 kobit
* src/main/java/tigase/xmpp/impl/Jingle.java: Added session element
2007-02-21 23:33 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/impl/Jingle.java: Support for jingle in
Yate added
2007-02-21 22:08 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java:
USER_STATUS - presence status fixed
2007-02-21 22:00 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/stats/StatisticType.java: USER_STATUS
processing command moved to different place
2007-02-15 06:52 kobit
* build.properties, pom.xml: Version change to 2.6.4
2007-02-15 06:51 kobit
* src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/disco/XMPPService.java,
src/main/java/tigase/server/AbstractMessageReceiver.java,
src/main/java/tigase/server/Command.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/stats/StatRecord.java,
src/main/java/tigase/stats/StatisticsCollector.java: Improved
ad-hoc commands for configuration settings and statistics
retrieval
2007-02-14 10:37 kobit
* build.properties, pom.xml: Version number change
2007-02-14 09:44 kobit
* src/main/java/tigase/net/IOService.java,
src/main/java/tigase/xmpp/XMPPIOService.java: Fixed a bug with
UTF-8 encoder/decoder for network data
2007-02-13 23:50 kobit
* build.properties, pom.xml,
src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/disco/XMPPServiceCollector.java,
src/main/java/tigase/net/IOService.java,
src/main/java/tigase/server/AbstractComponentRegistrator.java,
src/main/java/tigase/server/Command.java,
src/main/java/tigase/stats/StatisticsCollector.java,
src/main/java/tigase/xmpp/impl/OfflineMessages.java,
src/main/java/tigase/xmpp/impl/Presence.java: Reconfiguration at
run-time ready - not well tested yet
2007-02-12 14:25 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java:
Corrected handling stanzas:
2007-02-12 14:03 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Presence update to
other user accounts corrected - attributes from/to where set
incorrectly
2007-02-12 12:04 kobit
* src/main/java/tigase/xmpp/XMPPSession.java,
src/main/java/tigase/xmpp/impl/Presence.java: Resource priority
is now set correctly and message to account with multiple active
resources is handled properly
2007-02-11 20:58 kobit
* build.properties, pom.xml,
src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/disco,
src/main/java/tigase/disco/ServiceEntity.java,
src/main/java/tigase/disco/ServiceIdentity.java,
src/main/java/tigase/disco/XMPPService.java,
src/main/java/tigase/disco/XMPPServiceCollector.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/MessageRouterConfig.java,
src/main/java/tigase/server/ServiceEntity.java,
src/main/java/tigase/server/ServiceIdentity.java,
src/main/java/tigase/server/XMPPService.java,
src/main/java/tigase/server/XMPPServiceCollector.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/main/java/tigase/server/xmppserver/ServerConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/stats/StatisticsCollector.java,
src/main/java/tigase/xmpp/impl/ServiceDiscovery.java: Service
discovery API changed and small refactoring to move all disco
related classes to separate package
2007-02-11 20:53 kobit
* src/main/java/tigase/xmpp/impl/VCardTemp.java: Fixed a bug
related to strange stanza when user session is null....
2007-02-11 14:06 kobit
* src/main/java/tigase/conf/Configurable.java,
src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/server/AbstractComponentRegistrator.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/ServiceEntity.java,
src/main/java/tigase/server/ServiceIdentity.java,
src/main/java/tigase/server/XMPPServer.java,
src/main/java/tigase/server/XMPPService.java,
src/main/java/tigase/server/XMPPServiceCollector.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/stats/StatisticsCollector.java,
src/main/java/tigase/stats/StatisticsContainer.java: New service
discovert API
2007-02-08 11:30 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Fixed problem with
initial presence after subscription, server used to send presnece
without resource part, Thank to Daniele for the fix
2007-02-07 23:34 kobit
* src/main/java/tigase/io/TLSEventHandler.java,
src/main/java/tigase/io/TLSIO.java,
src/main/java/tigase/io/TLSWrapper.java,
src/main/java/tigase/io/TelnetClient.java,
src/main/java/tigase/io/TelnetServer.java,
src/main/java/tigase/net/IOService.java,
src/main/java/tigase/xmpp/XMPPIOService.java: Fixed socket write
method for TLS connection, bug causing possible data loss for
large buffers, Gajim still inserts line-breaks in the middle of
large buffer, somewhere near 16k data block
2007-02-04 22:43 kobit
* src/main/java/tigase/server/xmppsession/SessionManagerConfig.java,
src/main/java/tigase/xmpp/impl/JabberIqSi.java: More components
depreciated due to PacketFilter use
2007-02-04 18:19 bmalkow
* pom.xml: add maven release plugin configuration
2007-02-03 17:15 kobit
* src/main/java/tigase/server/XMPPServer.java,
src/main/java/tigase/server/XMPPServiceCollector.java: Added
server version information to service discovery
2007-02-03 09:25 kobit
* build.properties, pom.xml: Version change
2007-02-03 09:23 kobit
* src/main/java/tigase/server/xmppsession/SessionManager.java: Fix
for the bug introduced by PacketFilter caused to ignore privacy
lists
2007-02-02 16:20 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java: Fixed
a problem with NullPointerException when there is no 'from'
attribute in PacketFilter
2007-02-02 16:10 kobit
* build.xml,
src/main/java/tigase/server/xmppsession/PacketFilter.java: Fixed
a problem with NullPointerException when there is no 'to'
attribute in PacketFilter
2007-02-02 15:47 kobit
* src/main/java/tigase/server/xmppsession/PacketFilter.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java,
src/main/java/tigase/xmpp/impl/IBB.java,
src/main/java/tigase/xmpp/impl/JabberIqOOB.java,
src/main/java/tigase/xmpp/impl/JabberIqSocks5Bytestreams.java,
src/main/java/tigase/xmpp/impl/Message.java: Introduced
PacketFilter in place of SimpleForwarder
2007-02-02 11:33 kobit
* .classpath, .project, .settings: Removed eclipse configuration
files to avoid overwriting other developers eclipse settings
2007-02-02 11:09 kobit
* src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppsession/SessionManager.java:
Fixed problem with incorrectly sent stream features
2007-01-28 17:28 kobit
* etc/tigase-mysql.conf, etc/tigase-pgsql.conf: sample
configuration file improved - added sample db connection uri
2007-01-28 17:02 kobit
* src/main/assembly/prodenv.xml: Removed some scripts not needed by
the user
2007-01-28 16:02 bmalkow
* pom.xml: fix error in dependency
2007-01-28 15:54 kobit
* etc, etc/tigase-mysql.conf, etc/tigase-pgsql.conf,
etc/tigase.conf, scripts/tigase.sh,
src/main/assembly/prodenv.xml: Configuration changed to better
integrate with maven
2007-01-28 12:32 bmalkow
* pom.xml: add version in package filename
2007-01-28 12:17 bmalkow
* pom.xml: add 'optional' attribute in dependency
2007-01-28 12:04 bmalkow
* pom.xml, src/main/assembly, src/main/assembly/prodenv.xml: add
simple assembly goal config
2007-01-27 08:28 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Removed some
cache calls - calls for specific data items where cache was not
working correctly
2007-01-26 22:22 kobit
* database/mysql-schema.sql, database/postgresql-schema.sql,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java:
Fixed problem with default auth-db-url if set only user-db-url
2007-01-26 21:07 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Changed cache
size back to 10000
2007-01-26 16:29 kobit
* src/main/java/tigase/db/jdbc/JDBCRepository.java: Increased cache
size
2007-01-26 11:57 kobit
* src/main/java/tigase/server/ConnectionManager.java: Allow
component reconnection for about 1000h and then giveup
2007-01-26 08:44 kobit
* src/main/java/tigase/server/Permissions.java,
src/main/java/tigase/server/xmppsession/Permissions.java: Moved
to right location
2007-01-25 23:18 kobit
* build.properties, pom.xml, prj.el,
src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/io/TLSWrapper.java,
src/main/java/tigase/server/Command.java,
src/main/java/tigase/server/MessageRouter.java,
src/main/java/tigase/server/Packet.java,
src/main/java/tigase/server/XMPPService.java,
src/main/java/tigase/server/XMPPServiceCollector.java,
src/main/java/tigase/server/xmppclient/ClientConnectionManager.java,
src/main/java/tigase/server/xmppsession/Permissions.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/server/xmppsession/SessionManagerConfig.java,
src/main/java/tigase/stats/StatisticsCollector.java,
src/main/java/tigase/xmpp/XMPPImplIfc.java,
src/main/java/tigase/xmpp/XMPPProcessor.java,
src/main/java/tigase/xmpp/impl/JabberIqAuth.java,
src/main/java/tigase/xmpp/impl/JabberIqCommand.java,
src/main/java/tigase/xmpp/impl/JabberIqRegister.java,
src/main/java/tigase/xmpp/impl/JabberIqSi.java,
src/main/java/tigase/xmpp/impl/JabberIqStats.java,
src/main/java/tigase/xmpp/impl/JabberIqVersion.java,
src/main/java/tigase/xmpp/impl/OfflineMessages.java,
src/main/java/tigase/xmpp/impl/ServiceDiscovery.java,
src/main/java/tigase/xmpp/impl/StartTLS.java: ad-hoc commands,
service discovery, Yate integration first step
2007-01-25 21:05 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: incoming direct
availability presence now allowed even if remote entity is not in
roster - required for MUC
2007-01-25 14:56 kobit
* src/main/java/tigase/xmpp/impl/Presence.java: Sending direct
presence bug fixed now
2007-01-24 09:27 bmalkow
* .classpath, pom.xml: fix errors in maven configuration
2007-01-20 19:35 bmalkow
* pom.xml: add deploy information to maven config
2007-01-20 18:46 kobit
* src/main/java/tigase/io/TLSWrapper.java: Indentation corrected
2007-01-20 18:38 kobit
* src/main/java/tigase/io/TLSWrapper.java: Indentation corrected
2007-01-20 18:12 kobit
* build.properties, build.xml,
src/main/java/tigase/conf/Configurator.java,
src/main/java/tigase/io/TLSWrapper.java,
src/main/java/tigase/server/XMPPService.java,
src/main/java/tigase/server/XMPPServiceCollector.java,
src/main/java/tigase/server/xmppsession/SessionManager.java,
src/main/java/tigase/xmpp/impl/ServiceDiscovery.java: service
discovery-items and ad-hoc command for configuration in progress
2007-01-20 17:59 bmalkow
* ., .classpath, .project, .settings,
.settings/org.eclipse.jdt.core.prefs,
.settings/org.eclipse.jdt.ui.prefs, pom.xml, src/main,
src/main/java, src/main/java/tigase, src/test, src/test/java,
src/tigase: convert to maven2 nature
2007-01-19 17:37 kobit
* src/tigase/server/Command.java, src/tigase/server/Packet.java:
Modified command so now command id is in node attribute instead
of action
2007-01-19 10:28 kobit
* scripts/tigase.sh, src/tigase/conf/Configurable.java,
src/tigase/conf/Configurator.java,
src/tigase/net/ConnectionOpenThread.java,
src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/MessageRouterConfig.java,
src/tigase/server/XMPPServer.java,
src/tigase/server/XMPPService.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/server/xmppsession/SessionManagerConfig.java: Number
of changes, but the most important related do confifuration
generation
2007-01-17 00:55 kobit
* src/tigase/server/Command.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/Packet.java,
src/tigase/server/XMPPServiceCollector.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/stats/StatisticsCollector.java,
src/tigase/xmpp/StanzaType.java,
src/tigase/xmpp/impl/JabberIqStats.java,
src/tigase/xmpp/impl/ServiceDiscovery.java,
src/tigase/xmpp/impl/StartTLS.java: Switched to ad-hoc command
for communication between components and implemented USER_STATUS
command. Update from xmltools is requiredsvn status
2007-01-15 17:26 kobit
* src/tigase/server/xmppsession/SessionManager.java,
src/tigase/stats/StatRecord.java: Added repository information to
statuses
2007-01-15 17:10 kobit
* src/tigase/db/UserAuthRepository.java,
src/tigase/db/UserAuthRepositoryImpl.java,
src/tigase/db/UserRepository.java,
src/tigase/db/jdbc/DrupalAuth.java,
src/tigase/db/jdbc/JDBCRepository.java,
src/tigase/db/xml/XMLRepository.java: Added methods to retrieve
repository URI
2007-01-14 02:25 kobit
* src/tigase/server/xmppsession/SessionManager.java,
src/tigase/server/xmppsession/SessionManagerConfig.java,
src/tigase/stats/StatisticsCollector.java,
src/tigase/xmpp/impl/JabberIqStats.java: Changed stats
implementation to conform XEP-39
2007-01-13 22:12 kobit
* prj.el, src/tigase/net/ConnectionOpenThread.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppsession/SessionManagerConfig.java,
src/tigase/xmpp/impl/IBB.java,
src/tigase/xmpp/impl/JabberIqOOB.java,
src/tigase/xmpp/impl/JabberIqRoster.java,
src/tigase/xmpp/impl/JabberIqSi.java,
src/tigase/xmpp/impl/JabberIqSocks5Bytestreams.java,
src/tigase/xmpp/impl/JabberIqVersion.java,
src/tigase/xmpp/impl/Message.java,
src/tigase/xmpp/impl/SimpleForwarder.java: File transfer protocol
implemented
2007-01-12 17:16 kobit
* src/tigase/server/xmppsession/SessionManager.java,
src/tigase/xmpp/impl/JabberIqRoster.java: Fixed bug with
processing incorrect Roster stanza
2007-01-11 22:44 kobit
* src/tigase/server/ConnectionManager.java: Added more detailed
loggin info
2007-01-11 22:41 kobit
* scripts/tigase.sh, src/tigase/server/ConnectionManager.java:
Added more detailed loggin info
2007-01-09 06:16 kobit
* src/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Removed packing stanza into routed packet - not needed anymore??
2007-01-08 23:40 kobit
* database/postgresql-schema.sql: Postgresql DB schema
2007-01-07 23:08 kobit
* ant-definitions.xml, build.xml, manifest.temp: Build scripts
slightly changed to not force user to have svn tools installed
separately
2006-12-18 16:38 kobit
* scripts/config.sh, scripts/repo.sh,
src/tigase/db/UserAuthRepositoryImpl.java,
src/tigase/xmpp/XMPPDomBuilderHandler.java: Corrected support for
IDN domain names
2006-12-18 10:29 kobit
* src/tigase/db/jdbc/JDBCRepository.java: Set autocommit to true
for JDBC connection
2006-12-17 23:42 kobit
* src/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Component protocol (JEP-114) implemented - untested
2006-12-17 23:05 kobit
* src/tigase/server/XMPPServer.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/xmpp/impl/Privacy.java: Privacy lists management a few
bugs fixed
2006-12-17 15:31 kobit
* src/tigase/db/UserAuthRepositoryImpl.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Fixed nullpointer exception bug in authorizatin module
2006-12-17 15:21 kobit
* src/tigase/server/xmppserver/ServerConnectionManager.java: Fixed
problem with command processing - temporarly, no command are
processed by this component for now
2006-12-15 12:44 kobit
* src/tigase/auth/LoginHandler.java,
src/tigase/auth/ResourceConnectionCallback.java,
src/tigase/auth/SaslPLAIN.java,
src/tigase/auth/TigaseSaslProvider.java,
src/tigase/auth/TigaseSaslServerFactory.java,
src/tigase/db/AuthorizationException.java,
src/tigase/db/DBInitException.java,
src/tigase/db/NonAuthUserRepository.java,
src/tigase/db/RepositoryFactory.java,
src/tigase/db/TigaseDBException.java,
src/tigase/db/UserAuthRepository.java,
src/tigase/db/UserAuthRepositoryImpl.java,
src/tigase/db/jdbc/DrupalAuth.java,
src/tigase/db/jdbc/JDBCRepository.java,
src/tigase/io/BufferUnderflowException.java,
src/tigase/io/IOInterface.java,
src/tigase/io/SSLContextContainer.java,
src/tigase/io/SampleSocketThread.java,
src/tigase/io/SocketIO.java, src/tigase/io/TLSIO.java,
src/tigase/io/TLSStatus.java, src/tigase/io/TLSUtil.java,
src/tigase/io/TLSWrapper.java, src/tigase/io/TelnetClient.java,
src/tigase/io/TelnetServer.java, src/tigase/net/Accept.java,
src/tigase/net/ConnectionOpenListener.java,
src/tigase/net/ConnectionOpenThread.java,
src/tigase/net/ConnectionType.java,
src/tigase/net/IOServiceListener.java,
src/tigase/net/SocketReadThread.java,
src/tigase/net/SocketType.java,
src/tigase/server/AbstractComponentRegistrator.java,
src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/Command.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/MessageRouterConfig.java,
src/tigase/server/XMPPServer.java,
src/tigase/server/xmppsession/SessionManagerConfig.java,
src/tigase/stats/StatRecord.java,
src/tigase/stats/StatisticType.java,
src/tigase/util/ElementUtils.java,
src/tigase/util/LogFormatter.java,
src/tigase/util/RepositoryUtils.java,
src/tigase/util/RoutingsContainer.java,
src/tigase/xmpp/RepositoryAccess.java,
src/tigase/xmpp/StanzaType.java,
src/tigase/xmpp/XMPPIOService.java,
src/tigase/xmpp/XMPPIOServiceListener.java,
src/tigase/xmpp/XMPPImplIfc.java,
src/tigase/xmpp/XMPPPostprocessorIfc.java,
src/tigase/xmpp/XMPPPreprocessorIfc.java,
src/tigase/xmpp/XMPPProcessorIfc.java,
src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/XMPPSession.java,
src/tigase/xmpp/XMPPStopListenerIfc.java,
src/tigase/xmpp/impl/BindResource.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/JabberIqPrivacy.java,
src/tigase/xmpp/impl/JabberIqRegister.java,
src/tigase/xmpp/impl/JabberIqRoster.java,
src/tigase/xmpp/impl/JabberIqStats.java,
src/tigase/xmpp/impl/JabberIqVersion.java,
src/tigase/xmpp/impl/Message.java,
src/tigase/xmpp/impl/OfflineMessages.java,
src/tigase/xmpp/impl/Presence.java,
src/tigase/xmpp/impl/Privacy.java,
src/tigase/xmpp/impl/Roster.java,
src/tigase/xmpp/impl/SaslAuth.java,
src/tigase/xmpp/impl/ServiceDiscovery.java,
src/tigase/xmpp/impl/SessionBind.java,
src/tigase/xmpp/impl/StartTLS.java,
src/tigase/xmpp/impl/VCardTemp.java: e-mail address corrected
2006-12-15 12:38 kobit
* prj.el:
2006-12-15 12:18 kobit
* prj.el, src/tigase/db/UserAuthRepositoryImpl.java,
src/tigase/db/jdbc/DrupalAuth.java,
src/tigase/io/SSLContextContainer.java: Now uses own Tigase
implementation of Base64
2006-12-14 15:49 kobit
* src/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Some fixes in implementation, work not finished yet but it
compiles
2006-12-14 15:49 kobit
* src/tigase/auth/TigaseSaslServerFactory.java,
src/tigase/db/jdbc/JDBCRepository.java: Corrections related to
JDK-1.6 version change
2006-12-14 15:32 kobit
* build.properties: Version number change to 2.3.4
2006-12-14 15:32 kobit
* src/tigase/server/xmppcomponent/ComponentConnectionManager.java:
XEP-114 coponent protocol implementation in progress
2006-12-14 15:31 kobit
* src/tigase/xmpp/impl/JabberIqPrivacy.java,
src/tigase/xmpp/impl/Privacy.java: Active/default list is kept in
user session data to improve performance
2006-12-14 15:30 kobit
* src/tigase/db/jdbc/JDBCRepository.java: Increased cache size to
10k elements, cache.remove() has been improved so now
cache.clear() is replaced with cache.remove(user_id)
2006-12-13 23:29 kobit
* src/tigase/io/SSLContextContainer.java: Now adding all ICA
certificates for each domain keystore
2006-12-13 12:52 kobit
* certs/rsa-keystore: Dummy certificate
2006-12-13 12:50 kobit
* src/tigase/xmpp/impl/JabberIqPrivacy.java,
src/tigase/xmpp/impl/Privacy.java: Fixed a few minor bugs in
privacy lists management
2006-12-13 12:50 kobit
* src/tigase/io/SSLContextContainer.java: Fixed problem with loadin
certain types of certificates
2006-12-10 19:22 kobit
* src/tigase/server/xmppserver/ServerConnectionManager.java: vHosts
bug in s2s fixed now
2006-12-10 15:49 kobit
* build.properties,
src/tigase/server/xmppserver/ServerConnectionManager.java: vHosts
for s2s bug fixed
2006-12-05 19:17 kobit
* build.xml: Fixed build numbering problem
2006-12-05 19:17 kobit
* src/tigase/xmpp/impl/Presence.java: Fixed problem with sending
initial presence from all active resources
2006-12-04 23:52 kobit
* certs/rsa-keystore, src/tigase/io/SSLContextContainer.java,
src/tigase/io/TLSUtil.java, src/tigase/io/TelnetClient.java,
src/tigase/io/TelnetServer.java,
src/tigase/server/ConnectionManager.java: Default certificate now
implemented, SSL uses default and TLS uses default if certificate
for selected domain does not exist
2006-12-03 21:55 kobit
* certs/rsa-keystore, src/tigase/io/SSLContextContainer.java,
src/tigase/io/TLSUtil.java, src/tigase/io/TelnetClient.java,
src/tigase/io/TelnetServer.java, src/tigase/net/IOService.java,
src/tigase/server/xmppclient/ClientConnectionManager.java:
Implemented support for vHosts certificates
2006-11-29 23:31 kobit
* build.properties: Version change to 2.3.2
2006-11-29 23:31 kobit
* src/tigase/db/jdbc/JDBCRepository.java: Removed all
synchronization code from the implementation as the class is
intended to use in single thread
2006-11-29 15:45 kobit
* build.properties: Version change
2006-11-29 15:05 kobit
* src/tigase/server/AbstractMessageReceiver.java: Fixed dead lock
problem on multi-cpu machines - replaced single thread/queue with
2 queues and a thread for each
2006-11-29 15:04 kobit
* src/tigase/server/ConnectionManager.java: Changed loging level
for case when service for packet can not be found
2006-11-29 15:03 kobit
* src/tigase/server/xmppsession/SessionManager.java: Changed loging
level for case when session can not be found
2006-11-29 15:03 kobit
* src/tigase/server/xmppclient/ClientConnectionManager.java:
Removed commented import statement
2006-11-29 15:02 kobit
* src/tigase/db/jdbc/JDBCRepository.java: Added synchronization
code around checking connection code
2006-11-29 15:02 kobit
* src/tigase/conf/Configurator.java: Added some more test code to
change logging level after some timeout to diagnoze lockup
problem
2006-11-29 15:01 kobit
* src/tigase/xmpp/RepositoryAccess.java: Changed loggin level from
warning to finest for usernotfound exception
2006-11-27 21:39 kobit
* src/tigase/db/jdbc/JDBCRepository.java: Wrapped cache object in
synchronized Map
2006-11-27 14:38 kobit
* src/tigase/util/SimpleCache.java: Moved to tigase-util subproject
2006-11-26 23:42 kobit
* build.properties: Version change
2006-11-26 23:02 kobit
* ant-definitions.xml, build.xml: Modied build system to
automatically create MANIFEST file
2006-11-26 22:43 kobit
* MANIFEST.MF: Removed file which is automatically generated for
each JAR file
2006-11-26 22:43 kobit
* MANIFEST.MF: Version change
2006-11-26 22:42 kobit
* MANIFEST.MF, ant-definitions.xml, build.xml, package.html,
scripts/tigase.sh, src/tigase/db/jdbc/DrupalAuth.java: Added
timestamp for login and last access in Drupal database
2006-11-26 22:41 kobit
* src/tigase/db/jdbc/JDBCRepository.java,
src/tigase/util/SimpleCache.java: Added simple caching for JDBC
connector
2006-11-25 08:50 kobit
* MANIFEST.MF, ant-definitions.xml: Modified building function to
include new startup script
2006-11-20 00:16 kobit
* MANIFEST.MF, src/tigase/server/xmppsession/SessionManager.java:
Fixed a bug with improperly handling disconnection in case of
user unregistration
2006-11-18 19:30 kobit
* MANIFEST.MF, src/tigase/db/UserAuthRepository.java,
src/tigase/db/UserAuthRepositoryImpl.java,
src/tigase/db/jdbc/DrupalAuth.java,
src/tigase/db/jdbc/JDBCRepository.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/xmpp/RepositoryAccess.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/SaslAuth.java: Implemented fix for long
lasting and idle jdbc connection disconnection from server side
2006-11-18 16:57 kobit
* src/tigase/xmpp/impl/SaslAuth.java: Ticket #35:
http://server.tigase.org/ticket/35, removed printing tacktrace
into standatd output
2006-11-16 12:50 kobit
* MANIFEST.MF, src/tigase/conf/Configurator.java,
src/tigase/db/RepositoryFactory.java,
src/tigase/db/jdbc/DrupalAuth.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/Packet.java,
src/tigase/util/RepositoryUtils.java: Fixed many small bugs found
during migration to Drupal
2006-11-16 12:50 kobit
* src/tigase/auth/SaslPLAIN.java: fixed the problem with the case
when client doesn't send authorization ID
2006-11-14 22:32 kobit
* MANIFEST.MF, scripts/tigase.sh: Statrup script added
2006-11-13 23:02 kobit
* MANIFEST.MF, src/tigase/util/RepositoryUtils.java: Added more
options and repository tests
2006-11-13 23:02 kobit
* src/tigase/db/xml/XMLRepository.java: JavaDoc fix
2006-11-13 23:02 kobit
* src/tigase/db/RepositoryFactory.java: Fixed problem with multiple
repository initialization for the same resource
2006-11-13 21:01 kobit
* src/tigase/db/xml/XMLRepository.java: Fixed the problem with
repository initialization on fresh installation where XML user
repo does not exist
2006-11-12 19:25 kobit
* MANIFEST.MF, src/tigase/util/RepositoryUtils.java: Added support
for UserAuthRepository
2006-11-12 19:25 kobit
* src/tigase/db/jdbc/DrupalAuth.java: addUser() implementation
added and checking for user status in drupal database
2006-11-12 13:46 kobit
* MANIFEST.MF, src/tigase/auth/SaslPLAIN.java,
src/tigase/db/UserAuthRepository.java,
src/tigase/db/UserAuthRepositoryImpl.java,
src/tigase/db/jdbc/DrupalAuth.java,
src/tigase/db/jdbc/JDBCRepository.java,
src/tigase/db/xml/XMLRepository.java,
src/tigase/io/SSLContextContainer.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/xmpp/RepositoryAccess.java,
src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/SaslAuth.java: Authorization framework is
finished and polished, drupal authentication is implemented and
workssvn add src/tigase/db/UserAuthRepositoryImpl.java
src/tigase/db/jdbc/DrupalAuth.java
2006-11-11 20:28 kobit
* MANIFEST.MF, certs/rsa-keystore, scripts/repo.sh,
src/tigase/auth/SaslPLAIN.java,
src/tigase/auth/TigaseSaslProvider.java,
src/tigase/auth/TigaseSaslServerFactory.java,
src/tigase/db/AuthorizationException.java,
src/tigase/db/UserAuthRepository.java,
src/tigase/db/jdbc/JDBCRepository.java,
src/tigase/db/xml/XMLRepository.java,
src/tigase/xmpp/RepositoryAccess.java,
src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/SaslAuth.java: Authorization framework
rewriten again, it works but not well tested
2006-11-06 23:58 kobit
* MANIFEST.MF, src/tigase/auth/CommitHandler.java,
src/tigase/auth/DigestAuth.java,
src/tigase/auth/LoginHandler.java,
src/tigase/auth/PlainAuth.java,
src/tigase/auth/SaslCallbackHandler.java,
src/tigase/auth/SaslPLAIN.java,
src/tigase/auth/SessionCallback.java,
src/tigase/auth/TigaseConfiguration.java,
src/tigase/auth/TigaseSasl.java,
src/tigase/auth/TigaseSaslProvider.java,
src/tigase/auth/TigaseSaslServerFactory.java,
src/tigase/db/RepositoryFactory.java,
src/tigase/db/UserAuthRepository.java,
src/tigase/db/xml/XMLRepository.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/server/xmppsession/SessionManagerConfig.java,
src/tigase/util/RepositoryUtils.java,
src/tigase/xmpp/RepositoryAccess.java,
src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/SaslAuth.java: Authorization framework
rewritten and PLAIN SASL implemented
2006-11-06 22:18 kobit
* src/tigase/auth/TigaseSasl.java: Small experiments with auth
framework
2006-11-02 19:54 kobit
* MANIFEST.MF,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/xmpp/XMPPIOService.java: Fixed the problem with 'to'
attribute in stream open element, ticket:
http://server.tigase.org/ticket/4
2006-10-30 22:38 kobit
* MANIFEST.MF, src/tigase/util/RepositoryUtils.java: Modified to
allow print repository content only for one given user account
2006-10-30 21:27 kobit
* scripts, scripts/config.sh, scripts/repo.sh: Command line tools
for repository and configuration maniulation
2006-10-30 21:21 kobit
* MANIFEST.MF, database/mysql-schema.sql,
database/simple-sqldb.sql,
src/tigase/xmpp/impl/JabberIqRoster.java,
src/tigase/xmpp/impl/Presence.java,
src/tigase/xmpp/impl/Roster.java: Filename change to reflect
database
2006-10-30 15:13 kobit
* MANIFEST.MF, src/tigase/conf/Configurator.java: Full off-line
configuration management implemented
2006-10-29 10:57 kobit
* src/tigase/db/NonAuthUserRepository.java,
src/tigase/server/ConnectionManager.java,
src/tigase/xmpp/RepositoryAccess.java,
src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/impl/OfflineMessages.java,
src/tigase/xmpp/impl/VCardTemp.java: Javadoc warning fixed -
javadoc is still not complete yet.
2006-10-29 00:16 kobit
* MANIFEST.MF, src/tigase/xmpp/impl/Presence.java: Fixed a bug with
extra probe sent for each presence: ticket -
http://server.tigase.org/ticket/31
2006-10-29 00:08 kobit
* MANIFEST.MF, src/tigase/conf/ConfigRepository.java,
src/tigase/conf/Configurator.java,
src/tigase/db/jdbc/JDBCRepository.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/server/xmppsession/SessionManagerConfig.java,
src/tigase/util/RepositoryUtils.java: Simple configuration and
repository management
2006-10-28 16:15 kobit
* src/tigase/util/RepositoryUtils.java: JDBC module is ready and
tested
2006-10-28 15:26 kobit
* MANIFEST.MF, src/tigase/db/jdbc/JDBCRepository.java,
src/tigase/util/RepositoryUtils.java: JDBC module is ready and
tested
2006-10-28 09:32 kobit
* MANIFEST.MF, src/tigase/db/jdbc/JDBCRepository.java: Jdbc
repository implementation is finished now but untested
2006-10-27 16:10 kobit
* MANIFEST.MF, database/simple-sqldb.sql,
src/tigase/auth/PlainAuth.java,
src/tigase/auth/SaslCallbackHandler.java,
src/tigase/db/DBInitException.java,
src/tigase/db/DataOverwriteException.java,
src/tigase/db/RepositoryFactory.java,
src/tigase/db/TigaseDBException.java,
src/tigase/db/UserExistsException.java,
src/tigase/db/UserNotFoundException.java,
src/tigase/db/UserRepository.java, src/tigase/db/jdbc,
src/tigase/db/jdbc/JDBCRepository.java,
src/tigase/db/xml/XMLRepository.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/xmpp/RepositoryAccess.java: JDBC database backend
implementation
2006-10-26 08:44 kobit
* MANIFEST.MF, database/simple-sqldb.sql,
src/tigase/db/UserRepository.java,
src/tigase/db/xml/XMLRepository.java,
src/tigase/xmpp/RepositoryAccess.java,
src/tigase/xmpp/XMPPResourceConnection.java: Added getUsers()
method - should be used only for conversion process from one
database to another....
2006-10-26 08:05 kobit
* database, database/simple-sqldb.sql: Database schema for SQL
databases
2006-10-24 22:31 kobit
* MANIFEST.MF, src/tigase/db/RepositoryFactory.java,
src/tigase/db/UserRepository.java,
src/tigase/db/xml/XMLRepository.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java: Separation
user repository from auth repository (ticket:
http://server.tigase.org/ticket/9 )and cleaned up repository
initialization api
2006-10-24 22:30 kobit
* src/tigase/server/xmppsession/SessionManagerConfig.java:
Separated config constants from main class to make code cleaner
2006-10-24 14:48 kobit
* src/tigase/xmpp/RepositoryAccess.java: Implementation of offline
and public data finished
2006-10-24 14:35 kobit
* MANIFEST.MF, src/tigase/xmpp/impl/VCardTemp.java: Added support
for retrieving vCard info for off-line users.
2006-10-24 14:27 kobit
* MANIFEST.MF, src/tigase/db/DataOverwriteException.java,
src/tigase/db/NonAuthUserRepository.java,
src/tigase/db/UserRepository.java,
src/tigase/db/WriteOnlyUserRepository.java,
src/tigase/db/xml/XMLRepository.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/xmpp/XMPPPostprocessorIfc.java,
src/tigase/xmpp/XMPPPreprocessorIfc.java,
src/tigase/xmpp/XMPPProcessorIfc.java,
src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/XMPPStopListenerIfc.java,
src/tigase/xmpp/impl/BindResource.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/JabberIqPrivacy.java,
src/tigase/xmpp/impl/JabberIqRegister.java,
src/tigase/xmpp/impl/JabberIqRoster.java,
src/tigase/xmpp/impl/JabberIqStats.java,
src/tigase/xmpp/impl/JabberIqVersion.java,
src/tigase/xmpp/impl/Message.java,
src/tigase/xmpp/impl/OfflineMessages.java,
src/tigase/xmpp/impl/Presence.java,
src/tigase/xmpp/impl/SaslAuth.java,
src/tigase/xmpp/impl/ServiceDiscovery.java,
src/tigase/xmpp/impl/SessionBind.java,
src/tigase/xmpp/impl/StartTLS.java,
src/tigase/xmpp/impl/VCardTemp.java: Implementation of offline
and public data finished
2006-10-20 08:48 kobit
* MANIFEST.MF, src/tigase/server/xmppsession/SessionManager.java:
Serious bug fixed with infinite error message loop
2006-10-20 01:13 kobit
* src/tigase/xmpp/impl/JabberIqVersion.java: Commented out double
attribute set
2006-10-20 01:12 kobit
* src/tigase/server/Packet.java: Added from and to attributes in
'result' packet
2006-10-20 01:12 kobit
* src/tigase/server/xmppsession/SessionManager.java: Fixed nasty
bug with infinite loop sending error packets
2006-10-20 01:11 kobit
* src/tigase/xmpp/impl/VCardTemp.java: Added vCard implementation
2006-10-19 22:11 kobit
* MANIFEST.MF, src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/impl/JabberIqRoster.java: Fixed problem with
removing user from the last group.
2006-10-19 22:10 kobit
* src/tigase/xmpp/impl/JabberIqVersion.java: Corrected version
retrieving between user clients.
2006-10-18 21:14 kobit
* MANIFEST.MF, src/tigase/server/Packet.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/xmpp/impl/BindResource.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/JabberIqPrivacy.java,
src/tigase/xmpp/impl/JabberIqRegister.java,
src/tigase/xmpp/impl/JabberIqRoster.java,
src/tigase/xmpp/impl/JabberIqStats.java,
src/tigase/xmpp/impl/JabberIqVersion.java,
src/tigase/xmpp/impl/Message.java,
src/tigase/xmpp/impl/OfflineMessages.java,
src/tigase/xmpp/impl/Presence.java,
src/tigase/xmpp/impl/SaslAuth.java,
src/tigase/xmpp/impl/ServiceDiscovery.java,
src/tigase/xmpp/impl/SessionBind.java,
src/tigase/xmpp/impl/StartTLS.java: Privacy lists full
implementation finished
2006-10-16 15:58 kobit
* MANIFEST.MF, src/tigase/server/xmppsession/SessionManager.java,
src/tigase/xmpp/XMPPStopListenerIfc.java,
src/tigase/xmpp/impl/OfflineMessages.java,
src/tigase/xmpp/impl/Presence.java: Stop listener implementation
corrected
2006-10-16 15:13 kobit
* src/tigase/db/WriteOnlyUserRepository.java: This is a workaround
to allow plugins to write to repository even if there is no
authorized session. It is needed for off-line message storage
plugin
2006-10-16 15:12 kobit
* src/tigase/xmpp/OfflineMessageStorage.java: Reimplemented as
plugin not needed anymore
2006-10-16 15:11 kobit
* MANIFEST.MF, certs/rsa-keystore,
src/tigase/db/UserRepository.java, src/tigase/server/Packet.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/xmpp/ProcessorFactory.java,
src/tigase/xmpp/XMPPImplIfc.java,
src/tigase/xmpp/XMPPPostprocessorIfc.java,
src/tigase/xmpp/XMPPPreprocessorIfc.java,
src/tigase/xmpp/XMPPProcessor.java,
src/tigase/xmpp/XMPPProcessorIfc.java,
src/tigase/xmpp/XMPPStopListenerIfc.java,
src/tigase/xmpp/impl/BindResource.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/JabberIqPrivacy.java,
src/tigase/xmpp/impl/JabberIqRegister.java,
src/tigase/xmpp/impl/JabberIqRoster.java,
src/tigase/xmpp/impl/JabberIqStats.java,
src/tigase/xmpp/impl/JabberIqVersion.java,
src/tigase/xmpp/impl/Message.java,
src/tigase/xmpp/impl/OfflineMessages.java,
src/tigase/xmpp/impl/Presence.java,
src/tigase/xmpp/impl/SaslAuth.java,
src/tigase/xmpp/impl/ServiceDiscovery.java,
src/tigase/xmpp/impl/SessionBind.java,
src/tigase/xmpp/impl/StartTLS.java: Major refactoring to add
preprocessing/postprocessing, stopped handlers, offline messages
are now implemented as a plugin
2006-10-10 21:45 kobit
* MANIFEST.MF, src/tigase/xmpp/impl/JabberIqPrivacy.java,
src/tigase/xmpp/impl/Privacy.java: Initial Privacy lists
implementation. You can manage privacy lists now but server
doesn't use them yet
2006-10-10 21:44 kobit
* src/tigase/xmpp/impl/JabberIqRoster.java,
src/tigase/xmpp/impl/SessionBind.java: Because of overloading
okResult() method from Package class minor adjustemts in code
were necessary
2006-10-10 21:43 kobit
* src/tigase/xmpp/XMPPResourceConnection.java: Changed log levels
from SEVERE to WARNING and added new method: getDataKeys()
2006-10-10 21:42 kobit
* src/tigase/db/xml/XMLRepository.java: Added better support for
concurrent access to repository. Now each thread can initialize
and access repository indepedently even for the same resource
(data file)
2006-10-10 21:41 kobit
* src/tigase/db/UserRepository.java: Added but commented out
method: getInstance(resource) as there is still no consistent
idea how it should work
2006-10-10 21:40 kobit
* src/tigase/server/Packet.java: Added 2 more methods:
okResult(Element, int) and getElemChildren()
2006-10-10 21:38 kobit
* src/tigase/server/xmppsession/SessionManager.java: Added privacy
component loading in default configuration and changed
initialization of XMLRepository to allow accessing repository
from different threads
2006-10-10 21:37 kobit
* src/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Changes related to reconnecting connections
2006-10-10 21:36 kobit
* src/tigase/server/ConnectionManager.java: All connections are
initialized with delay at startup time now to allow configuration
fully load first, especially initialization of SSL can take a bit
longer. Now all 'connect' type connections are not reconnecting
by default, you have to set counter for them to allow
reconnecting
2006-10-10 21:34 kobit
* src/tigase/io/TLSWrapper.java: Corrected logger package ID
2006-10-09 16:02 kobit
* package.html: Basic server documentation
2006-10-09 16:02 kobit
* MANIFEST.MF, src/tigase/io/SSLContextContainer.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/MessageRouter.java: Changed
ClientConnectionManager component addressing
2006-10-09 16:02 kobit
* src/tigase/server/xmppclient/ClientConnectionManager.java:
Changed ClientConnectionManager component addressing
2006-10-05 17:18 kobit
* MANIFEST.MF, src/tigase/server/ConnectionManager.java,
src/tigase/server/MessageRouterConfig.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java: Component
addressing for ClientConnectionManager has been changed to make
it more consistent and make all hostnames setting mean the same
2006-10-04 16:37 kobit
* libs: Added directory required by build file
2006-10-04 16:35 kobit
* MANIFEST.MF, ant-definitions.xml, build.xml: Corrected build file
2006-10-04 16:35 kobit
* src/tigase/xmpp/impl/ServiceDiscovery.java: Fixed null pointer
exception
2006-10-03 11:20 kobit
* MANIFEST.MF, src/tigase/server/Packet.java,
src/tigase/xmpp/impl/Presence.java,
src/tigase/xmpp/impl/SaslAuth.java: Fixed broken presence
2006-10-02 21:43 kobit
* src/tigase/xmpp/StanzaType.java: Added new - non-standard stanza
type used by kopete
2006-10-02 21:42 kobit
* src/tigase/xmpp/impl/Presence.java: Fixed problem with updating
presence for multiple user connections
2006-09-30 16:48 kobit
* MANIFEST.MF, src/tigase/xmpp/impl/JabberIqVersion.java: Null
pointer exception fixed
2006-09-30 16:37 kobit
* MANIFEST.MF, src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/xmpp/OfflineMessageStorage.java: Message to admin
implemented
2006-09-28 22:45 kobit
* MANIFEST.MF, ant-definitions.xml,
src/tigase/server/XMPPServer.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/xmpp/impl/ServiceDiscovery.java: Fixed service
discovery and statistics reports
2006-09-28 22:45 kobit
* src/tigase/net/IOService.java: Commented out printing stack trace
on text console
2006-09-28 22:44 kobit
* src/tigase/xmpp/impl/SaslAuth.java: Corrected SASL implementation
for RFC compliance
2006-09-28 22:44 kobit
* src/tigase/xmpp/impl/Presence.java: Fixed null pointer exception
when probe was called for buddy not in roster
2006-09-26 06:24 kobit
* MANIFEST.MF, src/tigase/io/SocketIO.java: Fixed incorrect logger
id
2006-09-26 06:23 kobit
* src/tigase/xmpp/OfflineMessageStorage.java: Added time stamp and
off-line message delivery element
2006-09-26 06:23 kobit
* src/tigase/xmpp/impl/Presence.java: Fixed missing 'from'
attribute when user send message to himself and implemented
off-line message delivery on receiving presence packet
2006-09-26 06:22 kobit
* src/tigase/xmpp/impl/Message.java: Fixed missing 'from' attribute
when user send message to himself
2006-09-25 18:54 kobit
* MANIFEST.MF, src/tigase/server/xmppsession/SessionManager.java,
src/tigase/xmpp/impl/Presence.java,
src/tigase/xmpp/impl/SaslAuth.java: Off-line messages for XMPP
1.0 fixed. Now all off-line messages are delivered after
receiving initial presence message.
2006-09-24 23:04 kobit
* MANIFEST.MF, build.properties, build.xml,
src/tigase/io/BufferUnderflowException.java,
src/tigase/io/IOInterface.java, src/tigase/io/SocketIO.java,
src/tigase/io/TLSIO.java, src/tigase/io/TLSWrapper.java,
src/tigase/net/IOService.java: Fixed problem with disconnecting
SSL connection on receiving large packets of data. See ticket: #6
- http://server.tigase.org/ticket/6
2006-09-24 23:02 kobit
* src/tigase/xmpp/XMPPDomBuilderHandler.java: Added error message
for error() method, now it easier to find out what caused the
error.
2006-09-19 14:00 kobit
* MANIFEST.MF, src/tigase/server/xmppsession/SessionManager.java:
Fixed problem with Processors not loaded for specified ID, it
used to trow NullPointerException
2006-09-19 09:11 kobit
* MANIFEST.MF,
src/tigase/server/xmppserver/ServerConnectionManager.java:
Another correction for the code disconnecting second channel if
one of dialback connection has been closed
2006-09-18 23:12 kobit
* MANIFEST.MF, ant-definitions.xml, build.xml: Corrected build
process for generating distribution files
2006-09-18 23:12 kobit
* src/tigase/conf/Configurator.java: Changed tigase log name from
java.log to tigase.log
2006-09-18 23:10 kobit
* src/tigase/server/xmppserver/ServerConnectionManager.java: Some
servers disconnect one connection from s2s pair and don't accept
any data on the other connection, as a result communication is
broken. This fix closes other connection if one of them has been
closed by remote server
2006-09-18 13:09 kobit
* src/tigase/server/ConnectionManager.java: Changed default
configuration to use rsa-keystore
2006-09-18 13:00 kobit
* certs/rsa-keystore: Keystore with RSA, default contain DSA wich
is not liked by gaim
2006-09-18 12:33 kobit
* build.properties: version numer change after bug fixes
2006-09-18 12:10 kobit
* MANIFEST.MF, ant-definitions.xml,
src/tigase/server/xmppsession/SessionManager.java: Fixed problem
with gajim connection - now server sends back error for all
unsupported stanze received from the client, previously gajim
seemed to hang waiting for response on unsupported IQ stanzas
2006-09-18 12:09 kobit
* src/tigase/server/ComponentRegistrator.java: Fixed broken javadoc
comment
2006-09-18 12:09 kobit
* src/tigase/conf/Configurator.java: Changed default configuration,
handler for file logger is now setup correctly
2006-09-18 12:08 kobit
* src/tigase/auth/SaslCallbackHandler.java: Fixed broken javadoc
comment
2006-09-17 18:48 kobit
* MANIFEST.MF: This is version 2.2.0
2006-09-17 18:48 kobit
* build.properties: Version number change
2006-09-17 18:47 kobit
* src/tigase/server/xmppserver/ServerConnectionManager.java: Fixed
problem with remote server diconnect and impossible to establish
connection with that server later
2006-09-17 18:47 kobit
* src/tigase/xmpp/OfflineMessageStorage.java: Small correction to
preven storring for off-line delivery stanzas other than
2006-09-16 21:57 kobit
* MANIFEST.MF, src/tigase/db/UserRepository.java,
src/tigase/db/xml/XMLRepository.java,
src/tigase/net/IOService.java, src/tigase/server/Command.java,
src/tigase/server/Packet.java,
src/tigase/server/XMPPServiceCollector.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/util/ElementUtils.java,
src/tigase/xmpp/OfflineMessageStorage.java,
src/tigase/xmpp/XMPPIOService.java,
src/tigase/xmpp/XMPPProcessor.java,
src/tigase/xmpp/XMPPProcessorIfc.java,
src/tigase/xmpp/impl/BindResource.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/JabberIqRegister.java,
src/tigase/xmpp/impl/SaslAuth.java,
src/tigase/xmpp/impl/SessionBind.java,
src/tigase/xmpp/impl/StartTLS.java: Offline messages storage
added and fixed various bugs
2006-09-14 12:17 kobit
* MANIFEST.MF, src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/XMPPSession.java,
src/tigase/xmpp/impl/JabberIqAuth.java: Fixed problem with
setting resources, later after authorization
2006-09-14 07:21 kobit
* MANIFEST.MF,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/xmpp/XMPPSession.java,
src/tigase/xmpp/impl/JabberIqAuth.java: Fixed problem with
reconnecting resource - the old session for the same resource was
not removed correctly
2006-09-14 04:54 kobit
* MANIFEST.MF,
src/tigase/server/xmppserver/ServerConnectionManager.java:
Session id and dialback key is kept under different entries in
shared session data
2006-09-13 16:48 kobit
* MANIFEST.MF, src/tigase/server/ConnectionManager.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/xmpp/XMPPProcessor.java,
src/tigase/xmpp/XMPPSession.java: Corrected, simplified and
improved but not tested s2s - completely rewrited actually,
should handle google case easy
2006-09-13 16:48 kobit
* src/tigase/auth/DialbackAuth.java: Not used anymore....
2006-09-13 16:47 kobit
* src/tigase/xmpp/impl/Dialback.java: Not used anymore....
2006-09-13 16:47 kobit
* src/tigase/xmpp/impl/Dialback.java: Not used anymore....
2006-09-11 19:35 kobit
* MANIFEST.MF, src/tigase/server/MessageRouterConfig.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java: Switched to
use SRV DNS record for xmpp servcice
2006-09-11 19:35 kobit
* src/tigase/net/IOService.java: Removed unused import statement
2006-09-11 19:34 kobit
* src/tigase/xmpp/impl/Presence.java: Fixed problem with sending
presence notification just after subscription has been approved
2006-09-11 19:33 kobit
* src/tigase/xmpp/impl/Roster.java: Added more logging code
2006-09-11 15:11 kobit
* src/tigase/net/DNSResolver.java: Moved to tigase.util project
2006-09-11 15:11 kobit
* src/tigase/net/DNSResolver.java: Changed function parameter to
'final'
2006-09-11 15:04 kobit
* src/tigase/net/AllAddresses.java,
src/tigase/net/DNSResolver.java: Renamed to more appropropriate
name
2006-09-11 15:03 kobit
* src/tigase/net/AllAddresses.java: Generic function implemented
for retrieving IP address for xmpp SRV DNS record
2006-09-11 13:02 kobit
* src/tigase/net/ConnectionOpenThread.java: Server used to die on
SocketException, that was wrong, fixed now....
2006-09-11 13:01 kobit
* src/tigase/server/xmppsession/SessionManager.java: Corrected
default configuration generated during first startup
2006-09-11 13:01 kobit
* src/tigase/net/AllAddresses.java: Sample class showing how to
retrieve DNS records like SRV
2006-09-10 22:33 kobit
* MANIFEST.MF, src/tigase/auth/DialbackAuth.java,
src/tigase/auth/SessionCallback.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/xmpp/impl/Dialback.java, tests/data/tigase-config.xml:
s2s implementation finishedsvn status Finally.
2006-09-10 22:31 kobit
* src/tigase/server/ConnectionManager.java: Due to asynchronouse
nature I had to exchange 2 lines. Now serviceStarted(serv) is
called before readThread.addSocketService(serv)
2006-09-10 22:30 kobit
* src/tigase/server/MessageRouter.java: It may happen only due to a
bug in server code that packet.getTo() == null for packet
processing by this class. So just in case added checking at the
beginning of the processPacket method. Also replaced InetAddress
class call with new JID.getNodeHostIP method
2006-09-10 22:28 kobit
* src/tigase/server/Packet.java: Added getElemCData() method
2006-09-10 22:27 kobit
* src/tigase/xmpp/XMPPIOService.java: Added assert debug(data) code
2006-09-10 22:27 kobit
* src/tigase/xmpp/impl/Presence.java: According to RFC server
should not resend 'out_(un)subscribed' notice but it make it very
difficuly to synchronize presence subscrition in case of earlier
problems. So for now my implemention will resend such notice
2006-09-10 22:24 kobit
* src/tigase/xmpp/XMPPDomBuilderHandler.java: Support for
xmlns:elname added
2006-09-08 19:33 kobit
* MANIFEST.MF, src/tigase/auth/DialbackAuth.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/xmpp/impl/Dialback.java, tests/data/tigase-config.xml:
s2s implementation continued...., connecting to remote server
now....
2006-09-08 19:32 kobit
* src/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Changed code to make use of new method in IOService -
connectionType()
2006-09-08 19:31 kobit
* src/tigase/server/xmppsession/SessionManager.java: A few more
logging messages added
2006-09-08 19:30 kobit
* src/tigase/net/ConnectionOpenThread.java: A few more logging
messages added
2006-09-08 19:30 kobit
* src/tigase/xmpp/XMPPIOService.java: New method added -
xmppStreamOpen()
2006-09-08 19:29 kobit
* src/tigase/net/IOService.java: Fixed a bug in writeData method
for NULL data
2006-09-04 19:37 kobit
* src/tigase/server/xmppclient/ClientConnectionManager.java: Fixed
bug when constructing stream_opened command some data were added
as pure string rather than DOM XML structure.
2006-08-31 06:04 kobit
* MANIFEST.MF, src/tigase/auth/DialbackAuth.java,
src/tigase/auth/DigestAuth.java, src/tigase/auth/semantic.cache,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/xmpp/XMPPSession.java,
src/tigase/xmpp/impl/Dialback.java, tests/data/tigase-config.xml:
s2s implementation in progress
2006-08-31 06:03 kobit
* src/tigase/auth/TigaseConfiguration.java,
src/tigase/server/xmppsession/SessionManager.java: Changed
TigaseConfiguration to statis class
2006-08-31 06:01 kobit
* src/tigase/io/TelnetClient.java, src/tigase/io/TelnetServer.java:
Added support for sending files to test large portion of data
2006-08-22 14:47 kobit
* src/tigase/server/xmppserver/ServerConnectionManager.java:
Constant name change from SESSION_ID to SESSION_ID_KEY and
getUniqueId method corrected
2006-08-22 14:46 kobit
* src/tigase/server/ConnectionManager.java: TODO comments addded
for serviceStarted method
2006-08-22 14:45 kobit
* src/tigase/server/xmppcomponent/ComponentConnectionManager.java:
Constant name change from serv.SESSION_ID to serv.SESSION_ID_KEY
2006-08-22 14:45 kobit
* src/tigase/server/xmppclient/ClientConnectionManager.java:
Constant name change from serv.SESSION_ID to serv.SESSION_ID_KEY
2006-08-22 14:44 kobit
* src/tigase/net/IOService.java: Added ConnectionType and
remote/local address retrieving for connection service
2006-08-22 14:43 kobit
* src/tigase/conf/Configurator.java: Changed depreciated code
accessing Logger.global
2006-08-22 14:43 kobit
* src/tigase/xmpp/XMPPResourceConnection.java: Added java doc for
connectionId variable
2006-08-18 09:57 kobit
* MANIFEST.MF, prj.el, src/tigase/server/Packet.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/xmpp/StanzaType.java,
src/tigase/xmpp/impl/Dialback.java: s2s implementation and
Dialback implementation
2006-08-07 19:44 kobit
* MANIFEST.MF, src/tigase/io/TelnetClient.java: It uses trust-all
mode si it doesn't get disconnected when server sends unknown
certificate
2006-08-07 19:42 kobit
* MANIFEST.MF, src/tigase/io/SSLContextContainer.java,
src/tigase/io/TLSUtil.java, src/tigase/io/TLSWrapper.java: Added
support for trust-all SSLContext
2006-08-07 19:02 kobit
* MANIFEST.MF, src/tigase/io/TelnetClient.java,
src/tigase/io/TelnetServer.java: SSL connection is working now
and debug options turns debuging on
2006-08-07 18:25 kobit
* MANIFEST.MF, src/tigase/annotations/TODO.java,
src/tigase/auth/AuthorisationSystem.java,
src/tigase/auth/CommitHandler.java,
src/tigase/auth/DigestAuth.java, src/tigase/auth/PlainAuth.java,
src/tigase/auth/ResourceConnectionCallback.java,
src/tigase/auth/SaslCallbackHandler.java,
src/tigase/auth/TigaseConfiguration.java,
src/tigase/auth/TigaseSasl.java,
src/tigase/conf/ConfigComponent.java,
src/tigase/conf/ConfigRepository.java,
src/tigase/conf/Configurable.java,
src/tigase/conf/Configurator.java,
src/tigase/db/ConfigurationDB.java,
src/tigase/db/MessageHistoryDB.java,
src/tigase/db/MessageOfflineDB.java, src/tigase/db/UserDB.java,
src/tigase/db/UserExistsException.java,
src/tigase/db/UserNotFoundException.java,
src/tigase/db/UserRepository.java,
src/tigase/db/xml/XMLRepository.java,
src/tigase/http/HttpServer.java,
src/tigase/http/HttpService.java, src/tigase/io/IOInterface.java,
src/tigase/io/SSLContextContainer.java,
src/tigase/io/SocketIO.java, src/tigase/io/TLSIO.java,
src/tigase/io/TLSStatus.java, src/tigase/io/TLSUtil.java,
src/tigase/io/TLSWrapper.java, src/tigase/net/Accept.java,
src/tigase/net/ConnectionOpenListener.java,
src/tigase/net/ConnectionOpenThread.java,
src/tigase/net/ConnectionType.java,
src/tigase/net/IOService.java,
src/tigase/net/IOServiceListener.java,
src/tigase/net/ServiceCommand.java,
src/tigase/net/SocketReadThread.java,
src/tigase/net/SocketType.java,
src/tigase/server/AbstractComponentRegistrator.java,
src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/Command.java,
src/tigase/server/ComponentRegistrator.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/MessageReceiver.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/MessageRouterConfig.java,
src/tigase/server/Packet.java,
src/tigase/server/ServerComponent.java,
src/tigase/server/ThreadExceptionHandler.java,
src/tigase/server/XMPPServer.java,
src/tigase/server/XMPPService.java,
src/tigase/server/XMPPServiceCollector.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/stats/StatRecord.java,
src/tigase/stats/StatisticType.java,
src/tigase/stats/StatisticsCollector.java,
src/tigase/stats/StatisticsContainer.java,
src/tigase/stats/StatsComponent.java,
src/tigase/ui/UIComponent.java, src/tigase/ui/WebUI.java,
src/tigase/ui/XMPPServiceComponent.java,
src/tigase/util/ElementUtils.java,
src/tigase/util/LogFormatter.java,
src/tigase/util/RoutingsContainer.java,
src/tigase/xmpp/Authorization.java,
src/tigase/xmpp/NotAuthorizedException.java,
src/tigase/xmpp/ProcessorFactory.java,
src/tigase/xmpp/StanzaType.java,
src/tigase/xmpp/XMPPDomBuilderHandler.java,
src/tigase/xmpp/XMPPException.java,
src/tigase/xmpp/XMPPIOService.java,
src/tigase/xmpp/XMPPIOServiceListener.java,
src/tigase/xmpp/XMPPProcessor.java,
src/tigase/xmpp/XMPPProcessorIfc.java,
src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/XMPPSession.java,
src/tigase/xmpp/impl/BindResource.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/JabberIqRegister.java,
src/tigase/xmpp/impl/JabberIqRoster.java,
src/tigase/xmpp/impl/JabberIqStats.java,
src/tigase/xmpp/impl/JabberIqVersion.java,
src/tigase/xmpp/impl/Message.java,
src/tigase/xmpp/impl/Presence.java,
src/tigase/xmpp/impl/Roster.java,
src/tigase/xmpp/impl/SaslAuth.java,
src/tigase/xmpp/impl/ServiceDiscovery.java,
src/tigase/xmpp/impl/SessionBind.java,
src/tigase/xmpp/impl/StartTLS.java: e-mail address changed to
correct one in tigase.org domain
2006-08-07 18:24 kobit
* src/tigase/io/TelnetClient.java, src/tigase/io/TelnetServer.java:
Added SSL support, not working yet though
2006-08-07 14:48 kobit
* src/tigase/io/SampleSocketThread.java: Corrected error message,
when socket gets disconnected
2006-08-07 14:40 kobit
* MANIFEST.MF, src/tigase/io/SampleSocketThread.java,
src/tigase/io/TelnetClient.java, src/tigase/io/TelnetServer.java:
Sample classes for plain connection using tigase.io API
2006-08-07 14:40 kobit
* src/tigase/io/SocketIO.java: SocketIO now initializes
SocketChannel properly on its own, ie. set non-blocking mode and
so on
2006-08-07 14:19 kobit
* MANIFEST.MF, src/tigase/io/TelnetServer.java: TelnetServer works
now for plain socket connection, test it with telnet linux
program
2006-08-07 10:35 kobit
* MANIFEST.MF, src/tigase/io/SampleSocketThread.java,
src/tigase/io/SimpleReaderThread.java,
src/tigase/io/TelnetServer.java: Smaple classes implementation in
progress
2006-08-06 22:59 kobit
* src/tigase/io/SimpleReaderThread.java,
src/tigase/io/TelnetClient.java, src/tigase/io/TelnetServer.java:
Sample classes presenting tigase.io use
2006-08-06 22:57 kobit
* MANIFEST.MF, prj.el, src/tigase/io/TLSIO.java,
src/tigase/io/TLSWrapper.java, src/tigase/net/IOService.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/xmppclient/ClientConnectionManager.java: Added
support for client connection
2006-04-21 14:34 kobit
* src/tigase/xmpp/impl/JabberIqAuth.java: Unblocked digest
authorization
2006-04-21 13:54 kobit
* MANIFEST.MF, src/tigase/xmpp/XMPPIOService.java: Fixes to
multithreaded tests
2006-04-21 07:20 kobit
* MANIFEST.MF, src/tigase/server/xmppsession/SessionManager.java,
tests/data/tigase-config.xml: Fixed a few minor configuration
bugs
2006-04-21 07:15 kobit
* MANIFEST.MF, src/tigase/auth/AuthorisationSystem.java,
src/tigase/db/ConfigurationDB.java,
src/tigase/db/MessageHistoryDB.java,
src/tigase/db/MessageOfflineDB.java, src/tigase/db/UserDB.java,
src/tigase/http/HttpServer.java, src/tigase/server/Command.java,
src/tigase/server/XMPPService.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/ui/UIComponent.java,
src/tigase/util/RoutingsContainer.java,
src/tigase/xmpp/XMPPIOService.java,
src/tigase/xmpp/XMPPSession.java,
src/tigase/xmpp/impl/StartTLS.java,
tests/data/tigase-config-1.xml, tests/data/tigase-config.xml:
Corrected thread synchronization issues
2006-04-20 13:41 kobit
* MANIFEST.MF, src/tigase/auth/CommitHandler.java,
src/tigase/auth/PlainAuth.java,
src/tigase/auth/SaslCallbackHandler.java,
src/tigase/auth/semantic.cache,
src/tigase/net/SocketReadThread.java,
src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/stats/StatRecord.java,
src/tigase/stats/StatisticType.java,
src/tigase/xmpp/XMPPIOService.java,
src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/XMPPSession.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/Message.java,
src/tigase/xmpp/impl/Presence.java,
tests/data/tigase-config-2.xml: Fixed a few concurency issues
2006-04-10 20:23 kobit
* MANIFEST.MF, src/tigase/net/ConnectionOpenThread.java,
src/tigase/net/SocketReadThread.java,
tests/data/tigase-config-1.xml, tests/data/tigase-config-2.xml:
New XML-tools version support corrected, TestRoster now expects
XML data with " instead of '
2006-04-10 17:46 kobit
* MANIFEST.MF: Compiler warnings fixed
2006-04-10 16:47 kobit
* src/tigase/util/ClassComparator.java: Separation util code from
the rest of components
2006-04-10 16:46 kobit
* src/tigase/util/ObjectComparator.java: Separation util code from
the rest of components
2006-04-10 16:44 kobit
* MANIFEST.MF, src/tigase/util/ClassUtil.java: Separation util code
from the rest of components
2006-04-10 16:38 kobit
* src/tigase/util/Algorithms.java, src/tigase/util/JID.java,
src/tigase/util/Telnet.java: Separation util code from the rest
of components
2006-04-06 07:18 kobit
* MANIFEST.MF, build.properties, src/tigase/io/TLSIO.java,
src/tigase/net/IOService.java,
src/tigase/net/SocketReadThread.java,
src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/Packet.java, src/tigase/server/XMPPServer.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/xmpp/XMPPIOService.java,
src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/JabberIqStats.java,
src/tigase/xmpp/impl/JabberIqVersion.java,
src/tigase/xmpp/impl/Presence.java,
src/tigase/xmpp/impl/StartTLS.java,
tests/data/tigase-config-1.xml, tests/data/tigase-config-2.xml:
Fixes for bugs: TLS start, multithreaded I/0, uncautch exception
in main threads
2006-03-29 06:32 kobit
* MANIFEST.MF, src/tigase/conf/Configurator.java,
src/tigase/server/AbstractComponentRegistrator.java,
src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/Command.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/Packet.java,
src/tigase/server/ServerComponent.java,
src/tigase/server/XMPPService.java,
src/tigase/server/XMPPServiceCollector.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/stats/StatRecord.java,
src/tigase/stats/StatisticsCollector.java,
src/tigase/util/ElementUtils.java,
src/tigase/xmpp/impl/BindResource.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/JabberIqRegister.java,
src/tigase/xmpp/impl/JabberIqRoster.java,
src/tigase/xmpp/impl/JabberIqStats.java,
src/tigase/xmpp/impl/JabberIqVersion.java,
src/tigase/xmpp/impl/ServiceDiscovery.java,
src/tigase/xmpp/impl/StartTLS.java,
tests/data/tigase-config-2.xml: All basic implementations
comleted
2006-03-21 07:18 kobit
* MANIFEST.MF, src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/Command.java, src/tigase/server/Packet.java,
src/tigase/server/XMPPServer.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/xmpp/IqType.java, src/tigase/xmpp/StanzaType.java,
src/tigase/xmpp/XMPPIOService.java,
src/tigase/xmpp/XMPPProcessor.java,
src/tigase/xmpp/XMPPProcessorIfc.java,
src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/XMPPSession.java,
src/tigase/xmpp/impl/BindResource.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/JabberIqRegister.java,
src/tigase/xmpp/impl/JabberIqRoster.java,
src/tigase/xmpp/impl/JabberIqVersion.java,
src/tigase/xmpp/impl/Message.java,
src/tigase/xmpp/impl/Presence.java,
src/tigase/xmpp/impl/Roster.java,
src/tigase/xmpp/impl/SaslAuth.java,
src/tigase/xmpp/impl/SessionBind.java,
tests/data/tigase-config-1.xml, tests/data/tigase-config-2.xml:
Implemented presence, roster, message, version
2006-02-20 22:59 kobit
* MANIFEST.MF, src/tigase/auth/DigestAuth.java,
src/tigase/auth/PlainAuth.java, src/tigase/auth/semantic.cache,
src/tigase/server/Packet.java,
src/tigase/xmpp/Authorization.java, src/tigase/xmpp/IqType.java,
src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/impl/BindResource.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/JabberIqRegister.java,
src/tigase/xmpp/impl/SaslAuth.java,
src/tigase/xmpp/impl/SessionBind.java,
tests/data/tigase-config-2.xml: Added session bind and bind
resource implementation
2006-02-20 21:05 kobit
* src/tigase/xmpp/impl/SaslAuth.java,
src/tigase/xmpp/impl/XmppSasl.java: SASL authorization
implememted
2006-02-20 21:03 kobit
* src/tigase/xmpp/impl/XMPPSasl.java,
src/tigase/xmpp/impl/XmppSasl.java: SASL authorization
implememted
2006-02-20 21:01 kobit
* src/tigase/xmpp/impl/SaslAuth.java,
src/tigase/xmpp/impl/XMPPSasl.java: SASL authorization
implememted
2006-02-20 21:01 kobit
* MANIFEST.MF, src/tigase/auth/SaslCallbackHandler.java,
src/tigase/auth/semantic.cache,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/xmpp/IqType.java,
src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/SaslAuth.java,
tests/data/tigase-config-2.xml: SASL authorization implememted
2006-02-20 16:42 kobit
* tests/data/telnet-test.xml, tests/data/tigase-config-1.xml,
tests/data/tigase-config-2.xml, tests/data/tigase-config.xml:
Framework for authorization and some authorization implementation
is ready
2006-02-20 16:41 kobit
* src/tigase/xmpp/Authorization.java, src/tigase/xmpp/IqType.java,
src/tigase/xmpp/NotAuthorizedException.java,
src/tigase/xmpp/ProcessorFactory.java,
src/tigase/xmpp/XMPPException.java,
src/tigase/xmpp/XMPPIOServiceListener.java,
src/tigase/xmpp/XMPPProcessor.java,
src/tigase/xmpp/XMPPProcessorIfc.java,
src/tigase/xmpp/XMPPResourceConnection.java,
src/tigase/xmpp/XMPPSession.java: Framework for authorization and
some authorization implementation is ready
2006-02-20 16:41 kobit
* src/tigase/auth/CommitHandler.java,
src/tigase/auth/DigestAuth.java, src/tigase/auth/PlainAuth.java,
src/tigase/auth/ResourceConnectionCallback.java,
src/tigase/auth/SaslCallbackHandler.java,
src/tigase/auth/TigaseConfiguration.java,
src/tigase/auth/TigaseSasl.java, src/tigase/auth/semantic.cache,
src/tigase/db/UserExistsException.java,
src/tigase/db/UserNotFoundException.java,
src/tigase/db/UserRepository.java, src/tigase/db/xml,
src/tigase/db/xml/XMLRepository.java,
src/tigase/server/Command.java, src/tigase/util/Algorithms.java,
src/tigase/util/ClassComparator.java,
src/tigase/util/ClassUtil.java,
src/tigase/util/ObjectComparator.java,
src/tigase/util/RoutingsContainer.java, src/tigase/xmpp/impl,
src/tigase/xmpp/impl/JabberIqAuth.java,
src/tigase/xmpp/impl/JabberIqRegister.java,
src/tigase/xmpp/impl/SaslAuth.java: Framework for authorization
and some authorization implementation is ready
2006-02-20 16:39 kobit
* MANIFEST.MF, src/tigase/net/IOService.java,
src/tigase/net/Reply.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/Packet.java,
src/tigase/server/XMPPIOService.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/util/Telnet.java, src/tigase/xmpp,
src/tigase/xmpp/XMPPDomBuilderHandler.java,
src/tigase/xmpp/XMPPIOService.java: Framework for authorization
and some authorization implementation is ready
2006-02-07 07:45 kobit
* MANIFEST.MF, src/tigase/net/IOService.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/XMPPIOService.java: Better separation network
layer from protocol layer
2006-02-06 22:21 kobit
* MANIFEST.MF, prj.el, src/tigase/io,
src/tigase/io/IOInterface.java,
src/tigase/io/SSLContextContainer.java,
src/tigase/io/SocketIO.java, src/tigase/io/TLSIO.java,
src/tigase/io/TLSStatus.java, src/tigase/io/TLSUtil.java,
src/tigase/io/TLSWrapper.java, src/tigase/net,
src/tigase/net/Accept.java,
src/tigase/net/ConnectionOpenListener.java,
src/tigase/net/ConnectionOpenThread.java,
src/tigase/net/ConnectionType.java,
src/tigase/net/IOService.java,
src/tigase/net/IOServiceListener.java, src/tigase/net/Reply.java,
src/tigase/net/ServiceCommand.java,
src/tigase/net/SocketReadThread.java,
src/tigase/net/SocketType.java,
src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/MessageReceiver.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/MessageRouterConfig.java,
src/tigase/server/Packet.java,
src/tigase/server/ThreadExceptionHandler.java,
src/tigase/server/XMPPServer.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/util/JID.java, src/tigase/util/Telnet.java: Routing
between instances implemented
2006-01-23 00:04 kobit
* MANIFEST.MF, src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/ConnectionManager.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/xmppclient/ClientConnectionManager.java:
abstract ConnectionManager introduced
2006-01-15 23:48 kobit
* MANIFEST.MF, src/tigase/conf/ConfigRepository.java,
src/tigase/server/AbstractComponentRegistrator.java,
src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/MessageReceiver.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/MessageRouterConfig.java,
src/tigase/server/ServerComponent.java,
src/tigase/server/XMPPServer.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java: Server basic
startup
2006-01-05 23:59 kobit
* src/tigase/util, src/tigase/util/LogFormatter.java: Improved
configuration management
2006-01-05 23:58 kobit
* MANIFEST.MF, src/tigase/conf/ConfigRepository.java,
src/tigase/conf/Configurator.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/XMPPServer.java, tests/data/test_config.xml:
Improved configuration management
2006-01-04 00:21 kobit
* MANIFEST.MF, build.xml, src/tigase/conf/ConfigRepository.java,
src/tigase/conf/Configurable.java,
src/tigase/conf/Configurator.java,
src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/XMPPServer.java: Configuration basics
implemented
2006-01-02 22:52 kobit
* MANIFEST.MF, src/tigase/conf/ConfigRepository.java,
src/tigase/conf/Configurator.java, tests/data/test_config.xml:
XMLDB and config repository fixes
2005-12-29 07:42 kobit
* MANIFEST.MF, build.xml, src/tigase/conf/ConfigRepository.java,
src/tigase/conf/Configurator.java,
src/tigase/server/AbstractComponentRegistrator.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/XMPPServer.java,
src/tigase/server/XMPPServiceCollector.java,
src/tigase/stats/StatisticsCollector.java, tests/data,
tests/data/test_config.xml: Added types to XMLDB and support for
them in Configurator
2005-11-28 23:30 kobit
* MANIFEST.MF, src/tigase/conf/Configurable.java,
src/tigase/conf/Configurator.java,
src/tigase/server/AbstractComponentRegistrator.java,
src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/ComponentRegistrator.java,
src/tigase/server/MessageReceiver.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/XMPPServer.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java: MessageRouter
implementation started
2005-11-25 23:23 kobit
* MANIFEST.MF, src/tigase/conf/Configurable.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java: Configurable
interface corrected
2005-11-25 23:19 kobit
* MANIFEST.MF, src/tigase/annotations,
src/tigase/annotations/TODO.java,
src/tigase/conf/Configurable.java,
src/tigase/conf/Configurator.java,
src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/MessageReceiver.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/XMPPServer.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/stats/StatRecord.java,
src/tigase/stats/StatisticType.java,
src/tigase/stats/StatisticsContainer.java:
AbstractMessageReceiver initial implementation
2005-11-22 23:19 kobit
* MANIFEST.MF, ant-definitions.xml, build.xml, jar,
src/tigase/conf/ConfigComponent.java,
src/tigase/conf/Configurable.java,
src/tigase/conf/Configurator.java,
src/tigase/http/HttpService.java,
src/tigase/http/HttpServiceIfc.java,
src/tigase/server/AbstractComponentRegistrator.java,
src/tigase/server/AbstractMessageReceiver.java,
src/tigase/server/ComponentRegistrator.java,
src/tigase/server/ComponentRegistratorIfc.java,
src/tigase/server/MessageReceiver.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/Packet.java,
src/tigase/server/ServerComponent.java,
src/tigase/server/ServerComponentIfc.java,
src/tigase/server/XMPPService.java,
src/tigase/server/XMPPServiceCollector.java,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/stats/StatisticsCollector.java,
src/tigase/stats/StatisticsContainer.java,
src/tigase/stats/StatisticsContainerIfc.java,
src/tigase/stats/StatsComponent.java, src/tigase/ui/WebUI.java,
src/tigase/ui/XMPPServiceComponent.java: Initial, compilable
sources
2005-11-21 07:33 kobit
* ., ant-definitions.xml, build.properties, build.xml, certs,
certs/client_truststore, certs/dummy.cer, certs/keystore,
certs/truststore, jar, package-list, package-list/package-list,
prj.el, src, src/tigase, src/tigase/auth,
src/tigase/auth/AuthorisationSystem.java, src/tigase/conf,
src/tigase/conf/ConfigComponent.java,
src/tigase/conf/Configurable.java,
src/tigase/conf/Configurator.java, src/tigase/db,
src/tigase/db/ConfigurationDB.java,
src/tigase/db/MessageHistoryDB.java,
src/tigase/db/MessageOfflineDB.java, src/tigase/db/UserDB.java,
src/tigase/http, src/tigase/http/HttpServer.java,
src/tigase/http/HttpServiceIfc.java, src/tigase/server,
src/tigase/server/ComponentRegistratorIfc.java,
src/tigase/server/MessageReceiver.java,
src/tigase/server/MessageRouter.java,
src/tigase/server/Packet.java,
src/tigase/server/ServerComponentIfc.java,
src/tigase/server/XMPPService.java,
src/tigase/server/XMPPServiceCollector.java,
src/tigase/server/xmppclient,
src/tigase/server/xmppclient/ClientConnectionManager.java,
src/tigase/server/xmppcomponent,
src/tigase/server/xmppcomponent/ComponentConnectionManager.java,
src/tigase/server/xmppserver,
src/tigase/server/xmppserver/ServerConnectionManager.java,
src/tigase/server/xmppsession,
src/tigase/server/xmppsession/SessionManager.java,
src/tigase/stats, src/tigase/stats/StatisticsCollector.java,
src/tigase/stats/StatisticsContainerIfc.java,
src/tigase/stats/StatsComponent.java, src/tigase/ui,
src/tigase/ui/UIComponent.java, src/tigase/ui/WebUI.java,
src/tigase/ui/XMPPServiceComponent.java, tests, tests/unittests,
tests/unittests/src: Initial version of Tigase project.
================================================
FILE: scripts/debian/compat
================================================
5
================================================
FILE: scripts/debian/control
================================================
Source: tigase
Section: net
Priority: optional
Maintainer: Sergey Nazarov
Build-Depends: debhelper (>= 5), cdbs, patchutils, sun-java6-jdk, ant
Standards-Version: 3.7.2
Package: tigase
Section: net
Priority: optional
Pre-Depends: sun-java6-jre
Architecture: all
Description: A high performance XMPP (Jabber) server.
Tigase is an instant messaging server that implements the XMPP
(Jabber) protocol. It features high performance, a robust
administration console, and a full plugin system. The server
is 100% Java.
.
See http://www.tigase.org/
Homepage: http://www.tigase.org/
================================================
FILE: scripts/debian/copyright
================================================
This package was debianized by Sergey Nazarov
on January 9, 2009.
The source was downloaded from http://www.tigase.org.
Upstream author: Artur Hefczyc
Copyright (C) 2004-2012 "Artur Hefczyc"
You are free to distribute this software under the terms of
the GNU Affero General Public License. On Debian systems, the complete
text of the GNU Affero General Public License can be found in the file
'/usr/share/common-licenses/GPL'.
================================================
FILE: scripts/debian/init-debian.properties
================================================
config-type = --gen-config-def
--admins = admin@$HOST_NAME
--virt-hosts = $HOST_NAME
--debug=server
--user-db-uri = jdbc:derby:/var/lib/tigase/tigase-derbydb
basic-conf/logging/java.util.logging.FileHandler.pattern = /var/log/tigase/tigase.log
vhost-man/vhost-repo-uri = jdbc:derby:/var/lib/tigase/tigase-derbydb
================================================
FILE: scripts/debian/rules
================================================
#!/usr/bin/make -f
#export DH_VERBOSE=1
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/ant.mk
DEST := $(CURDIR)/debian/tigase
TARGET := $(CURDIR)
TIGJARS := $(CURDIR)/jars
TIGASE := $(DEST)/usr/share/tigase
ETCDIR := $(DEST)/etc/tigase
LOGDIR := $(DEST)/var/log/tigase
VARDIR := $(DEST)/var/lib/tigase
JAVA_HOME := /usr/lib/jvm/java-6-openjdk
ANT_HOME := /usr/share/ant
DEB_ANT_BUILDFILE := build.xml
DEB_ANT_CLEAN_TARGET := clean
DEB_JARS := ant-nodeps
install/tigase::
cp $(TIGJARS)/*.jar $(TIGASE)/jars
cp $(TARGET)/libs/*.jar $(TIGASE)/libs
cp -r $(TARGET)/certs $(TIGASE)/certs
cp $(TARGET)/etc/init-debian.properties $(ETCDIR)/init.properties
================================================
FILE: scripts/debian/tigase-debian.conf
================================================
ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8"
DRV="-Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver:org.apache.derby.jdbc.EmbeddedDriver"
#GC="-XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:ParallelCMSThreads=2"
JAVA_HOME="/usr/lib/jvm/java-6-sun"
CLASSPATH=""
JAVA_OPTIONS="${GC} ${ENC} ${DRV} -server -Xms100M -Xmx200M -XX:PermSize=32m -XX:MaxPermSize=256m -XX:MaxDirectMemorySize=128m "
TIGASE_CONFIG="/etc/tigase/tigase-server.xml"
TIGASE_OPTIONS=""
================================================
FILE: scripts/debian/tigase-install.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
CURDIR=`pwd`
TARGET=/usr/share/tigase
ETCDIR=/etc/tigase
LOGDIR=/var/log/tigase
VARDIR=/var/lib/tigase
if ! getent passwd tigase >/dev/null; then
adduser --disabled-password --quiet --system \
--home $VARDIR \
--gecos "Tigase XMPP server" --group tigase
fi
if ! getent group tigase >/dev/null; then
adduser --system tigase
fi
mkdir -p $TARGET
mkdir -p $ETCDIR
mkdir -p $LOGDIR
mkdir -p $VARDIR/tigase-derbydb
mkdir -p $TARGET/jars/
mkdir -p $TARGET/libs/
cp -f $CURDIR/jars/*.jar $TARGET/jars/
cp -f $CURDIR/libs/*.jar $TARGET/libs/
cp -fr $CURDIR/certs/ $TARGET/
cp -fr $CURDIR/database/ $TARGET/
cp -fr $CURDIR/scripts/ $TARGET/
chown -R tigase:tigase $TARGET
chmod -R o-rwx $TARGET
cp -f $CURDIR/scripts/debian/init-debian.properties $ETCDIR/init.properties
cp -f $CURDIR/scripts/debian/tigase-debian.conf /etc/default/tigase
cp -f $CURDIR/scripts/debian/tigase.init.d /etc/init.d/tigase
chown -R tigase:tigase $ETCDIR
chown -R tigase:tigase $LOGDIR
chown -R tigase:tigase $VARDIR
#chmod -R o-rwx $ETCDIR
#chmod -R o-rwx $LOGDIR
#chmod -R o-rwx $VARDIR
chmod 755 /etc/init.d/tigase
update-rc.d tigase defaults
================================================
FILE: scripts/debian/tigase.default
================================================
# Defaults for tigase initscript
# sourced by /etc/init.d/tigase
# installed at /etc/default/tigase by the maintainer scripts
#
# This is a POSIX shell fragment
#
# Additional options that are passed to the Daemon.
TIGASE_OPTIONS="--property-file /etc/tigase/init.properties"
================================================
FILE: scripts/debian/tigase.dirs
================================================
/etc/tigase
/usr/share/tigase/libs
/usr/share/tigase/jars
/var/log/tigase
/var/lib/tigase/embedded-db
================================================
FILE: scripts/debian/tigase.init.d
================================================
#!/bin/bash
### BEGIN INIT INFO
# Provides: tigase
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the Tigase XMPP server
#
### management instructions
##
## to install: update-rc.d tigase defaults
##
## on machines with NFS mounted it's essential to
## * NOT use 'noauto' option
## * add '$remote_fs' to Required-Start and Required-Stop
##
### END INIT INFO
# Enable Tigase as OSGi bundle
# OSGI=true
# Settings paths and other variables
# JAVA_HOME=
USERNAME=tigase
USERGROUP=tigase
NAME=tigase
DESC="Tigase XMPP server"
TIGASE_HOME=/usr/share/tigase
TIGASE_CONFIG=/etc/tigase/tigase-server.xml
TIGASE_OPTIONS=
TIGASE_PARAMS=
PIDFILE=
TIGASE_CONSOLE_LOG=
USER=$USERNAME
eval HOME="~$USER"
# Attempt to locate JAVA_HOME, code borrowed from jabref package
if [ -z $JAVA_HOME ]
then
for java_dir in /usr/lib/jvm/java-6-* ; do
test -d ${java_dir} && JAVA_HOME=${java_dir}
done
fi
# Include tigase defaults if available
if [ -z "${TIGASE_PARAMS}" ] ; then
if [ -r "/etc/default/tigase" ] ; then
TIGASE_PARAMS="/etc/default/tigase"
elif [ -r "/etc/tigase/tigase.conf" ] ; then
TIGASE_PARAMS="/etc/tigase/tigase.conf"
elif [ -r "${TIGASE_HOME}/etc/tigase.conf" ] ; then
TIGASE_PARAMS="${TIGASE_HOME}/etc/tigase.conf"
fi
fi
[[ -f "${TIGASE_PARAMS}" ]] && . ${TIGASE_PARAMS}
if [ -z "${JAVA_HOME}" ] ; then
echo "JAVA_HOME is not set."
echo "Please set it to correct value before starting the sever."
exit 1
fi
PATH=/sbin:/bin:/usr/sbin:/usr/bin:${JAVA_HOME}/bin
# Find tigase-server jar
if [ -n "${OSGI}" ] && ${OSGI} ; then
LIB_DIR=jars
JAR_FILE=${LIB_DIR}/org.apache.felix.main*.jar
else
LIB_DIR=jars
JAR_FILE=${LIB_DIR}/tigase-server*.jar
fi
for j in ${TIGASE_HOME}/${JAR_FILE} ; do
if [ -f ${j} ] ; then
TIGASE_JAR=${j}
break
fi
done
if [ -z "${TIGASE_CONSOLE_LOG}" ] ; then
if [ -w "/var/log/${USERNAME}/" ] ; then
TIGASE_CONSOLE_LOG="/var/log/${USERNAME}/tigase-console.log"
elif [ -w "${TIGASE_HOME}/logs/" ] ; then
TIGASE_CONSOLE_LOG="${TIGASE_HOME}/logs/tigase-console.log"
else
TIGASE_CONSOLE_LOG="/dev/null"
fi
fi
if [ -z "${PIDFILE}" ] ; then
if [ ! -d "/var/run/$NAME/" ] ; then
mkdir "/var/run/$NAME/"
chown -R "$USERNAME":"$USERGROUP" "/var/run/$NAME/"
fi
if [ -w "/var/run/$NAME/" ] ; then
PIDFILE="/var/run/$NAME/$NAME.pid"
elif [ -w "${TIGASE_HOME}/logs/" ] ; then
PIDFILE="${TIGASE_HOME}/logs/$NAME.pid"
else
PIDFILE="/var/tmp/$NAME.pid"
fi
fi
[[ -z "${TIGASE_RUN}" ]] && \
TIGASE_RUN="tigase.server.XMPPServer -c ${TIGASE_CONFIG} ${TIGASE_OPTIONS}"
[[ -z "${JAVA}" ]] && JAVA="${JAVA_HOME}/bin/java"
[[ -z "${CLASSPATH}" ]] || CLASSPATH="${CLASSPATH}:"
CLASSPATH="${CLASSPATH}${TIGASE_JAR}"
for lib in ${TIGASE_HOME}/${LIB_DIR}/*.jar ; do
CLASSPATH="${CLASSPATH}:$lib"
done
LOGBACK="-Dlogback.configurationFile=$TIGASE_HOME/etc/logback.xml"
if [ -n "${OSGI}" ] && ${OSGI} ; then
TIGASE_CMD="${JAVA_OPTIONS} ${LOGBACK} -Dfelix.config.properties=file:$TIGASE_HOME/etc/config.properties -jar ${JAR_FILE}"
else
TIGASE_CMD="${JAVA_OPTIONS} ${LOGBACK} -cp ${CLASSPATH} ${TIGASE_RUN}"
fi
if [ -d "${TIGASE_HOME}" ] ; then
cd ${TIGASE_HOME}
else
echo "${TIGASE_HOME} is not set to correct value"
echo "Please set it to correct value before starting the sever."
exit 1
fi
set -e
. /lib/lsb/init-functions
#Helper functions
start() {
if [ -f $PIDFILE ] && kill -0 `cat $PIDFILE` 2>/dev/null
then
echo "Tigase is already running!"
return 1
fi
su ${USERNAME} -c "/sbin/start-stop-daemon --start --quiet --make-pidfile --chdir ${TIGASE_HOME} --pidfile $PIDFILE --chuid $USERNAME:$USERGROUP --exec $JAVA -- $TIGASE_CMD >>${TIGASE_CONSOLE_LOG} 2>&1 &"
sleep 3
PID=`cat $PIDFILE`
if [[ -z "`ps -p ${PID} -o cmd=`" ]]; then
rm -f "$PIDFILE"
return 1
else
return 0
fi
}
stop() {
su ${USERNAME} -c "/sbin/start-stop-daemon --stop --quiet --chdir ${TIGASE_HOME} --pidfile $PIDFILE --chuid $USERNAME:$USERGROUP --exec $JAVA > /dev/null"
rm -f "$PIDFILE"
}
case "$1" in
start)
log_daemon_msg "Starting $DESC"
if start; then
log_end_msg 0
else
log_end_msg 1
fi
;;
stop)
log_daemon_msg "Stopping $DESC"
if stop; then
log_end_msg 0
else
log_end_msg 1
fi
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC"
stop
sleep 5
if start; then
log_end_msg 0
else
log_end_msg 1
fi
;;
clearrestart)
$0 stop $2
sleep 5
$0 clear $2
sleep 2
$0 start $2
;;
clear)
LOGBACK="${TIGASE_HOME}/logs"`date "+%Y-%m-%d--%H:%M:%S"`
log_daemon_msg "Clearing logs $DESC, moving backup to " ${LOGBACK}
mkdir -p ${LOGBACK}
mv "${TIGASE_HOME}/logs"/* ${LOGBACK}/
log_end_msg 0
if [ -n "${OSGI}" ] && ${OSGI} ; then
log_daemon_msg "Clearing osgi cache $DESC"
rm -rf "${TIGASE_HOME}/felix-cache"/*;
log_end_msg 0
fi
log_end_msg 0
;;
check|status)
echo "Checking arguments to Tigase: "
echo
echo "USERNAME = $USERNAME"
echo "USERGROUP = $USERGROUP"
echo "USER = $USER"
echo "HOME = $HOME"
echo
echo "OSGI = $OSGI"
echo
echo "TIGASE_HOME = $TIGASE_HOME"
echo "TIGASE_JAR = $TIGASE_JAR"
echo "TIGASE_CMD = $TIGASE_CMD"
echo "TIGASE_CONFIG = $TIGASE_CONFIG"
echo "TIGASE_PARAMS = $TIGASE_PARAMS"
echo "TIGASE_OPTIONS = $TIGASE_OPTIONS"
echo "TIGASE_CONSOLE_LOG = $TIGASE_CONSOLE_LOG"
echo "PIDFILE = $PIDFILE"
echo "JAVA_HOME = $JAVA_HOME"
echo "JAVA = $JAVA"
echo "JAVA_OPTIONS = $JAVA_OPTIONS"
echo "CLASSPATH = $CLASSPATH"
if [ -f $PIDFILE ] && kill -0 `cat $PIDFILE` 2>/dev/null
then
echo "Tigase running pid="`cat $PIDFILE`
exit 0
fi
exit 1
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|clearrestart|clear|force-reload|check|status}" >&2
exit 1
;;
esac
exit 0
================================================
FILE: scripts/debian/tigase.postinst
================================================
#! /bin/sh
set -e
# summary of how this script can be called:
# * `configure'
# * `abort-upgrade'
# * `abort-remove' `in-favour'
#
# * `abort-deconfigure' `in-favour'
# `removing'
#
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
#
# quoting from the policy:
# Any necessary prompting should almost always be confined to the
# post-installation script, and should be protected with a conditional
# so that unnecessary prompting doesn't happen if a package's
# installation fails and the `postinst' is called with `abort-upgrade',
# `abort-remove' or `abort-deconfigure'.
case "$1" in
configure)
if ! getent passwd tigase >/dev/null; then
adduser --disabled-password --quiet --system \
--home /var/lib/tigase \
--gecos "Tigase XMPP server" --group tigase
fi
if ! getent group tigase >/dev/null; then
adduser --system tigase
fi
mkdir -p /var/log/tigase
mkdir -p /var/lib/tigase/tigase-derbydb
chown -R tigase:tigase /usr/share/tigase
chown -R tigase:tigase /var/lib/tigase
chown -R tigase:tigase /var/log/tigase
chown -R tigase:tigase /etc/tigase
chmod -R o-rwx /usr/share/tigase
chmod -R o-rwx /var/lib/tigase
chmod -R o-rwx /var/log/tigase
chmod -R o-rwx /etc/tigase
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
================================================
FILE: scripts/debian/tigase.postrm
================================================
#!/bin/sh
# postrm script for tigase
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * `remove'
# * `purge'
# * `upgrade'
# * `failed-upgrade'
# * `abort-install'
# * `abort-install'
# * `abort-upgrade'
# * `disappear' overwrit>r>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
purge)
rm -Rf /etc/tigase
rm -Rf /var/log/tigase
rm -Rf /var/lib/tigase
rm -Rf /usr/share/tigase
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
================================================
FILE: scripts/gentoo/conf.d/tigase
================================================
TIGASE_HOME="/home/tigase/tigase-server"
TIGASE_USER=tigase
TIGASE_CONF="etc/tigase.conf"
================================================
FILE: scripts/gentoo/init.d/tigase
================================================
#!/sbin/runscript
depend() {
need net
use dns logger postgresql mysql
}
start() {
ebegin "Starting Tigase"
su - ${TIGASE_USER} -c "${TIGASE_ENV} ${TIGASE_HOME}/bin/tigase.sh start ${TIGASE_HOME}/${TIGASE_CONF}"
eend $?
}
stop () {
ebegin "Stopping Tigase"
su - ${TIGASE_USER} -c "${TIGASE_ENV} ${TIGASE_HOME}/bin/tigase.sh stop ${TIGASE_HOME}/${TIGASE_CONF}"
sleep 2
eend $?
}
svc_restart () {
ebegin "Restarting Tigase"
su - ${TIGASE_USER} -c "${TIGASE_ENV} ${TIGASE_HOME}/bin/tigase.sh stop ${TIGASE_HOME}/${TIGASE_CONF}"
sleep 10
su - ${TIGASE_USER} -c "${TIGASE_ENV} ${TIGASE_HOME}/bin/tigase.sh start ${TIGASE_HOME}/${TIGASE_CONF}"
eend $?
}
================================================
FILE: scripts/machine-check.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
function usage() {
echo "The script has to be run with following parameters:"
echo "$0 hostname username [vhost]"
echo "--------------------"
echo " hostname - is the machine hostname which might be also used as the cluster node name"
echo " username - is a user account from which the Tigase server will be run"
echo " vhost - is a virtual hostname used for the service if different than the hostname"
}
function check_dns() {
if host $1 | grep "not found" > /dev/null ; then
echo "WARNING - the $1 does NOT resolve to a valid IP address"
else
if host $1 | grep "127.0.0.1" > /dev/null ; then
echo "WARNING - DNS points to the localhost for the domain: $1"
else
echo "OK, DNS settings for $1"
fi
fi
if host -t SRV _xmpp-server._tcp.$1 | grep SRV > /dev/null ; then
echo "OK, SRV record found _xmpp-server._tcp.$1"
else
echo "WARNING - no SRV record _xmpp-server._tcp.$1"
fi
if host -t SRV _xmpp-client._tcp.$1 | grep SRV > /dev/null ; then
echo "OK, SRV record found _xmpp-client._tcp.$1"
else
echo "WARNING - no SRV record _xmpp-client._tcp.$1"
fi
}
function check_net() {
if ping -q -c 2 -W 100 $1 &> /dev/null ; then
echo "OK, The $1 host accessible through the network"
else
echo "WARNING - the $1 host seems to be unaccessible through the network!"
fi
}
if [ "$1" = "" ] || [ "$2" = "" ] ; then
echo "Missing hostname or username as a parameter, please run the script with correct parameters"
usage
exit
fi
HST=$1
USR=$2
VHST=$3
if [ "$VHST" = "" ] ; then
VHST=$HST
fi
# Checking network configuration
check_dns $HST
check_dns $VHST
check_net $HST
check_net $VHST
# Checking system configuration
if echo $OSTYPE | grep -i linux > /dev/null ; then
if [ "$USR" = "root" ] ; then
echo "WARNING - you should not run the Tigase server from the root account."
fi
if [ "$UID" == "0" ] ; then
# Checking ulimits
RES=`su -c - $USR "ulimit -n"`
if echo $RES | grep -i "user $USR does not exist" > /dev/null ; then
echo "WARNING - the $USR user given does not exist, run 'adduser -m $USR' to create the account"
else
if [ $RES -lt 300000 ] ; then
echo "WARNING - maximum open files for the $USR user is too low: $RES"
echo " To fix this, add following lines to file: /etc/security/limits.conf"
echo "$USR soft nofile 500000"
echo "$USR hard nofile 500000"
echo "-------"
echo "Add these lines? (yes/no)"
read ans
if [ "$ans" = "yes" ] ; then
echo "$USR soft nofile 500000" >> /etc/security/limits.conf
echo "$USR hard nofile 500000" >> /etc/security/limits.conf
fi
else
echo "OK, Max open files set to: $RES"
fi
fi
else
echo "I am running not within root account, can't check limits for the $USR"
fi
# Checking kernel settings
RES=`/sbin/sysctl fs.file-max | sed -e "s/fs.file-max *= *\([0-9]\+\)/\\1/"`
if [ $RES -lt 600000 ] ; then
echo "WARNING - system wide fs.file-max is too low: $RES"
echo " To fix this, add following line to file: /etc/sysctl.conf"
echo "fs.file-max=1000000"
echo "-------"
echo "Add the line and adjust sysctl for running system? (yes/no)"
read ans
if [ "$ans" = "yes" ] ; then
echo "fs.file-max=1000000" >> /etc/sysctl.conf
/sbin/sysctl -p > /dev/null
fi
else
echo "OK, system wide fs.file-max set to: $RES"
fi
LO_RES=`/sbin/sysctl net.ipv4.ip_local_port_range | sed -e "s/[^=]*= *\([0-9]\+\)[^0-9]*\([0-9]\+\)/\\1/"`
HI_RES=`/sbin/sysctl net.ipv4.ip_local_port_range | sed -e "s/[^=]*= *\([0-9]\+\)[^0-9]*\([0-9]\+\)/\\2/"`
if [ $LO_RES -gt 5000 ] || [ $HI_RES -lt 64000 ] ; then
echo "WARNING - IP port range is not optimal: $LO_RES $HI_RES"
echo " Recommended: 1024 65530"
echo " To fix this, add following line to file: /etc/sysctl.conf"
echo "net.ipv4.ip_local_port_range=1024 65530"
echo "-------"
echo "Add the line and adjust sysctl for running system? (yes/no)"
read ans
if [ "$ans" = "yes" ] ; then
echo "net.ipv4.ip_local_port_range=1024 65530" >> /etc/sysctl.conf
/sbin/sysctl -p > /dev/null
fi
else
echo "OK, IP port range set to: $LO_RES $HI_RES"
fi
else
echo "The $OSTYPE is not supported for further checks yet"
fi
================================================
FILE: scripts/mandriva/init.d/tigase
================================================
#!/bin/bash
#
# Startup script for SER
#
# chkconfig: 345 85 15
# description: Ser is a fast SIP Proxy.
#
# processname: ser
# pidfile: /var/run/ser.pid
# config: /etc/ser/ser.cfg
# Source function library.
. /etc/rc.d/init.d/functions
export JAVA_HOME=/usr/java/jdk1.6.0
export TIGASE_DIR=/opt/tigase/server/
tigase=$TIGASE_DIR/scripts/tigase.sh
prog=tigase
config=$TIGASE_DIR/etc/tigase.conf
RETVAL=0
start() {
gprintf "Starting %s: " "$prog"
daemon $tigase start $config
RETVAL=$?
echo
[ $RETVAL = 0 ]
return $RETVAL
}
stop() {
gprintf "Stopping %s: " "$prog"
daemon $tigase stop $config
RETVAL=$?
echo
[ $RETVAL = 0 ]
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $tigase
RETVAL=$?
;;
restart)
stop
sleep 10
start
;;
condrestart)
if [ -f /var/run/ser.pid ] ; then
stop
start
fi
;;
*)
gprintf "Usage: %s {start|stop|restart|status|help}\n" "$prog"
exit 1
esac
exit $RETVAL
================================================
FILE: scripts/redhat/init.d/tigase
================================================
#!/bin/bash
### BEGIN INIT INFO
#
# tigase This starts and stops the Tigase XMPP server.
#
# chkconfig: 345 85 15
# description: Tigase is a XMPP server.
#
# processname: tigase
# pidfile: /var/run/tigase/tigase.pid
# config: /home/tigase/tigase-server/etc/tigase.conf
#
### management instructions
##
## to install: /sbin/chkconfig --add tigase
## to check: /sbin/chkconfig --list tigase
## to start: /sbin/chkconfig tigase
##
### END INIT INFO
# Settings paths and other variables
JAVA_HOME=/usr/lib/jvm/java/
USERNAME=tigase
USERGROUP=tigase
NAME=tigase
DESC="Tigase XMPP server"
TIGASE_HOME=/home/tigase/tigase-server
TIGASE_LIB=${TIGASE_HOME}/jars
TIGASE_CONFIG=/etc/tigase/tigase-server.xml
TIGASE_OPTIONS=
TIGASE_PARAMS=
PIDFILE=
TIGASE_CONSOLE_LOG=
USER=$USERNAME
eval HOME="~$USER"
# Attempt to locate JAVA_HOME, code borrowed from jabref package
if [ -z $JAVA_HOME ]
then
for java_dir in /usr/lib/jvm/java-6-* ; do
test -d ${java_dir} && JAVA_HOME=${java_dir}
done
fi
# Include tigase defaults if available
if [ -z "${TIGASE_PARAMS}" ] ; then
if [ -r "/etc/default/tigase" ] ; then
TIGASE_PARAMS="/etc/default/tigase"
elif [ -r "/etc/tigase/tigase.conf" ] ; then
TIGASE_PARAMS="/etc/tigase/tigase.conf"
elif [ -r "${TIGASE_HOME}/etc/tigase.conf" ] ; then
TIGASE_PARAMS="${TIGASE_HOME}/etc/tigase.conf"
fi
fi
[[ -f "${TIGASE_PARAMS}" ]] && . ${TIGASE_PARAMS}
if [ -z "${JAVA_HOME}" ] ; then
echo "JAVA_HOME is not set."
echo "Please set it to correct value before starting the sever."
exit 1
fi
PATH=/sbin:/bin:/usr/sbin:/usr/bin:${JAVA_HOME}/bin
# Find tigase-server jar
for j in ${TIGASE_HOME}/jars/tigase-server*.jar ; do
if [ -f ${j} ] ; then
TIGASE_JAR=${j}
break
fi
done
if [ -z "${TIGASE_CONSOLE_LOG}" ] ; then
if [ -w "/var/log/${NAME}/" ] ; then
TIGASE_CONSOLE_LOG="/var/log/${NAME}/tigase-console.log"
elif [ -w "${TIGASE_HOME}/logs/" ] ; then
TIGASE_CONSOLE_LOG="${TIGASE_HOME}/logs/tigase-console.log"
else
TIGASE_CONSOLE_LOG="/dev/null"
fi
fi
if [ -z "${PIDFILE}" ] ; then
if [ -w "/var/run/" ] ; then
if [ ! -d "/var/run/$NAME/" ]; then
mkdir "/var/run/$NAME/";
chown $USERNAME:$USERGROUP "/var/run/$NAME/";
fi
PIDFILE="/var/run/$NAME/$NAME.pid"
elif [ -w "${TIGASE_HOME}/logs/" ] ; then
PIDFILE="${TIGASE_HOME}/logs/$NAME.pid"
else
PIDFILE="/var/tmp/$NAME.pid"
fi
fi
[[ -z "${TIGASE_RUN}" ]] && \
TIGASE_RUN="tigase.server.XMPPServer -c ${TIGASE_CONFIG} ${TIGASE_OPTIONS}"
[[ -z "${JAVA}" ]] && JAVA="${JAVA_HOME}/bin/java"
[[ -z "${CLASSPATH}" ]] || CLASSPATH="${CLASSPATH}:"
CLASSPATH="${CLASSPATH}${TIGASE_JAR}"
for lib in ${TIGASE_LIB}/*.jar ; do
CLASSPATH="${CLASSPATH}:$lib"
done
TIGASE_CMD="${JAVA_OPTIONS} -cp ${CLASSPATH} ${TIGASE_RUN}"
if [ -d "${TIGASE_HOME}" ] ; then
cd ${TIGASE_HOME}
else
echo "${TIGASE_HOME} is not set to correct value"
echo "Please set it to correct value before starting the sever."
exit 1
fi
# Source function library.
. /etc/rc.d/init.d/functions
#Helper functions
function checkRunning {
local pid="$1"
if [ -z "$pid" -o "$pid" == " " ]; then
return 1;
fi
if [ ! -e /proc/$pid ]; then
rm -f $PIDFILE; return 1;
fi
return 0;
}
function getPid {
if [ ! -f $PIDFILE ]; then
return 1;
fi
PID="$(<$PIDFILE)"
checkRunning $PID || return 1
return 0;
}
start() {
getPid
if [ $? -eq 0 ]; then
echo -ne "Tigase is already running!"
return 1
fi
rm -f $PIDFILE
local cmd="cd ${TIGASE_HOME}; setsid $JAVA $TIGASE_CMD >>${TIGASE_CONSOLE_LOG} 2>&1 & echo \$! >$PIDFILE"
su - ${USERNAME} -c "$cmd" || return 1
sleep 1
PID="$(<$PIDFILE)"
if checkRunning $PID; then :; else
echo -ne "Tigase start failed, see logfile."
return 1
fi
echo -ne "Tigase started"
return 0
}
stop() {
getPid
if [ $? -ne 0 ]; then
echo -ne "Tigase is not running!"
return 1
fi
kill $PID || return 1
for ((i=0; i<15*10; i++)); do
checkRunning $PID
if [ $? -ne 0 ]; then
rm -f $PIDFILE
return 0
fi
sleep 1
done
echo -ne "Tigase did not terminate within 15 seconds, sending SIGKILL..."
kill -s KILL $PID || return 1
for ((i=0; i<15*10; i++)); do
checkRunning $PID
if [ $? -ne 0 ]; then
rm -f $PIDFILE
return 0
fi
sleep 0.1
done
echo -ne "Error: Tigase could not be stopped"
return 1
}
case "$1" in
start)
echo "Starting $DESC"
if start; then
success
echo
exit 0
else
failure
echo
exit 1
fi
echo
;;
stop)
echo "Stopping $DESC"
if stop; then
success
echo
exit 0
else
failure
echo
exit 1
fi
echo
;;
restart|force-reload)
echo "Restarting $DESC"
stop
sleep 10
if start; then
success
echo
exit 0
else
failure
echo
exit 1
fi
echo
;;
clearrestart)
$0 stop $2
sleep 5
$0 clear $2
sleep 2
$0 start $2
;;
clear)
LOGBACK="${TIGASE_HOME}/logs"`date "+%Y-%m-%d--%H:%M:%S"`
echo "Clearing logs, moving backup to " ${LOGBACK}
mkdir -p ${LOGBACK}
mv "${TIGASE_HOME}/logs"/* ${LOGBACK}/
if [ -n "${OSGI}" ] && ${OSGI} ; then
echo "Clearing osgi cache"
rm -rf "${TIGASE_HOME}/felix-cache"/*;
fi
;;
check)
getPid
echo "Checking arguments to Tigase: "
echo
echo "USERNAME = $USERNAME"
echo "USERGROUP = $USERGROUP"
echo "USER = $USER"
echo "HOME = $HOME"
echo "NAME = $NAME"
echo
echo "TIGASE_HOME = $TIGASE_HOME"
echo "TIGASE_JAR = $TIGASE_JAR"
echo "TIGASE_CMD = $TIGASE_CMD"
echo "TIGASE_CONFIG = $TIGASE_CONFIG"
echo "TIGASE_PARAMS = $TIGASE_PARAMS"
echo "TIGASE_OPTIONS = $TIGASE_OPTIONS"
echo "TIGASE_CONSOLE_LOG = $TIGASE_CONSOLE_LOG"
echo "PIDFILE = $PIDFILE"
echo "JAVA_HOME = $JAVA_HOME"
echo "JAVA = $JAVA"
echo "JAVA_OPTIONS = $JAVA_OPTIONS"
echo "CLASSPATH = $CLASSPATH"
if [ -f $PIDFILE ] && kill -0 `cat $PIDFILE` 2>/dev/null
then
echo "Tigase running pid="`cat $PIDFILE`
exit 0
fi
exit 1
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|clearrestart|clear|force-reload|check|status}" >&2
exit 1
;;
esac
exit 0
================================================
FILE: scripts/repo.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
CP="jars/tigase-server.jar:libs/jdbc-mysql.jar:libs/jdbc-postgresql.jar:libs/tigase-xmltools.jar:libs/tigase-utils.jar"
D="-server -Xms100M -Xmx1500M -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver"
MYSQL_REP="-sc tigase.db.jdbc.JDBCRepository -su jdbc:mysql://localhost/nk_200k?user=root&password=mypass"
PGSQL_REP="-sc tigase.db.jdbc.JDBCRepository -su jdbc:postgresql://localhost/tigase?user=tigase"
java $D -cp $CP tigase.util.RepositoryUtils $MYSQL_REP $*
================================================
FILE: scripts/restart-all-servers.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
if [ "$1" == "" ] ; then
SERVS=`cat all-production-servers.txt`
else
SERVS=`cat $1`
fi
[[ -f script.conf ]] && . script.conf
SERVERS=""
for s in "${SERVS}" ; do
if [[ ${s} != "#"* ]] ; then
SERVERS="${SERVERS} ${s}"
fi
done
TIGASE_USER="tigase"
DIR="/home/${TIGASE_USER}/tigase-server"
PROP_FILE="cluster.properties"
CONF_FILE="cluster.tigase.conf"
JARS="target/tigase-server.jar"
LOG_TIMESTAMP=`date +"%Y-%m-%d_%H-%M-%S"`
IPS=()
COLORS=('green' 'yellow' 'orange' 'blue' 'white' 'lightblue' 'gray' 'pink' 'lightgreen' 'red')
echo -e "=== SERVERS:\n${SERVERS}"
echo -e "=== DIR:\n${DIR}"
read -p "Press [Enter] key to start restart..."
function restart_server() {
s=$1
s_ip=$2
echo "Restarting: ${s} ${s_ip}"
if [ -f ${PROP_FILE} ] ; then
echo -e "\n\n Copying ${PROP_FILE} file to ${s}"
scp ${PROP_FILE} root@${s}:${DIR}/etc/init.properties
fi
if [ -f ${CONF_FILE} ] ; then
echo -e "\n\n Copying ${CONF_FILE} file to ${s}"
echo "The cluster node ${s} IP is: ${s_ip}"
sed -e "s/\(Djava.rmi.server.hostname=.*\"\)/Djava.rmi.server.hostname=${s_ip}\"/" ${CONF_FILE} > ${CONF_FILE}_${s}
scp ${CONF_FILE}_${s} root@${s}:${DIR}/etc/tigase.conf
fi
echo "Copying jar files"
for f in ${JARS} ; do
echo -e "\n\n Copying ${f} file to ${s}"
[[ -f ${f} ]] && scp ${f} root@${s}:${DIR}/jars/
done
echo -e "\n\n===\trestarting ${s} ==="
ssh root@${s} "chown -R ${TIGASE_USER}:${TIGASE_USER} /home/${TIGASE_USER} ; service tigase stop ; sleep 10 ; cp -r $\
{DIR}/logs ${DIR}/logs_${LOG_TIMESTAMP} ; rm -f ${DIR}/logs/* ; service tigase start"
echo -e "===\trestart of ${s} FINISHED ==="
}
function restart_tmp() {
s=$1
s_ip=$2
echo "Restarting: ${s} ${s_ip}"
sleep 5
echo "${s} restarted"
}
echo "Resolving IPs..."
cnt=0
for s in ${SERVERS} ; do
IPS[$cnt]=`host ${s} | sed -e "s/.*has address \(.*\)/\1/"`
echo "${COLORS[$cnt]}:${s}:${IPS[$cnt]}"
((cnt++))
done
echo -ne "nodes="
COLORS=('green' 'yellow' 'orange' 'blue' 'white' 'lightblue' 'gray' 'pink' 'lightgreen' 'red')
for i in "${!IPS[@]}"; do
echo -ne "${COLORS[$i]}:${IPS[$i]},"
done
echo ""
cnt=0
for s in ${SERVERS} ; do
s_ip=${IPS[$cnt]}
((cnt++))
restart_server $s $s_ip&
done
================================================
FILE: scripts/stop-all-servers.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
if [ "$1" == "" ] ; then
SERVERS=`cat all-production-servers.txt`
else
SERVERS=`cat $1`
fi
DIR="/home/tigase/tigase-server"
echo -e "=== SERVERS:\n${SERVERS}"
echo -e "=== DIR:\n${DIR}"
read -p "Press [Enter] key to start restart..."
for s in ${SERVERS} ; do
if [[ ${s} != "#"* ]] ; then
echo -e "\n\n===\trestarting ${s} ==="
ssh root@${s} "service tigase stop"
echo -e "===\trestart of ${s} FINISHED ==="
fi
done
================================================
FILE: scripts/systemd/tigase-server
================================================
# Defaults / Configuration options for Tigase XMPP Server
================================================
FILE: scripts/systemd/tigase-server.service
================================================
[Unit]
Description=Tigase XMPP Server
After=syslog.target network-online.target
[Service]
Type=forking
User=tigase
EnvironmentFile=/etc/default/tigase-server
WorkingDirectory=/home/tigase/tigase-server/
PIDFile=/home/tigase/tigase-server/logs/tigase.pid
ExecStart=/home/tigase/tigase-server/scripts/tigase.sh start etc/tigase.conf
ExecStop=/home/tigase/tigase-server/scripts/tigase.sh stop etc/tigase.conf
StandardOutput=syslog
StandardError=syslog
Restart=on-failure
RestartSec=10
KillMode=process
[Install]
WantedBy=multi-user.target
================================================
FILE: scripts/tigase.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
function usage()
{
echo "";
echo "Usage: $0 {start|stop|run|clear|clearrestart|restart|check|status|install-schema|upgrade-schema|upgrade-config|export-data|import-data} [params-file.conf] [parameters]"
echo "";
echo -e "\tFor upgrade-schema task please add --help as a parameter a for list of parameters supported by this task."
exit 1
}
if [ -z "${2}" ] ; then
DEF_PARAMS="tigase.conf"
# Gentoo style config location
if [ -f "/etc/conf.d/${DEF_PARAMS}" ] ; then
TIGASE_PARAMS="/etc/conf.d/${DEF_PARAMS}"
elif [ -f "/etc/${DEF_PARAMS}" ] ; then
TIGASE_PARAMS="/etc/${DEF_PARAMS}"
elif [ -f "/etc/tigase/${DEF_PARAMS}" ] ; then
TIGASE_PARAMS="/etc/tigase/${DEF_PARAMS}"
else
TIGASE_PARAMS=""
fi
echo "No params-file.conf given. Using: '$TIGASE_PARAMS'"
else
TIGASE_PARAMS=${2}
fi
[[ -f "${TIGASE_PARAMS}" ]] && . ${TIGASE_PARAMS}
if [ -z "${TIGASE_HOME}" ] ; then
if [ ${0:0:1} = '/' ] ; then
TIGASE_HOME=${0}
else
TIGASE_HOME=${PWD}/${0}
fi
TIGASE_HOME=`dirname ${TIGASE_HOME}`
TIGASE_HOME=`dirname ${TIGASE_HOME}`
TIGASE_JAR=""
fi
if [ -n "${OSGI}" ] && ${OSGI} ; then
echo "OSGi mode is no longer supported by Tigase XMPP Server."
exit 1
LIB_DIR=jars
JAR_FILE=${LIB_DIR}/org.apache.felix.main*.jar
else
LIB_DIR=jars
JAR_FILE=${LIB_DIR}/tigase-server*.jar
fi
for j in ${TIGASE_HOME}/${JAR_FILE} ; do
if [ -f ${j} ] ; then
TIGASE_JAR=${j}
break
fi
done
if [ -z ${TIGASE_JAR} ] ; then
echo "TIGASE_HOME is not set or main binary (${JAR_FILE}) was missing in ${TIGASE_HOME} location"
echo "Please set it to correct value before starting the sever."
exit 1
fi
if [ -z "${TIGASE_CONSOLE_LOG}" ] ; then
if [ ! -d "logs" ] ; then
mkdir logs
fi
if [ -w "${TIGASE_HOME}/logs/" ] ; then
TIGASE_CONSOLE_LOG="${TIGASE_HOME}/logs/tigase-console.log"
else
TIGASE_CONSOLE_LOG="/dev/null"
fi
fi
if [ -z "${TIGASE_PID}" ] ; then
if [ -w "${TIGASE_HOME}/logs/" ] ; then
TIGASE_PID="${TIGASE_HOME}/logs/tigase.pid"
else
if [ -w "/var/run/" ] ; then
TIGASE_PID="/var/run/tigase.pid"
else
TIGASE_PID="/var/tmp/tigase.pid"
fi
fi
fi
[[ -z "${TIGASE_RUN}" ]] && \
TIGASE_RUN="tigase.server.XMPPServer ${TIGASE_OPTIONS}"
[[ -z "${SCHEMA_MANAGER}" ]] && \
SCHEMA_MANAGER="tigase.db.util.SchemaManager"
[[ -z "${REPOSITORY_MANAGER}" ]] && \
REPOSITORY_MANAGER="tigase.db.util.importexport.RepositoryManager"
[[ -z "${CONFIG_HOLDER}" ]] && \
CONFIG_HOLDER="tigase.conf.ConfigHolder"
JAVA=$(command -v java)
if [ -n "${JAVA_HOME}" ] ; then
if [ -n "$(command -v ${JAVA_HOME}/bin/java)" ] ; then
JAVA="$(command -v ${JAVA_HOME}/bin/java)"
fi
fi
if [ -z "${JAVA}" ] ; then
echo "Java is not installed or not configured properly"
echo "Please make sure that 'java' can be executed or set JAVA_HOME to correct value before starting the sever."
exit 1
fi
[[ -z "${CLASSPATH}" ]] || CLASSPATH="${CLASSPATH}:"
CLASSPATH="${TIGASE_HOME}/${LIB_DIR}/*:${CLASSPATH}"
LOGBACK="-Dlogback.configurationFile=$TIGASE_HOME/etc/logback.xml"
if [ -n "${OSGI}" ] && ${OSGI} ; then
TIGASE_CMD="${JAVA} ${JAVA_OPTIONS} ${LOGBACK} -Dfelix.config.properties=file:$TIGASE_HOME/etc/config.properties -jar ${JAR_FILE}"
else
TIGASE_CMD="${JAVA} ${JAVA_OPTIONS} ${LOGBACK} -cp ${CLASSPATH} ${TIGASE_RUN}"
fi
cd "${TIGASE_HOME}"
case "${1}" in
start)
echo "Starting Tigase: "
if [ -f ${TIGASE_PID} ] && kill -0 $(<${TIGASE_PID}) 2>/dev/null
then
echo "Already Running!!"
exit 1
fi
echo -e "==========\nSTARTED Tigase `date` using:\n ${0} ${1} ${2} ${3}\n==========" >> ${TIGASE_CONSOLE_LOG}
nohup sh -c "exec $TIGASE_CMD >>${TIGASE_CONSOLE_LOG} 2>&1" >/dev/null &
echo $! > $TIGASE_PID
echo "Tigase running pid="`cat $TIGASE_PID`
;;
stop)
PID=`cat $TIGASE_PID 2>/dev/null`
if [ -z "$PID" ] ; then
echo "Tigase is not running."
exit 0
fi
echo "Shutting down Tigase: $PID"
kill $PID 2>/dev/null
for ((i=1; i <= 20; i++)) ; do
if ps -p $PID > /dev/null ; then
echo "$i. Waiting for the server to terminate..."
sleep 1
else
echo "$i. Tigase terminated."
break
fi
done
if ps -p $PID > /dev/null ; then
echo "Forcing the server to terminate."
kill -9 $PID 2>/dev/null
fi
rm -f $TIGASE_PID
echo "STOPPED `date`" >>${TIGASE_CONSOLE_LOG}
;;
restart)
$0 stop $2
sleep 5
$0 start $2
;;
clearrestart)
$0 stop $2
sleep 5
$0 clear $2
sleep 2
$0 start $2
;;
clear)
LOGBACK="${TIGASE_HOME}/logs"`date "+%Y-%m-%d--%H:%M:%S"`
echo "Clearing logs, moving backup to " ${LOGBACK}
mkdir -p ${LOGBACK}
mv "${TIGASE_HOME}/logs"/* ${LOGBACK}/
if [ -n "${OSGI}" ] && ${OSGI} ; then
echo "Clearing osgi cache"
rm -rf "${TIGASE_HOME}/felix-cache"/*;
fi
;;
run)
echo "Running Tigase: "
if [ -f $TIGASE_PID ]
then
echo "Already Running!!"
exit 1
fi
sh -c "exec $TIGASE_CMD"
;;
export-data|import-data)
TMP="${@:2}"
sh -c "${JAVA} ${JAVA_OPTIONS} -DscriptName='${0}' ${LOGBACK} -cp ${CLASSPATH} ${REPOSITORY_MANAGER} ${1} ${TIGASE_OPTIONS} ${TMP}"
;;
upgrade-schema|install-schema|destroy-schema)
TMP="${@:2}"
sh -c "${JAVA} ${JAVA_OPTIONS} -DscriptName='${0}' ${LOGBACK} -cp ${CLASSPATH} ${SCHEMA_MANAGER} ${1} ${TIGASE_OPTIONS} ${TMP}"
;;
upgrade-config)
TMP="${@:3}"
sh -c "${JAVA} ${JAVA_OPTIONS} -DscriptName='${0}' ${LOGBACK} -cp ${CLASSPATH} ${CONFIG_HOLDER} ${1} ${TIGASE_OPTIONS} ${TMP}"
;;
check|status)
echo "Checking arguments to Tigase: "
echo "OSGI = $OSGI"
echo "TIGASE_HOME = $TIGASE_HOME"
echo "TIGASE_JAR = $TIGASE_JAR"
echo "TIGASE_PARAMS = $TIGASE_PARAMS"
echo "TIGASE_RUN = $TIGASE_RUN"
echo "TIGASE_PID = $TIGASE_PID"
echo "TIGASE_OPTIONS = $TIGASE_OPTIONS"
echo "JAVA_HOME = $JAVA_HOME"
echo "JAVA = $JAVA"
echo "JAVA_OPTIONS = $JAVA_OPTIONS"
echo "JAVA_CMD = $JAVA_CMD"
echo "CLASSPATH = $CLASSPATH"
echo "TIGASE_CMD = $TIGASE_CMD"
echo "TIGASE_CONSOLE_LOG = $TIGASE_CONSOLE_LOG"
echo
if [ -f ${TIGASE_PID} ] && kill -0 $(<${TIGASE_PID}) 2>/dev/null
then
echo "Tigase running pid="`cat ${TIGASE_PID}`
exit 0
fi
exit 1
;;
zap)
rm -f $TIGASE_PID
;;
*)
usage
;;
esac
================================================
FILE: scripts/update-all-servers.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
if [ "$1" == "" ] ; then
LOCATIONS=`cat all-production-servers.txt`
else
LOCATIONS=`cat $1`
fi
DIR="/home/tigase/tigase-server"
echo -e "=== LOCATIONS:\n${LOCATIONS}"
echo -e "=== DIR:\n${DIR}"
read -p "Press [Enter] key to start update..."
for s in ${LOCATIONS} ; do
echo -e "\n\n===\tuploading to ${s} ==="
scp jars/tigase-server.jar tigase@${s}:${DIR}/jars/
scp libs/tigase-* tigase@${s}:${DIR}/libs/
scp src/main/groovy/tigase/admin/*.groovy tigase@${s}:${DIR}/scripts/admin/
echo -e "===\tupload to ${s} DONE ==="
done
================================================
FILE: scripts/update-code-functions.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
export TMP_DIR="/tmp"
function build_xmltools() {
mvn -q clean package install &> ${TMP_DIR}/xmltools-build.txt
ant clean jar-dist &> ${TMP_DIR}/xmltools-build.txt
echo jars/tigase-xmltools.jar
}
function build_utils() {
mvn -q clean package install &> ${TMP_DIR}/utils-build.txt
cp -f ../xmltools/jars/tigase-xmltools.jar jars/
ant clean jar-dist &> ${TMP_DIR}/utils-build.txt
echo jars/tigase-utils.jar
}
function build_server() {
mvn -q clean package install &> ${TMP_DIR}/server-build.txt
ant clean jar-dist &> ${TMP_DIR}/server-build.txt
echo ""
}
function build_maven() {
mvn clean package &> ${TMP_DIR}/$1-build.txt
echo `find target -name "tigase-*.jar"`
}
function build_extras() {
build_maven extras
}
function build_muc() {
build_maven muc
}
function build_pubsub() {
build_maven pubsub
}
function build_archiving() {
build_maven archiving
}
function build_socks5() {
build_maven socks5
}
function build_stun() {
build_maven stun
}
function build_tigase_http_api() {
build_maven "tigase-http-api"
}
================================================
FILE: scripts/update-code.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
MY_DIR=`dirname ${0}`
# Load external script with some utility functions
. ${MY_DIR}/update-code-functions.sh
# Load configuration
# PROJECTS_DIR - directory with source codes for all projects:
# xmltools, utils, extras, server, muc, pubsub, socks5, stun, archiving
# TARGET_DIR - a directory where the installed serve binaries are located
CONFIG="${MY_DIR}/update-code-config.sh"
if [ "$1" != "" ] ; then
CONFIG="$1"
fi
. ${CONFIG}
SRV_PACKAGES="xmltools utils extras server muc pubsub archiving socks5 stun tigase_http_api"
CUR_DIR=`pwd`
cd ${PROJECTS_DIR}
#set -x
echo "Updating and building packages..."
# Build all server packages
for p in $SRV_PACKAGES ; do
echo "Building package: $p"
cd $p
mkdir -p jars
git pull
JAR=`build_$p`
echo "jar file: $JAR"
if [ ! -z "${JAR}" ] ; then
cp -f $JAR ../server/jars/tigase-$p.jar
fi
cd ..
done
cd ${CUR_DIR}
if [ "${TARGET_DIR}" != "" ] ; then
cp -fv ${PROJECTS_DIR}/server/jars/* ${TARGET_DIR}/bundle/
cp -fv ${PROJECTS_DIR}/server/jars/* ${TARGET_DIR}/jars/
fi
================================================
FILE: scripts/user_roster.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
CP="jars/tigase-server.jar:libs/jdbc-mysql.jar:libs/tigase-xmltools.jar:libs/tigase-utils.jar"
D="-server -Xms100M -Xmx1500M -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8 -Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver"
XML_REP="-sc tigase.db.xml.XMLRepository -su ../testsuite/user-repository.xml_200k_backup"
D_MYSQL_REP="-dc tigase.db.jdbc.JDBCRepository -du jdbc:mysql://localhost/tigasetest200k?user=root&password=mypass"
S_MYSQL_REP="-sc tigase.db.jdbc.JDBCRepository -su jdbc:mysql://localhost/tigasetest?user=root&password=mypass"
S_PGSQL_REP="-sc tigase.db.jdbc.JDBCRepository -su jdbc:postgresql://localhost/tigase?user=tigase"
java $D -cp $CP tigase.util.RepositoryUtils $S_MYSQL_REP -u "$1" -pr
================================================
FILE: scripts/wait-for-it.sh
================================================
#!/usr/bin/env bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
# Use this script to test if a given TCP host/port are available
# MIT Licensed, from https://github.com/vishnubob/wait-for-it
WAITFORIT_cmdname=${0##*/}
echoerr() { if [[ $WAITFORIT_QUIET -ne 1 ]]; then echo "$@" 1>&2; fi }
usage()
{
cat << USAGE >&2
Usage:
$WAITFORIT_cmdname host:port [-s] [-t timeout] [-- command args]
-h HOST | --host=HOST Host or IP under test
-p PORT | --port=PORT TCP port under test
Alternatively, you specify the host and port as host:port
-s | --strict Only execute subcommand if the test succeeds
-q | --quiet Don't output any status messages
-t TIMEOUT | --timeout=TIMEOUT
Timeout in seconds, zero for no timeout
-- COMMAND ARGS Execute command with args after the test finishes
USAGE
exit 1
}
wait_for()
{
if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
echoerr "$WAITFORIT_cmdname: waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
else
echoerr "$WAITFORIT_cmdname: waiting for $WAITFORIT_HOST:$WAITFORIT_PORT without a timeout"
fi
WAITFORIT_start_ts=$(date +%s)
while :
do
if [[ $WAITFORIT_ISBUSY -eq 1 ]]; then
nc -z $WAITFORIT_HOST $WAITFORIT_PORT
WAITFORIT_result=$?
else
(echo -n > /dev/tcp/$WAITFORIT_HOST/$WAITFORIT_PORT) >/dev/null 2>&1
WAITFORIT_result=$?
fi
if [[ $WAITFORIT_result -eq 0 ]]; then
WAITFORIT_end_ts=$(date +%s)
echoerr "$WAITFORIT_cmdname: $WAITFORIT_HOST:$WAITFORIT_PORT is available after $((WAITFORIT_end_ts - WAITFORIT_start_ts)) seconds"
break
fi
sleep 1
done
return $WAITFORIT_result
}
wait_for_wrapper()
{
# In order to support SIGINT during timeout: http://unix.stackexchange.com/a/57692
if [[ $WAITFORIT_QUIET -eq 1 ]]; then
timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --quiet --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
else
timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
fi
WAITFORIT_PID=$!
trap "kill -INT -$WAITFORIT_PID" INT
wait $WAITFORIT_PID
WAITFORIT_RESULT=$?
if [[ $WAITFORIT_RESULT -ne 0 ]]; then
echoerr "$WAITFORIT_cmdname: timeout occurred after waiting $WAITFORIT_TIMEOUT seconds for $WAITFORIT_HOST:$WAITFORIT_PORT"
fi
return $WAITFORIT_RESULT
}
# process arguments
while [[ $# -gt 0 ]]
do
case "$1" in
*:* )
WAITFORIT_hostport=(${1//:/ })
WAITFORIT_HOST=${WAITFORIT_hostport[0]}
WAITFORIT_PORT=${WAITFORIT_hostport[1]}
shift 1
;;
--child)
WAITFORIT_CHILD=1
shift 1
;;
-q | --quiet)
WAITFORIT_QUIET=1
shift 1
;;
-s | --strict)
WAITFORIT_STRICT=1
shift 1
;;
-h)
WAITFORIT_HOST="$2"
if [[ $WAITFORIT_HOST == "" ]]; then break; fi
shift 2
;;
--host=*)
WAITFORIT_HOST="${1#*=}"
shift 1
;;
-p)
WAITFORIT_PORT="$2"
if [[ $WAITFORIT_PORT == "" ]]; then break; fi
shift 2
;;
--port=*)
WAITFORIT_PORT="${1#*=}"
shift 1
;;
-t)
WAITFORIT_TIMEOUT="$2"
if [[ $WAITFORIT_TIMEOUT == "" ]]; then break; fi
shift 2
;;
--timeout=*)
WAITFORIT_TIMEOUT="${1#*=}"
shift 1
;;
--)
shift
WAITFORIT_CLI=("$@")
break
;;
--help)
usage
;;
*)
echoerr "Unknown argument: $1"
usage
;;
esac
done
if [[ "$WAITFORIT_HOST" == "" || "$WAITFORIT_PORT" == "" ]]; then
echoerr "Error: you need to provide a host and port to test."
usage
fi
WAITFORIT_TIMEOUT=${WAITFORIT_TIMEOUT:-15}
WAITFORIT_STRICT=${WAITFORIT_STRICT:-0}
WAITFORIT_CHILD=${WAITFORIT_CHILD:-0}
WAITFORIT_QUIET=${WAITFORIT_QUIET:-0}
# Check to see if timeout is from busybox?
WAITFORIT_TIMEOUT_PATH=$(type -p timeout)
WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH)
WAITFORIT_BUSYTIMEFLAG=""
if [[ $WAITFORIT_TIMEOUT_PATH =~ "busybox" ]]; then
WAITFORIT_ISBUSY=1
# Check if busybox timeout uses -t flag
# (recent Alpine versions don't support -t anymore)
if timeout &>/dev/stdout | grep -q -e '-t '; then
WAITFORIT_BUSYTIMEFLAG="-t"
fi
else
WAITFORIT_ISBUSY=0
fi
if [[ $WAITFORIT_CHILD -gt 0 ]]; then
wait_for
WAITFORIT_RESULT=$?
exit $WAITFORIT_RESULT
else
if [[ $WAITFORIT_TIMEOUT -gt 0 ]]; then
wait_for_wrapper
WAITFORIT_RESULT=$?
else
wait_for
WAITFORIT_RESULT=$?
fi
fi
if [[ $WAITFORIT_CLI != "" ]]; then
if [[ $WAITFORIT_RESULT -ne 0 && $WAITFORIT_STRICT -eq 1 ]]; then
echoerr "$WAITFORIT_cmdname: strict mode, refusing to execute subprocess"
exit $WAITFORIT_RESULT
fi
exec "${WAITFORIT_CLI[@]}"
else
exit $WAITFORIT_RESULT
fi
================================================
FILE: src/main/bash/cron-dnotify-check.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
monitored_dir="/home/webapp/drupal-sites/users-list"
mydir=`dirname $0`
cron_check=`ps axw | grep -c "[d]notify -C"`
if [ $cron_check -eq 0 ] ; then
# echo "dnotify monitor is not running, starting a new one...."
/usr/bin/dnotify -C -b $monitored_dir -e $mydir/users-list-moitor.sh '{}'
fi
================================================
FILE: src/main/bash/users-list-moitor.sh
================================================
#!/bin/bash
#
# Tigase XMPP Server - The instant messaging server
# Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. Look for COPYING file in the top folder.
# If not, see http://www.gnu.org/licenses/.
#
mydir=$1
if [ "$mydir" == "" ] ; then
echo "Directory name is missing..."
exit 1
fi
for i in $mydir/* ; do
newuser=`basename $i`
echo "Adding new user: "$newuser
/usr/sbin/useradd $newuser -m
rm -f $i
/usr/bin/mail -s "Welcome to Tigase LiveCD" -t ${newuser}@livecd.tigase.org < 0 then user is online, the value
-- indicates the number of user connections.
-- It is incremented on each user login and decremented on each
-- user logout.
online_status int default 0,
-- Number of failed login attempts
failed_logins int default 0,
-- User status, whether the account is active or disabled
-- >0 - account active, 0 - account disabled
account_status int default 1
);
-- QUERY END:
-- QUERY START:
create unique index user_id on tig_users ( user_id );
-- QUERY END:
-- QUERY START:
create index user_pw on tig_users (user_pw);
-- QUERY END:
-- QUERY START:
create index last_login on tig_users (last_login);
-- QUERY END:
-- QUERY START:
create index last_logout on tig_users (last_logout);
-- QUERY END:
-- QUERY START:
create index account_status on tig_users (account_status);
-- QUERY END:
-- QUERY START:
create index online_status on tig_users (online_status);
-- QUERY END:
-- QUERY START:
create table tig_nodes (
nid BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY,
parent_nid bigint,
uid bigint NOT NULL references tig_users(uid),
node varchar(255) NOT NULL
);
-- QUERY END:
-- QUERY START:
create unique index tnode on tig_nodes ( parent_nid, uid, node );
-- QUERY END:
-- QUERY START:
create index node on tig_nodes ( node );
-- QUERY END:
-- QUERY START:
-- The new index is a duplicate of an existing index
create index nuid on tig_nodes (uid);
-- QUERY END:
-- QUERY START:
create index parent_nid on tig_nodes (parent_nid);
-- QUERY END:
-- QUERY START:
create table tig_pairs (
PID BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY,
nid bigint references tig_nodes(nid),
uid bigint NOT NULL references tig_users(uid),
pkey varchar(255) NOT NULL,
pval CLOB
);
-- QUERY END:
-- QUERY START:
-- The new index is a duplicate of an existing index
create index pkey on tig_pairs ( pkey );
-- QUERY END:
-- QUERY START:
-- The new index is a duplicate of an existing index
create index puid on tig_pairs (uid);
-- QUERY END:
-- QUERY START:
create index pnid on tig_pairs (nid);
-- QUERY END:
-- QUERY START:
create table tig_offline_messages (
msg_id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY,
ts timestamp DEFAULT CURRENT_TIMESTAMP,
expired timestamp,
sender varchar(2049),
sender_sha1 char(40),
receiver varchar(2049) not null,
receiver_sha1 char(40) not null,
msg_type int not null default 0,
message varchar(32672) not null
);
-- QUERY END:
-- QUERY START:
create index tig_offline_messages_expired on tig_offline_messages (expired);
-- QUERY END:
-- QUERY START:
create index tig_offline_messages_receiver on tig_offline_messages (receiver_sha1);
-- QUERY END:
-- QUERY START:
create index tig_offline_messages_receiver_sender on tig_offline_messages (receiver_sha1, sender_sha1);
-- QUERY END:
-- QUERY START:
create table tig_broadcast_messages (
id varchar(128) not null,
expired timestamp not null,
msg varchar(32672) not null,
primary key (id)
);
-- QUERY END:
-- QUERY START:
create table tig_broadcast_jids (
jid_id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL PRIMARY KEY,
jid varchar(2049) not null,
jid_sha1 char(128) not null
);
-- QUERY END:
-- QUERY START:
create table tig_broadcast_recipients (
msg_id varchar(128) not null references tig_broadcast_messages(id),
jid_id bigint not null references tig_broadcast_jids(jid_id),
primary key (msg_id, jid_id)
);
-- QUERY END:
-- QUERY START:
create table tig_cluster_nodes (
hostname varchar(512) not null,
secondary varchar(512),
password varchar(255) not null,
last_update timestamp default current_timestamp,
port int,
cpu_usage double precision not null,
mem_usage double precision not null,
primary key (hostname)
);
-- QUERY END:
-- ------------- Credentials support
-- QUERY START:
create table tig_user_credentials (
uid bigint not null references tig_users(uid),
username varchar(2049) not null,
mechanism varchar(128) not null,
value varchar(32672) not null,
primary key (uid, username, mechanism)
);
-- QUERY END:
================================================
FILE: src/main/database/derby-server-8.0.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
CREATE function TigGetDBProperty(tkey varchar(255)) returns long varchar
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigGetDBProperty';
-- QUERY END:
-- QUERY START:
CREATE procedure TigPutDBProperty(tkey varchar(255), tval varchar(32672))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigPutDBProperty';
-- QUERY END:
-- QUERY START:
CREATE procedure TigInitdb()
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigInitdb';
-- QUERY END:
-- QUERY START:
CREATE procedure TigAddUser(userId varchar(2049), userPw varchar(255))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigAddUser';
-- QUERY END:
-- QUERY START:
CREATE procedure TigAddUserPlainPw(userId varchar(2049), userPw varchar(255))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigAddUserPlainPw';
-- QUERY END:
-- QUERY START:
CREATE procedure TigGetUserDBUid(userId varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigGetUserDBUid';
-- QUERY END:
-- QUERY START:
CREATE procedure TigRemoveUser(userId varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigRemoveUser';
-- QUERY END:
-- QUERY START:
CREATE procedure TigGetPassword(userId varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigGetPassword';
-- QUERY END:
-- QUERY START:
CREATE procedure TigUpdatePasswordPlainPwRev(userId varchar(2049), userPw varchar(255))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUpdatePasswordPlainPwRev';
-- QUERY END:
-- QUERY START:
CREATE procedure TigUpdatePasswordPlainPw(userId varchar(2049), userPw varchar(255))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUpdatePasswordPlainPw';
-- QUERY END:
-- QUERY START:
CREATE procedure TigUpdatePassword(userId varchar(2049), userPw varchar(255))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUpdatePassword';
-- QUERY END:
-- QUERY START:
CREATE procedure TigOnlineUsers()
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigOnlineUsers';
-- QUERY END:
-- QUERY START:
CREATE procedure TigOfflineUsers()
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigOfflineUsers';
-- QUERY END:
-- QUERY START:
CREATE procedure TigAllUsers()
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigAllUsers';
-- QUERY END:
-- QUERY START:
CREATE procedure TigAllUsersCount()
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigAllUsersCount';
-- QUERY END:
-- QUERY START:
CREATE procedure TigUserLoginPlainPw(userId varchar(2049), userPw varchar(255))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUserLoginPlainPw';
-- QUERY END:
-- QUERY START:
CREATE procedure TigUserLogin(userId varchar(2049), userPw varchar(255))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUserLogin';
-- QUERY END:
-- QUERY START:
CREATE procedure TigUserLogout(userId varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUserLogout';
-- QUERY END:
-- QUERY START:
CREATE procedure TigDisableAccount(userId varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigDisableAccount';
-- QUERY END:
-- QUERY START:
CREATE procedure TigEnableAccount(userId varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigEnableAccount';
-- QUERY END:
-- QUERY START:
CREATE procedure TigActiveAccounts()
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigActiveAccounts';
-- QUERY END:
-- QUERY START:
CREATE procedure TigDisabledAccounts()
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigDisabledAccounts';
-- QUERY END:
-- QUERY START:
CREATE procedure TigAddNode(parentNid bigint, uid bigint, node varchar(255))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigAddNode';
-- QUERY END:
-- QUERY START:
CREATE procedure TigUpdatePairs(nid bigint, uid bigint, tkey varchar(255), tval clob)
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUpdatePairs';
-- QUERY END:
-- QUERY START:
CREATE procedure TigUpdateLoginTime(userId varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUpdateLoginTime';
-- QUERY END:
-- QUERY START:
CREATE procedure Tig_OfflineMessages_AddMessage("to" varchar(2049), "from" varchar(2049), "type" int, "ts" timestamp, "message" varchar(32672), "expired" timestamp, "limit" bigint)
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.MsgRepositoryStoredProcedures.addMessage';
-- QUERY END:
-- QUERY START:
CREATE procedure Tig_OfflineMessages_GetMessages("to" varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.MsgRepositoryStoredProcedures.getMessages';
-- QUERY END:
-- QUERY START:
CREATE procedure Tig_OfflineMessages_GetMessagesByIds("to" varchar(2049), "msg_id1" varchar(50), "_msg_id2" varchar(50), "_msg_id3" varchar(50), "_msg_id4" varchar(50))
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.MsgRepositoryStoredProcedures.getMessagesByIds';
-- QUERY END:
-- QUERY START:
CREATE procedure Tig_OfflineMessages_GetMessagesCount("to" varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.MsgRepositoryStoredProcedures.getMessagesCount';
-- QUERY END:
-- QUERY START:
CREATE procedure Tig_OfflineMessages_ListMessages("to" varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.MsgRepositoryStoredProcedures.listMessages';
-- QUERY END:
-- QUERY START:
CREATE procedure Tig_OfflineMessages_DeleteMessages("to" varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.MsgRepositoryStoredProcedures.deleteMessages';
-- QUERY END:
-- QUERY START:
CREATE procedure Tig_OfflineMessages_DeleteMessagesByIds("to" varchar(2049), "msg_id1" varchar(50), "_msg_id2" varchar(50), "_msg_id3" varchar(50), "_msg_id4" varchar(50))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.MsgRepositoryStoredProcedures.deleteMessagesByIds';
-- QUERY END:
-- QUERY START:
CREATE procedure Tig_OfflineMessages_DeleteMessage(msg_id bigint)
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.MsgRepositoryStoredProcedures.deleteMessage';
-- QUERY END:
-- QUERY START:
CREATE procedure Tig_OfflineMessages_GetExpiredMessages("limit" int)
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.MsgRepositoryStoredProcedures.getExpiredMessages';
-- QUERY END:
-- QUERY START:
CREATE procedure Tig_OfflineMessages_GetExpiredMessagesBefore("before" timestamp)
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.MsgRepositoryStoredProcedures.getExpiredMessagesBefore';
-- QUERY END:
-- ------------ Broadcast Messages
-- QUERY START:
CREATE procedure Tig_BroadcastMessages_AddMessage("msg_id" varchar(128), "expired" timestamp, "msg" varchar(32672))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.MsgBroadcastRepositoryStoredProcedures.addMessage';
-- QUERY END:
-- QUERY START:
CREATE procedure Tig_BroadcastMessages_AddMessageRecipient("msg_id" varchar(128), "jid" varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.MsgBroadcastRepositoryStoredProcedures.addMessageRecipient';
-- QUERY END:
-- QUERY START:
CREATE procedure Tig_BroadcastMessages_GetMessages("expired" timestamp)
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.MsgBroadcastRepositoryStoredProcedures.getMessages';
-- QUERY END:
-- QUERY START:
CREATE procedure Tig_BroadcastMessages_GetMessageRecipients("msg_id" varchar(128))
PARAMETER STYLE JAVA
LANGUAGE JAVA
READS SQL DATA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.MsgBroadcastRepositoryStoredProcedures.getMessageRecipients';
-- QUERY END:
-- QUERY START:
CREATE PROCEDURE TigUpdateAccountStatus("userId" VARCHAR(2049), "status" INT)
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUpdateAccountStatus';
-- QUERY END:
-- QUERY START:
CREATE PROCEDURE TigAccountStatus("userId" VARCHAR(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigAccountStatus';
-- QUERY END:
-- ------------- Credentials support
-- QUERY START:
CREATE PROCEDURE TigUserCredential_Update(userId varchar(2049), username varchar(2049), mechanism varchar(128), value varchar(32672))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUserCredentialUpdate';
-- QUERY END:
-- QUERY START:
CREATE PROCEDURE TigUserCredentials_Get(userId varchar(2049), username varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUserCredentialsGet';
-- QUERY END:
-- QUERY START:
CREATE PROCEDURE TigUserUsernames_Get(userId varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUserUsernamesGet';
-- QUERY END:
-- QUERY START:
CREATE PROCEDURE TigUserCredential_Remove(userId varchar(2049), username varchar(2049))
PARAMETER STYLE JAVA
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'tigase.db.derby.StoredProcedures.tigUserCredentialRemove';
-- QUERY END:
================================================
FILE: src/main/database/derby-server-8.0.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
run 'database/derby-server-8.0.0-schema.sql';
run 'database/derby-server-8.0.0-sp.sql';
run 'database/derby-server-8.0.0-props.sql';
-- LOAD FILE: database/derby-server-8.0.0-schema.sql
-- LOAD FILE: database/derby-server-8.0.0-sp.sql
-- LOAD FILE: database/derby-server-8.0.0-props.sql
================================================
FILE: src/main/database/derby-server-8.1.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
call TigSetComponentVersion('server', '8.1.0');
-- QUERY END:
================================================
FILE: src/main/database/derby-server-8.1.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
run 'database/derby-server-8.1.0-props.sql';
-- LOAD FILE: database/derby-server-8.1.0-props.sql
================================================
FILE: src/main/database/derby-server-8.2.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
call TigSetComponentVersion('server', '8.2.0');
-- QUERY END:
================================================
FILE: src/main/database/derby-server-8.2.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
ALTER TABLE tig_users ADD COLUMN last_used timestamp;
-- QUERY END:
================================================
FILE: src/main/database/derby-server-8.2.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
DROP procedure TigPutDBProperty;
-- QUERY END:
-- QUERY START:
DROP procedure TigUserLogin;
-- QUERY END:
-- QUERY START:
DROP procedure TigUserLogout;
-- QUERY END:
-- QUERY START:
DROP procedure TigOnlineUsers;
-- QUERY END:
-- QUERY START:
DROP procedure TigOfflineUsers;
-- QUERY END:
-- QUERY START:
DROP procedure TigUserLoginPlainPw;
-- QUERY END:
================================================
FILE: src/main/database/derby-server-8.2.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
run 'database/derby-server-8.2.0-schema.sql';
run 'database/derby-server-8.2.0-sp.sql';
run 'database/derby-server-8.2.0-props.sql';
-- LOAD FILE: database/derby-server-8.2.0-schema.sql
-- LOAD FILE: database/derby-server-8.2.0-sp.sql
-- LOAD FILE: database/derby-server-8.2.0-props.sql
================================================
FILE: src/main/database/derby-server-8.3.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
call TigSetComponentVersion('server', '8.3.0');
-- QUERY END:
================================================
FILE: src/main/database/derby-server-8.3.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
--
================================================
FILE: src/main/database/derby-server-8.3.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
--
================================================
FILE: src/main/database/derby-server-8.3.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
run 'database/derby-server-8.3.0-schema.sql';
run 'database/derby-server-8.3.0-sp.sql';
run 'database/derby-server-8.3.0-props.sql';
-- LOAD FILE: database/derby-server-8.3.0-schema.sql
-- LOAD FILE: database/derby-server-8.3.0-sp.sql
-- LOAD FILE: database/derby-server-8.3.0-props.sql
================================================
FILE: src/main/database/derby-server-8.4.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
================================================
FILE: src/main/database/derby-server-8.5.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
================================================
FILE: src/main/database/mssql-server-8.5.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
================================================
FILE: src/main/database/mysql-common-0.0.1.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
create table if not EXISTS tig_schema_versions (
-- Component Name
component varchar(100) NOT NULL,
-- Version of loaded schema
version varchar(100) NOT NULL,
-- Time when schema was loaded last time
last_update timestamp NOT NULL,
primary key (component)
);
-- QUERY END:
-- QUERY START:
drop PROCEDURE if exists TigGetComponentVersion;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigSetComponentVersion;
-- QUERY END:
delimiter //
-- QUERY START:
create PROCEDURE TigGetComponentVersion(_component varchar(100) CHARSET utf8)
begin
select version from tig_schema_versions where (component = _component);
end //
-- QUERY END:
-- QUERY START:
create procedure TigSetComponentVersion(_component varchar(255) CHARSET utf8, _version mediumtext CHARSET utf8)
begin
INSERT INTO tig_schema_versions (component, version, last_update)
VALUES (_component, _version, now())
ON DUPLICATE KEY UPDATE
version = _version, last_update = now();
end //
-- QUERY END:
================================================
FILE: src/main/database/mysql-common-0.0.2.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
update tig_schema_versions
set version = concat(version, '-SNAPSHOT')
where exists (
select 1
from (select * from tig_schema_versions) sv
where
sv.component = 'common'
and sv.version = '0.0.1'
) and version not like '%-SNAPSHOT%';
-- QUERY END:
================================================
FILE: src/main/database/mysql-common-0.0.3.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
drop procedure if exists TigExecuteIf;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigExecuteIfNot;
-- QUERY END:
delimiter //
-- QUERY START:
create procedure TigExecuteIf(cond int, query text)
begin
set @s = (select if (
cond > 0,
query,
'select 1'
));
prepare stmt from @s;
execute stmt;
deallocate prepare stmt;
end //
-- QUERY END:
-- QUERY START:
create procedure TigExecuteIfNot(cond int, query text)
begin
set @s = (select if (
cond <= 0,
query,
'select 1'
));
prepare stmt from @s;
execute stmt;
deallocate prepare stmt;
end //
-- QUERY END:
delimiter ;
================================================
FILE: src/main/database/mysql-counter_data_logger-0.0.1.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
create table if not exists tig_stats_log (
lid serial,
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
hostname varchar(2049) NOT NULL,
cpu_usage double precision not null default 0,
mem_usage double precision not null default 0,
uptime bigint not null default 0,
vhosts int not null default 0,
sm_packets bigint not null default 0,
muc_packets bigint not null default 0,
pubsub_packets bigint not null default 0,
c2s_packets bigint not null default 0,
s2s_packets bigint not null default 0,
ext_packets bigint not null default 0,
presences bigint not null default 0,
messages bigint not null default 0,
iqs bigint not null default 0,
registered bigint not null default 0,
c2s_conns int not null default 0,
s2s_conns int not null default 0,
bosh_conns int not null default 0,
primary key (ts, hostname(255))
);
-- QUERY END:
-- QUERY START:
call TigExecuteIfNot(
(select count(1) from information_schema.COLUMNS where TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'tig_stats_log' AND COLUMN_NAME = 'ws2s_conns'),
"ALTER TABLE tig_stats_log ADD `ws2s_conns` INT not null default 0"
);
-- QUERY END:
-- QUERY START:
call TigExecuteIfNot(
(select count(1) from information_schema.COLUMNS where TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'tig_stats_log' AND COLUMN_NAME = 'ws2s_packets'),
"ALTER TABLE tig_stats_log ADD `ws2s_packets` bigint not null default 0"
);
-- QUERY END:
-- QUERY START:
call TigExecuteIfNot(
(select count(1) from information_schema.COLUMNS where TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'tig_stats_log' AND COLUMN_NAME = 'sm_sessions'),
"ALTER TABLE tig_stats_log ADD `sm_sessions` bigint not null default 0"
);
-- QUERY END:
-- QUERY START:
call TigExecuteIfNot(
(select count(1) from information_schema.COLUMNS where TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'tig_stats_log' AND COLUMN_NAME = 'sm_connections'),
"ALTER TABLE tig_stats_log ADD `sm_connections` bigint not null default 0"
);
-- QUERY END:
================================================
FILE: src/main/database/mysql-installer-create-db.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START: create database
create database IF NOT EXISTS ${dbName};
-- QUERY END: create database
-- QUERY START: add user
CREATE USER IF NOT EXISTS '${dbUser}'@'%' IDENTIFIED BY '${dbPass}';
-- QUERY END: add user
-- QUERY START: add user
CREATE USER IF NOT EXISTS '${dbUser}'@'localhost' IDENTIFIED BY '${dbPass}';
-- QUERY END: add user
-- QUERY START: add user
CREATE USER IF NOT EXISTS '${dbUser}' IDENTIFIED BY '${dbPass}';
-- QUERY END: user
-- QUERY START: add user
GRANT ALL ON ${dbName}.* TO '${dbUser}'@'%';
-- QUERY END: add user
-- QUERY START: add user
GRANT ALL ON ${dbName}.* TO '${dbUser}'@'localhost';
-- QUERY END: add user
-- QUERY START: add user
GRANT ALL ON ${dbName}.* TO '${dbUser}';
-- QUERY END: user
-- QUERY START: flush privileges
FLUSH PRIVILEGES;
-- QUERY END: flush privileges
================================================
FILE: src/main/database/mysql-installer-post.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
================================================
FILE: src/main/database/mysql-server-8.0.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
select NOW(), ' - Setting schema version to 8.0.0';
-- QUERY START:
call TigSetComponentVersion('server', '8.0.0');
-- QUERY END:
================================================
FILE: src/main/database/mysql-server-8.0.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
create table if not exists tig_users (
uid bigint unsigned NOT NULL auto_increment,
-- Jabber User ID
user_id varchar(2049) NOT NULL,
-- UserID SHA1 hash to prevent duplicate user_ids
sha1_user_id char(128) NOT NULL,
-- User password encrypted or not
-- DEPRECATED
user_pw varchar(255) default NULL,
-- Time the account has been created
acc_create_time timestamp DEFAULT CURRENT_TIMESTAMP,
-- Time of the last user login
-- DEPRECATED
last_login timestamp NULL DEFAULT NULL,
-- Time of the last user logout
-- DEPRECATED
last_logout timestamp NULL DEFAULT NULL,
-- User online status, if > 0 then user is online, the value
-- indicates the number of user connections.
-- It is incremented on each user login and decremented on each
-- user logout.
-- DEPRECATED
online_status int default 0,
-- Number of failed login attempts
failed_logins int default 0,
-- User status, whether the account is active or disabled
-- >0 - account active, 0 - account disabled
account_status int default 1,
primary key (uid),
unique key sha1_user_id (sha1_user_id),
key user_pw (user_pw),
key part_of_user_id (user_id(255)),
key last_login (last_login),
key last_logout (last_logout),
key account_status (account_status),
key online_status (online_status)
)
ENGINE=InnoDB default character set utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
-- QUERY END:
-- QUERY START:
create table if not exists tig_nodes (
nid bigint unsigned NOT NULL auto_increment,
parent_nid bigint unsigned,
uid bigint unsigned NOT NULL,
node varchar(255) NOT NULL,
primary key (nid),
unique key tnode (parent_nid, uid, node),
key node (node),
key uid (uid),
key parent_nid (parent_nid),
constraint tig_nodes_constr foreign key (uid) references tig_users (uid)
)
ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC;
-- QUERY END:
-- QUERY START:
create table if not exists tig_pairs (
pid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
nid bigint unsigned,
uid bigint unsigned NOT NULL,
pkey varchar(255) NOT NULL,
pval mediumtext character set utf8mb4 collate utf8mb4_unicode_ci,
key pkey (pkey),
key uid (uid),
key nid (nid),
constraint tig_pairs_constr_1 foreign key (uid) references tig_users (uid),
constraint tig_pairs_constr_2 foreign key (nid) references tig_nodes (nid)
)
ENGINE=InnoDB default character set utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
-- QUERY END:
-- QUERY START:
create table if not exists tig_offline_messages (
msg_id bigint unsigned not null auto_increment,
ts timestamp(6) default current_timestamp(6),
expired timestamp null default null,
sender varchar(2049),
sender_sha1 char(128),
receiver varchar(2049) not null,
receiver_sha1 char(128) not null,
msg_type int not null default 0,
message mediumtext character set utf8mb4 collate utf8mb4_unicode_ci not null,
primary key (msg_id),
key tig_offline_messages_expired_index (expired),
key tig_offline_messages_receiver_sha1_index (receiver_sha1),
key tig_offline_messages_receiver_sha1_sender_sha1_index (receiver_sha1, sender_sha1)
) ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC;
-- QUERY END:
-- QUERY START:
create table if not exists tig_broadcast_messages (
id varchar(128) not null,
expired timestamp(6) not null,
msg mediumtext character set utf8mb4 collate utf8mb4_unicode_ci not null,
primary key (id)
);
-- QUERY END:
-- QUERY START:
create table if not exists tig_broadcast_jids (
jid_id bigint unsigned not null auto_increment,
jid varchar(2049) not null,
jid_sha1 char(128) not null,
primary key (jid_id),
key tig_broadcast_jids_jid_sha1 (jid_sha1)
);
-- QUERY END:
-- QUERY START:
create table if not exists tig_broadcast_recipients (
msg_id varchar(128) not null references tig_broadcast_messages(id),
jid_id bigint not null references tig_broadcast_jids(jid_id),
primary key (msg_id, jid_id)
);
-- QUERY END:
-- ------------ Clustering support
-- QUERY START:
create table if not exists tig_cluster_nodes (
hostname varchar(255) not null,
secondary varchar(512),
password varchar(255),
last_update timestamp(6) default current_timestamp(6) on update current_timestamp(6),
port int,
cpu_usage double precision unsigned not null,
mem_usage double precision unsigned not null,
primary key (hostname)
) ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC;
-- QUERY END:
-- ------------- Credentials support
-- QUERY START:
create table if not exists tig_user_credentials (
uid bigint unsigned not null,
username varchar(2049) not null,
username_sha1 char(128) not null,
mechanism varchar(128) not null,
value mediumtext not null,
primary key (uid, username_sha1, mechanism),
constraint tig_credentials_uid foreign key (uid) references tig_users (uid)
) ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC;
-- QUERY END:
================================================
FILE: src/main/database/mysql-server-8.0.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
drop procedure if exists TigInitdb;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigAddUser;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigGetUserDBUid;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUpdatePassword;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUpdatePasswordPlainPwRev;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUserLogin;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUserLogout;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigOnlineUsers;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigOfflineUsers;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigAllUsers;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigAllUsersCount;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigDisableAccount;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigEnableAccount;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigActiveAccounts;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigDisabledAccounts;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigAddNode;
-- QUERY END:
-- QUERY START:
drop function if exists TigGetDBProperty;
-- QUERY END:
delimiter //
-- QUERY START:
-- DEPRECATED | Database properties get - function
create function TigGetDBProperty(_tkey varchar(255) CHARSET utf8) returns mediumtext CHARSET utf8
READS SQL DATA
begin
declare _result mediumtext CHARSET utf8;
select pval into _result from tig_pairs, tig_users
where (pkey = _tkey) AND (sha1_user_id = sha1(lower('db-properties')))
AND (tig_pairs.uid = tig_users.uid);
return (_result);
end //
-- QUERY END:
-- QUERY START:
-- DEPRECATED | The initialization of the database.
-- The procedure should be called manually somehow before starting the
-- server. In theory the server could call the procedure automatically
-- at the startup time but I don't know yet how to solve the problem
-- with multiple cluster nodes starting at later time when the server
-- is already running.
create procedure TigInitdb()
begin
update tig_users set online_status = 0;
end //
-- QUERY END:
-- QUERY START:
-- Add a new user to the database assuming the user password is already
-- encoded properly according to the database settings.
-- If password is not encoded TigAddUserPlainPw should be used instead.
create procedure TigAddUser(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8)
begin
declare res_uid bigint unsigned;
insert into tig_users (user_id, sha1_user_id, user_pw)
values (_user_id, sha1(lower(_user_id)), _user_pw);
select LAST_INSERT_ID() into res_uid;
insert into tig_nodes (parent_nid, uid, node)
values (NULL, res_uid, 'root');
if _user_pw is NULL then
update tig_users set account_status = -1 where uid = res_uid;
end if;
select res_uid as uid;
end //
-- QUERY END:
-- QUERY START:
-- Low level database user id as big number. Used only for performance reasons
-- and save database space. Besides JID is too large to server as UID
create procedure TigGetUserDBUid(_user_id varchar(2049) CHARSET utf8)
begin
select uid from tig_users where sha1_user_id = sha1(lower(_user_id));
end //
-- QUERY END:
-- QUERY START:
-- Variant of TigUpdatePasswordPlainPw SP with parameters in reverse order.
-- Some implementations require the parameters to be in the same order as
-- the update query.
create procedure TigUpdatePasswordPlainPwRev(_user_pw varchar(255) CHARSET utf8, _user_id varchar(2049) CHARSET utf8)
begin
call TigUpdatePasswordPlainPw(_user_id, _user_pw);
end //
-- QUERY END:
-- QUERY START:
-- Update user password
create procedure TigUpdatePassword(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8)
begin
update tig_users set user_pw = _user_pw where sha1_user_id = sha1(lower(_user_id));
end //
-- QUERY END:
-- QUERY START:
-- DEPRECATED | List all online users
create procedure TigOnlineUsers()
begin
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from tig_users where online_status > 0;
end //
-- QUERY END:
-- QUERY START:
-- DEPRECATED | List all offline users
create procedure TigOfflineUsers()
begin
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from tig_users where online_status = 0;
end //
-- QUERY END:
-- QUERY START:
-- List of all users in database
create procedure TigAllUsers()
begin
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from tig_users;
end //
-- QUERY END:
-- QUERY START:
-- All users count
create procedure TigAllUsersCount()
begin
select count(*) from tig_users;
end //
-- QUERY END:
-- QUERY START:
-- DEPRECATED | Perforrm user login. It returns user_id uppon success and NULL
-- on failure.
-- If the login is successful it also increases online_status and sets
-- last_login time to the current timestamp
create procedure TigUserLogin(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8)
begin
if exists(select 1 from tig_users
where (account_status > 0) AND (sha1_user_id = sha1(lower(_user_id))) AND (user_pw = _user_pw) AND (user_id = _user_id))
then
update tig_users
set online_status = online_status + 1, last_login = CURRENT_TIMESTAMP
where sha1_user_id = sha1(lower(_user_id));
select _user_id as user_id;
else
update tig_users set failed_logins = failed_logins + 1 where sha1_user_id = sha1(lower(_user_id));
select NULL as user_id;
end if;
end //
-- QUERY END:
-- QUERY START:
-- It decreases online_status and sets last_logout time to the current timestamp
create procedure TigUserLogout(_user_id varchar(2049) CHARSET utf8)
begin
update tig_users
set online_status = greatest(online_status - 1, 0),
last_logout = CURRENT_TIMESTAMP
where sha1_user_id = sha1(lower(_user_id));
end //
-- QUERY END:
-- QUERY START:
-- Disable user account
create procedure TigDisableAccount(_user_id varchar(2049) CHARSET utf8)
begin
update tig_users set account_status = 0 where sha1_user_id = sha1(lower(_user_id));
end //
-- QUERY END:
-- QUERY START:
-- Enable user account
create procedure TigEnableAccount(_user_id varchar(2049) CHARSET utf8)
begin
update tig_users set account_status = 1 where sha1_user_id = sha1(lower(_user_id));
end //
-- QUERY END:
-- QUERY START:
-- Get list of all active user accounts
create procedure TigActiveAccounts()
begin
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from tig_users where account_status > 0;
end //
-- QUERY END:
-- QUERY START:
-- Get list of all disabled user accounts
create procedure TigDisabledAccounts()
begin
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from tig_users where account_status = 0;
end //
-- QUERY END:
-- QUERY START:
-- Helper procedure for adding a new node
create procedure TigAddNode(_parent_nid bigint, _uid bigint, _node varchar(255) CHARSET utf8)
begin
if exists(SELECT 1 FROM tig_nodes WHERE parent_nid = _parent_nid AND uid = _uid AND node = _node) then
SELECT nid FROM tig_nodes WHERE parent_nid = _parent_nid AND uid = _uid AND node = _node;
ELSEIF exists(SELECT 1 FROM tig_nodes WHERE _parent_nid is null AND uid = _uid AND 'root' = _node) then
SELECT nid FROM tig_nodes WHERE uid = _uid AND node = _node;
ELSE
insert into tig_nodes (parent_nid, uid, node) values (_parent_nid, _uid, _node);
select LAST_INSERT_ID() as nid;
END IF;
end //
-- QUERY END:
delimiter ;
-- QUERY START:
drop procedure if exists TigUpdateLoginTime;
-- QUERY END:
delimiter //
-- QUERY START:
-- It sets last_login time to the current timestamp
create procedure TigUpdateLoginTime(_user_id varchar(2049) charset utf8mb4 )
begin
update tig_users
set last_login = CURRENT_TIMESTAMP
where sha1_user_id = sha1(lower(_user_id));
end //
-- QUERY END:
delimiter ;
-- QUERY START:
drop procedure if exists TigUpdatePairs;
-- QUERY END:
delimiter //
-- QUERY START:
-- Procedure to efficiently and safely update data in tig_pairs table
create procedure TigUpdatePairs(_nid bigint, _uid bigint, _tkey varchar(255) CHARSET utf8, _tval mediumtext CHARSET utf8mb4)
begin
if exists(SELECT 1 FROM tig_pairs WHERE nid = _nid AND uid = _uid AND pkey = _tkey)
then
UPDATE tig_pairs SET pval = _tval WHERE nid = _nid AND uid = _uid AND pkey = _tkey;
ELSE
INSERT INTO tig_pairs (nid, uid, pkey, pval) VALUES (_nid, _uid, _tkey, _tval);
END IF;
end //
-- QUERY END:
delimiter ;
-- QUERY START:
drop procedure if exists Tig_OfflineMessages_AddMessage;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_OfflineMessages_GetMessages;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_OfflineMessages_GetMessagesByIds;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_OfflineMessages_GetMessagesCount;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_OfflineMessages_ListMessages;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_OfflineMessages_DeleteMessages;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_OfflineMessages_DeleteMessagesByIds;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_OfflineMessages_DeleteMessage;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_OfflineMessages_GetExpiredMessages;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_OfflineMessages_GetExpiredMessagesBefore;
-- QUERY END:
delimiter //
-- QUERY START:
create procedure Tig_OfflineMessages_AddMessage(_to varchar(2049) charset utf8, _from varchar(2049) charset utf8, _type int, _ts timestamp(6), _message mediumtext charset utf8mb4, _expired timestamp(6), _limit bigint)
begin
declare msg_count bigint;
set msg_count = 0;
if _limit > 0 then
select count(msg_id) into msg_count from tig_offline_messages where receiver_sha1 = sha1(lower(_to)) and sender_sha1 = sha1(lower(_from));
end if;
if _limit = 0 or _limit > msg_count then
insert into tig_offline_messages ( receiver, receiver_sha1, sender, sender_sha1, msg_type, ts, message, expired )
values ( _to, sha1(lower(_to)), _from, sha1(lower(_from)), _type, _ts, _message, _expired );
select last_insert_id() as msg_id;
else
select null as msg_id;
end if;
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_OfflineMessages_GetMessages(_to varchar(2049) charset utf8)
begin
select message, msg_id
from tig_offline_messages
where receiver_sha1 = sha1(lower(_to));
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_OfflineMessages_GetMessagesByIds(_to varchar(2049) charset utf8, _msg_id1 varchar(50) charset utf8, _msg_id2 varchar(50) charset utf8, _msg_id3 varchar(50) charset utf8, _msg_id4 varchar(50) charset utf8)
begin
select message, msg_id
from tig_offline_messages
where receiver_sha1 = sha1(lower(_to))
and (
(_msg_id1 is not null and msg_id = _msg_id1)
or (_msg_id2 is not null and msg_id = _msg_id2)
or (_msg_id3 is not null and msg_id = _msg_id3)
or (_msg_id4 is not null and msg_id = _msg_id4)
);
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_OfflineMessages_GetMessagesCount(_to varchar(2049) charset utf8)
begin
select msg_type , count(msg_type)
from tig_offline_messages
where receiver_sha1 = sha1(lower(_to))
group by msg_type;
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_OfflineMessages_ListMessages(_to varchar(2049) charset utf8)
begin
select msg_id, msg_type, sender
from tig_offline_messages
where receiver_sha1 = sha1(lower(_to));
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_OfflineMessages_DeleteMessages(_to varchar(2049) charset utf8)
begin
delete from tig_offline_messages where receiver_sha1 = sha1(lower(_to));
select row_count() as deleted_rows;
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_OfflineMessages_DeleteMessagesByIds(_to varchar(2049) charset utf8, _msg_id1 varchar(50) charset utf8, _msg_id2 varchar(50) charset utf8, _msg_id3 varchar(50) charset utf8, _msg_id4 varchar(50) charset utf8)
begin
delete from tig_offline_messages
where receiver_sha1 = sha1(lower(_to))
and (
(_msg_id1 is not null and msg_id = _msg_id1)
or (_msg_id2 is not null and msg_id = _msg_id2)
or (_msg_id3 is not null and msg_id = _msg_id3)
or (_msg_id4 is not null and msg_id = _msg_id4)
);
select row_count() as deleted_rows;
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_OfflineMessages_DeleteMessage(_msg_id bigint)
begin
delete from tig_offline_messages where msg_id = _msg_id;
select row_count() as deleted_rows;
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_OfflineMessages_GetExpiredMessages(_limit int)
begin
select msg_id, expired, message
from tig_offline_messages
where expired is not null
order by expired asc
limit _limit;
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_OfflineMessages_GetExpiredMessagesBefore(_expired timestamp(6))
begin
select msg_id, expired, message
from tig_offline_messages
where expired is not null
and (_expired is null or expired <= _expired)
order by expired asc;
end //
-- QUERY END:
delimiter ;
-- ------------
-- QUERY START:
drop procedure if exists TigUpdateAccountStatus;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigAccountStatus;
-- QUERY END:
delimiter //
-- QUERY START:
-- Set user account status
create procedure TigUpdateAccountStatus(_user_id varchar(2049) CHARSET utf8, _status INT)
begin
update tig_users set account_status = _status where sha1_user_id = sha1(lower(_user_id));
end //
-- QUERY END:
-- QUERY START:
-- Get user account status
create procedure TigAccountStatus(_user_id varchar(2049) CHARSET utf8)
begin
select account_status from tig_users where sha1_user_id = sha1(lower(_user_id));
end //
-- QUERY END:
delimiter ;
-- ------------ Broadcast Messages
-- QUERY START:
drop procedure if exists Tig_BroadcastMessages_AddMessage;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_BroadcastMessages_AddMessageRecipient;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_BroadcastMessages_GetMessages;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_BroadcastMessages_GetMessageRecipients;
-- QUERY END:
delimiter //
-- QUERY START:
create procedure Tig_BroadcastMessages_AddMessage(_msg_id varchar(128), _expired timestamp, _msg mediumtext charset utf8mb4)
begin
start transaction;
insert into tig_broadcast_messages (id, expired, msg)
values (_msg_id, _expired, _msg)
on duplicate key update expired = expired;
commit;
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_BroadcastMessages_AddMessageRecipient(_msg_id varchar(128), _jid varchar(2049))
begin
declare _jid_id bigint;
declare _jid_sha1 char(128);
start transaction;
select jid_id into _jid_id from tig_broadcast_jids where jid_sha1 = sha1(lower(_jid));
if _jid_id is null then
insert into tig_broadcast_jids (jid, jid_sha1)
values (_jid, sha1(lower(_jid)))
on duplicate key update jid_id = LAST_INSERTED_ID(jid_id);
select LAST_INSERTED_ID() into _jid_id;
end if;
insert into tig_broadcast_recipients (msg_id, jid_id)
values (_msg_id, _jid_id)
on duplicate key update jid_id = jid_id;
commit;
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_BroadcastMessages_GetMessages(_expired timestamp(6))
begin
select id, expired, msg
from tig_broadcast_messages
where expired >= _expired;
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_BroadcastMessages_GetMessageRecipients(_msg_id varchar(128))
begin
select j.jid
from tig_broadcast_recipients r
inner join tig_broadcast_jids j on j.jid_id = r.jid_id
where r.msg_id = _msg_id;
end //
-- QUERY END:
delimiter ;
-- ------------- Credentials support
-- QUERY START:
drop procedure if exists TigUserCredential_Update;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUserCredentials_Get;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUserCredential_Remove;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUserLoginPlainPw;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigAddUserPlainPw;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigGetPassword;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUpdatePasswordPlainPw;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigRemoveUser;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUserUsernames_Get;
-- QUERY END:
delimiter //
-- QUERY START:
create procedure TigUserUsernames_Get(_user_id varchar(2049) CHARSET utf8)
begin
declare _user_id_sha1 char(128);
select sha1(lower(_user_id))
into _user_id_sha1;
select distinct
c.username
from tig_users u
inner join tig_user_credentials c on u.uid = c.uid
where
u.sha1_user_id = _user_id_sha1;
end
-- QUERY END:
-- QUERY START:
create procedure TigUserCredential_Update(_user_id varchar(2049) CHARSET utf8, _username varchar(2049) CHARSET utf8, _mechanism varchar(128) CHARSET utf8, _value mediumtext CHARSET utf8)
begin
declare _uid bigint;
declare _user_id_sha1 char(128);
declare _username_sha1 char(128);
select uid into _uid from tig_users where sha1_user_id = sha1(lower(_user_id));
if _uid is not null then
start transaction;
insert into tig_user_credentials (uid, username, username_sha1, mechanism, value)
values (_uid, _username, sha1(_username), _mechanism, _value)
on duplicate key update value = _value;
commit;
end if;
end //
-- QUERY END:
-- QUERY START:
create procedure TigUserCredentials_Get(_user_id varchar(2049) CHARSET utf8, _username varchar(2049) CHARSET utf8)
begin
declare _user_id_sha1 char(128);
select mechanism, value, account_status
from tig_users u
inner join tig_user_credentials c on u.uid = c.uid
where
u.sha1_user_id = sha1(lower(_user_id))
and c.username_sha1 = sha1(_username);
end //
-- QUERY END:
-- QUERY START:
create procedure TigUserCredential_Remove(_user_id varchar(2049) CHARSET utf8, _username varchar(2049) CHARSET utf8)
begin
declare _uid bigint;
declare _user_id_sha1 char(128);
select uid into _uid from tig_users where sha1_user_id = sha1(lower(_user_id));
if _uid is not null then
start transaction;
delete from tig_user_credentials where uid = _uid and username_sha1 = sha1(_username);
commit;
end if;
end //
-- QUERY END:
-- QUERY START:
-- Takes plain text user password and converts it to internal representation
-- and creates a new user account.
create procedure TigAddUserPlainPw(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8)
begin
declare res_uid bigint unsigned;
insert into tig_users (user_id, sha1_user_id)
values (_user_id, sha1(lower(_user_id)));
select LAST_INSERT_ID() into res_uid;
insert into tig_nodes (parent_nid, uid, node)
values (NULL, res_uid, 'root');
if _user_pw is NULL then
update tig_users set account_status = -1 where uid = res_uid;
else
call TigUpdatePasswordPlainPw(_user_id, _user_pw);
end if;
select res_uid as uid;
end //
-- QUERY END:
-- QUERY START:
-- Returns user's password from the database
create procedure TigGetPassword(_user_id varchar(2049) CHARSET utf8)
begin
select c.value
from tig_users u
inner join tig_user_credentials c on c.uid = u.uid
where
u.sha1_user_id = sha1(lower(_user_id))
and c.mechanism = 'PLAIN'
and c.username_sha1 = sha1('default');
end //
-- QUERY END:
-- QUERY START:
create procedure TigUpdatePasswordPlainPw(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8)
begin
declare _passwordEncoding varchar(128) CHARSET utf8;
declare _encodedPassword varchar(255) CHARSET utf8;
select IFNULL(TigGetDBProperty('password-encoding'), 'PLAIN') into _passwordEncoding;
select case _passwordEncoding
when 'MD5-PASSWORD' then
MD5(_user_pw)
when 'MD5-USERID-PASSWORD' then
MD5(CONCAT(_user_id, _user_pw))
when 'MD5-USERNAME-PASSWORD' then
MD5(CONCAT(substring_index(_user_id, '@', 1), _user_pw))
else
_user_pw
end into _encodedPassword;
call TigUserCredential_Update(_user_id, 'default', _passwordEncoding, _encodedPassword);
end //
-- QUERY END:
-- QUERY START:
-- Performs user login for a plain text password, converting it to an internal
-- representation if necessary
create procedure TigUserLoginPlainPw(_user_id varchar(2049) CHARSET utf8, _user_pw varchar(255) CHARSET utf8)
begin
declare _passwordEncoding varchar(128) CHARSET utf8;
declare _encodedPassword varchar(255) CHARSET utf8;
select IFNULL(TigGetDBProperty('password-encoding'), 'PLAIN') into _passwordEncoding;
select case _passwordEncoding
when 'MD5-PASSWORD' then
MD5(_user_pw)
when 'MD5-USERID-PASSWORD' then
MD5(CONCAT(_user_id, _user_pw))
when 'MD5-USERNAME-PASSWORD' then
MD5(CONCAT(substring_index(_user_id, '@', 1), _user_pw))
else
_user_pw
end into _encodedPassword;
if exists(select 1 from tig_users u
inner join tig_user_credentials c on c.uid = u.uid
where (u.account_status > 0) AND (u.sha1_user_id = sha1(lower(_user_id))) AND (u.user_id = _user_id)
AND (c.username_sha1 = sha1('default'))
AND (c.mechanism = _passwordEncoding) AND (c.value = _encodedPassword))
then
update tig_users
set online_status = online_status + 1, last_login = CURRENT_TIMESTAMP
where sha1_user_id = sha1(lower(_user_id));
select _user_id as user_id;
else
update tig_users set failed_logins = failed_logins + 1 where sha1_user_id = sha1(lower(_user_id));
select NULL as user_id;
end if;
end //
-- QUERY END:
-- Removes a user from the database
-- QUERY START:
create procedure TigRemoveUser(_user_id varchar(2049) CHARSET utf8)
begin
declare res_uid bigint unsigned;
select uid into res_uid from tig_users where sha1_user_id = sha1(lower(_user_id));
delete from tig_user_credentials where uid = res_uid;
delete from tig_pairs where uid = res_uid;
delete from tig_nodes where uid = res_uid;
delete from tig_users where uid = res_uid;
end //
-- QUERY END:
delimiter ;
================================================
FILE: src/main/database/mysql-server-8.0.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
source database/mysql-server-8.0.0-schema.sql;
source database/mysql-server-8.0.0-sp.sql;
source database/mysql-server-8.0.0-props.sql;
-- LOAD FILE: database/mysql-server-8.0.0-schema.sql;
-- LOAD FILE: database/mysql-server-8.0.0-sp.sql;
-- LOAD FILE: database/mysql-server-8.0.0-props.sql;
================================================
FILE: src/main/database/mysql-server-8.1.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
select NOW(), ' - Setting schema version to 8.1.0';
-- QUERY START:
call TigSetComponentVersion('server', '8.1.0');
-- QUERY END:
================================================
FILE: src/main/database/mysql-server-8.1.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
source database/mysql-server-8.1.0-props.sql;
-- LOAD FILE: database/mysql-server-8.1.0-props.sql;
--
================================================
FILE: src/main/database/mysql-server-8.2.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
select NOW(), ' - Setting schema version to 8.2.0';
-- QUERY START:
call TigSetComponentVersion('server', '8.2.0');
-- QUERY END:
================================================
FILE: src/main/database/mysql-server-8.2.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
drop procedure if exists TigServerUpgrade;
-- QUERY END:
delimiter //
-- QUERY START:
create procedure TigServerUpgrade()
begin
if exists (select 1 from information_schema.columns where table_schema = database() and table_name = 'tig_users' and column_name = 'online_status') then
alter table tig_users
drop column online_status,
drop column last_logout,
change column last_login last_used timestamp null default null;
end if;
end //
-- QUERY END:
delimiter ;
-- QUERY START:
call TigServerUpgrade();
-- QUERY END:
-- QUERY START:
drop procedure if exists TigServerUpgrade;
-- QUERY END:
delimiter //
-- QUERY START:
create procedure TigServerUpgrade()
begin
if exists(SELECT 1 FROM information_schema.statistics s1 WHERE s1.table_schema = database() AND s1.table_name = 'tig_users' AND s1.index_name = 'online_status') then
drop index online_status on tig_users;
end if;
end //
-- QUERY END:
delimiter ;
-- QUERY START:
call TigServerUpgrade();
-- QUERY END:
-- QUERY START:
drop procedure if exists TigServerUpgrade;
-- QUERY END:
delimiter //
-- QUERY START:
create procedure TigServerUpgrade()
begin
if exists(SELECT 1 FROM information_schema.statistics s1 WHERE s1.table_schema = database() AND s1.table_name = 'tig_users' AND s1.index_name = 'last_login') then
drop index last_login on tig_users;
end if;
end //
-- QUERY END:
delimiter ;
-- QUERY START:
call TigServerUpgrade();
-- QUERY END:
-- QUERY START:
drop procedure if exists TigServerUpgrade;
-- QUERY END:
delimiter //
-- QUERY START:
create procedure TigServerUpgrade()
begin
if exists(SELECT 1 FROM information_schema.statistics s1 WHERE s1.table_schema = database() AND s1.table_name = 'tig_users' AND s1.index_name = 'last_logout') then
drop index last_logout on tig_users;
end if;
end //
-- QUERY END:
delimiter ;
-- QUERY START:
call TigServerUpgrade();
-- QUERY END:
-- QUERY START:
drop procedure if exists TigServerUpgrade;
-- QUERY END:
delimiter //
-- QUERY START:
create procedure TigServerUpgrade()
begin
if exists(SELECT 1 FROM information_schema.statistics s1 WHERE s1.table_schema = database() AND s1.table_name = 'tig_offline_messages' AND s1.index_name = 'tig_offline_messages_receiver_sha1_index') then
drop index tig_offline_messages_receiver_sha1_index on tig_offline_messages;
end if;
end //
-- QUERY END:
delimiter ;
-- QUERY START:
call TigServerUpgrade();
-- QUERY END:
-- QUERY START:
drop procedure if exists TigServerUpgrade;
-- QUERY END:
delimiter //
-- QUERY START:
create procedure TigServerUpgrade()
begin
if exists(select * from information_schema.COLUMNS where TABLE_SCHEMA = database() and TABLE_NAME = 'tig_offline_messages' and COLUMN_NAME = 'sender_sha1' and CHARACTER_MAXIMUM_LENGTH = 128) and exists(select * from information_schema.COLUMNS where TABLE_SCHEMA = database() and TABLE_NAME = 'tig_offline_messages' and COLUMN_NAME = 'receiver_sha1' and CHARACTER_MAXIMUM_LENGTH = 128) then
alter table tig_offline_messages modify column receiver_sha1 char(40) not null, modify column sender_sha1 char(40);
end if;
end //
-- QUERY END:
delimiter ;
-- QUERY START:
call TigServerUpgrade();
-- QUERY END:
-- QUERY START:
drop procedure if exists TigServerUpgrade;
-- QUERY END:
================================================
FILE: src/main/database/mysql-server-8.2.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- database properties are deprecated and are being removed
-- QUERY START:
drop procedure if exists TigPutDBProperty;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUserLogin;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUserLogout;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigOnlineUsers;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigOfflineUsers;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigAllUsers;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUserLoginPlainPw;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUpdateLoginTime;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_OfflineMessages_DeleteMessage;
-- QUERY END:
delimiter //
-- QUERY START:
-- List of all users in database
create procedure TigAllUsers()
begin
select user_id, failed_logins, account_status
from tig_users;
end //
-- QUERY END:
-- QUERY START:
-- It sets last_used time to the current timestamp
create procedure TigUpdateLoginTime(_user_id varchar(2049) charset utf8mb4 )
begin
update tig_users
set last_used = CURRENT_TIMESTAMP
where sha1_user_id = sha1(lower(_user_id));
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_OfflineMessages_DeleteMessage(_msg_id bigint)
begin
delete from tig_offline_messages where msg_id = _msg_id;
end //
-- QUERY END:
delimiter ;
================================================
FILE: src/main/database/mysql-server-8.2.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
source database/mysql-server-8.2.0-schema.sql;
source database/mysql-server-8.2.0-sp.sql;
source database/mysql-server-8.2.0-props.sql;
-- LOAD FILE: database/mysql-server-8.2.0-schema.sql;
-- LOAD FILE: database/mysql-server-8.2.0-sp.sql;
-- LOAD FILE: database/mysql-server-8.2.0-props.sql;
================================================
FILE: src/main/database/mysql-server-8.3.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
select NOW(), ' - Setting schema version to 8.3.0';
-- QUERY START:
call TigSetComponentVersion('server', '8.3.0');
-- QUERY END:
================================================
FILE: src/main/database/mysql-server-8.3.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
--
================================================
FILE: src/main/database/mysql-server-8.3.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- database properties are deprecated and are being removed
================================================
FILE: src/main/database/mysql-server-8.3.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
source database/mysql-server-8.3.0-schema.sql;
source database/mysql-server-8.3.0-sp.sql;
source database/mysql-server-8.3.0-props.sql;
-- LOAD FILE: database/mysql-server-8.3.0-schema.sql;
-- LOAD FILE: database/mysql-server-8.3.0-sp.sql;
-- LOAD FILE: database/mysql-server-8.3.0-props.sql;
================================================
FILE: src/main/database/mysql-server-8.4.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
select NOW(), ' - Setting schema version to 8.3.0';
-- QUERY START:
call TigSetComponentVersion('server', '8.3.0');
-- QUERY END:
================================================
FILE: src/main/database/mysql-server-8.4.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
--
================================================
FILE: src/main/database/mysql-server-8.4.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
drop procedure if exists Tig_BroadcastMessages_AddMessage;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_BroadcastMessages_AddMessageRecipient;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUserCredential_Update;
-- QUERY END:
-- QUERY START:
drop procedure if exists TigUserCredential_Remove;
-- QUERY END:
delimiter //
-- QUERY START:
create procedure Tig_BroadcastMessages_AddMessage(_msg_id varchar(128), _expired timestamp, _msg mediumtext charset utf8mb4)
begin
-- DO NOT REMOVE, required for properly handle exceptions within transactions!
DECLARE exit handler for sqlexception
BEGIN
-- ERROR
ROLLBACK;
RESIGNAL;
END;
start transaction;
insert into tig_broadcast_messages (id, expired, msg)
values (_msg_id, _expired, _msg)
on duplicate key update expired = expired;
commit;
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_BroadcastMessages_AddMessageRecipient(_msg_id varchar(128), _jid varchar(2049))
begin
declare _jid_id bigint;
declare _jid_sha1 char(128);
-- DO NOT REMOVE, required for properly handle exceptions within transactions!
DECLARE exit handler for sqlexception
BEGIN
-- ERROR
ROLLBACK;
RESIGNAL;
END;
start transaction;
select jid_id into _jid_id from tig_broadcast_jids where jid_sha1 = sha1(lower(_jid));
if _jid_id is null then
insert into tig_broadcast_jids (jid, jid_sha1)
values (_jid, sha1(lower(_jid)))
on duplicate key update jid_id = LAST_INSERTED_ID(jid_id);
select LAST_INSERTED_ID() into _jid_id;
end if;
insert into tig_broadcast_recipients (msg_id, jid_id)
values (_msg_id, _jid_id)
on duplicate key update jid_id = jid_id;
commit;
end //
-- QUERY END:
-- QUERY START:
create procedure TigUserCredential_Update(_user_id varchar(2049) CHARSET utf8, _username varchar(2049) CHARSET utf8, _mechanism varchar(128) CHARSET utf8, _value mediumtext CHARSET utf8)
begin
declare _uid bigint;
declare _user_id_sha1 char(128);
declare _username_sha1 char(128);
-- DO NOT REMOVE, required for properly handle exceptions within transactions!
DECLARE exit handler for sqlexception
BEGIN
-- ERROR
ROLLBACK;
RESIGNAL;
END;
select uid into _uid from tig_users where sha1_user_id = sha1(lower(_user_id));
if _uid is not null then
start transaction;
insert into tig_user_credentials (uid, username, username_sha1, mechanism, value)
values (_uid, _username, sha1(_username), _mechanism, _value)
on duplicate key update value = _value;
commit;
end if;
end //
-- QUERY END:
-- QUERY START:
create procedure TigUserCredential_Remove(_user_id varchar(2049) CHARSET utf8, _username varchar(2049) CHARSET utf8)
begin
declare _uid bigint;
declare _user_id_sha1 char(128);
-- DO NOT REMOVE, required for properly handle exceptions within transactions!
DECLARE exit handler for sqlexception
BEGIN
-- ERROR
ROLLBACK;
RESIGNAL;
END;
select uid into _uid from tig_users where sha1_user_id = sha1(lower(_user_id));
if _uid is not null then
start transaction;
delete from tig_user_credentials where uid = _uid and username_sha1 = sha1(_username);
commit;
end if;
end //
-- QUERY END:
================================================
FILE: src/main/database/mysql-server-8.4.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
source database/mysql-server-8.4.0-schema.sql;
source database/mysql-server-8.4.0-sp.sql;
source database/mysql-server-8.4.0-props.sql;
-- LOAD FILE: database/mysql-server-8.4.0-schema.sql;
-- LOAD FILE: database/mysql-server-8.4.0-sp.sql;
-- LOAD FILE: database/mysql-server-8.4.0-props.sql;
================================================
FILE: src/main/database/mysql-server-8.5.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
drop procedure if exists TigServerUpgrade;
-- QUERY END:
delimiter //
-- QUERY START:
create procedure TigServerUpgrade()
begin
if not exists (select 1 from information_schema.STATISTICS where TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'tig_offline_messages' and INDEX_NAME = 'tig_offline_messages_receiver_sha1_msg_type_index') then
create index tig_offline_messages_receiver_sha1_msg_type_index on tig_offline_messages (receiver_sha1, msg_type);
end if;
if exists (select 1 from information_schema.STATISTICS where TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'tig_offline_messages' and INDEX_NAME = 'tig_offline_messages_receiver_sha1_index') then
drop index tig_offline_messages_receiver_sha1_index on tig_offline_messages;
end if;
end //
-- QUERY END:
delimiter ;
-- QUERY START:
call TigServerUpgrade();
-- QUERY END:
-- QUERY START:
drop procedure if exists TigServerUpgrade;
-- QUERY END:
================================================
FILE: src/main/database/mysql-server-8.5.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
drop procedure if exists Tig_OfflineMessages_AddMessage;
-- QUERY END:
-- QUERY START:
drop procedure if exists Tig_OfflineMessages_DeleteMessages;
-- QUERY END:
delimiter //
-- QUERY START:
create procedure Tig_OfflineMessages_AddMessage(_to varchar(2049) charset utf8, _from varchar(2049) charset utf8, _type int, _ts timestamp(6), _message mediumtext charset utf8mb4, _expired timestamp(6), _limit bigint)
begin
declare msg_count bigint;
set msg_count = 0;
if _limit > 0 then
select count(msg_id) into msg_count from tig_offline_messages where receiver_sha1 = sha1(lower(_to)) and sender_sha1 = sha1(lower(_from));
end if;
if _limit = 0 or _limit > msg_count then
insert into tig_offline_messages ( receiver, receiver_sha1, sender, sender_sha1, msg_type, ts, message, expired )
values ( _to, sha1(lower(_to)), _from, sha1(lower(_from)), _type, _ts, _message, _expired );
select 1 as msg_id;
else
select null as msg_id;
end if;
end //
-- QUERY END:
-- QUERY START:
create procedure Tig_OfflineMessages_DeleteMessages(_to varchar(2049) charset utf8)
begin
delete from tig_offline_messages where receiver_sha1 = sha1(lower(_to));
end //
-- QUERY END:
delimiter ;
================================================
FILE: src/main/database/mysql-server-8.5.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
source database/mysql-server-8.5.0-schema.sql;
source database/mysql-server-8.5.0-sp.sql;
-- LOAD FILE: database/mysql-server-8.5.0-schema.sql;
-- LOAD FILE: database/mysql-server-8.5.0-sp.sql;
================================================
FILE: src/main/database/postgresql-common-0.0.1.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
create table if not EXISTS tig_schema_versions (
-- Component Name
component varchar(100) NOT NULL,
-- Version of loaded schema
version varchar(100) NOT NULL,
-- Time when schema was loaded last time
last_update timestamp NOT NULL,
primary key (component)
);
-- QUERY END:
-- QUERY START:
CREATE OR REPLACE FUNCTION TigGetComponentVersion(_component VARCHAR(100))
RETURNS TEXT AS $$
DECLARE _result TEXT;
BEGIN
SELECT version INTO _result FROM tig_schema_versions WHERE (component = _component);
RETURN (_result);
END;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
CREATE OR REPLACE FUNCTION TigSetComponentVersion(_component text, _version text)
RETURNS void AS $$
BEGIN
UPDATE tig_schema_versions SET version = _version, last_update = now() WHERE component = _component;
IF FOUND THEN
RETURN;
END IF;
BEGIN
INSERT INTO tig_schema_versions (component, version, last_update) VALUES (_component, _version, now());
EXCEPTION WHEN OTHERS THEN
UPDATE tig_schema_versions SET version = _version WHERE component = _component;
END;
RETURN;
END;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
================================================
FILE: src/main/database/postgresql-common-0.0.2.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
update tig_schema_versions
set version = version || '-SNAPSHOT'
where exists (
select 1
from tig_schema_versions
where
component = 'common'
and version = '0.0.1'
) and version not like '%-SNAPSHOT%';
-- QUERY END:
================================================
FILE: src/main/database/postgresql-common-0.0.3.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
================================================
FILE: src/main/database/postgresql-counter_data_logger-0.0.1.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
create table tig_stats_log (
lid serial,
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
hostname varchar(2049) NOT NULL,
cpu_usage double precision not null default 0,
mem_usage double precision not null default 0,
uptime bigint not null default 0,
vhosts int not null default 0,
sm_packets bigint not null default 0,
muc_packets bigint not null default 0,
pubsub_packets bigint not null default 0,
c2s_packets bigint not null default 0,
s2s_packets bigint not null default 0,
ext_packets bigint not null default 0,
presences bigint not null default 0,
messages bigint not null default 0,
iqs bigint not null default 0,
registered bigint not null default 0,
c2s_conns int not null default 0,
s2s_conns int not null default 0,
bosh_conns int not null default 0,
primary key (ts, hostname(255))
);
-- QUERY END:
-- QUERY START:
do $$
begin
if not exists (select 1 from information_schema.columns where table_catalog = current_database() and table_schema = 'public' and table_name = 'tig_stats_log' and column_name = 'ws2s_conns') then
ALTER TABLE tig_stats_log ADD `ws2s_conns` INT not null default 0;
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if not exists (select 1 from information_schema.columns where table_catalog = current_database() and table_schema = 'public' and table_name = 'tig_stats_log' and column_name = 'ws2s_packets') then
ALTER TABLE tig_stats_log ADD `ws2s_packets` INT not null default 0;
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if not exists (select 1 from information_schema.columns where table_catalog = current_database() and table_schema = 'public' and table_name = 'tig_stats_log' and column_name = 'sm_sessions') then
ALTER TABLE tig_stats_log ADD `sm_sessions` INT not null default 0;
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if not exists (select 1 from information_schema.columns where table_catalog = current_database() and table_schema = 'public' and table_name = 'tig_stats_log' and column_name = 'sm_connections') then
ALTER TABLE tig_stats_log ADD `sm_connections` INT not null default 0;
end if;
end$$;
-- QUERY END:
================================================
FILE: src/main/database/postgresql-installer-create-db.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START: create database
create database ${dbName};
-- QUERY END: create database
-- QUERY START: add user
do $$
begin
IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = '${dbUser}') THEN
create user ${dbUser} with password '${dbPass}';
end if;
end$$;
-- QUERY END: add user
-- QUERY START: GRANT ALL
GRANT ALL ON database ${dbName} TO ${dbUser};
-- QUERY END: GRANT ALL
-- QUERY START: ALTER DATABASE
ALTER DATABASE ${dbName} OWNER TO ${dbUser};
-- QUERY END: ALTER DATABASE
-- QUERY START: Install uuid extension
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- QUERY END: Install uuid extension
================================================
FILE: src/main/database/postgresql-installer-post.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- Permissions fix
-- QUERY START: ALTER SCHEMA
ALTER SCHEMA public OWNER TO ${dbUser};
-- QUERY END: ALTER SCHEMA
-- QUERY START: GRANT ALL ON ALL TABLES
GRANT ALL ON ALL TABLES IN SCHEMA public TO ${dbUser};
-- QUERY END: GRANT ALL ON ALL TABLES
-- QUERY START: GRANT ALL ON ALL FUNCTIONS
GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO ${dbUser};
-- QUERY END: GRANT ALL ON ALL FUNCTIONS
-- QUERY START: GRANT ALL ON ALL SEQUENCES
GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO ${dbUser};
-- QUERY END: GRANT ALL ON ALL SEQUENCES
================================================
FILE: src/main/database/postgresql-server-8.0.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
select now(), ' - Setting schema version to 8.0.0';
-- QUERY START:
select TigSetComponentVersion('server', '8.0.0');
-- QUERY END:
================================================
FILE: src/main/database/postgresql-server-8.0.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
create table if not exists tig_users (
uid bigserial,
-- Jabber User ID
user_id varchar(2049) NOT NULL,
-- User password encrypted or not
user_pw varchar(255) default NULL,
-- Time the account has been created
acc_create_time timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
-- Time of the last user login
last_login timestamp with time zone,
-- Time of the last user logout
last_logout timestamp with time zone,
-- User online status, if > 0 then user is online, the value
-- indicates the number of user connections.
-- It is incremented on each user login and decremented on each
-- user logout.
online_status int default 0,
-- Number of failed login attempts
failed_logins int default 0,
-- User status, whether the account is active or disabled
-- >0 - account active, 0 - account disabled
account_status int default 1,
primary key (uid)
);
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.user_id') is null then
create unique index user_id on tig_users ( lower(user_id) );
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.user_pw') is null then
create index user_pw on tig_users (user_pw);
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.last_login') is null then
create index last_login on tig_users (last_login);
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.last_logout') is null then
create index last_logout on tig_users (last_logout);
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.account_status') is null then
create index account_status on tig_users (account_status);
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.online_status') is null then
create index online_status on tig_users (online_status);
end if;
end$$;
-- QUERY END:
-- QUERY START:
create table if not exists tig_nodes (
nid bigserial,
parent_nid bigint,
uid bigint NOT NULL references tig_users(uid),
node varchar(255) NOT NULL,
primary key (nid)
);
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.tnode') is null then
create unique index tnode on tig_nodes ( parent_nid, uid, node );
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.node') is null then
create index node on tig_nodes ( node );
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.nuid') is null then
create index nuid on tig_nodes (uid);
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.parent_nid') is null then
create index parent_nid on tig_nodes (parent_nid);
end if;
end$$;
-- QUERY END:
-- QUERY START:
create table if not exists tig_pairs (
pid BIGSERIAL PRIMARY KEY,
nid bigint references tig_nodes(nid),
uid bigint NOT NULL references tig_users(uid),
pkey varchar(255) NOT NULL,
pval text
);
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.pkey') is null then
create index pkey on tig_pairs ( pkey );
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.puid') is null then
create index puid on tig_pairs (uid);
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.pnid') is null then
create index pnid on tig_pairs (nid);
end if;
end$$;
-- QUERY END:
-- QUERY START:
create table if not exists tig_offline_messages (
msg_id bigserial,
ts timestamp with time zone default now(),
expired timestamp with time zone,
sender varchar(2049),
receiver varchar(2049) not null,
msg_type int not null default 0,
message text not null,
primary key(msg_id)
);
-- QUERY END:
-- QUERY START:
create table if not exists tig_broadcast_messages (
id varchar(128) not null,
expired timestamp with time zone not null,
msg text not null,
primary key (id)
);
-- QUERY END:
-- QUERY START:
create table if not exists tig_broadcast_jids (
jid_id bigserial,
jid varchar(2049) not null,
primary key (jid_id)
);
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.tig_broadcast_jids_jid') is null then
create index tig_broadcast_jids_jid on tig_broadcast_jids (lower(jid));
end if;
end$$;
-- QUERY END:
-- QUERY START:
create table if not exists tig_broadcast_recipients (
msg_id varchar(128) not null references tig_broadcast_messages(id),
jid_id bigint not null references tig_broadcast_jids(jid_id),
primary key (msg_id, jid_id)
);
-- QUERY END:
-- QUERY START:
do $$
begin
if to_regclass('public.tig_offline_messages_expired') is null then
create index tig_offline_messages_expired on tig_offline_messages (expired);
end if;
if to_regclass('public.tig_offline_messages_receiver') is null then
create index tig_offline_messages_receiver on tig_offline_messages (lower(receiver));
end if;
if to_regclass('public.tig_offline_messages_receiver_sender') is null then
create index tig_offline_messages_receiver_sender on tig_offline_messages (lower(receiver), lower(sender));
end if;
end$$;
-- QUERY END:
-- QUERY START:
create table if not exists tig_cluster_nodes (
hostname varchar(512) not null,
secondary varchar(512),
password varchar(255) not null,
last_update timestamp with time zone default current_timestamp,
port int,
cpu_usage double precision not null,
mem_usage double precision not null,
primary key (hostname)
);
-- QUERY END:
-- ------------- Credentials support
-- QUERY START:
create table if not exists tig_user_credentials (
uid bigint not null references tig_users(uid),
username varchar(2049) not null,
mechanism varchar(128) not null,
value text not null,
primary key (uid, username, mechanism)
);
-- QUERY END:
================================================
FILE: src/main/database/postgresql-server-8.0.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
CREATE OR REPLACE FUNCTION public.create_plpgsql_language ()
RETURNS TEXT
AS $$
CREATE LANGUAGE plpgsql;
SELECT 'language plpgsql created'::TEXT;
$$
LANGUAGE 'sql';
SELECT CASE WHEN
(SELECT true::BOOLEAN
FROM pg_language
WHERE lanname='plpgsql')
THEN
(SELECT 'language already installed'::TEXT)
ELSE
(SELECT public.create_plpgsql_language())
END;
DROP FUNCTION public.create_plpgsql_language ();
-- QUERY END:
-- QUERY START:
-- Database properties get - function
create or replace function TigGetDBProperty(varchar(255)) returns text as '
declare
_result text;
_tkey alias for $1;
begin
select pval into _result from tig_pairs, tig_users
where (pkey = _tkey) AND (lower(user_id) = lower(''db-properties''))
AND (tig_pairs.uid = tig_users.uid);
return _result;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- The initialization of the database.
-- The procedure should be called manually somehow before starting the
-- server. In theory the server could call the procedure automatically
-- at the startup time but I don't know yet how to solve the problem
-- with multiple cluster nodes starting at later time when the server
-- is already running.
create or replace function TigInitdb() returns void as '
begin
update tig_users set online_status = 0;
return;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- Add a new user to the database assuming the user password is already
-- encoded properly according to the database settings.
-- If password is not encoded TigAddUserPlainPw should be used instead.
create or replace function TigAddUser(varchar(2049), varchar(255))
returns bigint as '
declare
_user_id alias for $1;
_user_pw alias for $2;
_res_uid bigint;
begin
if exists( select uid from tig_users where
(lower(user_id) = lower(_user_id)) AND (user_pw = _user_pw) )
then
return null;
else
insert into tig_users (user_id, user_pw)
values (_user_id, _user_pw);
select currval(''tig_users_uid_seq'') into _res_uid;
insert into tig_nodes (parent_nid, uid, node)
values (NULL, _res_uid, ''root'');
return _res_uid as uid;
end if;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- Low level database user id as big number. Used only for performance reasons
-- and save database space. Besides JID is too large to server as UID
create or replace function TigGetUserDBUid(varchar(2049)) returns bigint as '
declare
_user_id alias for $1;
res_uid bigint;
begin
select uid into res_uid from tig_users where lower(user_id) = lower(_user_id);
return res_uid;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- Variant of TigUpdatePasswordPlainPw SP with parameters in reverse order.
-- Some implementations require the parameters to be in the same order as
-- the update query.
create or replace function TigUpdatePasswordPlainPwRev(varchar(255), varchar(2049))
returns void as '
declare
_user_pw alias for $1;
_user_id alias for $2;
begin
perform TigUpdatePasswordPlainPw(_user_id, _user_pw);
return;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- Update user password
create or replace function TigUpdatePassword(varchar(2049), varchar(255))
returns void as '
declare
_user_id alias for $1;
_user_pw alias for $2;
begin
update tig_users set user_pw = _user_pw where lower(user_id) = lower(_user_id);
return;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- List all online users
create or replace function TigOnlineUsers() returns void as '
begin
return;
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from tig_users where online_status > 0;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- List all offline users
create or replace function TigOfflineUsers() returns void as '
begin
return;
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from tig_users where online_status = 0;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- List of all users in database
create or replace function TigAllUsers() returns setof varchar(2049) as
'select user_id from tig_users;'
LANGUAGE 'sql';
-- create or replace function TigAllUsers() returns void as '
-- begin
-- return;
-- select user_id, last_login, last_logout, online_status, failed_logins, account_status
-- from tig_users;
-- end;
-- ' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- All users count
create or replace function TigAllUsersCount() returns bigint as '
declare
res_cnt bigint;
begin
select count(*) into res_cnt from tig_users;
return res_cnt;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- Perforrm user login. It returns user_id uppon success and NULL
-- on failure.
-- If the login is successful it also increases online_status and sets
-- last_login time to the current timestamp
create or replace function TigUserLogin(varchar(2049), varchar(255))
returns varchar(2049) as '
declare
_user_id alias for $1;
_user_pw alias for $2;
res_user_id varchar(2049);
begin
if exists(select user_id from tig_users
where (account_status > 0) AND (lower(user_id) = lower(_user_id)) AND (user_pw = _user_pw))
then
update tig_users
set online_status = online_status + 1, last_login = now()
where lower(user_id) = lower(_user_id);
select _user_id into res_user_id;
else
update tig_users set failed_logins = failed_logins + 1 where lower(user_id) = lower(_user_id);
select NULL into res_user_id;
end if;
return res_user_id;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- It decreases online_status and sets last_logout time to the current timestamp
create or replace function TigUserLogout(varchar(2049)) returns void as '
declare
_user_id alias for $1;
begin
update tig_users
set online_status = greatest(online_status - 1, 0),
last_logout = now()
where lower(user_id) = lower(_user_id);
return;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- Disable user account
create or replace function TigDisableAccount(varchar(2049)) returns void as '
declare
_user_id alias for $1;
begin
update tig_users set account_status = 0 where lower(user_id) = lower(_user_id);
return;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- Enable user account
create or replace function TigEnableAccount(varchar(2049)) returns void as '
declare
_user_id alias for $1;
begin
update tig_users set account_status = 1 where lower(user_id) = lower(_user_id);
return;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- Get list of all active user accounts
create or replace function TigActiveAccounts() returns void as '
begin
return;
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from tig_users where account_status > 0;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- Helper procedure for adding a new node
create or replace function TigAddNode(bigint, bigint, varchar(255))
returns bigint as '
declare
_parent_nid alias for $1;
_uid alias for $2;
_node alias for $3;
res_nid bigint;
begin
insert into tig_nodes (parent_nid, uid, node)
values (_parent_nid, _uid, _node);
select currval(''tig_nodes_nid_seq'') into res_nid;
return res_nid;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function TigUsers2Ver4Convert() returns void as '
declare
user_row RECORD;
begin
for user_row in
select user_id, pval as password
from tig_users, tig_pairs
where tig_users.uid = tig_pairs.uid and pkey = ''password'' loop
perform TigUpdatePasswordPlainPw(user_row.user_id, user_row.password);
END LOOP;
return;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function TigUpdatePairs(bigint, bigint, varchar(255), text) returns void as '
declare
_nid alias for $1;
_uid alias for $2;
_tkey alias for $3;
_tval alias for $4;
begin
if exists(select 1 from tig_pairs where nid = _nid and uid = _uid and pkey = _tkey)
then
update tig_pairs set pval = _tval where nid = _nid and uid = _uid and pkey = _tkey;
else
insert into tig_pairs (nid, uid, pkey, pval) values (_nid, _uid, _tkey, _tval);
end if;
return;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
-- It sets last_login time to the current timestamp
create or replace function TigUpdateLoginTime(varchar(2049)) returns void as $$
declare
_user_id alias for $1;
begin
update tig_users
set last_login = now()
where lower(user_id) = lower(_user_id);
return;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
do $$
begin
if exists( select 1 from pg_proc where proname = 'tigdisabledaccounts' and pg_get_function_result(oid) = 'TABLE(user_id character varying, last_login timestamp without time zone, last_logout timestamp without time zone, online_status integer, failed_logins integer, account_status integer)') then
drop function TigDisabledAccounts();
end if;
end$$;
-- QUERY END:
-- QUERY START:
-- Get list of all disabled user accounts
create or replace function TigDisabledAccounts() returns table(user_id varchar(2049), last_login timestamp with time zone, last_logout timestamp with time zone, online_status int, failed_logins int, account_status int) as '
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from tig_users where account_status = 0;
' LANGUAGE 'sql';
-- QUERY END:
-- ------------ Offline Messages
-- QUERY START:
do $$
begin
if exists( select 1 from pg_proc where proname = lower('Tig_OfflineMessages_AddMessage') and pg_get_function_arguments(oid) = '_to character varying, _from character varying, _type integer, _ts timestamp without time zone, _message text, _expired timestamp without time zone, _limit bigint') then
drop function Tig_OfflineMessages_AddMessage(_to character varying, _from character varying, _type integer, _ts timestamp without time zone, _message text, _expired timestamp without time zone, _limit bigint);
end if;
end$$;
-- QUERY END:
-- QUERY START:
create or replace function Tig_OfflineMessages_AddMessage(_to varchar(2049), _from varchar(2049), _type int, _ts timestamp with time zone, _message text, _expired timestamp with time zone, _limit bigint) returns bigint as $$
declare
_msg_count bigint;
_msg_id bigint;
begin
perform _msg_count = 0;
if _limit > 0 then
select count(msg_id) into _msg_count from tig_offline_messages where lower(receiver) = lower(_to) and lower(sender) = lower(_from);
end if;
if _limit = 0 or _limit > _msg_count then
with inserted_msg as (
insert into tig_offline_messages ( receiver, sender, msg_type, ts, message, expired )
values ( _to, _from, _type, _ts, _message, _expired )
returning msg_id
)
select msg_id into _msg_id from inserted_msg;
end if;
return _msg_id;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function Tig_OfflineMessages_GetMessages(_to varchar(2049)) returns table(
"message" text, "msg_id" bigint
) as $$
begin
return query select om.message, om.msg_id
from tig_offline_messages om
where lower(om.receiver) = lower(_to);
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function Tig_OfflineMessages_GetMessagesByIds(_to varchar(2049), _msg_id1 varchar(50), _msg_id2 varchar(50), _msg_id3 varchar(50), _msg_id4 varchar(50)) returns table(
"message" text, "msg_id" bigint
) as $$
begin
return query select om.message, om.msg_id
from tig_offline_messages om
where lower(om.receiver) = lower(_to)
and (
(_msg_id1 is not null and om.msg_id = cast(_msg_id1 as bigint))
or (_msg_id2 is not null and om.msg_id = cast(_msg_id2 as bigint))
or (_msg_id3 is not null and om.msg_id = cast(_msg_id3 as bigint))
or (_msg_id4 is not null and om.msg_id = cast(_msg_id4 as bigint))
);
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function Tig_OfflineMessages_GetMessagesCount(_to varchar(2049)) returns table(
"msg_type" int, "count" bigint
) as $$
begin
return query select om.msg_type, count(om.msg_type)
from tig_offline_messages om
where lower(om.receiver) = lower(_to)
group by om.msg_type;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function Tig_OfflineMessages_ListMessages(_to varchar(2049)) returns table(
"msg_id" bigint, "msg_type" int, "sender" varchar(2049)
) as $$
begin
return query select om.msg_id, om.msg_type, om.sender
from tig_offline_messages om
where lower(om.receiver) = lower(_to);
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function Tig_OfflineMessages_DeleteMessages(_to varchar(2049)) returns bigint as $$
declare _deleted bigint;
begin
with deleted as (
delete from tig_offline_messages where lower(receiver) = lower(_to)
returning msg_id
)
select count(msg_id) into _deleted from deleted;
return _deleted;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function Tig_OfflineMessages_DeleteMessagesByIds(_to varchar(2049), _msg_id1 varchar(50), _msg_id2 varchar(50), _msg_id3 varchar(50), _msg_id4 varchar(50)) returns bigint as $$
declare _deleted bigint;
begin
with deleted as (
delete from tig_offline_messages
where lower(receiver) = lower(_to)
and (
(_msg_id1 is not null and msg_id = cast(_msg_id1 as bigint))
or (_msg_id2 is not null and msg_id = cast(_msg_id2 as bigint))
or (_msg_id3 is not null and msg_id = cast(_msg_id3 as bigint))
or (_msg_id4 is not null and msg_id = cast(_msg_id4 as bigint))
)
returning msg_id
)
select count(msg_id) into _deleted from deleted;
return _deleted;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function Tig_OfflineMessages_DeleteMessage(_msg_id bigint) returns bigint as $$
declare _deleted bigint;
begin
with deleted as (
delete from tig_offline_messages where msg_id = _msg_id
returning msg_id
)
select count(msg_id) into _deleted from deleted;
return _deleted;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
do $$
begin
if exists( select 1 from pg_proc where proname = lower('Tig_OfflineMessages_GetExpiredMessages') and pg_get_function_result(oid) = 'TABLE(msg_id bigint, expired timestamp without time zone, message text)') then
drop function Tig_OfflineMessages_GetExpiredMessages(int);
end if;
end$$;
-- QUERY END:
-- QUERY START:
create or replace function Tig_OfflineMessages_GetExpiredMessages(_limit int) returns table(
"msg_id" bigint, "expired" timestamp with time zone, "message" text
) as $$
begin
return query select om.msg_id, om.expired, om.message
from tig_offline_messages om
where om.expired is not null
order by om.expired asc
limit _limit;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
do $$
begin
if exists( select 1 from pg_proc where proname = lower('Tig_OfflineMessages_GetExpiredMessagesBefore') and pg_get_function_result(oid) = 'TABLE(msg_id bigint, expired timestamp without time zone, message text)') then
drop function Tig_OfflineMessages_GetExpiredMessagesBefore(timestamp without time zone);
end if;
end$$;
-- QUERY END:
-- QUERY START:
create or replace function Tig_OfflineMessages_GetExpiredMessagesBefore(_expired timestamp with time zone) returns table(
"msg_id" bigint, "expired" timestamp with time zone, "message" text
) as $$
begin
return query select om.msg_id, om.expired, om.message
from tig_offline_messages om
where om.expired is not null
and (_expired is null or om.expired <= _expired)
order by om.expired asc;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- ------------ Broadcast Messages
-- QUERY START:
do $$
begin
if exists( select 1 from pg_proc where proname = lower('Tig_BroadcastMessages_AddMessage') and pg_get_function_arguments(oid) = '_msg_id character varying, _expired timestamp without time zone, _msg text') then
drop function Tig_BroadcastMessages_AddMessage(_msg_id character varying, _expired timestamp without time zone, _msg text);
end if;
end$$;
-- QUERY END:
-- QUERY START:
create or replace function Tig_BroadcastMessages_AddMessage(_msg_id varchar(128), _expired timestamp with time zone, _msg text) returns void
as $$
begin
begin
insert into tig_broadcast_messages (id, expired, msg)
select _msg_id, _expired, _msg
where not exists (
select 1 from tig_broadcast_messages where id = _msg_id
);
exception when unique_violation then
end;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function Tig_BroadcastMessages_AddMessageRecipient(_msg_id varchar(128), _jid varchar(2049)) returns void
as $$
declare _jid_id bigint;
begin
select jid_id into _jid_id from tig_broadcast_jids where lower(jid) = lower(_jid);
if _jid_id is null then
begin
with inserted as (
insert into tig_broadcast_jids (jid)
values (_jid)
returning jid_id
)
select jid_id into _jid_id from inserted;
exception when unique_violation then
select jid_id into _jid_id from tig_broadcast_jids where lower(jid) = lower(_jid);
end;
end if;
begin
insert into tig_broadcast_recipients (msg_id, jid_id)
select _msg_id, _jid_id where not exists (
select 1 from tig_broadcast_recipients br where br.msg_id = _msg_id and br.jid_id = _jid_id
);
exception when unique_violation then
end;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
do $$
begin
if exists( select 1 from pg_proc where proname = lower('Tig_BroadcastMessages_GetMessages') and pg_get_function_arguments(oid) = '_expired timestamp without time zone') then
drop function Tig_BroadcastMessages_GetMessages(_expired timestamp without time zone);
end if;
end$$;
-- QUERY END:
-- QUERY START:
create or replace function Tig_BroadcastMessages_GetMessages(_expired timestamp with time zone) returns table (
id varchar(128),
expired timestamp,
msg text
) as $$
begin
return query select bm.id, bm.expired, bm.msg
from tig_broadcast_messages bm
where bm.expired >= _expired;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function Tig_BroadcastMessages_GetMessageRecipients(_msg_id varchar(128)) returns table (
jid varchar(2049)
) as $$
begin
return query select j.jid
from tig_broadcast_recipients r
inner join tig_broadcast_jids j on j.jid_id = r.jid_id
where r.msg_id = _msg_id;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
CREATE OR REPLACE FUNCTION TigUpdateAccountStatus(_user_id VARCHAR(2049), _status INT)
RETURNS VOID
AS $$
BEGIN
UPDATE tig_users
SET account_status = _status
WHERE lower(user_id) = lower(_user_id);
RETURN;
END;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
CREATE OR REPLACE FUNCTION TigAccountStatus(_user_id VARCHAR(2049))
RETURNS TABLE(status INT)
AS $$
BEGIN
RETURN QUERY SELECT account_status
FROM tig_users
WHERE lower(user_id) = lower(_user_id);
END;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- ------------- Credentials support
-- QUERY START:
create or replace function TigUserCredential_Update(_user_id varchar(2049), _username varchar(2049), _mechanism varchar(128), _value text) returns void
as $$
declare _uid bigint;
begin
select uid into _uid from tig_users where lower(user_id) = lower(_user_id);
if _uid is not null then
update tig_user_credentials set value = _value where uid = _uid and username = _username and mechanism = _mechanism;
insert into tig_user_credentials (uid, username, mechanism, value)
select _uid, _username, _mechanism, _value
where not exists (select 1 from tig_user_credentials where uid = _uid and username = _username and mechanism = _mechanism);
end if;
end;
$$ language 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function TigUserCredentials_Get(_user_id varchar(2049), _username varchar(2049)) returns table (
mechanism varchar(128),
value text,
account_status int
) as $$
begin
return query select c.mechanism, c.value, u.account_status
from tig_users u
inner join tig_user_credentials c on c.uid = u.uid
where
lower(u.user_id) = lower(_user_id)
and c.username = _username;
end;
$$ language 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function TigUserUsernames_Get(_user_id varchar(2049)) returns table (
username varchar(2049)
) as $$
begin
return query select distinct c.username
from tig_users u
inner join tig_user_credentials c on c.uid = u.uid
where
lower(u.user_id) = lower(_user_id);
end;
$$ language 'plpgsql';
-- QUERY END:
-- QUERY START:
create or replace function TigUserCredential_Remove(_user_id varchar(2049), _username varchar(2049)) returns void
as $$
declare _uid bigint;
begin
select uid into _uid from tig_users where lower(user_id) = lower(_user_id);
if _uid is not null then
delete from tig_user_credentials where uid = _uid and username = _username;
end if;
end;
$$ language 'plpgsql';
-- QUERY END:
-- QUERY START:
-- _user_id character varying, _user_pw character varying
-- Add a new user to the database assuming the user password is already
-- encoded properly according to the database settings.
-- If password is not encoded TigAddUserPlainPw should be used instead.
create or replace function TigAddUserPlainPw(_user_id varchar(2049), _user_pw varchar(255))
returns bigint as $$
declare
_res_uid bigint;
begin
insert into tig_users (user_id)
values (_user_id);
select currval('tig_users_uid_seq') into _res_uid;
insert into tig_nodes (parent_nid, uid, node)
values (NULL, _res_uid, 'root');
if _user_pw is null then
update tig_users set account_status = -1 where lower(user_id) = lower(_user_id);
else
perform TigUpdatePasswordPlainPw(_user_id, _user_pw);
end if;
return _res_uid as uid;
end;
$$ language 'plpgsql';
-- QUERY END:
-- QUERY START:
do $$
begin
if exists( select 1 from pg_proc where proname = lower('TigGetPassword') and pg_get_function_result(oid) = 'character varying') then
drop function TigGetPassword(character varying);
end if;
end$$;
-- QUERY END:
-- QUERY START:
-- Returns user's password from the database
create or replace function TigGetPassword(_user_id varchar(2049)) returns text as $$
declare
res_pw text;
begin
select c.value into res_pw
from tig_users u
inner join tig_user_credentials c on c.uid = u.uid
where
lower(u.user_id) = lower(_user_id)
and c.username = 'default'
and c.mechanism = 'PLAIN';
return res_pw;
end;
$$ language 'plpgsql';
-- QUERY END:
-- QUERY START:
-- Takes plain text user password and converts it to internal representation
create or replace function TigUpdatePasswordPlainPw(_user_id varchar(2049), _user_pw varchar(255))
returns void as $$
declare
_passwordEncoding text;
_encodedPassword text;
begin
select coalesce(TigGetDBProperty('password-encoding'), 'PLAIN') into _passwordEncoding;
select
case _passwordEncoding
when 'MD5-PASSWORD' then MD5(_user_pw)
when 'MD5-USERID-PASSWORD' then MD5(_user_id || _user_pw)
when 'MD5-USERNAME-PASSWORD' then MD5(split_part(_user_id, '@', 1) || _user_pw)
else _user_pw
end into _encodedPassword;
perform TigUserCredential_Update(_user_id, 'default', _passwordEncoding, _encodedPassword);
end;
$$ language 'plpgsql';
-- QUERY END:
-- QUERY START:
-- Performs user login for a plain text password, converting it to an internal
-- representation if necessary
create or replace function TigUserLoginPlainPw(_user_id varchar(2049), _user_pw varchar(255))
returns varchar(2049) as $$
declare
_res_user_id varchar(2049);
_passwordEncoding text;
_encodedPassword text;
begin
select coalesce(TigGetDBProperty('password-encoding'), 'PLAIN') into _passwordEncoding;
select
case _passwordEncoding
when 'MD5-PASSWORD' then MD5(_user_pw)
when 'MD5-USERID-PASSWORD' then MD5(_user_id || _user_pw)
when 'MD5-USERNAME-PASSWORD' then MD5(split_part(_user_id, '@', 1) || _user_pw)
else _user_pw
end into _encodedPassword;
select u.user_id into _res_user_id
from tig_users u
inner join tig_user_credentials c on c.uid = u.uid
where
lower(u.user_id) = lower(_user_id)
and c.username = 'default'
and c.mechanism = _passwordEncoding
and c.value = _encodedPassword
and u.account_status > 0;
if _res_user_id is not null then
update tig_users
set online_status = online_status + 1, last_login = now()
where lower(user_id) = lower(_user_id);
else
update tig_users set failed_logins = failed_logins + 1 where lower(user_id) = lower(_user_id);
end if;
return _res_user_id;
end;
$$ language 'plpgsql';
-- QUERY END:
-- QUERY START:
-- Removes a user from the database
create or replace function TigRemoveUser(_user_id varchar(2049)) returns void as $$
declare
res_uid bigint;
begin
select uid into res_uid from tig_users where lower(user_id) = lower(_user_id);
delete from tig_user_credentials where uid = res_uid;
delete from tig_pairs where uid = res_uid;
delete from tig_nodes where uid = res_uid;
delete from tig_users where uid = res_uid;
end;
$$ language 'plpgsql';
-- QUERY END:
-- QUERY START:
-- Database properties set - procedure
create or replace function TigPutDBProperty(varchar(255), text) returns void as '
declare
_tkey alias for $1;
_tval alias for $2;
begin
if exists( select pval from tig_pairs, tig_users where
(lower(user_id) = lower(''db-properties'')) AND (tig_users.uid = tig_pairs.uid)
AND (pkey = _tkey))
then
update tig_pairs set pval = _tval from tig_users
where (lower(tig_users.user_id) = lower(''db-properties''))
AND (tig_users.uid = tig_pairs.uid)
AND (pkey = _tkey);
else
if not exists( select 1 from tig_users where user_id = ''db-properties'' ) then
perform TigAddUserPlainPw(''db-properties'', NULL);
end if;
insert into tig_pairs (pkey, pval, uid, nid)
select _tkey, _tval, tu.uid, tn.nid from tig_users tu left join tig_nodes tn on tn.uid=tu.uid
where (lower(user_id) = lower(''db-properties'') and tn.node=''root'' );
end if;
return;
end;
' LANGUAGE 'plpgsql';
-- QUERY END:
================================================
FILE: src/main/database/postgresql-server-8.0.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
\i database/postgresql-server-8.0.0-schema.sql
\i database/postgresql-server-8.0.0-sp.sql
\i database/postgresql-server-8.0.0-props.sql
-- LOAD FILE: database/postgresql-server-8.0.0-schema.sql
-- LOAD FILE: database/postgresql-server-8.0.0-sp.sql
-- LOAD FILE: database/postgresql-server-8.0.0-props.sql
================================================
FILE: src/main/database/postgresql-server-8.1.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
select now(), ' - Setting schema version to 8.1.0';
-- QUERY START:
select TigSetComponentVersion('server', '8.1.0');
-- QUERY END:
================================================
FILE: src/main/database/postgresql-server-8.1.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
\i database/postgresql-server-8.1.0-props.sql
-- LOAD FILE: database/postgresql-server-8.1.0-props.sql
================================================
FILE: src/main/database/postgresql-server-8.2.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
select now(), ' - Setting schema version to 8.2.0';
-- QUERY START:
select TigSetComponentVersion('server', '8.2.0');
-- QUERY END:
================================================
FILE: src/main/database/postgresql-server-8.2.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
do $$
begin
if exists (select 1 where (select to_regclass('public.last_login')) is not null) then
drop index last_login;
end if;
if exists (select 1 where (select to_regclass('public.last_logout')) is not null) then
drop index last_logout;
end if;
if exists (select 1 where (select to_regclass('public.online_status')) is not null) then
drop index online_status;
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if exists (select 1 from information_schema.columns where table_catalog = current_database() and table_schema = 'public' and table_name = 'tig_users' and column_name = 'last_login') then
alter table tig_users rename column last_login to last_used;
end if;
if exists (select 1 from information_schema.columns where table_catalog = current_database() and table_schema = 'public' and table_name = 'tig_users' and column_name = 'last_logout') then
alter table tig_users drop column last_logout;
end if;
if exists (select 1 from information_schema.columns where table_catalog = current_database() and table_schema = 'public' and table_name = 'tig_users' and column_name = 'online_status') then
alter table tig_users drop column online_status;
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if exists (select 1 where (select to_regclass('public.tig_offline_messages_receiver')) is not null) then
drop index tig_offline_messages_receiver;
end if;
end$$;
-- QUERY END:
================================================
FILE: src/main/database/postgresql-server-8.2.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- database properties are deprecated and are being removed
-- QUERY START:
do $$
begin
if exists( select 1 from pg_proc where proname = lower('TigPutDBProperty')) then
drop function TigPutDBProperty(varchar(255), text);
end if;
end$$;
-- QUERY END:
-- QUERY START:
do $$
begin
if exists( select 1 from pg_proc where proname = lower('TigUserLogin')) then
drop function TigUserLogin(varchar(2049), varchar(255));
end if;
if exists( select 1 from pg_proc where proname = lower('TigUserLogout')) then
drop function TigUserLogout(varchar(2049));
end if;
if exists( select 1 from pg_proc where proname = lower('TigOnlineUsers')) then
drop function TigOnlineUsers();
end if;
if exists( select 1 from pg_proc where proname = lower('TigOfflineUsers')) then
drop function TigOfflineUsers();
end if;
if exists( select 1 from pg_proc where proname = lower('TigUserLoginPlainPw')) then
drop function TigUserLoginPlainPw(varchar(2049), varchar(255));
end if;
end$$;
-- QUERY END:
-- QUERY START:
-- It sets last_login time to the current timestamp
create or replace function TigUpdateLoginTime(varchar(2049)) returns void as $$
declare
_user_id alias for $1;
begin
update tig_users
set last_used = now()
where lower(user_id) = lower(_user_id);
return;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
do $$
begin
if exists( select 1 from pg_proc where proname = lower('Tig_OfflineMessages_DeleteMessage')) then
drop function Tig_OfflineMessages_DeleteMessage(_msg_id bigint);
end if;
end$$;
-- QUERY END:
-- QUERY START:
create function Tig_OfflineMessages_DeleteMessage(_msg_id bigint) returns void as $$
begin
delete from tig_offline_messages where msg_id = _msg_id;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
================================================
FILE: src/main/database/postgresql-server-8.2.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
\i database/postgresql-server-8.2.0-schema.sql
\i database/postgresql-server-8.2.0-sp.sql
\i database/postgresql-server-8.2.0-props.sql
-- LOAD FILE: database/postgresql-server-8.2.0-schema.sql
-- LOAD FILE: database/postgresql-server-8.2.0-sp.sql
-- LOAD FILE: database/postgresql-server-8.2.0-props.sql
================================================
FILE: src/main/database/postgresql-server-8.3.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
select now(), ' - Setting schema version to 8.3.0';
-- QUERY START:
select TigSetComponentVersion('server', '8.3.0');
-- QUERY END:
================================================
FILE: src/main/database/postgresql-server-8.3.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
--
================================================
FILE: src/main/database/postgresql-server-8.3.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- database properties are deprecated and are being removed
================================================
FILE: src/main/database/postgresql-server-8.3.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
\i database/postgresql-server-8.3.0-schema.sql
\i database/postgresql-server-8.3.0-sp.sql
\i database/postgresql-server-8.3.0-props.sql
-- LOAD FILE: database/postgresql-server-8.3.0-schema.sql
-- LOAD FILE: database/postgresql-server-8.3.0-sp.sql
-- LOAD FILE: database/postgresql-server-8.3.0-props.sql
================================================
FILE: src/main/database/postgresql-server-8.4.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
================================================
FILE: src/main/database/postgresql-server-8.5.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
do $$
begin
if exists (select 1 where (select to_regclass('public.tig_offline_messages_receiver_msg_type_index')) is null) then
create index tig_offline_messages_receiver_msg_type_index on tig_offline_messages (lower(receiver), msg_type);
end if;
end$$;
-- QUERY END:
================================================
FILE: src/main/database/postgresql-server-8.5.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
do $$
begin
if exists( select 1 from pg_proc where proname = lower('Tig_OfflineMessages_AddMessage') and pg_get_function_arguments(oid) = '_to character varying, _from character varying, _type integer, _ts timestamp without time zone, _message text, _expired timestamp without time zone, _limit bigint') then
drop function Tig_OfflineMessages_AddMessage(_to character varying, _from character varying, _type integer, _ts timestamp without time zone, _message text, _expired timestamp without time zone, _limit bigint);
end if;
end$$;
-- QUERY END:
-- QUERY START:
create or replace function Tig_OfflineMessages_AddMessage(_to varchar(2049), _from varchar(2049), _type int, _ts timestamp with time zone, _message text, _expired timestamp with time zone, _limit bigint) returns bigint as $$
declare
_msg_count bigint;
_msg_id bigint;
begin
perform _msg_count = 0;
if _limit > 0 then
select count(msg_id) into _msg_count from tig_offline_messages where lower(receiver) = lower(_to) and lower(sender) = lower(_from);
end if;
if _limit = 0 or _limit > _msg_count then
insert into tig_offline_messages ( receiver, sender, msg_type, ts, message, expired )
values ( _to, _from, _type, _ts, _message, _expired )
select 1 into _msg_id from inserted_msg;
end if;
return _msg_id;
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
-- QUERY START:
do $$
begin
if exists( select 1 from pg_proc where proname = lower('Tig_OfflineMessages_DeleteMessages')) then
drop function Tig_OfflineMessages_DeleteMessages(varchar(2049));
end if;
end$$;
-- QUERY END:
-- QUERY START:
create or replace function Tig_OfflineMessages_DeleteMessages(_to varchar(2049)) returns void as $$
begin
delete from tig_offline_messages where lower(receiver) = lower(_to)
end;
$$ LANGUAGE 'plpgsql';
-- QUERY END:
================================================
FILE: src/main/database/postgresql-server-8.5.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
\i database/postgresql-server-8.5.0-schema.sql
\i database/postgresql-server-8.5.0-sp.sql
================================================
FILE: src/main/database/sqlserver-common-0.0.1.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
SET QUOTED_IDENTIFIER ON
-- QUERY END:
GO
-- QUERY START:
IF object_id('dbo.tig_schema_versions') IS NULL
create table [dbo].[tig_schema_versions] (
-- Component Name
[component] [varchar](100) NOT NULL,
-- Version of loaded schema
[version] [varchar](100) NOT NULL,
-- Time when schema was loaded last time
[last_update] [datetime] NOT NULL,
CONSTRAINT [PK_tig_schema_versions] PRIMARY KEY CLUSTERED ( [component] ASC ) ON [PRIMARY]
);
-- QUERY END:
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigSetComponentVersion')
DROP PROCEDURE TigSetComponentVersion
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigGetComponentVersion')
DROP FUNCTION TigGetComponentVersion
-- QUERY END:
GO
-- QUERY START:
create procedure TigGetComponentVersion (@_component nvarchar(255))
AS
begin
SELECT version FROM tig_schema_versions WHERE (component = @_component);
end
-- QUERY END:
GO
-- QUERY START:
create procedure dbo.TigSetComponentVersion @_component nvarchar(255), @_version nvarchar(255)
AS
BEGIN
if exists (select 1 from dbo.tig_schema_versions where (component = @_component))
begin
UPDATE tig_schema_versions SET version = @_version, last_update = getutcdate() WHERE component = @_component;
end
else
begin
INSERT INTO tig_schema_versions (component, version, last_update) VALUES (@_component, @_version, getutcdate());
end
end
-- QUERY END:
GO
================================================
FILE: src/main/database/sqlserver-common-0.0.2.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
SET QUOTED_IDENTIFIER ON
-- QUERY END:
GO
-- QUERY START:
update tig_schema_versions
set version = concat(version, '-SNAPSHOT')
where exists (
select 1
from tig_schema_versions
where
component = 'common'
and version = '0.0.1'
) and version not like '%-SNAPSHOT%';
-- QUERY END:
GO
================================================
FILE: src/main/database/sqlserver-common-0.0.3.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
--
================================================
FILE: src/main/database/sqlserver-counter_data_logger-0.0.1.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
create table tig_stats_log
(
lid [bigint] IDENTITY(1, 1),
ts [datetime] DEFAULT getdate(),
hostname [nvarchar](2049) NOT NULL,
cpu_usage double precision not null default 0,
mem_usage double precision not null default 0,
uptime bigint not null default 0,
vhosts int not null default 0,
sm_packets bigint not null default 0,
muc_packets bigint not null default 0,
pubsub_packets bigint not null default 0,
c2s_packets bigint not null default 0,
s2s_packets bigint not null default 0,
ext_packets bigint not null default 0,
presences bigint not null default 0,
messages bigint not null default 0,
iqs bigint not null default 0,
registered bigint not null default 0,
c2s_conns int not null default 0,
s2s_conns int not null default 0,
bosh_conns int not null default 0,
primary key (ts, hostname)
);
-- QUERY END:
-- QUERY START:
if not exists (select 1 from information_schema.columns where table_schema = database() and table_name = 'tig_stats_log' and column_name = 'ws2s_conns') then
ALTER TABLE tig_stats_log ADD `ws2s_conns` INT not null default 0
end
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from information_schema.columns where table_schema = database() and table_name = 'tig_stats_log' and column_name = 'ws2s_packets') then
ALTER TABLE tig_stats_log ADD `ws2s_packets` INT not null default 0
end
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from information_schema.columns where table_schema = database() and table_name = 'tig_stats_log' and column_name = 'sm_sessions') then
ALTER TABLE tig_stats_log ADD `sm_sessions` INT not null default 0
end
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from information_schema.columns where table_schema = database() and table_name = 'tig_stats_log' and column_name = 'sm_connections') then
ALTER TABLE tig_stats_log ADD `sm_connections` INT not null default 0
end
-- QUERY END:
GO
================================================
FILE: src/main/database/sqlserver-installer-create-db.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START: USE database
USE [master]
-- QUERY END: USE database
GO
-- QUERY START: create database
CREATE DATABASE ${dbName};
-- QUERY END: create database
GO
-- QUERY START: add user
CREATE LOGIN [${dbUser}] WITH PASSWORD=N'${dbPass}', DEFAULT_DATABASE=[${dbName}]
-- QUERY END: add user
GO
-- QUERY START: ALTER DATABASE
IF NOT EXISTS (SELECT name FROM sys.filegroups WHERE is_default=1 AND name = N'PRIMARY') ALTER DATABASE [${dbName}] MODIFY FILEGROUP [PRIMARY] DEFAULT
-- QUERY END: ALTER DATABASE
GO
-- QUERY START: USE DATABASE
USE [${dbName}]
-- QUERY END: USE DATABASE
GO
-- QUERY START: GRANT ALL
CREATE USER [${dbUser}] FOR LOGIN [${dbUser}]
-- QUERY END: GRANT ALL
GO
-- QUERY START: ALTER DATABASE
ALTER USER [${dbUser}] WITH DEFAULT_SCHEMA=[dbo]
-- QUERY END: ALTER DATABASE
GO
-- QUERY START: ALTER DATABASE
ALTER ROLE [db_owner] ADD MEMBER [${dbUser}]
-- QUERY END: ALTER DATABASE
GO
================================================
FILE: src/main/database/sqlserver-installer-post.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START: USE DATABASE
USE [${dbName}]
-- QUERY END: USE DATABASE
GO
-- QUERY START: ALTER DATABASE
ALTER ROLE [db_owner] ADD MEMBER [${dbUser}]
-- QUERY END: ALTER DATABASE
GO
================================================
FILE: src/main/database/sqlserver-server-8.0.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
SET QUOTED_IDENTIFIER ON
-- QUERY END:
GO
select GETDATE(), ' - Setting schema version to 8.0.0';
-- QUERY START:
exec dbo.TigPutDBProperty 'schema-version', '8.0.0';
-- QUERY END:
GO
-- QUERY START:
exec TigSetComponentVersion 'server', '8.0.0';
-- QUERY END:
GO
================================================
FILE: src/main/database/sqlserver-server-8.0.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
SET QUOTED_IDENTIFIER ON
-- QUERY END:
GO
-- QUERY START:
IF object_id('dbo.tig_users') IS NULL
CREATE TABLE [dbo].[tig_users](
[uid] [bigint] IDENTITY(1,1) NOT NULL,
-- Jabber User ID
[user_id] [nvarchar](2049) NOT NULL,
-- UserID SHA1 hash to prevent duplicate user_ids
[sha1_user_id] [varbinary](32) NOT NULL,
-- User password encrypted or not
[user_pw] [nvarchar](255) NULL,
-- Time the account has been created
[acc_create_time] [datetime] DEFAULT getdate(),
-- Time of the last user login
[last_login] [datetime] default 0,
-- Time of the last user logout
[last_logout] [datetime] default 0,
-- User online status, if > 0 then user is online, the value
-- indicates the number of user connections.
-- It is incremented on each user login and decremented on each
-- user logout.
[online_status] [int] default 0,
-- Number of failed login attempts
[failed_logins] [int] default 0,
-- User status, whether the account is active or disabled
-- >0 - account active, 0 - account disabled
[account_status] [int] default 1,
-- helper column for indexing due to limitation of SQL server
user_id_fragment AS LEFT (user_id, 256),
CONSTRAINT [PK_tig_users] PRIMARY KEY CLUSTERED ( [uid] ASC ) ON [PRIMARY],
CONSTRAINT [IX_tig_users_sha1_user_id] UNIQUE NONCLUSTERED ( [sha1_user_id] ASC ) ON [PRIMARY]
) ON [PRIMARY]
-- QUERY END:
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_users') and name = 'IX_tig_users_account_status' )
CREATE NONCLUSTERED INDEX [IX_tig_users_account_status] ON [dbo].[tig_users] ([account_status] ASC) ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_users') and name = 'IX_tig_users_last_login' )
CREATE NONCLUSTERED INDEX [IX_tig_users_last_login] ON [dbo].[tig_users] ([last_login] ASC) ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_users') and name = 'IX_tig_users_last_logout' )
CREATE NONCLUSTERED INDEX [IX_tig_users_last_logout] ON [dbo].[tig_users] ( [last_logout] ASC) ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_users') and name = 'IX_tig_users_online_status' )
CREATE NONCLUSTERED INDEX [IX_tig_users_online_status] ON [dbo].[tig_users] ([online_status] ASC) ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_users') and name = 'IX_tig_users_user_id_fragment' )
CREATE NONCLUSTERED INDEX [IX_tig_users_user_id_fragment] ON [dbo].[tig_users] ( [user_id_fragment] ASC) ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_users') and name = 'IX_tig_users_user_pw' )
CREATE NONCLUSTERED INDEX [IX_tig_users_user_pw] ON [dbo].[tig_users] ([user_pw] ASC) ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
IF object_id('dbo.tig_nodes') IS NULL
CREATE TABLE [dbo].[tig_nodes](
[nid] [bigint] IDENTITY(1,1) NOT NULL,
[parent_nid] [bigint] NULL,
[uid] [bigint] NOT NULL,
[node] [nvarchar](255) NOT NULL,
CONSTRAINT [PK_tig_nodes_nid] PRIMARY KEY CLUSTERED ( [nid] ASC ) ON [PRIMARY],
CONSTRAINT [IX_tnode] UNIQUE NONCLUSTERED ( [parent_nid] ASC, [uid] ASC, [node] ASC ) ON [PRIMARY]
) ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_nodes') and name = 'IX_tig_nodes_node' )
CREATE NONCLUSTERED INDEX [IX_tig_nodes_node] ON [dbo].[tig_nodes] ( [node] ASC) ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_nodes') and name = 'IX_tig_nodes_parent_nid' )
CREATE NONCLUSTERED INDEX [IX_tig_nodes_parent_nid] ON [dbo].[tig_nodes] ( [parent_nid] ASC ) ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_nodes') and name = 'IX_tig_nodes_uid' )
CREATE NONCLUSTERED INDEX [IX_tig_nodes_uid] ON [dbo].[tig_nodes] ( [uid] ASC ) ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
if object_id('dbo.FK_tig_nodes_tig_users') is null
ALTER TABLE [dbo].[tig_nodes] WITH CHECK ADD CONSTRAINT [FK_tig_nodes_tig_users] FOREIGN KEY([uid])
REFERENCES [dbo].[tig_users] ([uid])
-- QUERY END:
GO
-- QUERY START:
ALTER TABLE [dbo].[tig_nodes] CHECK CONSTRAINT [FK_tig_nodes_tig_users]
-- QUERY END:
GO
-- QUERY START:
IF object_id('dbo.tig_pairs') IS NULL
CREATE TABLE [dbo].[tig_pairs](
[pid] [bigint] IDENTITY(1,1) NOT NULL,
[nid] [bigint] NULL,
[uid] [bigint] NOT NULL,
[pkey] [nvarchar](255) NOT NULL,
[pval] [ntext] NULL,
CONSTRAINT [PK_tig_pairs] PRIMARY KEY CLUSTERED ( [pid] ASC ) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_pairs') and name = 'IX_tig_pairs_nid' )
CREATE NONCLUSTERED INDEX [IX_tig_pairs_nid] ON [dbo].[tig_pairs] ( [nid] ASC ) ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_pairs') and name = 'IX_tig_pairs_pkey' )
CREATE NONCLUSTERED INDEX [IX_tig_pairs_pkey] ON [dbo].[tig_pairs] ( [pkey] ASC ) ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_pairs') and name = 'IX_tig_pairs_uid' )
CREATE NONCLUSTERED INDEX [IX_tig_pairs_uid] ON [dbo].[tig_pairs] ( [uid] ASC ) ON [PRIMARY]
-- QUERY END:
GO
-- QUERY START:
if object_id('dbo.FK_tig_pairs_tig_nodes') is null
ALTER TABLE [dbo].[tig_pairs] WITH CHECK ADD CONSTRAINT [FK_tig_pairs_tig_nodes] FOREIGN KEY([nid])
REFERENCES [dbo].[tig_nodes] ([nid])
-- QUERY END:
GO
-- QUERY START:
ALTER TABLE [dbo].[tig_pairs] CHECK CONSTRAINT [FK_tig_pairs_tig_nodes]
-- QUERY END:
GO
-- QUERY START:
if object_id('dbo.FK_tig_pairs_tig_users') is null
ALTER TABLE [dbo].[tig_pairs] WITH CHECK ADD CONSTRAINT [FK_tig_pairs_tig_users] FOREIGN KEY([uid])
REFERENCES [dbo].[tig_users] ([uid])
-- QUERY END:
GO
-- QUERY START:
ALTER TABLE [dbo].[tig_pairs] CHECK CONSTRAINT [FK_tig_pairs_tig_users]
-- QUERY END:
GO
-- QUERY START:
IF object_id('dbo.tig_offline_messages') IS NULL
create table tig_offline_messages (
msg_id [bigint] IDENTITY(1,1),
ts [datetime] DEFAULT GETUTCDATE(),
expired [datetime],
sender nvarchar(2049),
sender_sha1 varbinary(20),
receiver nvarchar(2049) not null,
receiver_sha1 varbinary(20) not null,
msg_type int not null default 0,
message nvarchar(max) not null,
primary key (msg_id)
);
-- QUERY END:
GO
-- QUERY START:
if object_id('dbo.tig_broadcast_messages') is null
create table tig_broadcast_messages (
id varchar(128) not null,
expired datetime not null,
msg nvarchar(max) not null,
primary key (id)
);
-- QUERY END:
GO
-- QUERY START:
if object_id('dbo.tig_broadcast_jids') is null
create table tig_broadcast_jids (
jid_id [bigint] IDENTITY(1,1),
jid [nvarchar](2049) not null,
jid_sha1 [varbinary](20) not null,
primary key (jid_id)
);
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_offline_messages') and name = 'IX_tig_broadcast_jids_jid_sha1' )
create index IX_tig_broadcast_jids_jid_sha1 on tig_broadcast_jids (jid_sha1);
-- QUERY END:
GO
-- QUERY START:
if object_id('dbo.tig_broadcast_recipients') is null
create table tig_broadcast_recipients (
msg_id [varchar](128) not null references tig_broadcast_messages(id),
jid_id [bigint] not null references tig_broadcast_jids(jid_id),
primary key (msg_id, jid_id)
);
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_offline_messages') and name = 'IX_tig_offline_messages_expired' )
create index IX_tig_offline_messages_expired on [dbo].[tig_offline_messages] (expired);
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_offline_messages') and name = 'IX_tig_offline_messages_receiver_sha1' )
create index IX_tig_offline_messages_receiver_sha1 on [dbo].[tig_offline_messages] (receiver_sha1);
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_offline_messages') and name = 'IX_tig_offline_messages_receiver_sha1_sender_sha1' )
create index IX_tig_offline_messages_receiver_sha1_sender_sha1 on [dbo].[tig_offline_messages] (receiver_sha1, sender_sha1);
-- QUERY END:
GO
-- QUERY START:
if object_id('dbo.tig_cluster_nodes') is null
create table [dbo].[tig_cluster_nodes] (
hostname nvarchar(450) not null,
secondary nvarchar(512),
password nvarchar(255) not null,
last_update [datetime] default getutcdate(),
port int,
cpu_usage double precision not null,
mem_usage double precision not null,
constraint [PK_tig_cluster_nodes] PRIMARY KEY ClUSTERED ( [hostname] asc ) on [PRIMARY],
constraint [IX_tig_cluster_nodes_hostname] unique nonclustered ( [hostname] asc) on [PRIMARY]
);
-- QUERY END:
GO
-- ------------- Credentials support
-- QUERY START:
if object_id('dbo.tig_user_credentials') is null
create table tig_user_credentials (
uid bigint not null references tig_users(uid),
username nvarchar(2049) not null,
username_sha1 varbinary(32) not null,
mechanism nvarchar(128) not null,
value nvarchar(max) not null,
primary key (uid, username_sha1, mechanism)
);
-- QUERY END:
GO
-- QUERY START:
if not exists (select 1 from tig_user_credentials) and exists (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigGetDBProperty')
begin
execute('insert into tig_user_credentials (uid, username, username_sha1, mechanism, value)
select uid, ''default'', HASHBYTES(''SHA1'', ''default''), coalesce(TigGetDBProperty(''password-encoding''), ''PLAIN''), user_pw
from tig_users
where
user_pw is not null;
update tig_users set user_pw = null where user_pw is not null;');
end
-- QUERY END:
GO
================================================
FILE: src/main/database/sqlserver-server-8.0.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
SET QUOTED_IDENTIFIER ON
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigInitdb')
DROP PROCEDURE TigInitdb
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigAddUser')
DROP PROCEDURE TigAddUser
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigGetUserDBUid')
DROP PROCEDURE TigGetUserDBUid
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUpdatePassword')
DROP PROCEDURE TigUpdatePassword
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUpdatePasswordPlainPwRev')
DROP PROCEDURE TigUpdatePasswordPlainPwRev
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigOnlineUsers')
DROP PROCEDURE TigOnlineUsers
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigOfflineUsers')
DROP PROCEDURE TigOfflineUsers
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigAllUsers')
DROP PROCEDURE TigAllUsers
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigAllUsersCount')
DROP PROCEDURE TigAllUsersCount
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigDisableAccount')
DROP PROCEDURE TigDisableAccount
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigEnableAccount')
DROP PROCEDURE TigEnableAccount
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigActiveAccounts')
DROP PROCEDURE TigActiveAccounts
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigDisabledAccounts')
DROP PROCEDURE TigDisabledAccounts
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigAddNode')
DROP PROCEDURE TigAddNode
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'FN' AND name = 'TigGetDBProperty')
DROP FUNCTION TigGetDBProperty
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUpdatePairs')
DROP PROCEDURE TigUpdatePairs
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'FN' AND name = 'InlineMax')
DROP FUNCTION InlineMax
-- QUERY END:
GO
-- QUERY START:
-- The initialization of the database.
-- The procedure should be called manually somehow before starting the
-- server. In theory the server could call the procedure automatically
-- at the startup time but I don't know yet how to solve the problem
-- with multiple cluster nodes starting at later time when the server
-- is already running.
create procedure dbo.TigInitdb
AS
begin
update dbo.tig_users set online_status = 0;
end
-- QUERY END:
GO
-- QUERY START:
-- Database properties get - function
create function TigGetDBProperty(@_tkey nvarchar(255)) returns nvarchar(MAX)
AS
begin
--Declare @_result nvarchar(MAX);
return (select pval from dbo.tig_pairs AS p, dbo.tig_users AS u
where (pkey = @_tkey) AND (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties')))
AND (p.uid = u.uid));
end
-- QUERY END:
GO
-- QUERY START:
-- Add a new user to the database assuming the user password is already
-- encoded properly according to the database settings.
-- If password is not encoded TigAddUserPlainPw should be used instead.
create procedure dbo.TigAddUser
@_user_id nvarchar(2049),
@_user_pw nvarchar(255)
AS
begin
SET NOCOUNT ON;
declare @res_uid bigint;
insert into dbo.tig_users (user_id, sha1_user_id, user_pw)
values (@_user_id, HASHBYTES('SHA1', LOWER(@_user_id)) , @_user_pw);
set @res_uid = (select SCOPE_IDENTITY());
if (@res_uid is not NULL)
insert into dbo.tig_nodes (parent_nid, uid, node)
values (NULL, @res_uid, N'root');
if (@_user_pw is NULL)
update dbo.tig_users set account_status = -1 where uid = @res_uid;
select @res_uid as uid;
end;
-- QUERY END:
GO
-- QUERY START:
-- Low level database user id as big number. Used only for performance reasons
-- and save database space. Besides JID is too large to server as UID
create procedure dbo.TigGetUserDBUid
@_user_id nvarchar(2049)
AS
begin
select uid from dbo.tig_users where sha1_user_id = hashbytes('SHA1', lower(@_user_id));
end
-- QUERY END:
GO
-- QUERY START:
-- Update user password
create procedure dbo.TigUpdatePassword
@_user_id nvarchar(2049),
@_user_pw nvarchar(255)
AS
begin
update dbo.tig_users set user_pw = @_user_pw where sha1_user_id = hashbytes('SHA1', lower(@_user_id));
end
-- QUERY END:
GO
-- QUERY START:
-- Variant of TigUpdatePasswordPlainPw SP with parameters in reverse order.
-- Some implementations require the parameters to be in the same order as
-- the update query.
create procedure dbo.TigUpdatePasswordPlainPwRev
@_user_pw nvarchar(255),
@_user_id nvarchar(2049)
AS
begin
exec TigUpdatePasswordPlainPw @_user_id, @_user_pw;
end
-- QUERY END:
GO
-- QUERY START:
-- List all online users
create procedure dbo.TigOnlineUsers
AS
begin
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from dbo.tig_users where online_status > 0;
end
-- QUERY END:
GO
-- QUERY START:
-- List all offline users
create procedure dbo.TigOfflineUsers
AS
begin
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from dbo.tig_users where online_status = 0;
end
-- QUERY END:
GO
-- QUERY START:
-- List of all users in database
create procedure dbo.TigAllUsers
AS
begin
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from dbo.tig_users;
end
-- QUERY END:
GO
-- QUERY START:
-- All users count
create procedure dbo.TigAllUsersCount
AS
begin
select count(*) from dbo.tig_users;
end
-- QUERY END:
GO
-- QUERY START:
-- helper function
create function dbo.InlineMax(@val1 int, @val2 int)
returns int
as
begin
if @val1 > @val2
return @val1
return isnull(@val2,@val1)
end
-- QUERY END:
GO
-- QUERY START:
-- Disable user account
create procedure dbo.TigDisableAccount
@_user_id nvarchar(2049)
AS
begin
update dbo.tig_users set account_status = 0 where sha1_user_id = hashbytes('SHA1', lower(@_user_id));
end
-- QUERY END:
GO
-- QUERY START:
-- Enable user account
create procedure dbo.TigEnableAccount
@_user_id nvarchar(2049)
AS
begin
update dbo.tig_users set account_status = 1 where sha1_user_id = hashbytes('SHA1', lower(@_user_id));
end
-- QUERY END:
GO
-- QUERY START:
-- Get list of all active user accounts
create procedure dbo.TigActiveAccounts
AS
begin
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from dbo.tig_users where account_status > 0;
end
-- QUERY END:
GO
-- QUERY START:
-- Get list of all disabled user accounts
create procedure dbo.TigDisabledAccounts
AS
begin
select user_id, last_login, last_logout, online_status, failed_logins, account_status
from dbo.tig_users where account_status = 0;
end
-- QUERY END:
GO
-- QUERY START:
-- Helper procedure for adding a new node
create procedure dbo.TigAddNode
@_parent_nid bigint,
@_uid bigint,
@_node nvarchar(255)
AS
begin
SET NOCOUNT ON;
insert into dbo.tig_nodes (parent_nid, uid, node)
values (@_parent_nid, @_uid, @_node);
select SCOPE_IDENTITY() as nid;
end
-- QUERY END:
GO
-- QUERY START:
-- Procedure to efficiently and safely update data in tig_pairs table
create procedure dbo.TigUpdatePairs
@_nid bigint,
@_uid bigint,
@_tkey nvarchar(255),
@_tval ntext
AS
begin
if exists(SELECT 1 FROM dbo.tig_pairs WHERE nid = @_nid AND uid = @_uid AND pkey = @_tkey)
UPDATE dbo.tig_pairs SET pval = @_tval WHERE nid = @_nid AND uid = @_uid AND pkey = @_tkey;
ELSE
INSERT INTO dbo.tig_pairs (nid, uid, pkey, pval) VALUES (@_nid, @_uid, @_tkey, @_tval);
END
-- QUERY END:
GO
-- QUERY START:
SET QUOTED_IDENTIFIER ON
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUpdateLoginTime')
DROP PROCEDURE TigUpdateLoginTime
-- QUERY END:
GO
-- QUERY START:
-- It sets last_login time to the current timestamp
create procedure dbo.TigUpdateLoginTime
@_user_id nvarchar(2049)
AS
begin
update dbo.tig_users
set last_login = GETUTCDATE()
where user_id = @_user_id;
end
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUserLogin')
DROP PROCEDURE TigUserLogin
-- QUERY END:
GO
-- QUERY START:
-- Perforrm user login. It returns user_id uppon success and NULL
-- on failure.
-- If the login is successful it also increases online_status and sets
-- last_login time to the current timestamp
create procedure dbo.TigUserLogin
@_user_id nvarchar(2049),
@_user_pw nvarchar(255)
AS
begin
if exists(select 1 from dbo.tig_users
where (account_status > 0) AND (sha1_user_id = hashbytes('SHA1', lower(@_user_id)))
AND (user_pw = @_user_pw) AND (user_id = @_user_id))
begin
update dbo.tig_users
set online_status = online_status + 1, last_login = GETUTCDATE()
where sha1_user_id = hashbytes('SHA1', lower(@_user_id));
select @_user_id as user_id;
end
else
begin
update dbo.tig_users set failed_logins = failed_logins + 1 where sha1_user_id = hashbytes('SHA1', lower(@_user_id));
select NULL as user_id;
end
end
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUserLogout')
DROP PROCEDURE TigUserLogout
-- QUERY END:
GO
-- QUERY START:
-- It decreases online_status and sets last_logout time to the current timestamp
create procedure dbo.TigUserLogout
@_user_id nvarchar(2049)
AS
begin
update dbo.tig_users
set online_status = dbo.InlineMax(online_status - 1, 0),
last_logout = GETUTCDATE()
where user_id = @_user_id;
end
-- QUERY END:
GO
-- ------------ Offline Messages
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_OfflineMessages_AddMessage')
drop procedure [dbo].[Tig_OfflineMessages_AddMessage];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_OfflineMessages_AddMessage]
@_to nvarchar(2049),
@_from nvarchar(2049),
@_type int,
@_ts datetime,
@_message nvarchar(max),
@_expired datetime,
@_limit bigint
as
begin
set nocount on;
declare
@_msg_count bigint,
@_msg_id bigint;
set @_msg_count = 0;
if @_limit > 0
select @_msg_count = count(msg_id) from tig_offline_messages where receiver_sha1 = HASHBYTES('SHA1', lower(@_to)) and sender_sha1 = HASHBYTES('SHA1', lower(@_from));
if @_limit = 0 or @_limit > @_msg_count
begin
insert into tig_offline_messages ( receiver, receiver_sha1, sender, sender_sha1, msg_type, ts, message, expired )
select @_to, HASHBYTES('SHA1', lower(@_to)), @_from, HASHBYTES('SHA1', lower(@_from)), @_type, @_ts, @_message, @_expired;
select @_msg_id = @@IDENTITY;
end
select @_msg_id as msg_id;
set nocount off;
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_OfflineMessages_GetMessages')
drop procedure [dbo].[Tig_OfflineMessages_GetMessages];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_OfflineMessages_GetMessages]
@_to nvarchar(2049)
as
begin
select om.message, om.msg_id
from tig_offline_messages om
where om.receiver_sha1 = HASHBYTES('SHA1', lower(@_to));
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_OfflineMessages_GetMessagesByIds')
drop procedure [dbo].[Tig_OfflineMessages_GetMessagesByIds];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_OfflineMessages_GetMessagesByIds]
@_to nvarchar(2049),
@_msg_id1 nvarchar(50),
@_msg_id2 nvarchar(50),
@_msg_id3 nvarchar(50),
@_msg_id4 nvarchar(50)
as
begin
select om.message, om.msg_id
from tig_offline_messages om
where om.receiver_sha1 = HASHBYTES('SHA1', lower(@_to))
and (
(@_msg_id1 is not null and om.msg_id = @_msg_id1)
or (@_msg_id2 is not null and om.msg_id = @_msg_id2)
or (@_msg_id3 is not null and om.msg_id = @_msg_id3)
or (@_msg_id4 is not null and om.msg_id = @_msg_id4)
);
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_OfflineMessages_GetMessagesCount')
drop procedure [dbo].[Tig_OfflineMessages_GetMessagesCount];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_OfflineMessages_GetMessagesCount]
@_to nvarchar(2049)
as
begin
select om.msg_type, count(om.msg_type)
from tig_offline_messages om
where om.receiver_sha1 = HASHBYTES('SHA1', lower(@_to))
group by om.msg_type;
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_OfflineMessages_ListMessages')
drop procedure [dbo].[Tig_OfflineMessages_ListMessages];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_OfflineMessages_ListMessages]
@_to nvarchar(2049)
as
begin
select om.msg_id, om.msg_type, om.sender
from tig_offline_messages om
where om.receiver_sha1 = HASHBYTES('SHA1', lower(@_to));
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_OfflineMessages_DeleteMessages')
drop procedure [dbo].[Tig_OfflineMessages_DeleteMessages];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_OfflineMessages_DeleteMessages]
@_to nvarchar(2049)
as
begin
set nocount on;
delete from tig_offline_messages where receiver_sha1 = HASHBYTES('SHA1', lower(@_to))
select @@ROWCOUNT as affected_rows;
set nocount off;
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_OfflineMessages_DeleteMessagesByIds')
drop procedure [dbo].[Tig_OfflineMessages_DeleteMessagesByIds];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_OfflineMessages_DeleteMessagesByIds]
@_to nvarchar(2049),
@_msg_id1 nvarchar(50),
@_msg_id2 nvarchar(50),
@_msg_id3 nvarchar(50),
@_msg_id4 nvarchar(50)
as
begin
set nocount on;
delete from tig_offline_messages
where receiver_sha1 = HASHBYTES('SHA1', lower(@_to))
and (
(@_msg_id1 is not null and msg_id = @_msg_id1)
or (@_msg_id2 is not null and msg_id = @_msg_id2)
or (@_msg_id3 is not null and msg_id = @_msg_id3)
or (@_msg_id4 is not null and msg_id = @_msg_id4)
);
select @@ROWCOUNT as affected_rows;
set nocount off;
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_OfflineMessages_DeleteMessage')
drop procedure [dbo].[Tig_OfflineMessages_DeleteMessage];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_OfflineMessages_DeleteMessage]
@_msg_id bigint
as
begin
set nocount on;
delete from tig_offline_messages where msg_id = @_msg_id;
select @@ROWCOUNT as affected_rows;
set nocount off;
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_OfflineMessages_GetExpiredMessages')
drop procedure [dbo].[Tig_OfflineMessages_GetExpiredMessages];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_OfflineMessages_GetExpiredMessages]
@_limit int
as
begin
select top (@_limit) om.msg_id, om.expired, om.message
from tig_offline_messages om
where om.expired is not null
order by om.expired asc;
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_OfflineMessages_GetExpiredMessagesBefore')
drop procedure [dbo].[Tig_OfflineMessages_GetExpiredMessagesBefore];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_OfflineMessages_GetExpiredMessagesBefore]
@_expired datetime
as
begin
select om.msg_id, om.expired, om.message
from tig_offline_messages om
where om.expired is not null
and (@_expired is null or om.expired <= @_expired)
order by om.expired asc;
end
-- QUERY END:
GO
-- ------------ Broadcast Messages
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_BroadcastMessages_AddMessage')
drop procedure [dbo].[Tig_BroadcastMessages_AddMessage];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_BroadcastMessages_AddMessage]
@_msg_id varchar(128),
@_expired datetime,
@_msg nvarchar(max)
as
begin
if not exists (select 1 from tig_broadcast_messages where id = @_msg_id)
begin
insert into tig_broadcast_messages (id, expired, msg)
values (@_msg_id, @_expired, @_msg);
end
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_BroadcastMessages_AddMessageRecipient')
drop procedure [dbo].[Tig_BroadcastMessages_AddMessageRecipient];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_BroadcastMessages_AddMessageRecipient]
@_msg_id varchar(128),
@_jid nvarchar(2049)
as
begin
declare @ErrorMessage nvarchar(max), @ErrorSeverity int, @ErrorState int;
declare @_jid_sha1 varbinary(20),
@_jid_id bigint;
set @_jid_sha1 = HASHBYTES('SHA1', lower(@_jid));
select @_jid_id = jid_id from tig_broadcast_jids where jid_sha1 = @_jid_sha1;
if @_jid_id is null
begin
begin try
insert into tig_broadcast_jids (jid, jid_sha1) values (@_jid, @_jid_sha1);
select @_jid_id = @@IDENTITY;
end try
begin catch
if error_number() = 2627
select @_jid_id = jid_id from tig_broadcast_jids where jid_sha1 = @_jid_sha1;
else
begin
select @ErrorMessage = ERROR_MESSAGE() + ' Line ' + cast(ERROR_LINE() as nvarchar(5)), @ErrorSeverity = ERROR_SEVERITY(), @ErrorState = ERROR_STATE();
raiserror (@ErrorMessage, @ErrorSeverity, @ErrorState);
end
end catch
end
begin try
insert into tig_broadcast_recipients (msg_id, jid_id)
select @_msg_id, @_jid_id where not exists (
select 1 from tig_broadcast_recipients br where br.msg_id = @_msg_id and br.jid_id = @_jid_id
);
end try
begin catch
if error_number() <> 2627
begin
select @ErrorMessage = ERROR_MESSAGE() + ' Line ' + cast(ERROR_LINE() as nvarchar(5)), @ErrorSeverity = ERROR_SEVERITY(), @ErrorState = ERROR_STATE();
raiserror (@ErrorMessage, @ErrorSeverity, @ErrorState);
end
end catch
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_BroadcastMessages_GetMessages')
drop procedure [dbo].[Tig_BroadcastMessages_GetMessages];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_BroadcastMessages_GetMessages]
@_expired datetime
as
begin
select id, expired, msg
from tig_broadcast_messages
where expired >= @_expired;
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_BroadcastMessages_GetMessageRecipients')
drop procedure [dbo].[Tig_BroadcastMessages_GetMessageRecipients];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_BroadcastMessages_GetMessageRecipients]
@_msg_id varchar(128)
as
begin
select j.jid
from tig_broadcast_recipients r
inner join tig_broadcast_jids j on j.jid_id = r.jid_id
where r.msg_id = @_msg_id;
end
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUpdateAccountStatus')
DROP PROCEDURE [dbo].[TigUpdateAccountStatus]
-- QUERY END:
GO
-- QUERY START:
-- Upate account status
CREATE PROCEDURE [dbo].[TigUpdateAccountStatus]
@_user_id NVARCHAR(2049),
@_status INT
AS
BEGIN
UPDATE dbo.tig_users
SET account_status = @_status
WHERE user_id = @_user_id;
END
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigAccountStatus')
DROP PROCEDURE [dbo].[TigAccountStatus]
-- QUERY END:
GO
-- QUERY START:
-- Returns account_status
CREATE PROCEDURE [dbo].[TigAccountStatus]
@_user_id NVARCHAR(2049)
AS
BEGIN
SELECT account_status
FROM tig_users
WHERE user_id = @_user_id;
END
-- QUERY END:
GO
-- ------------- Credentials support
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUserCredential_Update')
DROP PROCEDURE TigUserCredential_Update
-- QUERY END:
GO
-- QUERY START:
-- It sets last_login time to the current timestamp
create procedure dbo.TigUserCredential_Update
@_user_id nvarchar(2049),
@_username nvarchar(2049),
@_mechanism nvarchar(128),
@_value nvarchar(max)
AS
begin
declare @_uid bigint;
declare @_username_sha1 varbinary(32);
select @_uid = uid, @_username_sha1 = HASHBYTES('SHA1', @_username) from tig_users where sha1_user_id = HASHBYTES('SHA1', lower(@_user_id));
if @_uid is not null
begin
update tig_user_credentials set value = @_value where uid = @_uid and username_sha1 = @_username_sha1 and mechanism = @_mechanism;
if @@ROWCOUNT = 0
begin
begin try
insert into tig_user_credentials (uid, username, username_sha1, mechanism, value)
select @_uid, @_username, @_username_sha1, @_mechanism, @_value
where not exists (
select 1 from tig_user_credentials
where
uid = @_uid
and username_sha1 = @_username_sha1
and mechanism = @_mechanism
);
end try
begin catch
IF ERROR_NUMBER() <> 2627
declare @ErrorMessage nvarchar(max), @ErrorSeverity int, @ErrorState int;
select @ErrorMessage = ERROR_MESSAGE() + ' Line ' + cast(ERROR_LINE() as nvarchar(5)), @ErrorSeverity = ERROR_SEVERITY(), @ErrorState = ERROR_STATE();
raiserror (@ErrorMessage, @ErrorSeverity, @ErrorState);
end catch
end
end
end
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUserCredentials_Get')
DROP PROCEDURE TigUserCredentials_Get
-- QUERY END:
GO
-- QUERY START:
-- It sets last_login time to the current timestamp
create procedure dbo.TigUserCredentials_Get
@_user_id nvarchar(2049),
@_username nvarchar(2049)
AS
begin
select c.mechanism, c.value, u.account_status
from tig_users u
inner join tig_user_credentials c on c.uid = u.uid
where
u.sha1_user_id = HASHBYTES('SHA1', lower(@_user_id))
and c.username_sha1 = HASHBYTES('SHA1', @_username);
end
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUserUsernames_Get')
DROP PROCEDURE TigUserUsernames_Get
-- QUERY END:
GO
-- QUERY START:
create procedure dbo.TigUserUsernames_Get
@_user_id nvarchar(2049)
AS
begin
select distinct
c.username
from tig_users u
inner join tig_user_credentials c on c.uid = u.uid
where
u.sha1_user_id = HASHBYTES('SHA1', lower(@_user_id));
end
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUserCredential_Remove')
DROP PROCEDURE TigUserCredential_Remove
-- QUERY END:
GO
-- QUERY START:
-- It sets last_login time to the current timestamp
create procedure dbo.TigUserCredential_Remove
@_user_id nvarchar(2049),
@_username nvarchar(2049)
AS
begin
declare @_uid bigint;
declare @_username_sha1 varbinary(32);
select @_uid = uid, @_username_sha1 = HASHBYTES('SHA1', @_username) from tig_users where sha1_user_id = HASHBYTES('SHA1', lower(@_user_id));
delete from tig_user_credentials
where
uid = @_uid
and username_sha1 = @_username_sha1;
end
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigAddUserPlainPw')
DROP PROCEDURE TigAddUserPlainPw
-- QUERY END:
GO
-- QUERY START:
-- Add a new user to the database assuming the user password is already
-- encoded properly according to the database settings.
-- If password is not encoded TigAddUserPlainPw should be used instead.
create procedure dbo.TigAddUserPlainPw
@_user_id nvarchar(2049),
@_user_pw nvarchar(255)
AS
begin
SET NOCOUNT ON;
declare @res_uid bigint;
insert into dbo.tig_users (user_id, sha1_user_id)
values (@_user_id, HASHBYTES('SHA1', LOWER(@_user_id)));
set @res_uid = (select SCOPE_IDENTITY());
if (@res_uid is not NULL)
insert into dbo.tig_nodes (parent_nid, uid, node)
values (NULL, @res_uid, N'root');
if (@_user_pw is NULL)
update dbo.tig_users set account_status = -1 where uid = @res_uid;
else
exec TigUpdatePasswordPlainPw @_user_id, @_user_pw
select @res_uid as uid;
end;
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigGetPassword')
DROP PROCEDURE TigGetPassword
-- QUERY END:
GO
-- QUERY START:
-- Returns user's password from the database
create procedure dbo.TigGetPassword
@_user_id nvarchar(2049)
AS
begin
select c.value
from tig_users u
inner join tig_user_credentials c on c.uid = u.uid
where
u.sha1_user_id = hashbytes('SHA1', lower(@_user_id))
and c.username_sha1 = hashbytes('SHA1', N'default')
and c.mechanism = N'PLAIN';
end
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUpdatePasswordPlainPw')
DROP PROCEDURE TigUpdatePasswordPlainPw
-- QUERY END:
GO
-- QUERY START:
-- Takes plain text user password and converts it to internal representation
create procedure dbo.TigUpdatePasswordPlainPw
@_user_id nvarchar(2049),
@_user_pw nvarchar(255)
AS
begin
declare @_encoding nvarchar(512)
declare @_encoded nvarchar(max)
set @_encoding = coalesce(dbo.TigGetDBProperty(N'password-encoding'), N'PLAIN')
set @_encoded = case @_encoding
when N'MD5-PASSWORD' then HASHBYTES('MD5', @_user_pw)
when N'MD5-USERID-PASSWORD' then HASHBYTES('MD5', @_user_id + @_user_pw)
when N'MD5-USERNAME-PASSWORD' then HASHBYTES('MD5', (LEFT (@_user_id, CHARINDEX(N'@',@_user_id)-1)) + @_user_pw)
else @_user_pw
end;
exec TigUserCredential_Update @_user_id, N'default', @_encoding, @_encoded
end
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUserLoginPlainPw')
DROP PROCEDURE TigUserLoginPlainPw
-- QUERY END:
GO
-- QUERY START:
-- Performs user login for a plain text password, converting it to an internal
-- representation if necessary
create procedure dbo.TigUserLoginPlainPw
@_user_id nvarchar(2049),
@_user_pw nvarchar(255)
AS
begin
declare @_encoding nvarchar(512)
declare @_encoded nvarchar(max)
set @_encoding = coalesce(dbo.TigGetDBProperty(N'password-encoding'), N'PLAIN')
set @_encoded = case @_encoding
when N'MD5-PASSWORD' then HASHBYTES('MD5', @_user_pw)
when N'MD5-USERID-PASSWORD' then HASHBYTES('MD5', @_user_id + @_user_pw)
when N'MD5-USERNAME-PASSWORD' then HASHBYTES('MD5', (LEFT (@_user_id, CHARINDEX(N'@',@_user_id)-1)) + @_user_pw)
else @_user_pw
end;
if exists (select 1 from dbo.tig_users u
inner join tig_user_credentials c on c.uid = u.uid
where u.sha1_user_id = hashbytes('SHA1', lower(@_user_id))
and u.account_status > 0
and c.username_sha1 = hashbytes('SHA1', N'default')
and c.mechanism = @_encoding
and c.value = @_encoded)
begin
update dbo.tig_users
set online_status = online_status + 1, last_login = CURRENT_TIMESTAMP
where sha1_user_id = hashbytes('SHA1', lower(@_user_id));
select @_user_id as user_id;
end
else
begin
update dbo.tig_users set failed_logins = failed_logins + 1 where sha1_user_id = hashbytes('SHA1', lower(@_user_id));
select NULL as user_id;
end
end
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigRemoveUser')
DROP PROCEDURE TigRemoveUser
-- QUERY END:
GO
-- QUERY START:
-- Removes a user from the database
create procedure dbo.TigRemoveUser
@_user_id nvarchar(2049)
AS
begin
declare @res_uid bigint;
set @res_uid = (select uid from dbo.tig_users where sha1_user_id = hashbytes('SHA1', lower(@_user_id)));
delete from dbo.tig_user_credentials where uid = @res_uid;
delete from dbo.tig_pairs where uid = @res_uid;
delete from dbo.tig_nodes where uid = @res_uid;
delete from dbo.tig_users where uid = @res_uid;
end
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigPutDBProperty')
DROP PROCEDURE TigPutDBProperty
-- QUERY END:
GO
-- QUERY START:
-- Database properties set - procedure
create procedure dbo.TigPutDBProperty
@_tkey nvarchar(255),
@_tval ntext
AS
begin
Declare @_nid int;
Declare @_uid int;
Declare @_count int;
if exists (select 1 from dbo.tig_pairs, dbo.tig_users
where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties')))
AND (dbo.tig_users.uid = dbo.tig_pairs.uid) AND (pkey = @_tkey))
begin
select @_nid = dbo.tig_pairs.nid, @_uid = dbo.tig_pairs.uid from dbo.tig_pairs, dbo.tig_users
where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties')))
AND (dbo.tig_users.uid = dbo.tig_pairs.uid) AND (pkey = @_tkey);
update dbo.tig_pairs set pval = @_tval
where (@_uid = uid) AND (pkey = @_tkey) ;
end
else
begin
if not exists (select 1 from tig_users where user_id = 'db-properties')
exec dbo.TigAddUserPlainPw 'db-properties', NULL;
select @_nid = dbo.tig_pairs.nid, @_uid = dbo.tig_pairs.uid from dbo.tig_pairs, dbo.tig_users
where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties')))
AND (dbo.tig_users.uid = dbo.tig_pairs.uid) AND (pkey = @_tkey);
insert into dbo.tig_pairs (pkey, pval, uid, nid)
select @_tkey, @_tval, tu.uid, tn.nid from dbo.tig_users tu left join tig_nodes tn on tn.uid=tu.uid
where (sha1_user_id = HASHBYTES('SHA1', LOWER(N'db-properties')) and tn.node='root');
end
end
-- QUERY END:
GO
================================================
FILE: src/main/database/sqlserver-server-8.0.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- To load schema to PostgreSQL database execute following commands:
--
-- createuser tigase
-- createdb -U tigase tigase
-- psql -q -U tigase -d tigase -f postgresql-schema.sql
-- LOAD FILE: database/sqlserver-server-8.0.0-schema.sql
-- LOAD FILE: database/sqlserver-server-8.0.0-sp.sql
-- LOAD FILE: database/sqlserver-server-8.0.0-props.sql
================================================
FILE: src/main/database/sqlserver-server-8.1.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
SET QUOTED_IDENTIFIER ON
-- QUERY END:
GO
select GETDATE(), ' - Setting schema version to 8.1.0';
-- QUERY START:
exec dbo.TigPutDBProperty 'schema-version', '8.1.0';
-- QUERY END:
GO
-- QUERY START:
exec TigSetComponentVersion 'server', '8.1.0';
-- QUERY END:
GO
================================================
FILE: src/main/database/sqlserver-server-8.1.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- LOAD FILE: database/sqlserver-server-8.1.0-props.sql
================================================
FILE: src/main/database/sqlserver-server-8.2.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
SET QUOTED_IDENTIFIER ON
-- QUERY END:
GO
select GETDATE(), ' - Setting schema version to 8.2.0';
-- QUERY START:
exec TigSetComponentVersion 'server', '8.2.0';
-- QUERY END:
GO
================================================
FILE: src/main/database/sqlserver-server-8.2.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
IF EXISTS (select 1 from sys.indexes where object_id = object_id('dbo.tig_users') and name = 'IX_tig_users_last_login' )
DROP INDEX [IX_tig_users_last_login] ON [dbo].[tig_users]
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (select 1 from sys.indexes where object_id = object_id('dbo.tig_users') and name = 'IX_tig_users_last_logout' )
DROP INDEX [IX_tig_users_last_logout] ON [dbo].[tig_users]
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (select 1 from sys.indexes where object_id = object_id('dbo.tig_users') and name = 'IX_tig_users_online_status' )
DROP INDEX [IX_tig_users_online_status] ON [dbo].[tig_users]
-- QUERY END:
GO
-- QUERY START:
IF NOT EXISTS (SELECT * FROM sys.columns WHERE name = 'last_used' AND object_id = object_id('dbo.tig_users'))
BEGIN
ALTER TABLE [tig_users] ADD [last_used] [datetime] default 0;
END
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.columns WHERE name = 'last_login' AND object_id = object_id('dbo.tig_users'))
BEGIN
UPDATE [tig_users] SET [last_used] = [last_login] WHERE [last_used] = 0;
END
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.columns WHERE name = 'online_status' AND object_id = object_id('dbo.tig_users'))
BEGIN
DECLARE @sqlStmt nvarchar(MAX)
DECLARE C CURSOR LOCAL STATIC READ_ONLY FORWARD_ONLY FOR
select 'ALTER TABLE tig_users DROP CONSTRAINT ' + dc.name + ';'
from sys.default_constraints as dc
left join sys.columns as sc on dc.parent_column_id = sc.column_id
where dc.parent_object_id = OBJECT_ID('dbo.tig_users')
and type_desc = 'DEFAULT_CONSTRAINT'
and sc.name in ('online_status', 'last_login', 'last_logout')
OPEN C
FETCH NEXT FROM C INTO @sqlStmt
WHILE @@FETCH_STATUS = 0
BEGIN
exec sp_executesql @sqlStmt
fetch next from c into @sqlStmt
END
ALTER TABLE [tig_users] DROP COLUMN IF EXISTS [online_status], [last_logout], [last_login]
END
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (select 1 from sys.indexes where object_id = object_id('dbo.tig_offline_messages') and name = 'IX_tig_offline_messages_receiver_sha1' )
DROP INDEX [IX_tig_offline_messages_receiver_sha1] ON [dbo].[tig_offline_messages]
-- QUERY END:
GO
================================================
FILE: src/main/database/sqlserver-server-8.2.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- database properties are deprecated and are being removed
-- QUERY START:
SET QUOTED_IDENTIFIER ON
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigPutDBProperty')
DROP PROCEDURE TigPutDBProperty
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUserLogin')
DROP PROCEDURE TigUserLogin
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUserLogout')
DROP PROCEDURE TigUserLogout
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigOnlineUsers')
DROP PROCEDURE TigOnlineUsers
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigOfflineUsers')
DROP PROCEDURE TigOfflineUsers
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUserLoginPlainPw')
DROP PROCEDURE TigUserLoginPlainPw
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigAllUsers')
DROP PROCEDURE TigAllUsers
-- QUERY END:
GO
-- QUERY START:
-- List of all users in database
create procedure dbo.TigAllUsers
AS
begin
select user_id, failed_logins, account_status from dbo.tig_users;
end
-- QUERY END:
GO
-- QUERY START:
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'TigUpdateLoginTime')
DROP PROCEDURE TigUpdateLoginTime
-- QUERY END:
GO
-- QUERY START:
-- It sets last_login time to the current timestamp
create procedure dbo.TigUpdateLoginTime
@_user_id nvarchar(2049)
AS
begin
update dbo.tig_users
set last_used = GETUTCDATE()
where user_id = @_user_id;
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_OfflineMessages_DeleteMessage')
drop procedure [dbo].[Tig_OfflineMessages_DeleteMessage];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_OfflineMessages_DeleteMessage]
@_msg_id bigint
as
begin
set nocount on;
delete from tig_offline_messages where msg_id = @_msg_id;
set nocount off;
end
-- QUERY END:
GO
================================================
FILE: src/main/database/sqlserver-server-8.2.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- LOAD FILE: database/sqlserver-server-8.2.0-schema.sql
-- LOAD FILE: database/sqlserver-server-8.2.0-sp.sql
-- LOAD FILE: database/sqlserver-server-8.2.0-props.sql
================================================
FILE: src/main/database/sqlserver-server-8.3.0-props.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
SET QUOTED_IDENTIFIER ON
-- QUERY END:
GO
select GETDATE(), ' - Setting schema version to 8.3.0';
-- QUERY START:
exec TigSetComponentVersion 'server', '8.3.0';
-- QUERY END:
GO
================================================
FILE: src/main/database/sqlserver-server-8.3.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
--
================================================
FILE: src/main/database/sqlserver-server-8.3.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- database properties are deprecated and are being removed
================================================
FILE: src/main/database/sqlserver-server-8.3.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- LOAD FILE: database/sqlserver-server-8.3.0-schema.sql
-- LOAD FILE: database/sqlserver-server-8.3.0-sp.sql
-- LOAD FILE: database/sqlserver-server-8.3.0-props.sql
================================================
FILE: src/main/database/sqlserver-server-8.4.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
================================================
FILE: src/main/database/sqlserver-server-8.5.0-schema.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
if not exists (select 1 from sys.indexes where object_id = object_id('dbo.tig_offline_messages') and name = 'IX_tig_offline_messages_receiver_sha1_msg_type' )
create index IX_tig_offline_messages_receiver_sha1_msg_type on [dbo].[tig_offline_messages] (receiver_sha1, msg_type);
-- QUERY END:
GO
================================================
FILE: src/main/database/sqlserver-server-8.5.0-sp.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_OfflineMessages_AddMessage')
drop procedure [dbo].[Tig_OfflineMessages_AddMessage];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_OfflineMessages_AddMessage]
@_to nvarchar(2049),
@_from nvarchar(2049),
@_type int,
@_ts datetime,
@_message nvarchar(max),
@_expired datetime,
@_limit bigint
as
begin
set nocount on;
declare
@_msg_count bigint,
@_msg_id bigint;
set @_msg_count = 0;
if @_limit > 0
select @_msg_count = count(msg_id) from tig_offline_messages where receiver_sha1 = HASHBYTES('SHA1', lower(@_to)) and sender_sha1 = HASHBYTES('SHA1', lower(@_from));
if @_limit = 0 or @_limit > @_msg_count
begin
insert into tig_offline_messages ( receiver, receiver_sha1, sender, sender_sha1, msg_type, ts, message, expired )
select @_to, HASHBYTES('SHA1', lower(@_to)), @_from, HASHBYTES('SHA1', lower(@_from)), @_type, @_ts, @_message, @_expired;
set @_msg_id = 1;
end
select @_msg_id as msg_id;
set nocount off;
end
-- QUERY END:
GO
-- QUERY START:
if exists (select 1 from sys.objects where type = 'P' and name = 'Tig_OfflineMessages_DeleteMessages')
drop procedure [dbo].[Tig_OfflineMessages_DeleteMessages];
-- QUERY END:
GO
-- QUERY START:
create procedure [dbo].[Tig_OfflineMessages_DeleteMessages]
@_to nvarchar(2049)
as
begin
set nocount on;
delete from tig_offline_messages where receiver_sha1 = HASHBYTES('SHA1', lower(@_to))
set nocount off;
end
-- QUERY END:
GO
================================================
FILE: src/main/database/sqlserver-server-8.5.0.sql
================================================
--
-- Tigase XMPP Server - The instant messaging server
-- Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Affero General Public License as published by
-- the Free Software Foundation, version 3 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU Affero General Public License for more details.
--
-- You should have received a copy of the GNU Affero General Public License
-- along with this program. Look for COPYING file in the top folder.
-- If not, see http://www.gnu.org/licenses/.
--
-- LOAD FILE: database/sqlserver-server-8.5.0-schema.sql
-- LOAD FILE: database/sqlserver-server-8.5.0-sp.sql
================================================
FILE: src/main/groovy/tigase/admin/AddUser.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
User add script as described in XEP-0133:
http://xmpp.org/extensions/xep-0133.html#add-user
AS:Description: Add user
AS:CommandId: http://jabber.org/protocol/admin#add-user
AS:Component: sess-man
AS:Group: Users
*/
package tigase.admin
import tigase.db.AuthRepository
import tigase.db.TigaseDBException
import tigase.db.UserExistsException
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.jid.BareJID
import java.util.logging.Level
import java.util.logging.Logger
def log = Logger.getLogger("tigase.admin");
def JID = "accountjid"
def PASSWORD = "password"
def PASSWORD_VERIFY = "password-verify"
def EMAIL = "email"
def p = (Packet) packet
def auth_repo = (AuthRepository) authRepository
def user_repo = (UserRepository) userRepository
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def userJid = Command.getFieldValue(packet, JID)
def userPass = Command.getFieldValue(packet, PASSWORD)
def userPassVer = Command.getFieldValue(packet, PASSWORD_VERIFY)
def userEmail = Command.getFieldValue(packet, EMAIL)
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Executing command add-user: ${userJid}. Request: ${p}, command: ${this}")
}
if (userJid == null || userPass == null || userPassVer == null || userEmail == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Adding a User")
Command.addInstructions(result, "Fill out this form to add a user.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
Command.addFieldValue(result, JID, userJid ?: "", "jid-single",
"The Jabber ID for the account to be added")
Command.addFieldValue(result, PASSWORD, userPass ?: "", "text-private",
"The password for this account")
Command.addFieldValue(result, PASSWORD_VERIFY, userPassVer ?: "", "text-private",
"Retype password")
Command.addFieldValue(result, EMAIL, userEmail ?: "", "text-single",
"Email address")
return result
}
def result = p.commandResult(Command.DataType.result)
try {
def bareJID = BareJID.bareJIDInstance(userJid)
if (isAllowedForDomain.apply(bareJID.getDomain())) {
auth_repo.addUser(bareJID, userPass)
user_repo.setData(bareJID, "email", userEmail);
Command.addTextField(result, "Note", "Operation successful");
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "User ${userJid} added correctly. Request packet: ${p}, command: ${this}")
}
} else {
Command.addTextField(result, "Error", "You do not have enough permissions to create account for this domain.");
}
} catch (UserExistsException ex) {
log.log(Level.WARNING, "Error while adding user ${userJid}: User already exists, can't be added. Request packet: ${p}, command: ${this}", ex)
Command.addTextField(result, "Note", "User already exists, can't be added.");
} catch (TigaseDBException ex) {
log.log(Level.WARNING, "Error while adding user ${userJid}: Problem accessing database, user not added. Request packet: ${p}, command: ${this}", ex)
Command.addTextField(result, "Note", "Problem accessing database, user not added.");
}
return result
================================================
FILE: src/main/groovy/tigase/admin/AddUserTracker.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Activate on the server user tracking mechanisms to aid in problem resolution.
AS:Description: Activate log tracker for a user
AS:CommandId: http://jabber.org/protocol/admin#add-user-tracker
AS:Component: sess-man
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
import tigase.util.log.LogUserFilter
import tigase.xmpp.XMPPSession
import tigase.xmpp.jid.BareJID
import java.util.logging.*
def JID = "accountjid"
def FILE_NAME = "file-name"
def FILE_LIMIT = 25000000
def FILE_COUNT = 5
def p = (Packet) packet
def userJid = Command.getFieldValue(packet, JID)
def fileName = Command.getFieldValue(packet, FILE_NAME)
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
if (!isServiceAdmin) {
def result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Error", "You are not service administrator");
return result
}
if (userJid == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Adding a User Log Tracker")
Command.addInstructions(result, "Fill out this form to add a user log tracker.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
Command.addFieldValue(result, JID, userJid ?: "", "jid-single",
"The Jabber ID for the account to be tracked")
Command.addFieldValue(result, FILE_NAME, fileName ?: "", "text-single",
"File name to write user's log entries")
return result
}
// Remove the old tracker if there is any active for that user
def hand = null
Handler[] handlers = Logger.getLogger("").getHandlers()
handlers.each {
Filter filt = it.getFilter()
if (filt != null && filt.class == LogUserFilter && ((LogUserFilter) filt).getId() == userJid) {
hand = it
}
}
if (hand != null) {
Logger.getLogger("").removeHandler(hand)
hand.close()
Command.addTextField(result, "Note", "Operation successful, tracker removed for " + userJid);
}
// Ok now we can setup a new tracker
def result = p.commandResult(Command.DataType.result)
def users_sessions = (Map) userSessions
def bareJID = BareJID.bareJIDInstance(userJid)
XMPPSession session = users_sessions.get(bareJID)
if (fileName == null || fileName == "") {
fileName = "logs/" + userJid
}
LogUserFilter filter = new LogUserFilter(bareJID, users_sessions)
FileHandler handler = new FileHandler(fileName, FILE_LIMIT, FILE_COUNT)
handler.setLevel(Level.ALL)
handler.setFilter(filter)
Logger.getLogger("").addHandler(handler)
Command.addTextField(result, "Note", "Operation successful");
Command.addTextField(result, "Note", "Tracking user " + userJid)
return result
================================================
FILE: src/main/groovy/tigase/admin/BoshPreBindSession.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
AS:Description: Pre-Bind BOSH user session
AS:CommandId: pre-bind-bosh-session
AS:Component: bosh
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Iq
import tigase.vhosts.VHostItem
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.jid.BareJID
try {
def USER_JID = "from";
def RID = "rid"
def HOLD = "hold"
def WAIT = "wait"
def SID = "sid"
def HOSTNAME = "hostname"
def p = (Iq) packet
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def userJid = Command.getFieldValue(p, USER_JID)
def rid = 0
def hold = Command.getFieldValue(p, HOLD)
def wait = Command.getFieldValue(p, WAIT)
if (userJid == null || userJid.isEmpty()) {
def res = (Iq) p.commandResult(Command.DataType.form);
Command.addTitle(res, "Pre-bind BOSH user session")
Command.addInstructions(res, "Fill out this form to create and pre-bind BOSH user session.")
Command.addFieldValue(res, "FORM_TYPE", "http://jabber.org/protocol/admin", "hidden")
Command.addFieldValue(res, USER_JID, "", "jid-single",
"JID of the user for which session should be created - either BareJID or FullJID, the former will result in randomly generated resource")
Command.addFieldValue(res, HOLD, hold ?: "1", "text-single", "HOLD value (optional)")
Command.addFieldValue(res, WAIT, wait ?: "60", "text-single", "WAIT value (optional)")
return res
}
def bareJID = BareJID.bareJIDInstance(userJid)
VHostItem vhost = vhost_man.getVHostItem(bareJID.getDomain())
def result = (Iq) p.commandResult(Command.DataType.result)
if (vhost == null) {
Command.addTextField(result, "Error", "Domain of the JID doesn't exists");
} else if (isAllowedForDomain.apply(bareJID.getDomain())) {
Map args = new HashMap();
if (userJid != null && !userJid.isEmpty()) {
args.put(USER_JID, userJid)
}
if (hold != null && !hold.isEmpty()) {
args.put(HOLD, hold)
}
if (wait != null && !wait.isEmpty()) {
args.put(WAIT, wait)
}
args = boshCM.preBindSession(args)
rid = args.get(RID);
def sid = args.get(SID);
def hostname = args.get(HOSTNAME)
userJid = args.get(USER_JID)
if (hostname != null) {
Command.addFieldValue(result, USER_JID, userJid, "jid-single", "JID")
Command.addFieldValue(result, HOSTNAME, hostname, "jid-single", "hostname")
Command.addFieldValue(result, RID, rid, "text-single", "RID")
Command.addFieldValue(result, SID, sid, "text-single", "SID")
Command.addFieldValue(result, HOLD, hold, "text-single", "HOLD")
Command.addFieldValue(result, WAIT, wait, "text-single", "WAIT")
} else {
Command.addTextField(result, "Error", "Error processing request, provided data is invalid");
}
} else {
Command.addTextField(result, "Error", "You do not have enough permissions");
}
return result
} catch (Exception ex) {
ex.printStackTrace();
}
================================================
FILE: src/main/groovy/tigase/admin/BroadcastToOnline.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
4.23 Send Announcement to Online Users as described in XEP-0133:
http://xmpp.org/extensions/xep-0133.html#announce
AS:Description: Send Announcement to Online Users
AS:CommandId: http://jabber.org/protocol/admin#announce
AS:Component: sess-man
AS:Group: Notifications
*/
package tigase.admin
import tigase.cluster.strategy.ClusteringStrategyIfc
import tigase.server.Command
import tigase.server.Iq
import tigase.server.Message
import tigase.server.Permissions
import tigase.xmpp.StanzaType
import tigase.xmpp.jid.JID
def FROM_JID = "from-jid"
def SUBJECT = "subject"
def MSG_TYPE = "msg-type"
def MSG_BODY = "announcement"
def p = (Iq) packet
def fromJid = Command.getFieldValue(p, FROM_JID)
def subject = Command.getFieldValue(p, SUBJECT)
def msg_type = Command.getFieldValue(p, MSG_TYPE)
def body = Command.getFieldValues(p, MSG_BODY)
def NOTIFY_CLUSTER = "notify-cluster"
boolean clusterMode = Boolean.valueOf(System.getProperty("cluster-mode", false.toString()));
boolean notifyCluster = Boolean.valueOf(Command.getFieldValue(packet, NOTIFY_CLUSTER))
if (fromJid == null || subject == null || msg_type == null || body == null) {
def res = (Iq) p.commandResult(Command.DataType.form);
Command.addTitle(res, "Message to online users")
Command.addInstructions(res, "Fill out this form to make an announcement to all active users of this service.")
Command.addFieldValue(res, "FORM_TYPE", "http://jabber.org/protocol/admin", "hidden")
Command.addFieldValue(res, FROM_JID, fromJid ?: p.getStanzaFrom().getDomain().toString(), "jid-single",
"From address")
Command.addFieldValue(res, SUBJECT, subject ?: "Message from administrators", "text-single", "Subject")
def msg_types = [ "normal", "headline", "chat" ]
Command.addFieldValue(res, MSG_TYPE, msg_type ?: msg_types[0], "Type", (String[]) msg_types, (String[]) msg_types)
if (body == null) {
body = [ "" ]
}
Command.addFieldMultiValue(res, MSG_BODY, body as List)
if (clusterMode) {
Command.addHiddenField(res, NOTIFY_CLUSTER, true.toString())
}
return res
}
Queue results = new LinkedList()
if (clusterMode && notifyCluster) {
if (null != clusterStrategy) {
def cluster = (ClusteringStrategyIfc) clusterStrategy
List cl_conns = cluster.getNodesConnected()
if (cl_conns && cl_conns.size() > 0) {
cl_conns.each { node ->
def forward = p.copyElementOnly();
Command.removeFieldValue(forward, NOTIFY_CLUSTER)
Command.addHiddenField(forward, NOTIFY_CLUSTER, false.toString())
forward.setPacketTo(node);
forward.setPermissions(Permissions.ADMIN);
results.offer(forward)
}
}
}
}
def jidFrom = JID.jidInstanceNS(fromJid)
def type = StanzaType.valueOf(msg_type)
def msg_body = body.join('\n')
def msg = Message.getMessage(null, null, type, msg_body, subject, null, "admin")
def result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Note", "Operation successful");
results += result
def conns = (Map) userConnections
conns.each { key, value ->
if (value.isAuthorized()) {
def res = msg.copyElementOnly()
res.initVars(jidFrom, value.getJID())
res.setPacketTo(key)
results += res
}
}
return (Queue) results
================================================
FILE: src/main/groovy/tigase/admin/ChangeUserPassword.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
User change password script as described in XEP-0133:
http://xmpp.org/extensions/xep-0133.html#
AS:Description: Change user password
AS:CommandId: http://jabber.org/protocol/admin#change-user-password
AS:Component: sess-man
AS:Group: Users
*/
package tigase.admin
import tigase.db.AuthRepository
import tigase.db.TigaseDBException
import tigase.db.UserNotFoundException
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.jid.BareJID
def JID = "accountjid"
def PASSWORD = "password"
//def PASSWORD_VERIFY = "password-verify"
def p = (Packet) packet
def auth_repo = (AuthRepository) authRepository
def user_repo = (UserRepository) userRepository
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def userJid = Command.getFieldValue(packet, JID)
def userPass = Command.getFieldValue(packet, PASSWORD)
//def userPassVer = Command.getFieldValue(packet, PASSWORD_VERIFY)
if (userJid == null || userPass == null /*|| userPassVer == null*/) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Changing a User Password")
Command.addInstructions(result, "Fill out this form to change a user's password.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
Command.addFieldValue(result, JID, userJid ?: "", "jid-single",
"The Jabber ID for this account")
Command.addFieldValue(result, PASSWORD, userPass ?: "", "text-private",
"The new password for this account")
// Command.addFieldValue(result, PASSWORD_VERIFY, userPassVer ?: "", "text-private",
// "Retype password")
return result
}
def result = p.commandResult(Command.DataType.result)
try {
def bareJID = BareJID.bareJIDInstance(userJid)
if (isAllowedForDomain.apply(bareJID.getDomain())) {
if (user_repo.userExists(bareJID)) {
auth_repo.updatePassword(bareJID, userPass)
Command.addTextField(result, "Note", "Operation successful");
} else {
Command.addTextField(result, "Note", "User not exists, can't change password.");
}
} else {
Command.addTextField(result, "Error",
"You do not have enough permissions to change account password for this domain.");
}
} catch (UserNotFoundException ex) {
Command.addTextField(result, "Note", "User not exists, can't change password.");
} catch (TigaseDBException ex) {
Command.addTextField(result, "Note", "Problem accessing database, password not changed.");
}
return result
================================================
FILE: src/main/groovy/tigase/admin/CompManager.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Manage active server components
AS:Description: Manage active server components
AS:CommandId: comp-manager
AS:Component: basic-conf
AS:Group: Configuration
*/
package tigase.admin
import tigase.conf.ConfigRepositoryIfc
import tigase.conf.Configurable
import tigase.conf.Configurator
import tigase.osgi.ModulesManagerImpl
import tigase.server.Command
import tigase.server.Iq
import tigase.server.MessageRouterConfig
import tigase.server.XMPPServer
class DelayedReloadTask
extends Thread {
void run() {
Thread.sleep(5000);
((Configurator) XMPPServer.getConfigurator()).updateMessageRouter();
}
}
try {
def ACTION = "action";
def ACTION_ADD = "Add";
def ACTION_EDIT = "Edit";
def ACTION_REMOVE = "Remove";
def ACTION_LIST = "List";
def COMP_NAME = "comp-name";
def COMP_CLASS = "comp-class";
def SUBMIT = "confirm";
def getComponentProperties = { comp_name, comp_class ->
def conf = XMPPServer.getConfigurator();
def prop = conf.getProperties(comp_name);
try {
def comp = ModulesManagerImpl.getInstance().getServerComponent(comp_class);
if (!comp) {
def INTERNAL_COMPONENTS = [ ];
INTERNAL_COMPONENTS.addAll(MessageRouterConfig.COMPONENT_CLASSES.values());
INTERNAL_COMPONENTS.addAll(MessageRouterConfig.COMP_CLUS_MAP.values());
if (!XMPPServer.isOSGi() || INTERNAL_COMPONENTS.contains(comp_class)) {
comp = XMPPServer.class.getClassLoader().loadClass(comp_class).newInstance()
}
}
if (comp) {
comp.setName(comp_name)
def defProp = comp.getDefaults(conf.getDefConfigParams() ?: [ : ]) ?: [ : ];
defProp.putAll(prop);
return defProp;
} else {
return [ : ];
}
} catch (Exception ex) {
ex.printStackTrace();
return [ : ];
}
};
def prepareComponentConfigForAdHoc = { res, comp_name, comp_class ->
def prop = getComponentProperties(comp_name, comp_class);
def keys = [ ];
keys.addAll(prop.keySet());
keys.sort { it }.each { key ->
def val = prop[key];
if (val.getClass().isArray()) {
def tmp = [ ];
for (def x : val) {
tmp.add(String.valueOf(x));
}
val = tmp.join(',');
}
if (!(val instanceof String)) {
val = val.toString();
}
Command.addFieldValue(res, key, val);
}
};
def getConfigFromAdHoc = { p, comp_name, comp_class ->
def defProp = getComponentProperties(comp_name, comp_class);
def props = [ : ];
defProp.each { key, defVal ->
def val = Command.getFieldValue(p, key);
def tmpVal = defVal;
if (tmpVal.getClass().isArray()) {
def tmp = [ ];
for (def x : tmpVal) {
tmp.add(String.valueOf(x));
}
tmpVal = tmp.join(',');
}
if (val && !val.equals(tmpVal)) {
def cls = defVal.getClass();
if (val == "null") {
val = null
};
if (cls == Long[].class) {
def out = [ ];
val.split(',').each { out.add(Long.parseLong(it)) };
val = (out as Long[]);
} else if (cls == Integer[].class) {
def out = [ ];
val.split(',').each { out.add(Integer.parseInt(it)) };
val = (out as Integer[]);
} else if (cls == String[].class) {
def out = [ ];
val.split(',').each { out.add(it) };
val = (out as String[]);
} else if (cls == Long.class) {
val = Long.parseLong(val);
} else if (cls == Integer.class) {
val = Integer.parseInt(val);
} else if (cls == Boolean.class) {
val = Boolean.parseBoolean(val);
} else {
println "unknown convertion for key = " + key + " , " + cls.getName()
}
props.put(key, val);
}
}
return props;
};
def conf_repo = (ConfigRepositoryIfc) comp_repo
def p = (Iq) packet
// check permission
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
if (!isServiceAdmin) {
def result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "You do not have enough permissions to access this data.");
return result
}
def comp_name = Command.getFieldValue(p, COMP_NAME)
def action = Command.getFieldValue(p, ACTION);
def submit = Command.getFieldValue(p, SUBMIT);
if (action == null) {
def res = (Iq) p.commandResult(Command.DataType.form)
def actions = [ ACTION_LIST, ACTION_ADD, ACTION_EDIT, ACTION_REMOVE ];
Command.addFieldValue(res, ACTION, actions[0], "Action",
(String[]) actions, (String[]) actions)
return res;
}
if (action == ACTION_ADD && comp_name == null) {
def res = (Iq) p.commandResult(Command.DataType.form)
Command.addFieldValue(res, COMP_NAME, "", "text-single", "Component name");
Command.addFieldValue(res, COMP_CLASS, "", "text-single", "Component class");
Command.addHiddenField(res, ACTION, ACTION_ADD);
return res;
} else if (action == ACTION_LIST && comp_name == null) {
def res = (Iq) p.commandResult(Command.DataType.form)
def compNames = [ ]
def conf = XMPPServer.getConfigurator();
def mrProps = conf.getProperties("message-router");
compNames = mrProps.get(MessageRouterConfig.MSG_RECEIVERS_NAMES_PROP_KEY).toList();
compNames += mrProps.get(MessageRouterConfig.REGISTRATOR_NAMES_PROP_KEY).toList();
compNames.each {
def mr = conf.getComponent(it);
if (mr) {
Command.addFieldMultiValue(res, it, Arrays.asList(mr.getComponentInfo().toString()))
}
}
Command.addHiddenField(res, ACTION, action);
return res
} else if (comp_name == null) {
def res = (Iq) p.commandResult(Command.DataType.form)
def compNames = [ ]
def conf = XMPPServer.getConfigurator();
conf_repo.getCompNames().findAll { conf.getComponent(it) != null }.each { compNames += it }
compNames.sort();
Command.addFieldValue(res, COMP_NAME, comp_name ?: compNames[0], "Components",
(String[]) compNames, (String[]) compNames)
Command.addHiddenField(res, ACTION, action ?: "");
return res
} else {
if (action == ACTION_REMOVE) {
def res = (Iq) p.commandResult(Command.DataType.result)
def conf = XMPPServer.getConfigurator();
def initProps = conf.getDefConfigParams().
findAll { return it.key.startsWith(Configurable.GEN_COMP_NAME) && it.value.equals(comp_name); };
def suffix = null;
initProps.each {
suffix = it.key.substring(Configurable.GEN_COMP_NAME.length());
}
conf.getDefConfigParams().remove(Configurable.GEN_COMP_NAME + suffix);
conf.getDefConfigParams().remove(Configurable.GEN_COMP_CLASS + suffix);
def mrProps = conf.getProperties("message-router");
def compNames = mrProps.get(MessageRouterConfig.MSG_RECEIVERS_NAMES_PROP_KEY).toList();
if (compNames.contains(comp_name)) {
compNames.remove(comp_name);
}
mrProps = [ : ];
mrProps.put(MessageRouterConfig.MSG_RECEIVERS_NAMES_PROP_KEY, (compNames as String[]));
conf.putProperties("message-router", mrProps);
new DelayedReloadTask().start();
Command.addTextField(res, "Note", "Operation successful.")
return res;
} else if (!submit) {
def comp_class = Command.getFieldValue(p, COMP_CLASS);
if (comp_class == null) {
def conf = XMPPServer.getConfigurator();
def initProps = conf.getDefConfigParams().
findAll { return it.key.startsWith(Configurable.GEN_COMP_NAME) && it.value.equals(comp_name); };
def suffix = null;
initProps.each {
suffix = it.key.substring(Configurable.GEN_COMP_NAME.length());
}
comp_class = conf.getDefConfigParams().get(Configurable.GEN_COMP_CLASS + suffix);
if (!comp_class) {
comp_class = MessageRouterConfig.COMPONENT_CLASSES.get(comp_name)
};
if (!comp_class) {
comp_class = MessageRouterConfig.COMP_CLUS_MAP.get(comp_name)
};
if (!comp_class && comp_name == "basic-conf") {
comp_class = XMPPServer.getConfigurator().
getClass().
getCanonicalName()
};
if (!comp_class) {
throw new Exception("Could not find component class for component: " + comp_name)
};
}
def res = (Iq) p.commandResult(Command.DataType.form)
Command.addFieldValue(res, COMP_NAME, comp_name, "fixed", "Component name");
Command.addHiddenField(res, COMP_CLASS, comp_class);
Command.addHiddenField(res, ACTION, action);
Command.addHiddenField(res, SUBMIT, SUBMIT);
prepareComponentConfigForAdHoc(res, comp_name, comp_class);
return res;
} else if (submit) {
def comp_class = Command.getFieldValue(p, COMP_CLASS);
// here we should apply results of new or edit
def res = (Iq) p.commandResult(Command.DataType.result)
def props = getConfigFromAdHoc(p, comp_name, comp_class);
def conf = XMPPServer.getConfigurator();
conf.putProperties(comp_name, props);
def initProps = conf.getDefConfigParams().
findAll { return it.key.startsWith(Configurable.GEN_COMP_NAME) && it.value.equals(comp_name); };
if (initProps.isEmpty()) {
def suffix = 1;
while (!(conf.getDefConfigParams().
findAll {
return it.key.startsWith(Configurable.GEN_COMP_NAME) && it.key.endsWith("-" + suffix);
}.
isEmpty())) {
suffix += 1;
}
conf.getDefConfigParams().put(Configurable.GEN_COMP_NAME + "-" + suffix, comp_name);
conf.getDefConfigParams().put(Configurable.GEN_COMP_CLASS + "-" + suffix, comp_class);
}
def mrProps = conf.getProperties("message-router");
def compNames = mrProps.get(MessageRouterConfig.MSG_RECEIVERS_NAMES_PROP_KEY).toList();
if (!compNames.contains(comp_name)) {
compNames.add(comp_name);
}
mrProps = [ : ];
mrProps.put(MessageRouterConfig.MSG_RECEIVERS_NAMES_PROP_KEY, (compNames as String[]));
mrProps.put(MessageRouterConfig.MSG_RECEIVERS_PROP_KEY + comp_name + ".class", comp_class)
conf.putProperties("message-router", mrProps);
new DelayedReloadTask().start();
Command.addTextField(res, "Note", "Operation successful.");
return res;
}
}
} catch (Exception ex) {
ex.printStackTrace();
throw ex;
}
================================================
FILE: src/main/groovy/tigase/admin/CompRepoItemAdd.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Add an item in a component repository:
tigase.db.ComponentRepository
Works only for some components which actually use the repository that way.
AS:Description: Add new item
AS:CommandId: comp-repo-item-add
AS:Component: vhost-man,ext,ext-disco
AS:ComponentClass: tigase.server.ext.ComponentProtocol,tigase.server.ext.ComponentProtocolManager
AS:Group: Configuration
*/
package tigase.admin
import tigase.db.comp.ComponentRepository
import tigase.server.Command
import tigase.server.Iq
import tigase.server.Permissions
def MARKER = "command-marker"
def repo = (ComponentRepository) comp_repo
def p = (Iq) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def item = repo.getItemInstance()
def marker = Command.getFieldValue(p, MARKER)
def supportedComponents = [ "vhost-man" ]
def NOTIFY_CLUSTER = "notify-cluster"
boolean clusterMode = Boolean.valueOf(System.getProperty("cluster-mode", false.toString()));
boolean notifyCluster = Boolean.valueOf(Command.getFieldValue(packet, NOTIFY_CLUSTER))
Queue results = new LinkedList()
if (marker == null) {
def result = p.commandResult(Command.DataType.form)
item.addCommandFields(result)
Command.addHiddenField(result, MARKER, MARKER)
if (clusterMode) {
Command.addHiddenField(result, NOTIFY_CLUSTER, true.toString())
}
return result
}
if (clusterMode && notifyCluster && supportedComponents.contains(componentName)) {
def nodes = (List) connectedNodes
if (nodes && nodes.size() > 0) {
nodes.each { node ->
def forward = p.copyElementOnly();
Command.removeFieldValue(forward, NOTIFY_CLUSTER)
Command.addHiddenField(forward, NOTIFY_CLUSTER, false.toString())
forward.setPacketTo(node);
forward.setPermissions(Permissions.ADMIN);
results.offer(forward)
}
}
}
def oldItem = item.getKey() != null ? repo.getItem(item.getKey()) : null;
def result = p.commandResult(Command.DataType.result)
try {
item.initFromCommand(p)
if (oldItem == null) {
def validateResult = repo.validateItem(item)
if (validateResult == null || (isServiceAdmin && !item.getKey().isEmpty())) {
repo.addItem(item)
Command.addTextField(result, "Note", "Operation successful.")
if (validateResult != null) {
Command.addTextField(result, "Note", " ")
Command.addTextField(result, "Warning", validateResult)
}
} else {
Command.addTextField(result, "Error", "The item did not pass validation checking.")
Command.addTextField(result, "Note", " ")
Command.addTextField(result, "Warning", validateResult)
}
} else {
Command.addTextField(result, "Error", "The item is already added, you can't add it twice.")
}
} catch (IllegalArgumentException ex) {
Command.addTextField(result, "Error", ex.getMessage());
}
results.add(result);
return results;
================================================
FILE: src/main/groovy/tigase/admin/CompRepoItemRemove.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Remove an item from a component repository:
tigase.db.ComponentRepository
Works only for some components which actually use the repository that way.
AS:Description: Remove an item
AS:CommandId: comp-repo-item-remove
AS:Component: vhost-man,ext,ext-disco
AS:ComponentClass: tigase.server.ext.ComponentProtocol,tigase.server.ext.ComponentProtocolManager
AS:Group: Configuration
*/
package tigase.admin
import tigase.db.comp.ComponentRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.server.Permissions
def ITEMS = "item-list"
def repo = (ComponentRepository) comp_repo
def p = (Packet) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def itemKey = Command.getFieldValue(packet, ITEMS)
def supportedComponents = [ "vhost-man" ]
def NOTIFY_CLUSTER = "notify-cluster"
boolean clusterMode = Boolean.valueOf(System.getProperty("cluster-mode", false.toString()));
boolean notifyCluster = Boolean.valueOf(Command.getFieldValue(packet, NOTIFY_CLUSTER))
Queue results = new LinkedList()
if (itemKey == null) {
def items = repo.allItems()
def itemsStr = [ ]
if (items.size() > 0) {
items.each {
if (isServiceAdmin || it.isOwner(stanzaFromBare.toString())) {
itemsStr += it.getKey()
}
}
}
if (itemsStr.size() > 0) {
def result = p.commandResult(Command.DataType.form)
Command.addFieldValue(result, ITEMS, itemsStr[0], "List of items",
(String[]) itemsStr, (String[]) itemsStr)
if (clusterMode) {
Command.addHiddenField(result, NOTIFY_CLUSTER, true.toString())
}
return result
} else {
def result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Note", "There are no items on the list");
return result
}
}
if (clusterMode && notifyCluster && supportedComponents.contains(componentName)) {
def nodes = (List) connectedNodes
if (nodes && nodes.size() > 0) {
nodes.each { node ->
def forward = p.copyElementOnly();
Command.removeFieldValue(forward, NOTIFY_CLUSTER)
Command.addHiddenField(forward, NOTIFY_CLUSTER, false.toString())
forward.setPacketTo(node);
forward.setPermissions(Permissions.ADMIN);
results.offer(forward)
}
}
}
def result = p.commandResult(Command.DataType.result)
def item = repo.getItem(itemKey)
if (item == null) {
Command.addTextField(result, "Error", "No such item, deletion impossible.");
} else {
if (isServiceAdmin || item.isOwner(stanzaFromBare.toString())) {
repo.removeItem(itemKey)
Command.addTextField(result, "Note", "Operation successful")
} else {
Command.addTextField(result, "Error",
"You are not the Item owner or you have no " + "enough permission to remove the item.")
}
}
results.add(result);
return results;
================================================
FILE: src/main/groovy/tigase/admin/CompRepoItemUpdate.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Update an item in a component repository:
tigase.db.ComponentRepository
Works only for some components which actually use the repository that way.
AS:Description: Update item configuration
AS:CommandId: comp-repo-item-update
AS:Component: vhost-man,ext,basic-conf,ext-disco
AS:ComponentClass: tigase.server.ext.ComponentProtocol,tigase.server.ext.ComponentProtocolManager
AS:Group: Configuration
*/
package tigase.admin
import tigase.db.comp.ComponentRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.server.Permissions
def MARKER = "command-marker"
def ITEMS = "item-list"
def repo = (ComponentRepository) comp_repo
def p = (Packet) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def itemKey = Command.getFieldValue(packet, ITEMS)
def marker = Command.getFieldValue(packet, MARKER)
def supportedComponents = [ "vhost-man" ]
def NOTIFY_CLUSTER = "notify-cluster"
boolean clusterMode = Boolean.valueOf(System.getProperty("cluster-mode", false.toString()));
boolean notifyCluster = Boolean.valueOf(Command.getFieldValue(packet, NOTIFY_CLUSTER))
Queue results = new LinkedList()
if (itemKey == null) {
def items = repo.allItems()
def itemsStr = [ ]
if (items.size() > 0) {
items.each {
if (isServiceAdmin || it.isOwner(stanzaFromBare.toString()) || it.isAdmin(stanzaFromBare.toString())) {
itemsStr += it.getKey()
}
}
}
if (itemsStr.size() > 0) {
def result = p.commandResult(Command.DataType.form)
Command.addFieldValue(result, ITEMS, itemsStr[0], "List of items",
(String[]) itemsStr, (String[]) itemsStr)
return result
} else {
def result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "There are no items on the list");
return result
}
}
if (marker == null) {
def item = repo.getItem(itemKey)
if (item == null) {
Command.addTextField(result, "Error", "No such item, update impossible.");
} else {
if (isServiceAdmin || item.isOwner(stanzaFromBare.toString()) || item.isAdmin(stanzaFromBare.toString())) {
def result = p.commandResult(Command.DataType.form)
item.addCommandFields(result)
Command.addHiddenField(result, MARKER, MARKER)
Command.addHiddenField(result, ITEMS, itemKey)
if (clusterMode) {
Command.addHiddenField(result, NOTIFY_CLUSTER, true.toString())
}
return result
} else {
def result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "You do not have enough permissions to manage this item.")
return result
}
}
}
if (clusterMode && notifyCluster && supportedComponents.contains(componentName)) {
def nodes = (List) connectedNodes
if (nodes && nodes.size() > 0) {
nodes.each { node ->
def forward = p.copyElementOnly();
Command.removeFieldValue(forward, NOTIFY_CLUSTER)
Command.addHiddenField(forward, NOTIFY_CLUSTER, false.toString())
forward.setPacketTo(node);
forward.setPermissions(Permissions.ADMIN);
results.offer(forward)
}
}
}
def result = p.commandResult(Command.DataType.result)
def item = repo.getItemInstance()
try {
item.initFromCommand(packet)
def oldItem = repo.getItem(item.getKey())
if (oldItem == null) {
Command.addTextField(result, "Error", "The item you try to update does not exist.");
} else {
def validateResult = repo.validateItem(item)
if (validateResult == null || isServiceAdmin) {
if (isServiceAdmin || oldItem.isOwner(stanzaFromBare.toString())
// we allow changes by admins, except for changing the owner of the domain.
|| oldItem.isAdmin(stanzaFromBare.toString()) && oldItem.getOwner().equals(item.getOwner())) {
repo.addItem(item)
Command.addTextField(result, "Note", "Operation successful");
if (validateResult != null) {
Command.addTextField(result, "Note", " ")
Command.addTextField(result, "Warning", validateResult)
}
} else {
Command.addTextField(result, "Error",
"You are not the Item owner or you have no " + "enough permission to change the item.")
}
} else {
Command.addTextField(result, "Error", "The item did not pass validation checking.")
Command.addTextField(result, "Note", " ")
Command.addTextField(result, "Warning", validateResult)
}
}
} catch (IllegalArgumentException ex) {
Command.addTextField(result, "Error", ex.getMessage());
}
results.add(result);
return results;
================================================
FILE: src/main/groovy/tigase/admin/CompRepoReload.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Reload a component repository:
tigase.db.ComponentRepository
Works only for some components which actually use the repository that way.
AS:Description: Reload component repository
AS:CommandId: comp-repo-reload
AS:Component: vhost-man,ext,ext-disco
*/
package tigase.admin
import tigase.db.comp.ComponentRepository
def repo = (ComponentRepository) comp_repo
repo.reload()
def result = "Reloaded items - " + repo.size() + ":\n"
def items = repo.allItems()
if (items.size() > 0) {
items.each { result += "\n" + it.getKey() }
}
return result
================================================
FILE: src/main/groovy/tigase/admin/ConnectionTime.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Calculates maximum and average connection time for all connected users
AS:Description: Connections time
AS:CommandId: connection-time
AS:Component: sess-man
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Iq
import tigase.xmpp.XMPPResourceConnection
def user_connections = (Map) userConnections
def p = (Iq) packet
def total_time = 0
def max_time = 0
def start_time = System.currentTimeMillis()
user_connections.entrySet().each {
if (!it.getKey().toString().startsWith("sess-man")) {
def session = (XMPPResourceConnection) it.getValue()
def creation_time = start_time - session.getCreationTime()
total_time += creation_time
if (creation_time > max_time) {
max_time = creation_time
}
}
}
def average_time = total_time / user_connections.size()
def res = (Iq) p.commandResult(Command.DataType.result)
Command.addFieldMultiValue(res, "Connections time: ",
[ "Longest connection: " + (max_time / 1000),
"Average connection time:" + (average_time / 1000) ])
return res
================================================
FILE: src/main/groovy/tigase/admin/DNSQuery.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
User add script as described in XEP-0133:
http://xmpp.org/extensions/xep-0133.html#add-user
AS:Description: DNS Query
AS:CommandId: query-dns
AS:Component: vhost-man
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
import tigase.util.dns.DNSEntry
import tigase.util.dns.DNSResolverFactory
def DOMAIN = "domain-name"
def p = (Packet) packet
def domain = Command.getFieldValue(packet, DOMAIN)
if (domain == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Provide domain name")
Command.addInstructions(result, "Fill out this form to query DNS for domain.")
Command.addFieldValue(result, DOMAIN, domain ?: "", "text-single",
"Domain name to query DNS")
return result
}
def result = p.commandResult(Command.DataType.result)
def response_data = [ ]
try {
response_data += "IP: " + DNSResolverFactory.getInstance().getHostIP(domain)
} catch (Exception ex) {
response_data += "IP: " + ex.toString()
}
try {
DNSEntry[] entries = DNSResolverFactory.getInstance().getHostSRV_Entries(domain)
int cnt = 1
entries.each {
response_data += "SRV " + (cnt++) + ": " + it.toString()
}
response_data += "Selected SRV: " + DNSResolverFactory.getInstance().getHostSRV_Entry(domain).toString()
response_data += "Selected SRV IP: " + DNSResolverFactory.getInstance().getHostSRV_IP(domain)
Command.addFieldMultiValue(result, "DNS Response ", response_data);
} catch (Exception ex) {
Command.addTextField(result, "Note", "Problem querying DNS for domain: " + domain);
// There is a new API to pass exception, for now we have to do it manually
//Command.addFieldMultiValue(result, "Exception: ", ex)
def stes = [ ]
stes += ex.toString()
ex.getStackTrace().each {
stes += it.toString()
}
Command.addFieldMultiValue(result, "Exception: ", stes);
}
return result
================================================
FILE: src/main/groovy/tigase/admin/DeleteMOTD.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Delete Message of the Day
AS:Description: Delete Message of the Day
AS:CommandId: http://jabber.org/protocol/admin#delete-motd
AS:Component: sess-man
AS:Group: Configuration
*/
package tigase.admin
import groovy.transform.CompileStatic
import tigase.kernel.core.Kernel
import tigase.server.Command
import tigase.server.Iq
import tigase.server.Packet
import tigase.server.xmppsession.SessionManager
import tigase.xmpp.impl.MotdProcessor
Kernel kernel = (Kernel) kernel;
SessionManager component = (SessionManager) component
packet = (Iq) packet
@CompileStatic
Packet process(Kernel kernel, SessionManager component, Iq p) {
if (!component.isAdmin(p.getStanzaFrom())) {
def result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "You are not service administrator")
return result
}
def result = p.commandResult(Command.DataType.result)
if (kernel.getDependencyManager().getBeanConfigs(MotdProcessor.class, null, null, true).isEmpty()) {
Command.addTextField(result, "Error", "MotDProcessor is disabled");
return result
}
MotdProcessor motdProcessor = kernel.getInstance(MotdProcessor.class)
motdProcessor.setMotd(null)
return result;
}
return process(kernel, component, packet)
================================================
FILE: src/main/groovy/tigase/admin/DeleteUser.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
User delete script as described in XEP-0133:
http://xmpp.org/extensions/xep-0133.html#delete-user
AS:Description: Delete user
AS:CommandId: http://jabber.org/protocol/admin#delete-user
AS:Component: sess-man
AS:Group: Users
*/
package tigase.admin
import tigase.db.AuthRepository
import tigase.db.TigaseDBException
import tigase.db.UserNotFoundException
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.server.Permissions
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.StanzaType
import tigase.xmpp.jid.BareJID
def JIDS = "accountjids"
def p = (Packet) packet
def auth_repo = (AuthRepository) authRepository
def user_repo = (UserRepository) userRepository
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def NOTIFY_CLUSTER = "notify-cluster"
boolean clusterMode = Boolean.valueOf(System.getProperty("cluster-mode", false.toString()));
def notifyClusterStr = Command.getFieldValue(packet, NOTIFY_CLUSTER);
boolean notifyCluster = (notifyClusterStr != null) ? Boolean.valueOf(notifyClusterStr) : true;
def user_sessions = (Map) userSessions;
def userJids = Command.getFieldValues(packet, JIDS)
if (userJids == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Deleting a User")
Command.addInstructions(result, "Fill out this form to delete a user.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
Command.addFieldValue(result, JIDS, userJids ?: "", "jid-multi",
"The Jabber ID(s) to delete")
if (clusterMode) {
Command.addHiddenField(result, NOTIFY_CLUSTER, true.toString())
}
return result
}
def results = new LinkedList();
def closeUserSessions = { userJid ->
try {
def bareJID = BareJID.bareJIDInstance(userJid)
def sess = user_sessions.get(bareJID);
if (sess != null) {
def conns = sess.getConnectionIds();
for (conn in conns) {
def res = sess.getResourceForConnectionId(conn);
if (res != null) {
def commandClose = Command.CLOSE.getPacket(p.getStanzaTo(), conn,
StanzaType.set, res.nextStanzaId());
results.offer(commandClose);
}
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
};
if (clusterMode) {
if (!notifyCluster) {
for (userJid in userJids) {
closeUserSessions(userJid);
}
return results;
}
}
def result = p.commandResult(Command.DataType.result)
results.offer(result);
def msgs = [ ];
def errors = [ ];
for (userJid in userJids) {
try {
def bareJID = BareJID.bareJIDInstance(userJid)
if (isAllowedForDomain.apply(bareJID.getDomain())) {
if (user_repo.userExists(bareJID)) {
auth_repo.removeUser(bareJID)
try {
user_repo.removeUser(bareJID)
} catch (UserNotFoundException ex) {
// We ignore this error here. If auth_repo and user_repo are in fact the same
// database, then user has been already removed with the auth_repo.removeUser(...)
// then the second call to user_repo may throw the exception which is fine.
}
if (clusterMode && notifyCluster) {
def nodes = (List) clusterStrategy.getNodesConnected();
if (nodes && nodes.size() > 0) {
nodes.each { node ->
def forward = p.copyElementOnly();
Command.removeFieldValue(forward, NOTIFY_CLUSTER)
Command.addHiddenField(forward, NOTIFY_CLUSTER, false.toString())
forward.setPacketTo(node);
forward.setPermissions(Permissions.ADMIN);
results.offer(forward)
}
}
}
closeUserSessions(userJid);
msgs.add("Operation successful for user " + userJid);
} else {
errors.add("User " + userJid + " not found, can't be deleted.");
}
} else {
errors.add("You do not have enough permissions to delete accounts for domain " + bareJID.getDomain() + ".");
}
} catch (UserNotFoundException ex) {
errors.add("User " + userJid + " not exists, can't be deleted.");
} catch (TigaseDBException ex) {
errors.add("Problem accessing database, user " + userJid + " not deleted.");
}
}
if (!msgs.isEmpty()) {
Command.addFieldMultiValue(result, "Notes", msgs)
};
if (!errors.isEmpty()) {
Command.addFieldMultiValue(result, "Errors", errors)
};
return results
================================================
FILE: src/main/groovy/tigase/admin/DeleteWelcomeMessage.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Delete Welcome Message
AS:Description: Delete Welcome Message
AS:CommandId: http://jabber.org/protocol/admin#delete-welcome
AS:Component: sess-man
AS:Group: Configuration
*/
package tigase.admin
import groovy.transform.CompileStatic
import tigase.kernel.core.Kernel
import tigase.server.Command
import tigase.server.Iq
import tigase.server.Packet
import tigase.server.xmppsession.SessionManager
import tigase.xmpp.impl.JabberIqRegister
Kernel kernel = (Kernel) kernel;
SessionManager component = (SessionManager) component
packet = (Iq) packet
@CompileStatic
Packet process(Kernel kernel, SessionManager component, Iq p) {
if (!component.isAdmin(p.getStanzaFrom())) {
def result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "You are not service administrator")
return result
}
def result = p.commandResult(Command.DataType.result)
if (kernel.getDependencyManager().getBeanConfigs(JabberIqRegister.class, null, null, true).isEmpty()) {
Command.addTextField(result, "Error", "JabberIqRegister is disabled");
return result
}
JabberIqRegister registerProcessor = kernel.getInstance(JabberIqRegister.class)
registerProcessor.setWelcomeMessage(null)
return result;
}
return process(kernel, component, packet)
================================================
FILE: src/main/groovy/tigase/admin/DisableUser.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
User modify script
AS:Description: Disable user
AS:CommandId: http://jabber.org/protocol/admin#disable-user
AS:Component: sess-man
AS:Group: Users
*/
package tigase.admin
import tigase.db.AuthRepository
import tigase.db.TigaseDBException
import tigase.db.UserNotFoundException
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.server.Permissions
import tigase.vhosts.VHostItem
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.StanzaType
import tigase.xmpp.jid.BareJID
def JIDS = "accountjids"
def p = (Packet) packet
def auth_repo = (AuthRepository) authRepository
def user_repo = (UserRepository) userRepository
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def NOTIFY_CLUSTER = "notify-cluster"
boolean clusterMode = Boolean.valueOf(System.getProperty("cluster-mode", false.toString()))
def notifyClusterStr = Command.getFieldValue(packet, NOTIFY_CLUSTER)
boolean notifyCluster = (notifyClusterStr != null) ? Boolean.valueOf(notifyClusterStr) : true
def user_sessions = (Map) userSessions
def userJids = Command.getFieldValues(packet, JIDS)
if (userJids == null) {
def result = p.commandResult(Command.DataType.form)
Command.addTitle(result, "Disabling a User")
Command.addInstructions(result, "Fill out this form to disable a user.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
Command.addFieldValue(result, JIDS, userJids ?: "", "jid-multi",
"The Jabber ID(s) to disable")
if (clusterMode) {
Command.addHiddenField(result, NOTIFY_CLUSTER, true.toString())
}
return result
}
def results = new LinkedList()
def closeUserSessions = { userJid ->
try {
def bareJID = BareJID.bareJIDInstance(userJid)
def sess = user_sessions.get(bareJID)
if (sess != null) {
def conns = sess.getConnectionIds()
for (conn in conns) {
def res = sess.getResourceForConnectionId(conn)
if (res != null) {
def commandClose = Command.CLOSE.getPacket(p.getStanzaTo(), conn,
StanzaType.set, res.nextStanzaId())
results.offer(commandClose)
}
}
}
} catch (Exception ex) {
ex.printStackTrace()
}
}
if (clusterMode) {
if (!notifyCluster) {
for (userJid in userJids) {
closeUserSessions(userJid)
}
return results
}
}
if (clusterMode && notifyCluster) {
def nodes = (List) clusterStrategy.getNodesConnected()
if (nodes && nodes.size() > 0) {
nodes.each { node ->
def forward = p.copyElementOnly()
Command.removeFieldValue(forward, NOTIFY_CLUSTER)
Command.addHiddenField(forward, NOTIFY_CLUSTER, false.toString())
forward.setPacketTo(node)
forward.setPermissions(Permissions.ADMIN)
results.offer(forward)
}
}
}
def result = p.commandResult(Command.DataType.result)
def msgs = [ ]
def errors = [ ]
for (userJid in userJids) {
try {
def bareJID = BareJID.bareJIDInstance(userJid)
VHostItem vhost = vhost_man.getVHostItem(bareJID.getDomain())
if (isAllowedForDomain.apply(bareJID.getDomain())) {
if (user_repo.userExists(bareJID)) {
try {
auth_repo.setAccountStatus(bareJID, AuthRepository.AccountStatus.disabled)
} catch (TigaseDBException ex) {
errors.add("Account " + userJid + " state was not enabled: " + ex.getMessage())
}
closeUserSessions(userJid)
msgs.add("Operation successful for user " + userJid)
} else {
msgs.add("User " + userJid + " doesn't exist")
}
} else {
errors.add("You do not have enough permissions to enable accounts for domain " + bareJID.getDomain() + ".")
}
} catch (UserNotFoundException ex) {
errors.add("User " + userJid + " not exists, can't be enabled.")
} catch (TigaseDBException ex) {
errors.add("Problem accessing database, user " + userJid + " not enabled.")
}
}
if (!msgs.isEmpty()) {
Command.addFieldMultiValue(result, "Notes", msgs)
}
if (!errors.isEmpty()) {
Command.addFieldMultiValue(result, "Errors", errors)
}
results.offer(result)
return results
================================================
FILE: src/main/groovy/tigase/admin/EditMOTD.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Edit Message of the Day
AS:Description: Edit Message of the Day
AS:CommandId: http://jabber.org/protocol/admin#edit-motd
AS:Component: sess-man
AS:Group: Configuration
*/
package tigase.admin
import groovy.transform.CompileStatic
import tigase.kernel.core.Kernel
import tigase.server.Command
import tigase.server.Iq
import tigase.server.Packet
import tigase.server.xmppsession.SessionManager
import tigase.xmpp.impl.MotdProcessor
Kernel kernel = (Kernel) kernel;
SessionManager component = (SessionManager) component
packet = (Iq) packet
@CompileStatic
Packet process(Kernel kernel, SessionManager component, Iq p) {
String MOTD = "motd"
if (!component.isAdmin(p.getStanzaFrom())) {
def result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "You are not service administrator")
return result
}
if (kernel.getDependencyManager().getBeanConfigs(MotdProcessor.class, null, null, true).isEmpty()) {
def result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "MotDProcessor is disabled");
return result
}
def motd = Command.getFieldValues(p, MOTD)
if (!motd) {
def result = p.commandResult(Command.DataType.form)
Command.addTitle(result, "Editing the Message of the Day")
Command.addInstructions(result, "Fill out this form to edit the message of the day.")
Command.addHiddenField(result, "FORM_TYPE", "http://jabber.org/protocol/admin")
MotdProcessor motdProcessor = kernel.getInstance(MotdProcessor.class)
Command.addFieldMultiValue(result, MOTD, (motdProcessor.getMotd()?.split("\n") ?: [ ]) as List,
"Message of the Day")
return result
} else {
def result = p.commandResult(Command.DataType.result)
MotdProcessor motdProcessor = kernel.getInstance(MotdProcessor.class)
motdProcessor.setMotd(motd.join("\n"))
return result
}
}
return process(kernel, component, packet)
================================================
FILE: src/main/groovy/tigase/admin/EditUser.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
User modify script
AS:Description: Modify user
AS:CommandId: modify-user
AS:Component: sess-man
AS:Group: Users
*/
package tigase.admin
import tigase.db.AuthRepository
import tigase.db.TigaseDBException
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Iq
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.jid.BareJID
def JID = "accountjid"
def EMAIL = "email"
def p = (Iq) packet
def auth_repo = (AuthRepository) authRepository
def user_repo = (UserRepository) userRepository
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def userJid = Command.getFieldValue(packet, JID)
def userEmail = Command.getFieldValue(packet, EMAIL)
if (userJid == null) {
def result = p.commandResult(Command.DataType.form)
//Command.addFieldValue(result, "FORM_TYPE", "", "hidden")
Command.addTitle(result, "Modifying a User")
Command.addInstructions(result, "Fill out this form to modify a user.")
Command.addFieldValue(result, JID, userJid ?: "", "jid-single",
"The Jabber ID for the account to be modified")
return result
}
def result = null
try {
def bareJID = BareJID.bareJIDInstance(userJid)
if (isAllowedForDomain.apply(bareJID.getDomain())) {
if (Command.getFieldValue(packet, "FORM_TYPE") == null ||
Command.getFieldValue(packet, "FORM_TYPE").isEmpty()) {
//if (Command.getFieldValue(packet, EMAIL) == null)
result = p.commandResult(Command.DataType.form)
Command.addTitle(result, "Modifying a User")
Command.addInstructions(result, "Fill out this form to modify a user " + (userJid ?: ""))
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
Command.addFieldValue(result, JID, userJid ?: "", "hidden")
Command.addFieldValue(result, EMAIL, user_repo.getData(bareJID, "email") ?: "", "text-single",
"Email address")
Command.addCheckBoxField(result, "Account enabled",
auth_repo.getAccountStatus(bareJID) == AuthRepository.AccountStatus.active)
// -- add disabled/enabled? vcard? roster?
} else {
result = p.commandResult(Command.DataType.result)
user_repo.setData(bareJID, "email", userEmail)
Command.addTextField(result, "Note", "Operation successful")
try {
auth_repo.setAccountStatus(bareJID, Command.getCheckBoxFieldValue(p,
"Account enabled") ? AuthRepository.AccountStatus.active :
AuthRepository.AccountStatus.disabled)
} catch (TigaseDBException ex) {
Command.addTextField(result, "Warning",
"Account state was not changed as it is not supported by used auth repository: " +
ex.getMessage())
}
}
} else {
result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "You do not have enough permissions to create account for this domain.")
}
} catch (TigaseDBException ex) {
result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Note", "Problem accessing database, user not added.")
}
return result
================================================
FILE: src/main/groovy/tigase/admin/EndUserSession.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
User delete script as described in XEP-0133:
http://jabber.org/protocol/admin#end-user-session
AS:Description: End User Session
AS:CommandId: http://jabber.org/protocol/admin#end-user-session
AS:Component: sess-man
AS:Group: Users
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
import tigase.server.Permissions
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.StanzaType
import tigase.xmpp.XMPPResourceConnection
import tigase.xmpp.jid.JID
import tigase.xml.Element
def JIDS = "accountjids"
def REASON = "reason";
def p = (Packet) packet
//def auth_repo =/**/ (AuthRepository)authRepository
//def user_repo = (UserRepository)userRepository
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def NOTIFY_CLUSTER = "notify-cluster"
boolean clusterMode = Boolean.valueOf(System.getProperty("cluster-mode", false.toString()));
def notifyClusterStr = Command.getFieldValue(packet, NOTIFY_CLUSTER);
boolean notifyCluster = (notifyClusterStr != null) ? Boolean.valueOf(notifyClusterStr) : true;
def user_sessions = (Map) userSessions;
def userJids = Command.getFieldValues(packet, JIDS)
def reason = Command.getFieldValue(packet, REASON)
if (userJids == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Ending session for the users")
Command.addInstructions(result,
"Fill out this form to end user(s) session(s). BareJID - will end all user sessions, FullJID - only particular session.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
Command.addFieldValue(result, JIDS, userJids ?: "", "jid-multi",
"The Jabber ID(s) for which end session")
Command.addFieldValue(result, REASON, reason ?: "", "text-single", "Reason to display to the user");
if (clusterMode) {
Command.addHiddenField(result, NOTIFY_CLUSTER, true.toString())
}
return result
}
def results = new LinkedList();
if (clusterMode && notifyCluster) {
def nodes = (List) clusterStrategy.getNodesConnected();
if (nodes && nodes.size() > 0) {
nodes.each { node ->
def forward = p.copyElementOnly();
Command.removeFieldValue(forward, NOTIFY_CLUSTER)
Command.addHiddenField(forward, NOTIFY_CLUSTER, false.toString())
forward.setPacketTo(node);
forward.setPermissions(Permissions.ADMIN);
results.offer(forward)
}
}
}
def result = p.commandResult(Command.DataType.result)
results.offer(result);
def msgs = [ ];
def errors = [ ];
for (userJid in userJids) {
try {
JID userFullJID = JID.jidInstance(userJid)
def sess = user_sessions.get(userFullJID.getBareJID());
if (isAllowedForDomain.apply(userFullJID.getDomain())) {
if (sess != null) {
def conns = sess.getConnectionIds();
for (conn in conns) {
XMPPResourceConnection res = sess.getResourceForConnectionId(conn);
if (res != null && userFullJID.getResource() == null ||
(userFullJID.getResource() == res.getResource())) {
def commandClose = Command.CLOSE.getPacket(p.getStanzaTo(), conn,
StanzaType.set, res.nextStanzaId());
if (reason != null && !reason.isEmpty()) {
Element commandEl = commandClose.getElemChild("command", Command.XMLNS);
Element el = new Element("undefined-condition");
el.setXMLNS("urn:ietf:params:xml:ns:xmpp-streams");
commandEl.addChild(el);
el = new Element("text", reason);
el.setXMLNS("urn:ietf:params:xml:ns:xmpp-streams");
commandEl.addChild(el);
}
results.offer(commandClose);
msgs.add("Operation successful for user " + res.getjid());
}
}
}
} else {
errors.add("You do not have enough permissions to end sessions for accounts for domain " +
bareJID.getDomain() + ".");
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
if (!msgs.isEmpty()) {
Command.addFieldMultiValue(result, "Notes", msgs)
};
if (!errors.isEmpty()) {
Command.addFieldMultiValue(result, "Errors", errors)
};
return results
================================================
FILE: src/main/groovy/tigase/admin/ForceStopServiceForKey.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Force stop IOService for a given key.
AS:Description: Force stop service
AS:CommandId: force-stop-service
AS:Component: cl-comp
*/
package tigase.admin
import tigase.net.IOService
import tigase.server.Command
import tigase.server.Packet
def p = (Packet) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
if (!isServiceAdmin) {
def result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Error", "You are not service administrator");
return result
}
def KEY = "key"
def key = Command.getFieldValue(packet, KEY)
if (key == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Force-stopping IOService for a given key")
Command.addInstructions(result, "Provide a key for IOService you wish to stop.")
Command.addFieldValue(result, KEY, key ?: "", "text-single", "Key")
return result
}
Map services = (Map) servicesMap
IOService serv = services.get(key)
if (serv == null) {
return "IOService for key: ${key} not found!"
} else {
serv.forceStop()
return "Stopped IOService for key: ${key}."
}
================================================
FILE: src/main/groovy/tigase/admin/GetAnyFile.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Get any file
AS:Description: Get any file
AS:CommandId: get-any-file
AS:Component: message-router
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
def p = (Packet) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def FILE_PATH = "file";
def filepath = Command.getFieldValue(p, FILE_PATH);
def result = p.commandResult(filepath ? Command.DataType.result : Command.DataType.form);
if (!isServiceAdmin) {
Command.addTextField(result, "Error", "You are not service administrator");
} else if (filepath == null) {
Command.addFieldValue(result, FILE_PATH, "", "text-single", "File");
} else {
if (filepath == null) {
Command.addTextField(result, "Error", "File not specified");
} else {
def file = new File(filepath);
if (file.exists()) {
def lines = [ ];
file.eachLine { line -> lines += line; };
Command.addFieldMultiValue(result, "Content", lines);
} else {
Command.addTextField(result, "Error", "File not found");
}
}
}
return result;
================================================
FILE: src/main/groovy/tigase/admin/GetConfigFile.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Get configuration file
AS:Description: Get configuration file
AS:CommandId: get-config-file
AS:Component: message-router
AS:Group: Configuration
*/
package tigase.admin
import tigase.component.DSLBeanConfigurator
import tigase.kernel.core.Kernel
import tigase.server.Command
import tigase.server.Packet
def p = (Packet) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def CFGFILE_TYPE = "config-file";
def CFGFILE_OPTIONS = [ "config.tdsl", "tigase.conf" ];
def cfgfile = Command.getFieldValue(p, CFGFILE_TYPE);
def result = p.commandResult(cfgfile ? Command.DataType.result : Command.DataType.form);
if (!isServiceAdmin) {
Command.addTextField(result, "Error", "You are not service administrator");
} else if (cfgfile == null) {
def filesArray = CFGFILE_OPTIONS.toArray(new String[CFGFILE_OPTIONS.size()]);
Command.addFieldValue(result, CFGFILE_TYPE, "config.tdsl", "File", filesArray, filesArray);
} else {
def filepath = [ ]
switch (cfgfile) {
case "config.tdsl":
filepath = [ ((Kernel) kernel).getInstance(DSLBeanConfigurator).
getConfigHolder().
getConfigFilePath().
toString() ];
break;
case "tigase.conf":
def filenames = [ "/etc/default/tigase", "/etc/tigase/tigase.conf", "etc/tigase.conf" ];
filenames.each { it ->
def file = new File(it);
if (filepath.size() == 0 && file.exists()) {
filepath.add(it);
}
};
break;
default:
break;
}
if (filepath == null) {
Command.addTextField(result, "Error", "Config file not specified");
} else {
filepath.each { it ->
def file = new File(it);
def lines = [ ];
file.eachLine { line -> lines += line; };
Command.addFieldMultiValue(result, "Content", lines);
}
}
}
return result;
================================================
FILE: src/main/groovy/tigase/admin/GetConfigTDSLFromMemory.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Get config.tdsl configuration from memory.
AS:Description: Get config.tdsl configuration
AS:CommandId: get-config-tdsl
AS:Component: message-router
AS:Group: Configuration
*/
package tigase.admin
import tigase.component.DSLBeanConfigurator
import tigase.kernel.core.Kernel
import tigase.server.Command
import tigase.server.Iq
Kernel kernel = (Kernel) kernel;
Iq p = (Iq) packet
Set admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def result = p.commandResult(Command.DataType.result);
if (!isServiceAdmin) {
Command.addTextField(result, "Error", "You are not service administrator");
} else {
DSLBeanConfigurator configurator = kernel.getInstance(DSLBeanConfigurator.class);
StringWriter writer = new StringWriter();
configurator.dumpConfiguration(writer);
Command.addFieldMultiValue(result, "config.tdsl", Arrays.asList(writer.toString().split("\n")));
}
return result;
================================================
FILE: src/main/groovy/tigase/admin/GetListOfActiveUsers.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Get list of online users script as described in XEP-0133:
http://xmpp.org/extensions/xep-0133.html#get-active-users-list
AS:Description: Get list of active users
AS:CommandId: http://jabber.org/protocol/admin#get-active-users
AS:Component: sess-man
AS:Group: Statistics
*/
package tigase.admin
import tigase.db.AuthRepository
import tigase.db.TigaseDBException
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostItem
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.jid.BareJID
def SECOND = 1000;
def MINUTE = 60 * SECOND;
def JID = "domainjid"
def MAX_ITEMS = "max_items"
def TIME_BEFORE_IDLE = 5 * MINUTE;
def p = (Packet) packet
def auth_repo = (AuthRepository) authRepository
def user_repo = (UserRepository) userRepository
def users_sessions = (Map) userSessions
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def domainJid = Command.getFieldValue(packet, JID);
def maxItemsStr = Command.getFieldValue(packet, MAX_ITEMS);
if (domainJid == null || maxItemsStr == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Requesting List of Active Users")
Command.addInstructions(result, "Fill out this form to request the active users\nof this service.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
// if (isServiceAdmin) {
//Command.addFieldValue(result, JID, domainJid ?: "", "jid-single",
// "The domain for the list of active users")
// }
// else {
def vhosts = [ ];
vhost_man.repo.allItems().each {
if (isAllowedForDomain.apply(it.getVhost().toString())) {
vhosts += it.getVhost().toString()
}
}
def vhostsArr = vhosts.toArray(new String[vhosts.size()]);
Command.addFieldValue(result, JID, "", "The domain for the list of active users", vhostsArr, vhostsArr);
// }
Command.addFieldValue(result, MAX_ITEMS, maxItemsStr ?: "", "Maximum number of items to show",
[ "25", "50", "75", "100", "150", "200", "None" ].toArray(new String[7]),
[ "25", "50", "75", "100", "150", "200", "None" ].toArray(new String[7]));
return result
}
def result = p.commandResult(Command.DataType.result)
try {
def maxItems = maxItemsStr ? (maxItemsStr == "None" ? null : Integer.parseInt(maxItemsStr)) : 25;
def bareJID = BareJID.bareJIDInstance(domainJid)
VHostItem vhost = vhost_man.getVHostItem(bareJID.getDomain())
if (isAllowedForDomain.apply(bareJID.getDomain())) {
def users_list = [ ];
users_sessions.entrySet().each {
if (!it.getKey().toString().startsWith("sess-man") && it.getKey().getDomain().equals(bareJID.getDomain())) {
if (!maxItems || users_list.size() < maxItems) {
def user = it.getKey().toString();
def session = it.getValue();
def active = false;
session.getActiveResources().each {
active = active || ((System.currentTimeMillis() - it.getLastAccessed()) < TIME_BEFORE_IDLE);
}
if (active == true) {
// user += " (" + session.getActiveResourcesSize() + ":";
// session.getJIDs().each { user += it.getResource() + ", "; }
// user = user[0..user.size() - 3] + ")";
users_list += user;
}
}
}
}
Command.addFieldMultiValue(result, "Users: " + users_list.size(), users_list);
} else {
Command.addTextField(result, "Error",
"You do not have enough permissions to list active accounts for this domain.");
}
} catch (TigaseDBException ex) {
Command.addTextField(result, "Note", "Problem accessing database, active users not listed.");
}
return result
================================================
FILE: src/main/groovy/tigase/admin/GetListOfClusterNodes.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Get list of all connected cluster nodes
AS:Description: Get list of all connected cluster nodes
AS:CommandId: cluster-nodes-list
AS:Component: cl-comp
AS:Group: Configuration
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
def p = (Packet) packet
def result = p.commandResult(Command.DataType.result)
try {
def nodes = component.getNodesConnectedWithLocal().collect { return it.getDomain() }
Command.addFieldMultiValue(result, "Cluster nodes:", nodes);
} catch (Exception ex) {
Command.addTextField(result, "Note",
"Problem with retrieving list of all connected cluster nodes: " + ex.getMessage());
}
return result
================================================
FILE: src/main/groovy/tigase/admin/GetListOfIdleUsers.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Get list of online users script as described in XEP-0133:
http://xmpp.org/extensions/xep-0133.html#get-idle-users-list
AS:Description: Get list of idle users
AS:CommandId: http://jabber.org/protocol/admin#get-idle-users
AS:Component: sess-man
AS:Group: Statistics
*/
package tigase.admin
import tigase.db.AuthRepository
import tigase.db.TigaseDBException
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.jid.BareJID
def SECOND = 1000;
def MINUTE = 60 * SECOND;
def JID = "domainjid"
def MAX_ITEMS = "max_items"
def TIME_BEFORE_IDLE = 5 * MINUTE;
def p = (Packet) packet
def auth_repo = (AuthRepository) authRepository
def user_repo = (UserRepository) userRepository
def users_sessions = (Map) userSessions
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def domainJid = Command.getFieldValue(packet, JID);
def maxItemsStr = Command.getFieldValue(packet, MAX_ITEMS);
if (domainJid == null || maxItemsStr == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Requesting List of Idle Users")
Command.addInstructions(result, "Fill out this form to request the idle users\nof this service.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
// if (isServiceAdmin) {
//Command.addFieldValue(result, JID, domainJid ?: "", "jid-single",
// "The domain for the list of active users")
// }
// else {
def vhosts = [ ];
vhost_man.repo.allItems().each {
if (isAllowedForDomain.apply(it.getVhost().toString())) {
vhosts += it.getVhost().toString()
}
}
def vhostsArr = vhosts.toArray(new String[vhosts.size()]);
Command.addFieldValue(result, JID, "", "The domain for the list of idle users", vhostsArr, vhostsArr);
// }
Command.addFieldValue(result, MAX_ITEMS, maxItemsStr ?: "", "Maximum number of items to show",
[ "25", "50", "75", "100", "150", "200", "None" ].toArray(new String[7]),
[ "25", "50", "75", "100", "150", "200", "None" ].toArray(new String[7]));
return result
}
def result = p.commandResult(Command.DataType.result)
try {
def maxItems = maxItemsStr ? (maxItemsStr == "None" ? null : Integer.parseInt(maxItemsStr)) : 25;
def bareJID = BareJID.bareJIDInstance(domainJid)
if (isAllowedForDomain.apply(bareJID.getDomain())) {
def users_list = [ ];
users_sessions.entrySet().each {
if (!it.getKey().toString().startsWith("sess-man") && it.getKey().getDomain().equals(bareJID.getDomain())) {
if (!maxItems || users_list.size() < maxItems) {
def user = it.getKey().toString();
def session = it.getValue();
def active = false;
session.getActiveResources().each {
active = active || ((System.currentTimeMillis() - it.getLastAccessed()) < TIME_BEFORE_IDLE);
}
if (active == false) {
// user += " (" + session.getActiveResourcesSize() + ":";
// session.getJIDs().each { user += it.getResource() + ", "; }
// user = user[0..user.size() - 3] + ")";
users_list += user;
}
}
}
}
Command.addFieldMultiValue(result, "Users: " + users_list.size(), users_list);
} else {
Command.addTextField(result, "Error",
"You do not have enough permissions to list idle accounts for this domain.");
}
} catch (TigaseDBException ex) {
Command.addTextField(result, "Note", "Problem accessing database, idle users not listed.");
}
return result
================================================
FILE: src/main/groovy/tigase/admin/GetListOfOnlineUsers.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Get list of online users script as described in XEP-0133:
http://xmpp.org/extensions/xep-0133.html#get-online-users-list
AS:Description: Get list of online users
AS:CommandId: http://jabber.org/protocol/admin#get-online-users-list
AS:Component: sess-man
AS:Group: Statistics
*/
package tigase.admin
import tigase.db.AuthRepository
import tigase.db.TigaseDBException
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.jid.BareJID
def JID = "domainjid"
def MAX_ITEMS = "max_items"
def p = (Packet) packet
def auth_repo = (AuthRepository) authRepository
def user_repo = (UserRepository) userRepository
def users_sessions = (Map) userSessions
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def domainJid = Command.getFieldValue(packet, JID);
def maxItemsStr = Command.getFieldValue(packet, MAX_ITEMS);
if (domainJid == null || maxItemsStr == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Requesting List of Online Users")
Command.addInstructions(result, "Fill out this form to request the online users\nof this service.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
// if (isServiceAdmin) {
//Command.addFieldValue(result, JID, domainJid ?: "", "jid-single",
// "The domain for the list of online users")
// }
// else {
def vhosts = [ ];
vhost_man.repo.allItems().each {
if (isAllowedForDomain.apply(it.getVhost().toString())) {
vhosts += it.getVhost().toString()
}
}
vhosts = vhosts.sort();
def vhostsArr = vhosts.toArray(new String[vhosts.size()]);
Command.addFieldValue(result, JID, "", "The domain for the list of online users", vhostsArr, vhostsArr);
// }
Command.addFieldValue(result, MAX_ITEMS, maxItemsStr ?: "", "Maximum number of items to show",
[ "25", "50", "75", "100", "150", "200", "None" ].toArray(new String[7]),
[ "25", "50", "75", "100", "150", "200", "None" ].toArray(new String[7]));
return result
}
def result = p.commandResult(Command.DataType.result)
try {
def maxItems = maxItemsStr ? (maxItemsStr == "None" ? null : Integer.parseInt(maxItemsStr)) : 25;
def bareJID = BareJID.bareJIDInstance(domainJid)
if (isAllowedForDomain.apply(bareJID.getDomain())) {
def users_list = [ ];
users_sessions.entrySet().each {
if (!it.getKey().toString().startsWith("sess-man") && it.getKey().getDomain().equals(bareJID.getDomain())) {
if (!maxItems || users_list.size() < maxItems) {
def user = it.getKey().toString();
def session = it.getValue();
user += " (" + session.getActiveResourcesSize() + ":";
session.getJIDs().each { user += it.getResource() + ", "; }
user = user[0..user.size() - 3] + ")";
users_list += user;
}
}
}
Command.addFieldMultiValue(result, "Users: " + users_list.size(), users_list);
} else {
Command.addTextField(result, "Error",
"You do not have enough permissions to list online accounts for this domain.");
}
} catch (TigaseDBException ex) {
Command.addTextField(result, "Note", "Problem accessing database, online users not listed.");
}
return result
================================================
FILE: src/main/groovy/tigase/admin/GetNumberOfActiveUsers.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Get list of online users script as described in XEP-0133:
http://xmpp.org/extensions/xep-0133.html#get-active-users-num
AS:Description: Get number of active users
AS:CommandId: http://jabber.org/protocol/admin#get-active-users-num
AS:Component: sess-man
AS:Group: Statistics
*/
package tigase.admin
import tigase.db.AuthRepository
import tigase.db.TigaseDBException
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.jid.BareJID
def SECOND = 1000;
def MINUTE = 60 * SECOND;
def JID = "domainjid"
def TIME_BEFORE_IDLE = 5 * MINUTE;
def p = (Packet) packet
def auth_repo = (AuthRepository) authRepository
def user_repo = (UserRepository) userRepository
def users_sessions = (Map) userSessions
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def domainJid = Command.getFieldValue(packet, JID);
if (domainJid == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Requesting Number of Active Users")
Command.addInstructions(result, "Fill out this form to request the number of active users\nof this service.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
// if (isServiceAdmin) {
//Command.addFieldValue(result, JID, domainJid ?: "", "jid-single",
// "The domain for the list of active users")
// }
// else {
def vhosts = [ ];
vhost_man.repo.allItems().each {
if (isAllowedForDomain.apply(it.getVhost().toString())) {
vhosts += it.getVhost().toString()
}
}
def vhostsArr = vhosts.toArray(new String[vhosts.size()]);
Command.addFieldValue(result, JID, "", "The domain for the number of active users", vhostsArr, vhostsArr);
// }
return result
}
def result = p.commandResult(Command.DataType.result)
try {
def bareJID = BareJID.bareJIDInstance(domainJid)
if (isAllowedForDomain.apply(bareJID.getDomain())) {
def users_list = [ ];
users_sessions.entrySet().each {
if (!it.getKey().toString().startsWith("sess-man") && it.getKey().getDomain().equals(bareJID.getDomain())) {
//if (!maxItems || users_list.size() < maxItems) {
def user = it.getKey().toString();
def session = it.getValue();
def active = false;
session.getActiveResources().each {
active = active || ((System.currentTimeMillis() - it.getLastAccessed()) < TIME_BEFORE_IDLE);
}
if (active == true) {
// user += " (" + session.getActiveResourcesSize() + ":";
// session.getJIDs().each { user += it.getResource() + ", "; }
// user = user[0..user.size() - 3] + ")";
users_list += user;
}
//}
}
}
Command.addFieldValue(result, "activeusersnum", String.valueOf(users_list.size()), "fixed",
"The number of active users");
} else {
Command.addTextField(result, "Error",
"You do not have enough permissions to get number of active accounts for this domain.");
}
} catch (TigaseDBException ex) {
Command.addTextField(result, "Note", "Problem accessing database, active users not counted.");
}
return result
================================================
FILE: src/main/groovy/tigase/admin/GetNumberOfIdleUsers.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Get list of online users script as described in XEP-0133:
http://xmpp.org/extensions/xep-0133.html#get-idle-users-num
AS:Description: Get number of idle users
AS:CommandId: http://jabber.org/protocol/admin#get-idle-users-num
AS:Component: sess-man
AS:Group: Statistics
*/
package tigase.admin
import tigase.db.AuthRepository
import tigase.db.TigaseDBException
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.jid.BareJID
def SECOND = 1000;
def MINUTE = 60 * SECOND;
def JID = "domainjid"
def TIME_BEFORE_IDLE = 5 * MINUTE;
def p = (Packet) packet
def auth_repo = (AuthRepository) authRepository
def user_repo = (UserRepository) userRepository
def users_sessions = (Map) userSessions
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def domainJid = Command.getFieldValue(packet, JID);
if (domainJid == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Requesting Number of Idle Users")
Command.addInstructions(result, "Fill out this form to request the number of idle users\nof this service.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
// if (isServiceAdmin) {
//Command.addFieldValue(result, JID, domainJid ?: "", "jid-single",
// "The domain for the list of active users")
// }
// else {
def vhosts = [ ];
vhost_man.repo.allItems().each {
if (isAllowedForDomain.apply(it.getVhost().toString())) {
vhosts += it.getVhost().toString()
}
}
def vhostsArr = vhosts.toArray(new String[vhosts.size()]);
Command.addFieldValue(result, JID, "", "The domain for the number of idle users", vhostsArr, vhostsArr);
// }
return result
}
def result = p.commandResult(Command.DataType.result)
try {
def bareJID = BareJID.bareJIDInstance(domainJid)
if (isAllowedForDomain.apply(bareJID.getDomain())) {
def users_list = [ ];
users_sessions.entrySet().each {
if (!it.getKey().toString().startsWith("sess-man") && it.getKey().getDomain().equals(bareJID.getDomain())) {
//if (!maxItems || users_list.size() < maxItems) {
def user = it.getKey().toString();
def session = it.getValue();
def active = false;
session.getActiveResources().each {
active = active || ((System.currentTimeMillis() - it.getLastAccessed()) < TIME_BEFORE_IDLE);
}
if (active == false) {
// user += " (" + session.getActiveResourcesSize() + ":";
// session.getJIDs().each { user += it.getResource() + ", "; }
// user = user[0..user.size() - 3] + ")";
users_list += user;
}
//}
}
}
Command.addFieldValue(result, "idleusersnum", String.valueOf(users_list.size()), "fixed",
"The number of idle users");
} else {
Command.addTextField(result, "Error",
"You do not have enough permissions to get number of idle accounts for this domain.");
}
} catch (TigaseDBException ex) {
Command.addTextField(result, "Note", "Problem accessing database, idle users not counted.");
}
return result
================================================
FILE: src/main/groovy/tigase/admin/GetRegisteredUserList.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Get registered user list script as described in XEP-0133:
http://xmpp.org/extensions/xep-0133.html#get-registered-users-list
AS:Description: Get registered user list
AS:CommandId: http://jabber.org/protocol/admin#get-registered-users-list
AS:Component: sess-man
AS:Group: Users
*/
package tigase.admin
import tigase.db.AuthRepository
import tigase.db.TigaseDBException
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.jid.BareJID
def JID = "domainjid"
def MAX_ITEMS = "max_items"
def p = (Packet) packet
def auth_repo = (AuthRepository) authRepository
def user_repo = (UserRepository) userRepository
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def domainJid = Command.getFieldValue(packet, JID);
def maxItemsStr = Command.getFieldValue(packet, MAX_ITEMS);
if (domainJid == null || maxItemsStr == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Requesting List of Registered Users")
Command.addInstructions(result, "Fill out this form to request the registered users \n of this service.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
// if (isServiceAdmin) {
//Command.addFieldValue(result, JID, domainJid ?: "", "jid-single",
// "The domain for the list of online users")
// }
// else {
def vhosts = [ ];
vhost_man.repo.allItems().each {
if (isAllowedForDomain.apply(it.getVhost().toString())) {
vhosts += it.getVhost().toString()
}
}
vhosts = vhosts.sort();
def vhostsArr = vhosts.toArray(new String[vhosts.size()]);
Command.addFieldValue(result, JID, "", "The domain for the list of registered users", vhostsArr, vhostsArr);
// }
Command.addFieldValue(result, MAX_ITEMS, maxItemsStr ?: "", "Maximum number of items to show",
[ "25", "50", "75", "100", "150", "200", "None" ].toArray(new String[7]),
[ "25", "50", "75", "100", "150", "200", "None" ].toArray(new String[7]));
return result
}
def result = p.commandResult(Command.DataType.result)
try {
def maxItems = maxItemsStr ? (maxItemsStr == "None" ? null : Integer.parseInt(maxItemsStr)) : 25;
def bareJID = BareJID.bareJIDInstance(domainJid)
if (isAllowedForDomain.apply(bareJID.getDomain())) {
def users_list = [ ];
def domain_user_repo = (user_repo instanceof tigase.db.UserRepositoryMDImpl) ? user_repo.getRepo(
bareJID.getDomain()) : user_repo;
def users = domain_user_repo.getUsers();
for (user in users) {
if (!user.getDomain().equals(bareJID.getDomain())) {
continue
};
users_list.add(user.toString());
if (maxItems && users_list.size() > maxItems) {
break
};
}
Command.addFieldMultiValue(result, "Users: " + users_list.size(), users_list);
} else {
Command.addTextField(result, "Error", "You do not have enough permissions to list accounts for this domain.");
}
} catch (TigaseDBException ex) {
Command.addTextField(result, "Note", "Problem accessing database, users not listed.");
}
return result
================================================
FILE: src/main/groovy/tigase/admin/GetTopActiveUsers.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Retrieves from the server specified number of top active users
AS:Description: Get top active users
AS:CommandId: http://jabber.org/protocol/admin#get-top-active-users
AS:Component: sess-man
AS:Group: Statistics
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
import tigase.xmpp.XMPPSession
def TOP_NUM = "top-num"
def p = (Packet) packet
def topNum = Command.getFieldValue(packet, TOP_NUM)
if (topNum == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Get top active users")
Command.addInstructions(result, "Fill out this form to get top active users.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
Command.addFieldValue(result, TOP_NUM, topNum ?: "10", "text-single",
"Number of top active users to show")
return result
}
def user_sessions = (Map) userSessions
def mc = [ compare: { XMPPSession a, XMPPSession b ->
a.getPacketsCounter() == b.getPacketsCounter() ? 0 : a.getPacketsCounter() > b.getPacketsCounter() ? -1 : 1
} ] as Comparator
def sessions = [ ]
// TODO: this is memory inefficient way to do it. We need to find a more memory friendly way
user_sessions.entrySet().each {
if (!it.getKey().toString().startsWith("sess-man")) {
sessions += it.getValue()
}
}
sessions.sort(mc)
def max = topNum.toInteger()
if (max > sessions.size()) {
max = sessions.size()
}
def usr_list = [ ]
sessions[0..(max - 1)].each { XMPPSession it ->
usr_list += it.getJIDs()[0].toString() + " online " + (it.getLiveTime() / 1000) + " sec, " +
it.getPacketsCounter() + " packets"
}
def result = p.commandResult(Command.DataType.result)
Command.addFieldMultiValue(result, "Top active users ", usr_list);
return result
================================================
FILE: src/main/groovy/tigase/admin/GetUserInfo.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Obtaining informations about user
AS:Description: Get User Info
AS:CommandId: get-user-info
AS:Component: sess-man
AS:Group: Users
*/
package tigase.admin
import tigase.cluster.strategy.ClusteringStrategyIfc
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostManagerIfc
import tigase.xml.Element
import tigase.xmpp.XMPPResourceConnection
import tigase.xmpp.XMPPSession
import tigase.xmpp.jid.BareJID
def JID = "accountjid"
def p = (Packet) packet
def sessions = (Map) userSessions
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def user_repo = (UserRepository) userRepository
def userJid = Command.getFieldValue(packet, JID)
if (userJid == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Get User Info")
Command.addInstructions(result, "Fill out this form to gather informations about user.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin", "hidden")
Command.addFieldValue(result, JID, userJid ?: "", "jid-single", "The Jabber ID for statistics")
Command.addCheckBoxField(result, "Show connected resources in table", true)
return result
}
def bareJID = BareJID.bareJIDInstance(userJid)
def resourcesAsTable = Command.getCheckBoxFieldValue(p, "Show connected resources in table");
def result = p.commandResult(Command.DataType.result)
if (isAllowedForDomain.apply(bareJID.getDomain())) {
Command.addTextField(result, "JID", "JID: " + userJid)
def userRes = [ ];
if (binding.variables.containsKey("clusterStrategy")) {
def cluster = (ClusteringStrategyIfc) clusterStrategy
def conns = cluster.getConnectionRecords(bareJID);
if (cluster.containsJid(bareJID) && (conns != null)) {
conns.each { rec -> userRes.add([ res: rec.getUserJid().getResource(), node: rec.getNode().getDomain() ]);
}
}
}
XMPPSession session = sessions.get(BareJID.bareJIDInstanceNS(userJid))
if (session != null) {
List conns = session.getActiveResources()
conns.each { con -> userRes.add([ res: con.getResource(), node: con.getConnectionId()?.getDomain() ]);
}
}
if (userRes.isEmpty()) {
if (user_repo.userExists(bareJID)) {
Command.addTextField(result, "Status", "Status: offline")
} else {
Command.addTextField(result, "Error", "User doesn't exists")
return result
}
} else {
userRes.sort { it.res };
Command.addTextField(result, "Status", "Status: " + (userRes.size() ? "online" : "offline"))
Command.addTextField(result, "Active connections", "Active connections: " + userRes.size())
if (resourcesAsTable) {
Element reported = new Element("reported");
reported.addAttribute("label", "Connected resources");
def cols = [ "Resource", "Cluster node" ];
cols.each {
Element el = new Element("field");
el.setAttribute("var", it);
reported.addChild(el);
}
result.getElement().getChild('command').getChild('x').addChild(reported);
userRes.each { con ->
Element item = new Element("item");
Element res = new Element("field");
res.setAttribute("var", "Resource");
res.addChild(new Element("value", con.res));
item.addChild(res);
Element node = new Element("field");
node.setAttribute("var", "Cluster node");
node.addChild(new Element("value", con.node));
item.addChild(node);
result.getElement().getChild('command').getChild('x').addChild(item);
}
} else {
for (def con : userRes) {
Command.addTextField(result, con.res + " is connected to", con.res + " is connected to " + con.node);
}
}
}
def sessionManager = component;
def offlineMsgsRepo = sessionManager.processors.values().find { it.hasProperty("msg_repo") }?.msg_repo;
if (offlineMsgsRepo && offlineMsgsRepo.metaClass.respondsTo(offlineMsgsRepo, "getMessagesCount",
[ tigase.xmpp.jid.JID ] as Object[])) {
def offlineStats = 0;
try {
offlineStats = offlineMsgsRepo.getMessagesCount(tigase.xmpp.jid.JID.jidInstance(bareJID));
} catch (tigase.db.UserNotFoundException ex) {
// ignoring this error for now as it is not important
}
def msg = "Offline messages: " +
(offlineStats ? (offlineStats[offlineStats.keySet().find { it.name() == "message" }] ?: 0) : 0);
Command.addTextField(result, msg, msg);
}
def loginHistoryProcessor = sessionManager.outFilters["login-history"];
if (loginHistoryProcessor) {
def unifiedArchiveComp = tigase.server.XMPPServer.getComponent(
loginHistoryProcessor.getComponentJid().getLocalpart())
//sessionManager.parent.components_byId[loginHistoryProcessor.componentJid];
if (unifiedArchiveComp) {
def ua_repo = unifiedArchiveComp.msg_repo;
def criteria = ua_repo.newCriteriaInstance();
criteria.setWith(bareJID.toString());
criteria.getRSM().hasBefore = true;
criteria.getRSM().max = 10;
criteria.itemType = "login";
// def logins = ua_repo.getItems(bareJID, criteria).reverse().collect { new java.util.Date(criteria.getStart().getTime() +
// (Integer.parseInt(it.getAttribute("secs"))*1000)).toString() + " for resource '" + it.getChildren().first().getCData() + "'" }.join("\n");
Element reported = new Element("reported");
reported.addAttribute("label", "Login times");
def cols = [ "Resource", "Date" ];
cols.each {
Element el = new Element("field");
el.setAttribute("var", it);
reported.addChild(el);
}
result.getElement().getChild('command').getChild('x').addChild(reported);
ua_repo.getItems(bareJID, criteria).reverse().each {
Element item = new Element("item");
Element res = new Element("field");
res.setAttribute("var", "Resource");
res.addChild(new Element("value", it.getChildren().first().getCData()));
item.addChild(res);
String ts = new java.util.Date(
criteria.getStart().getTime() + (Integer.parseInt(it.getAttribute("secs")) * 1000)).format(
"yyyy-MM-dd HH:mm:ss.S");
Element node = new Element("field");
node.setAttribute("var", "Date");
node.addChild(new Element("value", ts));
item.addChild(node);
result.getElement().getChild('command').getChild('x').addChild(item);
}
}
}
} else {
Command.addTextField(result, "Error",
"You do not have enough permissions to obtain statistics for user in this domain.");
}
return result
================================================
FILE: src/main/groovy/tigase/admin/GetUserRoster.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Obtaining User Statistics as described in in XEP-0133:
http://xmpp.org/extensions/xep-0133.html#get-user-roster
AS:Description: Get User Roster
AS:CommandId: http://jabber.org/protocol/admin#get-user-roster
AS:Component: sess-man
*/
package tigase.admin
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostManagerIfc
import tigase.xml.Element
import tigase.xmpp.XMPPSession
import tigase.xmpp.impl.roster.RosterAbstract
import tigase.xmpp.impl.roster.RosterElement
import tigase.xmpp.impl.roster.RosterFactory
import tigase.xmpp.impl.roster.RosterFlat
import tigase.xmpp.jid.BareJID
def JID = "accountjid"
def SHOW_AS_TABLE = "Present roster in table (required for UI)";
def p = (Packet) packet
def repository = (UserRepository) userRepository
def sessions = (Map) userSessions
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def userJid = Command.getFieldValue(packet, JID)
def showAsTable = Command.getCheckBoxFieldValue(packet, SHOW_AS_TABLE) ?: false;
if (userJid == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Getting a User's Roster")
Command.addInstructions(result, "Fill out this form to get a user's roster.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin", "hidden")
Command.addFieldValue(result, JID, userJid ?: "", "jid-single", "The Jabber ID for which to retrieve roster")
Command.addCheckBoxField(result, SHOW_AS_TABLE, showAsTable);
return result
}
def bareJID = BareJID.bareJIDInstance(userJid)
def result = p.commandResult(Command.DataType.result)
if (isAllowedForDomain.apply(bareJID.getDomain())) {
Command.addFieldValue(result, JID, userJid ?: "", "jid-single", "The Jabber ID for which to retrieve roster")
XMPPSession session = sessions.get(BareJID.bareJIDInstanceNS(userJid))
if (!showAsTable) {
Element query = new Element("query");
query.setXMLNS("jabber:iq:roster");
if (session == null) {
String rosterStr = repository.getData(bareJID, null,
RosterAbstract.ROSTER, null) ?: ""
Map roster = new LinkedHashMap()
RosterFlat.parseRosterUtil(rosterStr, roster, null)
roster.values().each {
query.addChild(it.getRosterItem());
}
} else {
RosterAbstract rosterUtil = RosterFactory.getRosterImplementation(true)
query.addChildren(rosterUtil.getRosterItems(session.getActiveResources().get(0)));
}
if (query != null) {
result.getElement().getChild("command").getChild("x", "jabber:x:data").addChild(query);
}
} else {
Map roster = new LinkedHashMap()
if (session == null) {
String rosterStr = repository.getData(bareJID, null,
RosterAbstract.ROSTER, null) ?: ""
RosterFlat.parseRosterUtil(rosterStr, roster, null)
} else {
def conn = session.getActiveResources().get(0)
RosterAbstract rosterUtil = RosterFactory.getRosterImplementation(true)
rosterUtil.getBuddies(conn).
each { buddyJid -> roster.put(buddyJid.getBareJID(), rosterUtil.getRosterElement(conn, buddyJid));
}
}
if (roster.isEmpty()) {
Command.addTextField(result, "Note", "Not found any roster entries for " + bareJID);
} else {
Command.addTextField(result, "Note", "Found " + roster.size() + " entries in roster for " + bareJID);
Element reported = new Element("reported");
reported.addAttribute("label", "Connected resources");
def cols = [ "JID", "Name", "Subscription", "Groups" ];
cols.each {
Element el = new Element("field");
el.setAttribute("var", it);
reported.addChild(el);
}
result.getElement().getChild('command').getChild('x').addChild(reported);
roster.each { jid, rosterEntry ->
Element item = new Element("item");
cols.each { col ->
Element res = new Element("field");
res.setAttribute("var", col);
def val = null;
if (col == "JID") {
val = rosterEntry.getJid().toString()
} else if (col == "Name") {
val = rosterEntry.
getName()
} else if (col == "Subscription") {
val = rosterEntry.getSubscription()?.name() ?: "none"
} else if (col == "Groups") {
val = rosterEntry.getGroups()?.join(", ") ?: ""
};
res.addChild(new Element("value", val));
item.addChild(res);
}
result.getElement().getChild('command').getChild('x').addChild(item);
}
}
}
} else {
Command.addTextField(result, "Error",
"You do not have enough permissions to retrieve roster for user in this domain.");
}
return result
================================================
FILE: src/main/groovy/tigase/admin/ListCommands.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Get list of available adhoc commands with additional metadata.
AS:Description: Get list available commands
AS:CommandId: list-commands
AS:Group: Example scripts
AS:ComponentClass: tigase.server.BasicComponent
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
import tigase.xml.Element
def p = (Packet) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def result = p.commandResult(Command.DataType.form)
Command.addTitle(result, "Retrieving list of commands");
def type = Command.getFieldValue(p, "type");
if (!type) {
Command.addInstructions(result, "Select a informations to retrieve")
Command.addFieldValue(result, "type", "", "Informations to retrive",
[ "Groups", "Commands" ].toArray(new String[2]),
[ "groups", "commands" ].toArray(new String[2]));
return result;
} else if (type == "groups") {
def groups = [ ];
Command.addInstructions(result, "Select a group for which to retrieve commands");
Command.addFieldValue(result, "type", "commands", "hidden");
adminCommands.each { id, script ->
if (!component.canCallCommand(p.getStanzaFrom(), id)) {
return
};
def group = script.getGroup();
if (group == null) {
group = "--";
}
if (!groups.contains(group)) {
groups.add(group)
};
}
Command.addFieldValue(result, "group", "", "Group", groups.toArray(new String[groups.size()]),
groups.toArray(new String[groups.size()]));
return result;
} else if (type == "commands") {
def group = Command.getFieldValue(p, "group");
Command.addHiddenField(result, "group", group ?: "");
Command.addInstructions(result, "Following commands are available" + (group ? " for group $group" : ""));
def x = Command.getData(result).find { it.getName() == "x" && it.getXMLNS() };
def reported = new Element("reported");
def fields = [ "node", "group", "name", "jid" ];
reported.addChildren(fields.collect {
new Element("field", [ "var" ].toArray(new String[1]), [ it ].toArray(new String[1]));
});
x.addChild(reported);
def scripts = [ ];
adminCommands.each { id, script ->
if (!component.canCallCommand(p.getStanzaFrom(), id)) {
return
};
if (group && !group.equals(script.getGroup())) {
return
};
def item = new Element("item");
fields.each {
def value = new Element("value");
def field = new Element("field");
field.setAttribute("var", it);
field.addChild(value);
item.addChild(field);
if (it == "node") {
value.setCData(id);
} else if (it == "group") {
value.setCData(script.getGroup());
} else if (it == "name") {
value.setCData(script.getDescription());
} else if (it == "jid") {
value.setCData(packet.getStanzaTo().toString());
}
}
x.addChild(item);
scripts.add([ id: id, name: script.getDescription() ]);
}
Command.addFieldValue(result, "commands", "", "Commands",
scripts.collect { it.name }.toArray(new String[scripts.size()]),
scripts.collect { it.id }.toArray(new String[scripts.size()]));
return result;
}
================================================
FILE: src/main/groovy/tigase/admin/ListServiceKeys.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
List all keys for active IOServices from the connection manager.
AS:Description: List Service Keys
AS:CommandId: service-keys
AS:Component: cl-comp
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
Map services = (Map) servicesMap
def p = (Packet) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
if (!isServiceAdmin) {
def result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Error", "You are not service administrator");
return result
}
return services.keySet().toString()
================================================
FILE: src/main/groovy/tigase/admin/LoadErrors.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Load errors caught by the server during execution:
AS:Description: Load errors
AS:CommandId: load-errors
AS:Component: monitor
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
import tigase.util.log.LogFormatter
def p = (Packet) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
if (!isServiceAdmin) {
def result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Error", "You are not service administrator");
return result
}
def result = [ ]
def size = LogFormatter.errors.size()
if (size > 0) {
LogFormatter.errors.each {
def entry = it.getValue()
result += "";
result += entry.getMessage() + ": " + entry.getCounter()
entry.getRecord().split("\n").each {
result += it
}
}
} else {
result += "No errors so far!"
}
def res = p.commandResult(Command.DataType.result)
Command.addFieldMultiValue(res, "Errors: " + size, result)
return res
================================================
FILE: src/main/groovy/tigase/admin/OAuthCredentials.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
AdHoc Command for setting OAuth credentials for JabberIQRegister
AS:Description: OAuth credentials
AS:CommandId: oauth-credentials
AS:Component: sess-man
*/
package tigase.admin
import tigase.kernel.KernelException
import tigase.server.Command
import tigase.server.Packet
import tigase.xmpp.Authorization
import tigase.xmpp.impl.JabberIqRegister
def p = (Packet) packet
def oauthTokenKey = Command.getFieldValue(packet, "oauthTokenKey")
def oauthTokenSecret = Command.getFieldValue(packet, "oauthTokenSecret")
def signedFormRequired = Command.getFieldValue(packet, "signedFormRequired")
if (signedFormRequired == null) {
def res = p.commandResult(Command.DataType.form)
Command.addTitle(res, "OAuth Credentials")
Command.addInstructions(res,
"It allows to set new OAuth credentials and enable or disable requirement of registration with Signed Form.")
Command.addFieldValue(res, "oauthTokenKey", "", "text-single", "OAuth Token Key")
Command.addFieldValue(res, "oauthTokenSecret", "", "text-single", "OAuth Token Secret")
Command.addFieldValue(res, "signedFormRequired", Boolean.toString(JabberIqRegister.isSignedFormRequired()),
"boolean", "Signed Form required to registration")
return res
} else {
try {
JabberIqRegister jabberIqRegister = kernel.getInstance(JabberIqRegister.class);
jabberIqRegister.setOAuthCredentials(oauthTokenKey, oauthTokenSecret)
jabberIqRegister.setSignedFormRequired(signedFormRequired.equals("1") || signedFormRequired.equals("true"))
def res = p.commandResult(Command.DataType.result)
Command.addTitle(res, "OAuth Credentials")
Command.addInstructions(res, "Credentials set.")
return res
} catch (KernelException ex) {
return Authorization.INTERNAL_SERVER_ERROR.getResponseMessage(p, "JabberIqRegister processor is not loaded",
false);
}
}
================================================
FILE: src/main/groovy/tigase/admin/PluginManager.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Manage active server plugins
AS:Description: Manage active server plugins
AS:CommandId: plugin-manager
AS:Component: basic-conf
AS:Group: Configuration
*/
package tigase.admin
import tigase.conf.Configurable
import tigase.conf.Configurator
import tigase.osgi.ModulesManagerImpl
import tigase.server.Command
import tigase.server.Iq
import tigase.server.XMPPServer
class DelayedReloadTaskPlugMan
extends Thread {
void run() {
Thread.sleep(5000);
((Configurator) XMPPServer.getConfigurator()).updateMessageRouter();
}
}
try {
def SUBMIT = "exec";
def p = (Iq) packet
// check permission
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
if (!isServiceAdmin) {
def result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "You do not have enough permissions to access this data.");
return result
}
//def submit = Command.getFieldValue(p, SUBMIT);
def submit = p.getElement().findChild([ "iq", "command", "x" ] as String[])?.getAttribute("type");
if (!submit) {
def res = (Iq) p.commandResult(Command.DataType.form)
def pluginsAll = [ ];
if (XMPPServer.isOSGi()) {
pluginsAll.addAll(ModulesManagerImpl.getInstance().plugins.keySet());
} else {
pluginsAll.addAll(tigase.xmpp.ProcessorFactory.processors.keySet());
}
def conf = XMPPServer.getConfigurator();
def pluginsEnabled = [ ];
pluginsEnabled.addAll(tigase.server.xmppsession.SessionManagerConfig.PLUGINS_FULL_PROP_VAL);
def pluginsStr = conf.getDefConfigParams().get(Configurable.GEN_SM_PLUGINS);
if (pluginsStr) {
pluginsStr.split(",").each { tmp ->
def id = tmp;
switch (tmp.charAt(0)) {
case '+':
id = tmp.substring(1);
if (!pluginsAll.contains(id)) {
pluginsAll.add(id);
}
if (!pluginsEnabled.contains(id)) {
pluginsEnabled.add(id);
}
break;
case '-':
id = tmp.substring(1);
if (!pluginsAll.contains(id)) {
pluginsAll.add(id);
}
pluginsEnabled.remove(id);
break;
default:
pluginsEnabled.add(id);
break;
}
}
}
Command.addHiddenField(res, SUBMIT, SUBMIT);
pluginsAll.sort();
pluginsAll.each { id -> Command.addCheckBoxField(res, id, pluginsEnabled.contains(id));
}
return res;
} else {
def pluginsEnabled = [ ];
pluginsEnabled.addAll(tigase.server.xmppsession.SessionManagerConfig.PLUGINS_FULL_PROP_VAL);
def str = "";
def data = Command.getData(p, "x", "jabber:x:data");
data.getChildren().each { child ->
if (child.getName() != 'field') {
return
};
if (child.getAttribute("value") == SUBMIT) {
return
};
def id = tigase.xml.XMLUtils.escape(child.getAttribute("var"));
def enable = Command.getCheckBoxFieldValue(p, id);
if (enable && pluginsEnabled.contains(id)) {
return
};
if (!enable && !pluginsEnabled.contains(id)) {
return
};
if (enable && !pluginsEnabled.contains(id)) {
if (!str.isEmpty()) {
str += ","
};
str += "+" + id;
pluginsEnabled.add(id);
} else if (!enable && pluginsEnabled.contains(id)) {
if (!str.isEmpty()) {
str += ","
};
str += "-" + id;
pluginsEnabled.remove(id);
}
}
def conf = XMPPServer.getConfigurator();
conf.getDefConfigParams().put(Configurable.GEN_SM_PLUGINS, str.isEmpty() ? null : str);
def props = [ : ];
props[tigase.server.xmppsession.SessionManagerConfig.PLUGINS_PROP_KEY] = (pluginsEnabled as String[]);
conf.putProperties("sess-man", props);
new DelayedReloadTaskPlugMan().start();
def res = (Iq) p.commandResult(Command.DataType.result)
Command.addTextField(res, "Note", "Operation successful.");
return res;
}
} catch (Exception ex) {
ex.printStackTrace();
throw ex;
}
================================================
FILE: src/main/groovy/tigase/admin/ReEnableUser.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
User modify script
AS:Description: Re-Enable User
AS:CommandId: http://jabber.org/protocol/admin#reenable-user
AS:Component: sess-man
AS:Group: Users
*/
package tigase.admin
import tigase.db.AuthRepository
import tigase.db.UserRepository
import tigase.db.TigaseDBException
import tigase.db.UserNotFoundException
import tigase.server.Command
import tigase.server.Packet
import tigase.server.Permissions
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.StanzaType
import tigase.xmpp.jid.BareJID
def JIDS = "accountjids"
def p = (Packet) packet
def auth_repo = (AuthRepository) authRepository
def user_repo = (UserRepository) userRepository
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def NOTIFY_CLUSTER = "notify-cluster"
boolean clusterMode = Boolean.valueOf(System.getProperty("cluster-mode", false.toString()))
def notifyClusterStr = Command.getFieldValue(packet, NOTIFY_CLUSTER)
boolean notifyCluster = (notifyClusterStr != null) ? Boolean.valueOf(notifyClusterStr) : true
def user_sessions = (Map) userSessions
def userJids = Command.getFieldValues(packet, JIDS)
if (userJids == null) {
def result = p.commandResult(Command.DataType.form)
Command.addTitle(result, "Re-enabling a User")
Command.addInstructions(result, "Fill out this form to re-enable a user.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
Command.addFieldValue(result, JIDS, userJids ?: "", "jid-multi",
"The Jabber ID(s) to re-enable")
if (clusterMode) {
Command.addHiddenField(result, NOTIFY_CLUSTER, true.toString())
}
return result
}
def results = new LinkedList()
def closeUserSessions = { userJid ->
try {
def bareJID = BareJID.bareJIDInstance(userJid)
def sess = user_sessions.get(bareJID)
if (sess != null) {
def conns = sess.getConnectionIds()
for (conn in conns) {
def res = sess.getResourceForConnectionId(conn)
if (res != null) {
def commandClose = Command.CLOSE.getPacket(p.getStanzaTo(), conn,
StanzaType.set, res.nextStanzaId())
results.offer(commandClose)
}
}
}
} catch (Exception ex) {
ex.printStackTrace()
}
}
if (clusterMode) {
if (!notifyCluster) {
for (userJid in userJids) {
closeUserSessions(userJid)
}
return results
}
}
if (clusterMode && notifyCluster) {
def nodes = (List) clusterStrategy.getNodesConnected()
if (nodes && nodes.size() > 0) {
nodes.each { node ->
def forward = p.copyElementOnly()
Command.removeFieldValue(forward, NOTIFY_CLUSTER)
Command.addHiddenField(forward, NOTIFY_CLUSTER, false.toString())
forward.setPacketTo(node)
forward.setPermissions(Permissions.ADMIN)
results.offer(forward)
}
}
}
def result = p.commandResult(Command.DataType.result)
def msgs = [ ]
def errors = [ ]
for (userJid in userJids) {
try {
def bareJID = BareJID.bareJIDInstance(userJid)
if (isAllowedForDomain.apply(bareJID.getDomain())) {
if (user_repo.userExists(bareJID)) {
try {
auth_repo.setAccountStatus(bareJID, AuthRepository.AccountStatus.active)
} catch (TigaseDBException ex) {
errors.add("Account " + userJid + " was not re-enabled: " + ex.getMessage())
}
closeUserSessions(userJid)
msgs.add("Operation successful for user " + userJid)
} else {
msgs.add("User " + userJid + " doesn't exist")
}
} else {
errors.add(
"You do not have enough permissions to re-enable accounts for domain " + bareJID.getDomain() + ".")
}
} catch (UserNotFoundException ex) {
errors.add("User " + userJid + " not exists, can't be re-enabled.")
} catch (TigaseDBException ex) {
errors.add("Problem accessing database, user " + userJid + " not re-enabled.")
}
}
if (!msgs.isEmpty()) {
Command.addFieldMultiValue(result, "Notes", msgs)
}
if (!errors.isEmpty()) {
Command.addFieldMultiValue(result, "Errors", errors)
}
results.offer(result)
return results
================================================
FILE: src/main/groovy/tigase/admin/RemoveUserTracker.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Activate on the server user tracking mechanisms to aid in problem resolution.
AS:Description: Remove log tracker for a user
AS:CommandId: http://jabber.org/protocol/admin#remove-user-tracker
AS:Component: sess-man
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
import tigase.util.log.LogUserFilter
import java.util.logging.Filter
import java.util.logging.Handler
import java.util.logging.Logger
def JID = "accountjid"
def p = (Packet) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
if (!isServiceAdmin) {
def result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Error", "You are not service administrator");
return result
}
def userJid = Command.getFieldValue(packet, JID)
if (userJid == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Removing a User Log Tracker")
//Command.addInstructions(result, "Fill out this form to add a user log tracker.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
Command.addFieldValue(result, JID, userJid ?: "", "jid-single",
"The Jabber ID for the tracker to be removed")
return result
}
def result = p.commandResult(Command.DataType.result)
def hand = null
Handler[] handlers = Logger.getLogger("").getHandlers()
handlers.each {
Filter filt = it.getFilter()
if (filt != null && filt.class == LogUserFilter && ((LogUserFilter) filt).getId() == userJid) {
hand = it
}
}
if (hand != null) {
Logger.getLogger("").removeHandler(hand)
hand.close()
Command.addTextField(result, "Note", "Operation successful, tracker removed for " + userJid);
} else {
Command.addTextField(result, "Note", "No tracker found for user " + userJid)
}
return result
================================================
FILE: src/main/groovy/tigase/admin/RosterFixer.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
The roster fixer scripts is used in a case if for whatever reason user's roster got
broken, lost or otherwise messed up. If we know the user's contact list, this script
can be used to restore the contact list. It adds missing entries to the user's roster.
If the user is online, he gets a roster push with updated entries to make sure
he is up to date with all the changes.
The script accepts a user JID, action (update or remove) and a list of buddies in
a following format:
buddy_jid,buddy_name,subscription
buddy_jid is a JID (bare JID)
buddy_name is just a string, it is optional, if omit, localpart of the JID is used
subscription is one of following (none, from, to, both), it is optional, if omit 'both' is used
AS:Description: Fixes user's roster
AS:CommandId: roster-fixer
AS:Component: sess-man
*/
package tigase.admin
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostManagerIfc
import tigase.xml.Element
import tigase.xmpp.XMPPSession
import tigase.xmpp.impl.roster.RosterAbstract
import tigase.xmpp.impl.roster.RosterElement
import tigase.xmpp.impl.roster.RosterFactory
import tigase.xmpp.impl.roster.RosterFlat
import tigase.xmpp.jid.BareJID
import tigase.xmpp.jid.JID
def ROSTER_OWNER_JID = "roster-owner-jid"
def ROSTER_BUDDY_LIST = "roster-buddy-list"
def ROSTER_ACTION = "roster-action"
def UPDATE = "update"
def REMOVE = "remove"
def subscriptions = [ "both", "from", "to", "none" ]
def actions = [ UPDATE, REMOVE ]
def actions_descr = [ "Add/Update item", "Remove item" ]
//def notify_cluster = ["no", "yes"]
def p = (Packet) packet
def repository = (UserRepository) userRepository
def sessions = (Map) userSessions
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID();
def isServiceAdmin = admins.contains(stanzaFromBare);
def rosterOwnerJid = Command.getFieldValue(packet, ROSTER_OWNER_JID)
def rosterAction = Command.getFieldValue(packet, ROSTER_ACTION)
def rosterBuddyList = Command.getFieldValues(packet, ROSTER_BUDDY_LIST) as List;
//def rosterNotifyCluster = Command.getFieldValue(packet, ROSTER_NOTIFY_CLUSTER)
if (rosterOwnerJid == null || rosterBuddyList == null || rosterAction == null) {
def res = p.commandResult(Command.DataType.form);
Command.addFieldValue(res, ROSTER_OWNER_JID, rosterOwnerJid ?: "",
"jid-single", "Roster owner JID")
Command.addFieldValue(res, ROSTER_ACTION, actions[0],
"Action", (String[]) actions_descr, (String[]) actions)
if (rosterBuddyList == null) {
rosterBuddyList = [ "" ]
}
Command.addFieldMultiValue(res, ROSTER_BUDDY_LIST, rosterBuddyList)
// Command.addFieldValue(res, ROSTER_NOTIFY_CLUSTER, notify_cluster[0],
// "Notify cluster", (String[])notify_cluster, (String[])notify_cluster)
return res
}
def remove_item = rosterAction == REMOVE
def Queue results = new LinkedList()
def res_report = [ ]
def updateRoster = { sess, online, jid, i_jid, i_name, i_subscr ->
if (online) {
// sess.getActiveResources().each{ conn ->
def conn = sess.getActiveResources()[0]
// Update online
RosterAbstract rosterUtil = RosterFactory.getRosterImplementation(true)
if (remove_item) {
rosterUtil.removeBuddy(conn, i_jid)
Element item = new Element("item",
(String[]) [ "jid", "subscription" ], (String[]) [ i_jid, "remove" ])
rosterUtil.updateBuddyChange(conn, results, item)
Element pres = new Element("presence",
(String[]) [ "from", "to", "type", "xmlns" ],
(String[]) [ jid, i_jid, "unsubscribed", "jabber:client" ]);
results.offer(Packet.packetInstance(pres))
pres = new Element("presence",
(String[]) [ "from", "to", "type", "xmlns" ],
(String[]) [ jid, i_jid, "unsubscribe", "jabber:client" ]);
results.offer(Packet.packetInstance(pres))
res_report += "Buddy: " + i_jid + " removed"
} else {
if (rosterUtil.containsBuddy(conn, i_jid)) {
res_report += "Buddy: " + i_jid + " already in the roster, skipping"
} else {
rosterUtil.addBuddy(conn, i_jid, i_name, null, RosterAbstract.SubscriptionType.valueOf(i_subscr), null)
item = rosterUtil.getBuddyItem(conn, i_jid)
rosterUtil.updateBuddyChange(conn, results, item)
res_report += "Buddy: " + i_jid + " added to the roster"
}
}
// }
} else {
// Update offline
String rosterStr = repository.getData(jid.getBareJID(), null,
RosterAbstract.ROSTER, null) ?: ""
Map roster = new LinkedHashMap()
RosterFlat.parseRosterUtil(rosterStr, roster, null)
if (remove_item) {
roster.remove(i_jid.getBareJID())
res_report += "Buddy: " + i_jid + " removed"
} else {
if (roster.get(i_jid.getBareJID()) == null) {
RosterElement rel = new RosterElement(i_jid, i_name, null)
rel.setSubscription(RosterAbstract.SubscriptionType.valueOf(i_subscr))
roster.put(i_jid, rel)
res_report += "Buddy: " + i_jid + " added to the roster"
} else {
res_report += "Buddy: " + i_jid + " already in the roster, skipping"
}
}
StringBuilder sb = new StringBuilder(200)
for (RosterElement relem : roster.values()) {
sb.append(relem.getRosterElement().toString())
}
repository.setData(jid.getBareJID(), null, RosterAbstract.ROSTER, sb.toString());
}
}
def jidRosterOwnerJid = JID.jidInstanceNS(rosterOwnerJid);
Packet result = p.commandResult(Command.DataType.result)
def vhost = vhost_man.getVHostItem(jidRosterOwnerJid.getDomain());
if (vhost == null ||
(!isAllowedForDomain.apply(jidRosterOwnerJid.getDomain()))) {
Command.addTextField(result, "Error", "You do not have enough permissions to modify roster of " + rosterOwnerJid);
results.add(result);
return results;
}
def rosterItemJid = null
def sess = sessions == null ? null : sessions.get(jidRosterOwnerJid.getBareJID());
def conn = sess != null ? sess.getActiveResources().get(0) : null;
def online = true
if (conn) {
res_report += "User: " + jidRosterOwnerJid + " is online, updating database and online connections"
} else {
res_report += "User: " + jidRosterOwnerJid + " is offline, updating database only"
online = false
}
rosterBuddyList.each {
def buddy = it.split(",")
if (it.contains(';')) {
buddy = it.split(";")
}
rosterItemJid = buddy[0]
def jidRosterItemJid = JID.jidInstanceNS(rosterItemJid)
def rosterItemName = (buddy as List)[1] ?: jidRosterItemJid.getLocalpart()
def rosterItemSubscr = (buddy as List)[2] ?: "both"
updateRoster(sess, online, jidRosterOwnerJid, jidRosterItemJid, rosterItemName, rosterItemSubscr)
if (!remove_item) {
Element pres = new Element("presence",
(String[]) [ "from", "to", "type", "xmlns" ],
(String[]) [ rosterOwnerJid, rosterItemJid,
"probe", "jabber:client" ])
results.offer(Packet.packetInstance(pres))
pres = new Element("presence",
(String[]) [ "from", "to", "type", "xmlns" ], (String[]) [ rosterItemJid, rosterOwnerJid,
"probe", "jabber:client" ])
results.offer(Packet.packetInstance(pres))
}
}
Command.addTextField(result, "Note", "Operation successful");
Command.addFieldMultiValue(result, "Report: ", res_report)
results.add(result)
return results
================================================
FILE: src/main/groovy/tigase/admin/RosterFixerCluster.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
The roster fixer scripts is used in a case if for whatever reason user's roster got
broken, lost or otherwise messed up. If we know the user's contact list, this script
can be used to restore the contact list. It adds missing entries to the user's roster.
If the user is online, he gets a roster push with updated entries to make sure
he is up to date with all the changes.
The script accepts a user JID, action (update or remove) and a list of buddies in
a following format:
buddy_jid,buddy_name,subscription
buddy_jid is a JID (bare JID)
buddy_name is just a string, it is optional, if omit, localpart of the JID is used
subscription is one of following (none, from, to, both), it is optional, if omit 'both' is used
AS:Description: Fixes user's roster on Tigase cluster
AS:CommandId: roster-fixer-cluster
AS:Component: sess-man
*/
package tigase.admin
import tigase.cluster.strategy.ClusteringStrategyIfc
import tigase.cluster.strategy.ConnectionRecord
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostManagerIfc
import tigase.xml.Element
import tigase.xmpp.StanzaType
import tigase.xmpp.XMPPSession
import tigase.xmpp.impl.roster.RosterAbstract
import tigase.xmpp.impl.roster.RosterElement
import tigase.xmpp.impl.roster.RosterFlat
import tigase.xmpp.jid.BareJID
import tigase.xmpp.jid.JID
def ROSTER_OWNER_JID = "roster-owner-jid"
def ROSTER_BUDDY_LIST = "roster-buddy-list"
def ROSTER_ACTION = "roster-action"
def DISCONNECTED_PHASE = "disconnected-phase"
def UPDATE = "update"
def REMOVE = "remove"
def subscriptions = [ "both", "from", "to", "none" ]
def actions = [ UPDATE, REMOVE ]
def actions_descr = [ "Add/Update item", "Remove item" ]
//def notify_cluster = ["no", "yes"]
def p = (Packet) packet
def repository = (UserRepository) userRepository
def sessions = (Map) userSessions
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID();
def isServiceAdmin = admins.contains(stanzaFromBare);
def rosterOwnerJid = Command.getFieldValue(packet, ROSTER_OWNER_JID)
def rosterAction = Command.getFieldValue(packet, ROSTER_ACTION)
def rosterBuddyList = Command.getFieldValues(packet, ROSTER_BUDDY_LIST) as List;
//def rosterNotifyCluster = Command.getFieldValue(packet, ROSTER_NOTIFY_CLUSTER)
boolean clusterMode = Boolean.valueOf(System.getProperty("cluster-mode", false.toString()));
if (rosterOwnerJid == null || rosterBuddyList == null || rosterAction == null) {
def res = p.commandResult(Command.DataType.form);
Command.addFieldValue(res, ROSTER_OWNER_JID, rosterOwnerJid ?: "",
"jid-single", "Roster owner JID")
Command.addFieldValue(res, ROSTER_ACTION, actions[0],
"Action", (String[]) actions_descr, (String[]) actions)
if (rosterBuddyList == null) {
rosterBuddyList = [ "" ]
}
Command.addFieldMultiValue(res, ROSTER_BUDDY_LIST, rosterBuddyList)
// Command.addFieldValue(res, ROSTER_NOTIFY_CLUSTER, notify_cluster[0],
// "Notify cluster", (String[])notify_cluster, (String[])notify_cluster)
return res
}
def remove_item = rosterAction == REMOVE
def res_report = [ ]
def jidRosterOwnerJid = JID.jidInstanceNS(rosterOwnerJid)
def Queue results = new LinkedList()
Packet result = p.commandResult(Command.DataType.result)
def vhost = vhost_man.getVHostItem(jidRosterOwnerJid.getDomain());
if (vhost == null ||
(!isAllowedForDomain.apply(jidRosterOwnerJid.getDomain()))) {
Command.addTextField(result, "Error", "You do not have enough permissions to modify roster of " + rosterOwnerJid);
results.offer(result);
return results;
}
def disconnected = Command.getFieldValue(p, DISCONNECTED_PHASE)
// Disconnecting all user's connections on the whole cluster
if (!disconnected) {
def sess = sessions == null ? null : sessions.get(jidRosterOwnerJid.getBareJID())
def online = false
if (sess && sess.getActiveResourcesSize() > 0) {
sess.getActiveResources().each { conn ->
def commandClose = Command.CLOSE.getPacket(p.getStanzaTo(), conn.getConnectionId(),
StanzaType.set, conn.nextStanzaId())
results.offer(commandClose)
res_report += "User: " + conn.getjid() + " is online, disconnected."
}
online = true
}
if (clusterMode) {
if (null != clusterStrategy) {
def cluster = (ClusteringStrategyIfc) clusterStrategy
Set cl_conns = cluster.getConnectionRecords(jidRosterOwnerJid.getBareJID())
if (cl_conns && cl_conns.size() > 0) {
cl_conns.each {
def commandClose = Command.CLOSE.getPacket(p.getStanzaTo(), it.getConnectionId(),
StanzaType.set, "77")
results.offer(commandClose)
res_report += "User: " + it.getUserJid() + " is online on node: " + it.getNode() + ", disconnected."
}
online = true
}
}
}
if (online) {
Command.addFieldMultiValue(p, "Report: ", res_report)
Command.addHiddenField(p, DISCONNECTED_PHASE, DISCONNECTED_PHASE)
results.offer(p)
return results
}
} else {
Command.getFieldValues(packet, "Report: ").each {
res_report += it
}
}
// Waiting 2 secs
sleep(2000)
// Updating user's roster in DB
def updateRoster = { sess, online, jid, i_jid, i_name, i_subscr ->
// Update offline
String rosterStr = repository.getData(jid.getBareJID(), null,
RosterAbstract.ROSTER, null) ?: ""
Map roster = new LinkedHashMap()
RosterFlat.parseRosterUtil(rosterStr, roster, null)
if (remove_item) {
roster.remove(i_jid.getBareJID())
res_report += "Buddy: " + i_jid + " removed"
} else {
if (roster.get(i_jid.getBareJID()) == null) {
RosterElement rel = new RosterElement(i_jid, i_name, null)
rel.setSubscription(RosterAbstract.SubscriptionType.valueOf(i_subscr))
roster.put(i_jid, rel)
res_report += "Buddy: " + i_jid + " added to the roster"
} else {
res_report += "Buddy: " + i_jid + " already in the roster, skipping"
}
}
StringBuilder sb = new StringBuilder(200)
for (RosterElement relem : roster.values()) {
sb.append(relem.getRosterElement().toString())
}
repository.setData(jid.getBareJID(), null, RosterAbstract.ROSTER, sb.toString());
}
def rosterItemJid = null
def sess = sessions == null ? null : sessions.get(jidRosterOwnerJid.getBareJID());
def conn = sess != null ? sess.getActiveResources().get(0) : null;
def online = true
if (conn) {
res_report += "User: " + jidRosterOwnerJid + " is online, updating database and online connections"
} else {
res_report += "User: " + jidRosterOwnerJid + " is offline, updating database only"
online = false
}
rosterBuddyList.each {
def buddy = it.split(",")
if (it.contains(';')) {
buddy = it.split(";")
}
rosterItemJid = buddy[0]
def jidRosterItemJid = JID.jidInstanceNS(rosterItemJid)
def rosterItemName = (buddy as List)[1] ?: jidRosterItemJid.getLocalpart()
def rosterItemSubscr = (buddy as List)[2] ?: "both"
updateRoster(sess, online, jidRosterOwnerJid, jidRosterItemJid, rosterItemName, rosterItemSubscr)
if (!remove_item) {
Element pres = new Element("presence",
(String[]) [ "from", "to", "type" ], (String[]) [ rosterOwnerJid, rosterItemJid,
"probe" ])
results.offer(Packet.packetInstance(pres))
pres = new Element("presence",
(String[]) [ "from", "to", "type" ], (String[]) [ rosterItemJid, rosterOwnerJid,
"probe" ])
results.offer(Packet.packetInstance(pres))
}
}
// Finishing the work and completing script
Command.addTextField(result, "Note", "Operation successful");
Command.addFieldMultiValue(result, "Report: ", res_report)
results.add(result)
return results
================================================
FILE: src/main/groovy/tigase/admin/S2SBadConnectionStates.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Script tries to find S2S connection in a bad state and reports connection details.
AS:Description: S2S Bad State Connections
AS:CommandId: s2s-bad-state-conns
AS:Component: s2s
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
import tigase.server.xmppserver.CIDConnections
def p = (Packet) packet
def cidConns = (Map) cidConnections
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
if (!isServiceAdmin) {
def result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Error", "You are not service administrator");
return result
}
def conns = [ ]
conns += "Total count: " + cidConns.size()
cidConns.entrySet().each {
CIDConnections con = it.getValue()
if (con.getWaitingCount() > 0) {
conns += it.getKey().toString() + ", out in progress: " + con.getOutgoingInProgress() + ", waiting: " +
con.getWaitingCount() + ", control: " + con.getWaitingControlCount() + ", incoming: " +
con.getIncomingCount() + ", outgoing: " + con.getOutgoingCount() + ", out-handshaking: " +
con.getOutgoingHandshakingCount()
}
}
def result = p.commandResult(Command.DataType.result)
Command.addFieldMultiValue(result, "Connections with waiting packets", conns);
return result
================================================
FILE: src/main/groovy/tigase/admin/S2SCIDState.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Returns S2S connection state for given CID
AS:Description: S2S get CID connection state
AS:CommandId: s2s-get-cid-connection
AS:Component: s2s
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
import tigase.server.xmppserver.CID
import tigase.server.xmppserver.CIDConnections
def p = (Packet) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def CID_KEY = "cid"
def cid = Command.getFieldValue(packet, CID_KEY)
if (!isServiceAdmin) {
def result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Error", "You are not service administrator");
return result
}
if (cid == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Get S2S connection state")
Command.addInstructions(result, "Fill out this form to get S2S connection state")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin",
"hidden")
Command.addFieldValue(result, CID_KEY, cid ?: "", "text-single",
"S2S connection CID")
return result
}
def conns = [ ]
def cidConns = (Map) cidConnections
CID c = new CID(cid)
CIDConnections con = cidConns.get(c)
if (con == null) {
conns += "No such CID connection found"
} else {
conns += cid
conns += "out in progress: " + con.getOutgoingInProgress()
conns += "waiting: " + con.getWaitingCount()
conns += "control: " + con.getWaitingControlCount()
conns += "incoming: " + con.getIncomingCount()
conns += "outgoing: " + con.getOutgoingCount()
conns += "out-handshaking: " + con.getOutgoingHandshakingCount()
}
def result = p.commandResult(Command.DataType.result)
Command.addFieldMultiValue(result, "S2S connection", conns);
return result
================================================
FILE: src/main/groovy/tigase/admin/S2SGetAllConnectionStates.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Script lists all CID connections.
AS:Description: S2S State of All Connections
AS:CommandId: s2s-all-conns-state
AS:Component: s2s
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
import tigase.server.xmppserver.CIDConnections
def p = (Packet) packet
def cidConns = (Map) cidConnections
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
if (!isServiceAdmin) {
def result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Error", "You are not service administrator");
return result
}
def conns = [ ]
conns += "Total count: " + cidConns.size() + ":"
cidConns.entrySet().each {
CIDConnections con = it.getValue()
conns += it.getKey().toString() + ", out in progress: " + con.getOutgoingInProgress() + ", waiting: " +
con.getWaitingCount() + ", control: " + con.getWaitingControlCount() + ", incoming: " +
con.getIncomingCount() + ", outgoing: " + con.getOutgoingCount() + ", out-handshaking: " +
con.getOutgoingHandshakingCount()
}
def result = p.commandResult(Command.DataType.result)
Command.addFieldMultiValue(result, "Connections with waiting packets", conns);
return result
================================================
FILE: src/main/groovy/tigase/admin/S2SResetBadConnections.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Script tries to find S2S connection in a bad state and resets their state
AS:Description: S2S Reset Bad State Connections
AS:CommandId: s2s-reset-bad-state-conns
AS:Component: s2s
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
import tigase.server.xmppserver.CIDConnections
def cidConns = (Map) cidConnections
def p = (Packet) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
if (!isServiceAdmin) {
def result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Error", "You are not service administrator");
return result
}
def conns = [ ]
conns += "Total count: " + cidConns.size()
cidConns.entrySet().each {
CIDConnections con = it.getValue()
// Bad state is when the OutgoingInProgress is set to true but there is no outgoing
// or outgoing handshaking connections.
if (con.getOutgoingInProgress() && (con.getOutgoingCount() == 0) && (con.getOutgoingHandshakingCount() == 0)) {
conns += it.getKey().toString() + ", waiting: " + con.getWaitingCount()
con.resetOutgoingInProgress()
}
}
def result = p.commandResult(Command.DataType.result)
Command.addFieldMultiValue(result, "Reset connections", conns);
return result
================================================
FILE: src/main/groovy/tigase/admin/SSLCertificateAdd.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Add an SSL certificate for a given domain.
AS:Description: Add SSL Certificate
AS:CommandId: ssl-certificate-add
AS:Component: vhost-man
*/
package tigase.admin
import groovy.transform.CompileStatic
import tigase.cert.CertificateEntry
import tigase.cert.CertificateUtil
import tigase.db.comp.ComponentRepository
import tigase.io.CertificateContainerIfc
import tigase.io.SSLContextContainerIfc
import tigase.kernel.core.Kernel
import tigase.server.Command
import tigase.server.Iq
import tigase.server.Packet
import tigase.vhosts.VHostItem
import tigase.xmpp.jid.BareJID
import java.security.cert.Certificate
import java.security.cert.X509Certificate
import java.util.function.Function
import java.util.logging.Level
import java.util.logging.Logger
Kernel kernel = (Kernel) kernel;
def repo = (ComponentRepository) comp_repo
def p = (Packet) packet
def admins = (Set) adminsSet
def log = Logger.getLogger("tigase.admin");
@CompileStatic
Packet process(Kernel kernel, Logger log, ComponentRepository repo, Iq packet, Set admins, Function isAllowedForDomain) {
def MARKER = "command-marker"
try {
def VHOST = "VHost"
def CERTIFICATE = "Certificate in PEM format"
def SAVE_TO_DISK = "Save permanently (to disk or repository)"
def USE_AS_DEFAULT = "Use as default"
def stanzaFromBare = packet.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def itemKey = Command.getFieldValue(packet, VHOST)
def marker = Command.getFieldValue(packet, MARKER)
def pemCertVals = Command.getFieldValues(packet, CERTIFICATE)
def saveToDisk = Command.getCheckBoxFieldValue(packet, SAVE_TO_DISK)
def useAsDefault = Command.getCheckBoxFieldValue(packet, USE_AS_DEFAULT)
// The first step - provide a list of all vhosts for the user
if (itemKey == null) {
Collection items = repo.allItems()
List itemsStr = items.findAll { isAllowedForDomain.apply(it.getKey()) }.collect { it.getKey() };
if (itemsStr.size() > 0) {
String[] itemsStrArray = itemsStr.toArray(new String[itemsStr.size()]);
def result = packet.commandResult(Command.DataType.form)
Command.addFieldValue(result, VHOST, itemsStr[0], "List of VHosts",
itemsStrArray, itemsStrArray);
return result
} else {
def result = packet.commandResult(Command.DataType.result)
Command.addTextField(result, "Note", "You have no VHosts to manage");
return result
}
}
// The second step - provide a form to fill be by the user for selected vhost
if (marker == null) {
VHostItem item = repo.getItem(itemKey)
if (item == null) {
def result = packet.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "No such VHost, adding SSL Certificate impossible.");
return result;
} else {
if (isAllowedForDomain.apply(itemKey)) {
def result = packet.commandResult(Command.DataType.form)
Command.addFieldValue(result, VHOST, itemKey, "text-single")
Command.addFieldMultiValue(result, CERTIFICATE, [ "" ])
Command.addCheckBoxField(result, SAVE_TO_DISK, true)
Command.addCheckBoxField(result, USE_AS_DEFAULT, false)
Command.addHiddenField(result, MARKER, MARKER)
return result
} else {
def result = packet.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "You do not have enough permissions to manage this VHost.")
return result
}
}
}
// The last step - process the form submitted by the user
def result = packet.commandResult(Command.DataType.result)
VHostItem item = repo.getItem(itemKey)
if (item == null) {
Command.addTextField(result, "Error", "No such VHost, loading SSL certificate impossible.")
} else {
if (isAllowedForDomain.apply(itemKey)) {
def pemCert = pemCertVals.join('\n')
// Basic certificate checks
// For XMPP service nonAdmins (domain owners) the alias must match CN name in the certificate
CertificateEntry certEntry = CertificateUtil.parseCertificate(new CharArrayReader(pemCert.toCharArray()))
if (certEntry.getPrivateKey() == null) {
Command.addTextField(result, "Error",
"Missing private key or private key encoded in uknown format.")
Command.addTextField(result, "Note", "Private key cannot be encoded with a password.")
} else {
def domainCertificate = (X509Certificate)CertificateUtil.sort(certEntry.getCertChain())[0]
def certCName = CertificateUtil.getCertCName(domainCertificate)
def subjectAltName = CertificateUtil.getCertAltCName(domainCertificate)
if (hasPermissionToUpdate(item, isServiceAdmin, stanzaFromBare, log) &&
isCertificateValidForVhost(itemKey, certCName, subjectAltName, log)) {
CertificateContainerIfc certContainer = kernel.getInstance(CertificateContainerIfc.class);
certContainer.addCertificates(new CertificateContainerIfc.CertificateEntity(pemCert, itemKey, saveToDisk, useAsDefault));
Command.addTextField(result, "Note",
"SSL Certificate for domain: " + itemKey + " loaded successfully")
} else {
Command.addTextField(result, "Error",
"Neither certificate CName nor any of SubjectAlternativeNames match the domain name!")
}
}
} else {
Command.addTextField(result, "Error", "You are not the VHost owner or you have no " +
"enough permission to change the VHost.")
}
}
return result;
} catch (Exception ex) {
def result = packet.commandResult(Command.DataType.result);
def errorMessage = ex.getMessage()
if (ex.getCause()!=null) {
errorMessage += "\n" + ex.getCause().getMessage();
}
Command.addTextField(result, "Error", errorMessage);
log.log(Level.FINE, "Error while processing request", ex)
return result;
}
}
private static boolean hasPermissionToUpdate(VHostItem item, boolean isServiceAdmin, BareJID userJid, Logger log) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "hasPermissionToUpdate :: userJid: ${userJid}, isServiceAdmin: ${isServiceAdmin}, isOwner: ${item.isOwner(userJid.toString())}, isAdmin: ${item.isAdmin(userJid.toString())}")
}
isServiceAdmin || item.isOwner(userJid.toString()) || item.isAdmin(userJid.toString())
}
private static boolean isCertificateValidForVhost(String itemKey, String certCName, List subjectAltName,
Logger log) {
def wildcardItemKey = "*." + itemKey
def result = certCName == itemKey || certCName == wildcardItemKey || isWildcardMatch(certCName, itemKey) || subjectAltName.contains(itemKey) ||
subjectAltName.contains(wildcardItemKey)
if (log.isLoggable(Level.FINEST)) {
Logger.getLogger("tigase.admin").
log(Level.FINEST,
"isCertificateValidForVhost:: itemKey: ${itemKey}, wildcardItemKey: ${wildcardItemKey}, certCName: ${certCName}, subjectAltName: ${subjectAltName}, result: ${result}")
}
return result
}
private static isWildcardMatch(String certCName, String vhost) {
def unWildcardCName = certCName.startsWith("*.") ? certCName.substring(2) : certCName;
def parentDomain = vhost.indexOf(".") != -1 ? vhost.substring(vhost.indexOf(".") + 1) : vhost;
return unWildcardCName == parentDomain;
}
return process(kernel, log, repo, p, admins, (Function) isAllowedForDomain);
================================================
FILE: src/main/groovy/tigase/admin/SetMOTD.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Set Message of the Day
AS:Description: Set Message of the Day
AS:CommandId: http://jabber.org/protocol/admin#set-motd
AS:Component: sess-man
AS:Group: Configuration
*/
package tigase.admin
import groovy.transform.CompileStatic
import tigase.kernel.KernelException
import tigase.kernel.core.Kernel
import tigase.server.Command
import tigase.server.Iq
import tigase.server.Packet
import tigase.server.xmppsession.SessionManager
import tigase.xmpp.impl.MotdProcessor
import java.util.logging.Level
import java.util.logging.Logger
Kernel kernel = (Kernel) kernel;
SessionManager component = (SessionManager) component
packet = (Iq) packet
@CompileStatic
Packet process(Kernel kernel, SessionManager component, Iq p) {
if (!component.isAdmin(p.getStanzaFrom())) {
def result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "You are not service administrator")
return result
}
try {
MotdProcessor motdProcessor = kernel.getInstance(MotdProcessor.class)
String MOTD = "motd"
def motd = Command.getFieldValues(p, MOTD)
if (!motd) {
def result = p.commandResult(Command.DataType.form)
Command.addTitle(result, "Setting the Message of the Day")
Command.addInstructions(result, "Fill out this form to set the message of the day.")
Command.addHiddenField(result, "FORM_TYPE", "http://jabber.org/protocol/admin")
Command.addFieldMultiValue(result, MOTD, [ ], "Message of the Day")
return result
} else {
def result = p.commandResult(Command.DataType.result)
motdProcessor.setMotd(motd.join("\n"))
return result
}
} catch (KernelException ex) {
def result = p.commandResult(Command.DataType.result)
Logger.getLogger("tigase.admin.SetMOTD").log(Level.WARNING, "MotDProcessor is not enabled or misconfigured", ex);
Command.addTextField(result, "Error",
"MotDProcessor is not enabled or misconfigured - please check server logs.");
return result;
}
}
return process(kernel, component, packet)
================================================
FILE: src/main/groovy/tigase/admin/SetWelcomeMessage.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Set Welcome Message
AS:Description: Set Welcome Message
AS:CommandId: http://jabber.org/protocol/admin#set-welcome
AS:Component: sess-man
AS:Group: Configuration
*/
package tigase.admin
import groovy.transform.CompileStatic
import tigase.kernel.core.Kernel
import tigase.server.Command
import tigase.server.Iq
import tigase.server.Packet
import tigase.server.xmppsession.SessionManager
import tigase.xmpp.impl.JabberIqRegister
Kernel kernel = (Kernel) kernel;
SessionManager component = (SessionManager) component
packet = (Iq) packet
@CompileStatic
Packet process(Kernel kernel, SessionManager component, Iq p) {
String MOTD = "welcome"
if (!component.isAdmin(p.getStanzaFrom())) {
def result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "You are not service administrator")
return result
}
if (kernel.getDependencyManager().getBeanConfigs(JabberIqRegister.class, null, null, true).isEmpty()) {
def result = p.commandResult(Command.DataType.result)
Command.addTextField(result, "Error", "JabberIqRegister is disabled");
return result
}
def motd = Command.getFieldValues(p, MOTD)
if (!motd) {
def result = p.commandResult(Command.DataType.form)
Command.addTitle(result, "Setting Welcome Message")
Command.addInstructions(result, "Fill out this form to set the welcome message for this service.")
Command.addHiddenField(result, "FORM_TYPE", "http://jabber.org/protocol/admin")
Command.addFieldMultiValue(result, MOTD, [ ], "Welcome message")
return result
} else {
def result = p.commandResult(Command.DataType.result)
JabberIqRegister registerProcessor = kernel.getInstance(JabberIqRegister.class)
registerProcessor.setWelcomeMessage(motd.join("\n"))
return result
}
}
return process(kernel, component, packet)
================================================
FILE: src/main/groovy/tigase/admin/Shutdown.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Script executes graceful shutdown of cluster node
AS:Description: Shutdown
AS:CommandId: http://jabber.org/protocol/admin#shutdown
AS:Component: message-router
AS:Group: Configuration
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
def DELAY = "delay";
def NODE = "node";
def NOTIFY = "Notify users";
def MESSAGE = "Message to users";
def p = (Packet) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
if (!isServiceAdmin) {
def result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Error", "This command is available only to administrator of this service");
return result
}
def nodes = Command.getFieldValues(p, NODE) as List;
def notify = Command.getCheckBoxFieldValue(p, NOTIFY);
def msg = (Command.getFieldValues(p, MESSAGE) as List) ?:
[ "Server will be restarted.", "During restart you will be disconnected from XMPP server." ];
def delay = Command.getFieldValue(p, DELAY) ?: "30";
def result = null;
if (nodes == null || nodes.isEmpty()) {
result = p.commandResult(Command.DataType.form)
Command.addTitle(result, "Shutting Down the Service")
Command.addInstructions(result, "Fill out this form to shut down the service.")
nodes = component.getNodesConnectedWithLocal().collect { it.getDomain() };
Command.addFieldValue(result, NODE, [ ] as String[], "Nodes to shutdown", nodes as String[], nodes as String[])
Command.addFieldValue(result, DELAY, delay, "Delay before node shutdown",
[ "30sec", "1min", "3min", "5min" ] as String[], [ "30", 60, "180", "300" ] as String[]);
Command.addCheckBoxField(result, NOTIFY, false);
Command.addFieldMultiValue(result, MESSAGE, msg)
} else {
result = p.commandResult(Command.DataType.result);
nodes.each { node ->
def event = new tigase.eventbus.events.ShutdownEvent(node, delay as Long,
(notify && msg) ? msg.join("\n") : null);
eventBus.fire(event);
}
Command.addTextField(result, "Info", "Shutdown of service started");
}
return result
================================================
FILE: src/main/groovy/tigase/admin/SimServiceStopped.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Simulate service stopped uncontrolled execution to help with testing weird network
problems.
AS:Description: Simulate serviceStopped method call
AS:CommandId: sim-serv-stopped
AS:Component: cl-comp
*/
package tigase.admin
import tigase.cluster.ClusterConnectionManager
import tigase.net.IOService
import tigase.server.Command
import tigase.server.Packet
def p = (Packet) packet
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
if (!isServiceAdmin) {
def result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Error", "You are not service administrator");
return result
}
def KEY = "key"
def key = Command.getFieldValue(packet, KEY)
if (key == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Simulate serviceStopped method call")
Command.addInstructions(result, "Provide a key for IOService you wish to test.")
Command.addFieldValue(result, KEY, key ?: "", "text-single", "Key")
return result
}
Map services = (Map) servicesMap
IOService serv = services.get(key)
if (serv == null) {
return "IOService for key: ${key} not found!"
} else {
ClusterConnectionManager clCM = (ClusterConnectionManager) clusterCM
clCM.serviceStopped(serv)
return "serviceStopped called for IOService for key: ${key}."
}
================================================
FILE: src/main/groovy/tigase/admin/UpdateConfig.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Update config.tdsl configuration
AS:Description: Update config.tdsl configuration
AS:CommandId: update-config-tdsl
AS:Component: message-router
AS:Group: Configuration
*/
package tigase.admin
import groovy.transform.CompileStatic
import tigase.component.DSLBeanConfigurator
import tigase.conf.ConfigReader
import tigase.conf.ConfigWriter
import tigase.kernel.core.Kernel
import tigase.server.Command
import tigase.server.Iq
import tigase.server.Packet
Kernel kernel = (Kernel) kernel;
Iq p = (Iq) packet
Set admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
@CompileStatic
class ConfigReloadTask
extends Thread {
private final Map props;
private final String configStr;
private final DSLBeanConfigurator beanConfigurator;
ConfigReloadTask(DSLBeanConfigurator beanConfigurator, Map props, String configStr) {
this.props = props;
this.configStr = configStr;
this.beanConfigurator = beanConfigurator;
}
void run() {
Thread.sleep(5000);
System.out.println("Updating configuration at " + new Date());
Map oldConfig = beanConfigurator.getConfigHolder().getProperties();
try {
beanConfigurator.getConfigHolder().setProperties(props);
beanConfigurator.configurationChanged();
String filepath = beanConfigurator.
getConfigHolder().
getConfigFilePath().
toString();
if (new File(filepath + ".backup").exists()) {
new File(filepath + ".backup").delete();
}
new File(filepath).renameTo(filepath + ".backup");
new File(filepath + ".new").write(configStr);
// Dumping new configuration
System.out.println("Configuration updated and saved!");
File f = new File("etc/config-dump.properties");
if (f.exists()) {
f.delete();
}
beanConfigurator.dumpConfiguration(f);
} catch (Throwable ex) {
System.out.println("Could not apply configuration:");
ex.printStackTrace();
beanConfigurator.getConfigHolder().setProperties(oldConfig);
beanConfigurator.configurationChanged();
}
}
}
@CompileStatic
Packet process(Kernel kernel, Iq p, boolean isServiceAdmin) {
if (!isServiceAdmin) {
Packet result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Error", "You are not service administrator");
return result;
}
String newConfig = Arrays.asList(Command.getFieldValues(p, "Config") ?: new String[0]).join("\n");
if (!newConfig.trim().isEmpty()) {
try {
Map newConfigMap = new ConfigReader().read(new StringReader(newConfig));
new ConfigReloadTask(kernel.getInstance(DSLBeanConfigurator.class), newConfigMap, newConfig).start();
Packet result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Note", "Config initially validated and scheduled to be applied.");
return result;
} catch (ConfigReader.UnsupportedOperationException e) {
Packet result = p.commandResult(Command.DataType.form);
Command.addTextField(result, "Error", e.getMessage() + " at line " + e.getLine() + " position " +
e.getPosition() + "\nLine: " + e.getLineContent());
Command.addFieldMultiValue(result, "Config", Command.getFieldValues(p, "Config") as List)
return result;
} catch (ConfigReader.ConfigException e) {
Packet result = p.commandResult(Command.DataType.form);
Command.addTextField(result, "Error", "There is an error in your config. Please fix it.");
Command.addFieldMultiValue(result, "Config", Command.getFieldValues(p, "Config") as List)
return result;
}
} else {
Packet result = p.commandResult(Command.DataType.form);
DSLBeanConfigurator configurator = kernel.getInstance(DSLBeanConfigurator.class);
StringWriter writer = new StringWriter();
new ConfigWriter().write(writer, configurator.getConfigHolder().getProperties());
Command.addFieldMultiValue(result, "Config", Arrays.asList(writer.toString().split("\n")));
return result;
}
}
try {
return process(kernel, p, isServiceAdmin);
} catch (Exception ex) {
ex.printStackTrace();
throw ex;
}
================================================
FILE: src/main/groovy/tigase/admin/UserDomainFilter.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
AS:Description: Change user inter-domain communication permission.
AS:CommandId: user-domain-perm
AS:Component: sess-man
*/
package tigase.admin
import tigase.db.UserNotFoundException
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Iq
import tigase.vhosts.VHostManagerIfc
import tigase.vhosts.filter.CustomDomainFilter
import tigase.vhosts.filter.DomainFilterPolicy
import tigase.xmpp.impl.DomainFilter
def vhost_man = (VHostManagerIfc) vhostMan
def JID = "jid"
def FILTERING_POLICY = "fiteringPolicy"
def FILTERING_LIST = "filteringList"
def p = (Iq) packet
def jid = Command.getFieldValue(p, JID)
def domain = Command.getFieldValue(p, FILTERING_POLICY)
def domainList = Command.getFieldValue(p, FILTERING_LIST)
if (jid == null || domain == null || (domain == DomainFilterPolicy.LIST.name() && domainList == null)) {
def res = (Iq) p.commandResult(Command.DataType.form);
Command.addFieldValue(res, JID, jid ?: "", "jid-single", "User JID")
def domainStr = [ ]
DomainFilterPolicy.values().each { domainStr += it.name() }
Command.addFieldValue(res, FILTERING_POLICY, domain ?: domainStr[0], "List of domains",
(String[]) domainStr, (String[]) domainStr)
Command.addFieldValue(res, FILTERING_LIST, domainList ?: "", "text-single", "Domains List")
return res
}
def bareJID = tigase.xmpp.jid.JID.jidInstanceNS(jid.toLowerCase()).getBareJID();
jid = bareJID.toString();
def repo = (UserRepository) userRepository
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
if (!isAllowedForDomain.apply(bareJID.getDomain())) {
def result = p.commandResult(Command.DataType.result);
Command.addTextField(result, "Error", "You do not have enough permissions to manage this domain");
return result
}
try {
def old_value = repo.getData(bareJID, null,
DomainFilter.ALLOWED_DOMAINS_KEY, null)
def old_value_domains = "";
if (DomainFilterPolicy.valuePoliciesWithDomainListStr().contains(old_value)) {
old_value_domains = repo.getData(bareJID, null, DomainFilter.ALLOWED_DOMAINS_LIST_KEY, null)
}
if (domainList != null) {
domainList = domainList.replaceAll("\\s", "")
}
def new_value = domain
if (DomainFilterPolicy.valuePoliciesWithDomainListStr().contains(domain)) {
if (DomainFilterPolicy.valueof(domain) == DomainFilterPolicy.CUSTOM) {
try {
CustomDomainFilter.parseRules(domainList)
} catch (Exception e) {
return "Error parsing rules: " + domainList
}
}
repo.setData(bareJID, null, DomainFilter.ALLOWED_DOMAINS_LIST_KEY, domainList)
}
repo.setData(bareJID, null, DomainFilter.ALLOWED_DOMAINS_KEY, new_value)
return "Changed an old value: $old_value (domains list: $old_value_domains) to a new value: $new_value (domains list: $domainList) for user: $jid"
} catch (e) {
if (e in UserNotFoundException) {
return "The user $jid was not found in the user repository"
} else {
return "Unexpected error: " + e
}
}
================================================
FILE: src/main/groovy/tigase/admin/UserRosterManagement.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Update user roster entry.
AS:Description: Update user roster entry
AS:CommandId: user-roster-management
AS:Component: sess-man
*/
package tigase.admin
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.XMPPSession
import tigase.xmpp.impl.roster.RosterAbstract
import tigase.xmpp.impl.roster.RosterElement
import tigase.xmpp.impl.roster.RosterFactory
import tigase.xmpp.jid.BareJID
import tigase.xmpp.jid.JID
import java.util.function.Function
class Field {
String name;
String label;
String type;
String defVal = ""
}
class RosterChangesControler {
UserRepository repository
VHostManagerIfc vhost_man
Set admins
Map sessions
Function isAllowedForDomain
Field addOperation = new Field(name: "addJid", label: "Add")
Field removeOperation = new Field(name: "removeJid", label: "Remove")
List operationTypes = [ addOperation, removeOperation ]
Field subscriptionNone = new Field(name: "none", label: "None")
Field subscriptionFrom = new Field(name: "from", label: "From")
Field subscriptionTo = new Field(name: "to", label: "To")
Field subscriptionBoth = new Field(name: "both", label: "Both")
List subscriptionTypes = [ subscriptionNone, subscriptionFrom, subscriptionTo, subscriptionBoth ]
Field ownerJid = new Field(name: "rosterOwnerJID", label: "Roster owner JID", type: "jid-single")
Field jidToChange = new Field(name: "jidToManipulate", label: "JID to manipulate", type: "jid-single")
Field groups = new Field(name: "groups", label: "Comma separated groups", type: "text-single")
Field operationType = new Field(name: "operationType", label: "Operation type",
defVal: addOperation.name)
Field subscriptionType = new Field(name: "subscriptionType",
label: "Subscription type", defVal: subscriptionBoth.name)
List formFields = [ ownerJid, jidToChange, groups, operationType, subscriptionType ]
def addField(Packet form, Field field, List listFields = [ ]) {
if (listFields != null && listFields.size() == 0) {
Command.addFieldValue(form, field.name, field.defVal,
field.type, field.label)
} else {
def listValues = (listFields.collect { it.name }).toArray(new String[0])
def listLabels = (listFields.collect { it.label }).toArray(new String[0])
Command.addFieldValue(form, field.name, field.defVal, field.label, listLabels, listValues)
}
}
def getFieldValue(Packet form, Field field) {
return Command.getFieldValue(form, field.name)
}
def processPacket(Packet p) {
if ((formFields.find { it.name != groups.name && Command.getFieldValue(p, it.name) == null }) == null) {
String ownerJidStr = getFieldValue(p, ownerJid)
String jidToManipulate = getFieldValue(p, jidToChange)
String[] groups = (getFieldValue(p, groups) ?: "").split(",")
String operationTypeStr = getFieldValue(p, operationType)
String subscriptionTypeStr = getFieldValue(p, subscriptionType)
Packet result = p.commandResult(Command.DataType.result)
BareJID stanzaFromBare = p.getStanzaFrom().getBareJID();
JID jidRosterOwnerJid = JID.jidInstanceNS(ownerJidStr);
JID jidRosterItemJid = JID.jidInstanceNS(jidToManipulate);
if (!isAllowedForDomain.apply(jidRosterOwnerJid.getDomain())) {
//if ( !(isServiceAdmin || (vhost != null && (vhost.isOwner(stanzaFromBare.toString()) || vhost.isAdmin(stanzaFromBare.toString())))) ) {
Command.addTextField(result, "Error",
"You do not have enough permissions to modify roster of " + ownerJidStr);
return result;
}
if (!isAllowedForDomain.apply(jidRosterItemJid.getDomain())) {
//if ( !(isServiceAdmin || (vhost != null && (vhost.isOwner(stanzaFromBare.toString()) || vhost.isAdmin(stanzaFromBare.toString())))) ) {
Command.addTextField(result, "Error",
"You do not have enough permissions to modify roster of " + jidToManipulate);
return result;
}
Queue results;
if (operationTypeStr == addOperation.name) {
RosterElement item = new RosterElement(jidRosterItemJid, jidRosterItemJid.toString(), groups);
item.setSubscription(subscription(subscriptionTypeStr));
results = RosterFactory.getRosterImplementation(true).addJidToRoster(repository, sessions.get(jidRosterOwnerJid.getBareJID()), jidRosterOwnerJid.getBareJID(), item);
} else {
results = RosterFactory.getRosterImplementation(true).removeJidFromRoster(repository, sessions.get(jidRosterOwnerJid.getBareJID()), jidRosterOwnerJid.getBareJID(), jidRosterItemJid);
}
Command.addTextField(result, "Note", "Operation successful");
results.add(result)
return results
} else {
Packet result = p.commandResult(Command.DataType.form)
addField(result, ownerJid)
addField(result, jidToChange)
addField(result, groups)
addField(result, operationType, operationTypes)
addField(result, subscriptionType, subscriptionTypes)
return result
}
}
def subscription(String str) {
return RosterAbstract.SubscriptionType.valueOf(str)
}
}
def changesControler = new RosterChangesControler(repository: userRepository,
admins: adminsSet,
vhost_man: vhostMan,
sessions: userSessions,
isAllowedForDomain: (Function) isAllowedForDomain)
changesControler.processPacket((Packet) packet)
================================================
FILE: src/main/groovy/tigase/admin/UserRosterManagementExt.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Update user roster entry, extended version.
If both given JIDs are local, rosters for both users are updated accordingly.
AS:Description: Update user roster entry, extended version.
AS:CommandId: user-roster-management-ext
AS:Component: sess-man
*/
package tigase.admin
import tigase.cluster.strategy.ClusteringStrategyIfc
import tigase.db.UserRepository
import tigase.server.Command
import tigase.server.Packet
import tigase.server.Permissions
import tigase.vhosts.VHostManagerIfc
import tigase.xml.Element
import tigase.xmpp.XMPPSession
import tigase.xmpp.impl.roster.RosterAbstract
import tigase.xmpp.impl.roster.RosterElement
import tigase.xmpp.impl.roster.RosterFactory
import tigase.xmpp.impl.roster.RosterFlat
import tigase.xmpp.jid.BareJID
import tigase.xmpp.jid.JID
try {
def ROSTER_OWNER_JID = "roster-owner-jid"
def ROSTER_OWNER_PRESENCE = "roster-owner-presence"
def ROSTER_OWNER_NAME = "roster-owner-name"
def ROSTER_OWNER_GROUPS = "roster-owner-groups"
def ROSTER_ITEM_JID = "roster-item-jid"
def ROSTER_ITEM_NAME = "roster-item-name"
def ROSTER_ITEM_GROUPS = "roster-item-groups"
def ROSTER_ITEM_SUBSCR = "roster-item-subscr"
def ROSTER_ACTION = "roster-action"
def NOTIFY_CLUSTER = "notify-cluster"
def UPDATE = "update"
def REMOVE = "remove"
def UPDATE_EXT = "update-ext"
def REMOVE_EXT = "remove-ext"
def subscriptions = [ "both", "from", "to", "none" ]
def actions = [ UPDATE, REMOVE, UPDATE_EXT, REMOVE_EXT ]
def actions_descr = [ "Add/Update item", "Remove item", "Add/Update both rosters", "Remove from both rosters" ]
Queue results = new LinkedList()
def p = (Packet) packet
def repository = (UserRepository) userRepository
def sessions = (Map) userSessions
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID();
def isServiceAdmin = admins.contains(stanzaFromBare);
def rosterOwnerJid = Command.getFieldValue(packet, ROSTER_OWNER_JID)
def rosterOwnerName = Command.getFieldValue(packet, ROSTER_OWNER_NAME)
def rosterOwnerGroups = Command.getFieldValue(packet, ROSTER_OWNER_GROUPS)
def rosterItemJid = Command.getFieldValue(packet, ROSTER_ITEM_JID)
def rosterItemName = Command.getFieldValue(packet, ROSTER_ITEM_NAME)
def rosterItemGroups = Command.getFieldValue(packet, ROSTER_ITEM_GROUPS)
def rosterItemSubscr = Command.getFieldValue(packet, ROSTER_ITEM_SUBSCR)
def rosterAction = Command.getFieldValue(packet, ROSTER_ACTION)
boolean clusterMode = Boolean.valueOf(System.getProperty("cluster-mode", false.toString()));
boolean notifyCluster = Boolean.valueOf(Command.getFieldValue(packet, NOTIFY_CLUSTER))
if (rosterOwnerJid == null || rosterItemJid == null || rosterItemSubscr == null || rosterAction == null) {
def res = p.commandResult(Command.DataType.form);
Command.addFieldValue(res, ROSTER_OWNER_JID, rosterOwnerJid ?: "", "jid-single", "Roster owner JID")
Command.addFieldValue(res, ROSTER_OWNER_NAME, rosterOwnerName ?: "", "text-single", "Roster owner name")
Command.addFieldValue(res, ROSTER_OWNER_GROUPS, rosterOwnerGroups ?: "", "text-single",
"Comma separated list of owner groups")
Command.addFieldValue(res, ROSTER_ITEM_JID, rosterItemJid ?: "", "jid-single", "Roster item JID")
Command.addFieldValue(res, ROSTER_ITEM_NAME, rosterItemName ?: "", "text-single", "Roster item name")
Command.addFieldValue(res, ROSTER_ITEM_GROUPS, rosterItemGroups ?: "", "text-single",
"Comma separated list of item groups")
Command.addFieldValue(res, ROSTER_ITEM_SUBSCR, subscriptions[0], "Roster item Subscription",
(String[]) subscriptions, (String[]) subscriptions)
Command.addFieldValue(res, ROSTER_ACTION, actions[0], "Action", (String[]) actions_descr, (String[]) actions)
if (clusterMode) {
Command.addHiddenField(res, NOTIFY_CLUSTER, true.toString())
}
return res
}
if (clusterMode && notifyCluster) {
if (null != clusterStrategy) {
def cluster = (ClusteringStrategyIfc) clusterStrategy
List cl_conns = cluster.getNodesConnected()
if (cl_conns && cl_conns.size() > 0) {
cl_conns.each { node ->
def forward = p.copyElementOnly();
Command.removeFieldValue(forward, NOTIFY_CLUSTER)
Command.addHiddenField(forward, NOTIFY_CLUSTER, false.toString())
forward.setPacketTo(node);
forward.setPermissions(Permissions.ADMIN);
results.offer(forward)
}
}
}
}
def remove_item = rosterAction == REMOVE || rosterAction == REMOVE_EXT
def updateRoster = { jid, i_jid, i_name, i_groups, i_subscr, i_original_node ->
def sess = sessions == null ? null : sessions.get(jid.getBareJID());
def conn = (sess != null && sess.getActiveResourcesSize() > 0) ? sess.getActiveResources().get(0) : null;
if (conn) {
// Update online
RosterAbstract rosterUtil = RosterFactory.getRosterImplementation(true)
Element item = new Element("item",
(String[]) [ "jid", "subscription" ], (String[]) [ i_jid, "remove" ])
if (remove_item) {
rosterUtil.removeBuddy(conn, i_jid)
} else {
rosterUtil.addBuddy(conn, i_jid, i_name ?: i_jid.getLocalpart(), i_groups ? i_groups.split(",") : null, RosterAbstract.SubscriptionType.valueOf(i_subscr), null)
item = rosterUtil.getBuddyItem(conn, i_jid)
}
rosterUtil.updateBuddyChange(conn, results, item)
} else if (i_original_node) {
// We need to synchronize on some object (ie. on UserRepository instance) to fix issue with
// race condition when we modify roster of user which is offline
// Is there a better object to use for synchronization?
synchronized (repository) {
// Update offline and only on original node
String rosterStr = repository.getData(jid.getBareJID(), null, RosterAbstract.ROSTER, null) ?: ""
Map roster = new LinkedHashMap()
RosterFlat.parseRosterUtil(rosterStr, roster, null)
if (remove_item) {
roster.remove(i_jid.getBareJID())
} else {
RosterElement rel = new RosterElement(i_jid, i_name, i_groups ? i_groups.split(",") : null)
rel.setSubscription(RosterAbstract.SubscriptionType.valueOf(i_subscr))
rel.setPersistent(true);
roster.put(i_jid, rel)
}
StringBuilder sb = new StringBuilder(200)
for (RosterElement relem : roster.values()) {
sb.append(relem.getRosterElement().toString())
}
repository.setData(jid.getBareJID(), null, RosterAbstract.ROSTER, sb.toString());
}
}
}
def jidRosterOwnerJid = JID.jidInstanceNS(rosterOwnerJid);
def jidRosterItemJid = JID.jidInstanceNS(rosterItemJid);
Packet result = p.commandResult(Command.DataType.result)
def vhost = vhost_man.getVHostItem(jidRosterOwnerJid.getDomain());
if (vhost == null || (!isAllowedForDomain.apply(jidRosterOwnerJid.getDomain()))) {
Command.addTextField(result, "Error",
"You do not have enough permissions to modify roster of " + rosterOwnerJid);
results.add(result);
return results;
}
updateRoster(jidRosterOwnerJid, jidRosterItemJid, rosterItemName, rosterItemGroups, rosterItemSubscr, notifyCluster)
Element pres;
if (rosterAction == UPDATE_EXT || rosterAction == REMOVE_EXT) {
def subscr = rosterItemSubscr;
switch (rosterItemSubscr) {
case "to": subscr = "from"; break;
case "from": subscr = "to"; break;
}
vhost = vhost_man.getVHostItem(jidRosterItemJid.getDomain());
if (vhost == null || (!isAllowedForDomain.apply(jidRosterItemJid.getDomain()))) {
Command.addTextField(result, "Error",
"You do not have enough permissions to modify roster of " + rosterItemJid);
results.add(result);
return results;
}
updateRoster(jidRosterItemJid, jidRosterOwnerJid, rosterOwnerName, rosterOwnerGroups, subscr, notifyCluster)
if (!remove_item) {
pres = new Element("presence", (String[]) [ "from", "to", "type" ],
(String[]) [ rosterOwnerJid, rosterItemJid, "probe" ])
results.offer(Packet.packetInstance(pres))
}
}
if (!remove_item) {
pres = new Element("presence", (String[]) [ "from", "to", "type" ],
(String[]) [ rosterItemJid, rosterOwnerJid, "probe" ])
results.offer(Packet.packetInstance(pres))
}
Command.addTextField(result, "Note", "Operation successful");
results.add(result)
//return results
return (Queue) results
} catch (Exception ex) {
ex.printStackTrace();
}
================================================
FILE: src/main/groovy/tigase/admin/UserStatistics.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Obtaining User Statistics as described in in XEP-0133:
http://xmpp.org/extensions/xep-0133.html#get-user-stats
AS:Description: Get User Statistics
AS:CommandId: http://jabber.org/protocol/admin#user-stats
AS:Component: sess-man
AS:Group: Statistics
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
import tigase.vhosts.VHostItem
import tigase.vhosts.VHostManagerIfc
import tigase.xmpp.XMPPResourceConnection
import tigase.xmpp.XMPPSession
import tigase.xmpp.jid.BareJID
def JID = "accountjid"
def p = (Packet) packet
def sessions = (Map) userSessions
def vhost_man = (VHostManagerIfc) vhostMan
def admins = (Set) adminsSet
def stanzaFromBare = p.getStanzaFrom().getBareJID()
def isServiceAdmin = admins.contains(stanzaFromBare)
def userJid = Command.getFieldValue(packet, JID)
if (userJid == null) {
def result = p.commandResult(Command.DataType.form);
Command.addTitle(result, "Get User Statistics")
Command.addInstructions(result, "Fill out this form to gather user statistics.")
Command.addFieldValue(result, "FORM_TYPE", "http://jabber.org/protocol/admin", "hidden")
Command.addFieldValue(result, JID, userJid ?: "", "jid-single", "The Jabber ID for statistics")
return result
}
def bareJID = BareJID.bareJIDInstance(userJid)
VHostItem vhost = vhost_man.getVHostItem(bareJID.getDomain())
def result = p.commandResult(Command.DataType.result)
if (vhost != null && isAllowedForDomain.apply(bareJID.getDomain())) {
XMPPSession session = sessions.get(BareJID.bareJIDInstanceNS(userJid))
if (session == null) {
return "There is no user's ${userJid} active session on the server"
} else {
List conns = session.getActiveResources()
String conns_str = "Connections: "
for (XMPPResourceConnection con : conns) {
conns_str += con.toString() + "###\n"
}
return "There is ${conns?.size()} active user's ${userJid} sessions, packets: ${session.getPacketsCounter()}\n" +
"user connections:\n" + conns_str
}
} else {
Command.addTextField(result, "Error",
"You do not have enough permissions to obtain statistics for user in this domain.");
}
return result
================================================
FILE: src/main/groovy/tigase/admin/example_HelloWorld.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
Example Hello World admin script for the script development guide.
AS:Description: [example] Hello World Script.
AS:CommandId: hello
AS:Component: sess-man
AS:Group: Example scripts
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
def p = (Packet) packet
def name = Command.getFieldValue(packet, "name")
if (name == null) {
def res = p.commandResult(Command.DataType.form)
Command.addTitle(res, "Hello World Script")
Command.addInstructions(res, "Please provide some details")
Command.addFieldValue(res, "name", name ?: "", "text-single",
"Your name")
return res
}
def res = p.commandResult(Command.DataType.result)
Command.addTitle(res, "Hello World Script")
Command.addInstructions(res, "Hello ${name}, how are you?")
return res
================================================
FILE: src/main/groovy/tigase/admin/example_TigaseScriptingGuide.groovy
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
/*
This is an example script for Tigase scripting support.
AS:Description: [example] Tigase scripting guide
AS:CommandId: groovy-example
AS:Component: sess-man
AS:Group: Example scripts
*/
package tigase.admin
import tigase.server.Command
import tigase.server.Packet
Packet p = (Packet) packet
num1 = Command.getFieldValue(p, "num1")
num2 = Command.getFieldValue(p, "num2")
if (num1 == null || num2 == null) {
Packet res = p.commandResult(Command.DataType.form)
Command.addTextField(res, "Note", "This is Groovy script!")
Command.addFieldValue(res, "num1", "", "text-single")
Command.addFieldValue(res, "num2", "", "text-single")
return res
}
return num1 + num2
================================================
FILE: src/main/groovy/tigase/admin/template.html
================================================
Tigase XMPP Server - Admin console
<% imports.each {
if (it.type == 'css' && it.src) { %>
<% } else if (it.type == 'css' && it.content) { %>
<% } else if (it.type == 'script') { %>
<% } %>
<% } %>
================================================
FILE: src/main/java/tigase/auth/AuthRepositoryAware.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import tigase.db.AuthRepository;
import javax.security.auth.callback.CallbackHandler;
/**
* Interface should be implemented by {@linkplain CallbackHandler} instance if {@linkplain AuthRepository} from session
* should be injected.
*/
public interface AuthRepositoryAware
extends Aware {
/**
* Sets {@linkplain AuthRepository}.
*
* @param repo {@linkplain AuthRepository}.
*/
void setAuthRepository(AuthRepository repo);
}
================================================
FILE: src/main/java/tigase/auth/Aware.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
public interface Aware {
}
================================================
FILE: src/main/java/tigase/auth/BruteForceLockerBean.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import tigase.eventbus.EventBus;
import tigase.eventbus.EventBusEvent;
import tigase.eventbus.HandleEvent;
import tigase.kernel.DefaultTypesConverter;
import tigase.kernel.TypesConverter;
import tigase.kernel.beans.Bean;
import tigase.kernel.beans.Initializable;
import tigase.kernel.beans.Inject;
import tigase.kernel.beans.UnregisterAware;
import tigase.kernel.beans.config.ConfigField;
import tigase.map.ClusterMapFactory;
import tigase.server.Command;
import tigase.server.DataForm;
import tigase.server.Packet;
import tigase.server.xmppsession.SessionManager;
import tigase.stats.ComponentStatisticsProvider;
import tigase.stats.StatisticsList;
import tigase.vhosts.AbstractVHostItemExtension;
import tigase.vhosts.VHostItemExtensionBackwardCompatible;
import tigase.vhosts.VHostItemExtensionManager;
import tigase.vhosts.VHostItemExtensionProvider;
import tigase.xml.Element;
import tigase.xmpp.XMPPResourceConnection;
import tigase.xmpp.jid.BareJID;
import tigase.xmpp.jid.JID;
import java.io.Serializable;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.logging.Level;
import java.util.logging.Logger;
import static tigase.auth.BruteForceLockerBean.Mode.IpJid;
@Bean(name = "brute-force-locker", parent = SessionManager.class, active = true)
public class BruteForceLockerBean
implements Initializable, UnregisterAware, ComponentStatisticsProvider {
private final static String ANY = "*";
private static final String LOCK_ENABLED_KEY = "brute-force-lock-enabled";
private static final String LOCK_AFTER_FAILS_KEY = "brute-force-lock-after-fails";
private static final String LOCK_DISABLE_ACCOUNT_FAILS_KEY = "brute-force-disable-after-fails";
private static final String LOCK_TIME_KEY = "brute-force-lock-time";
private static final String LOCK_PERIOD_TIME_KEY = "brute-force-period-time";
private static final String LOCK_MODE_KEY = "brute-force-mode";
private static final String MAP_TYPE = "brute-force-invalid-logins";
public enum Mode {
Ip,
IpJid,
Jid;
public Mode merge(Mode mode) {
switch (this) {
case Ip:
if (mode == Ip) {
return Ip;
}
return IpJid;
case Jid:
if (mode == Jid) {
return Jid;
}
return IpJid;
case IpJid:
return IpJid;
}
return this;
}
}
private final Logger log = Logger.getLogger(this.getClass().getName());
private final Map otherStatHolders = new ConcurrentHashMap<>();
private final StatHolder statHolder = new StatHolder();
@ConfigField(desc = "Allows storing detailed, per IP/JID statistics of blocked attempts")
private boolean detailedStatistics = false;
@Inject
private EventBus eventBus;
private Map map;
@Inject
private SessionManager sessionManager;
public static String getClientIp(XMPPResourceConnection session) {
try {
return Optional.ofNullable(session.getConnectionId())
.map(JID::getResource)
.map(res -> res.split("_")[2])
.filter(ip -> !"null".equals(ip))
.orElse(null);
} catch (Exception e) {
return null;
}
}
public void addInvalidLogin(XMPPResourceConnection session, String ip, BareJID jid) {
addInvalidLogin(session, ip, jid, System.currentTimeMillis());
}
public void addInvalidLogin(XMPPResourceConnection session, String ip, BareJID jid, final long currentTime) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Adding new entry, JID: {0}, ip: {1}, time: {2}", new Object[]{jid, ip, currentTime});
}
if (ip == null || "null".equals(ip)) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER, "IP is null. Skip adding entry.");
}
return;
}
if (map == null) {
log.warning("Brute Force Locker is no initialized yet!");
return;
}
final Key key = createKey(session, ip, jid);
Value value = map.get(key);
if (value == null) {
value = new Value(session != null ? session.getDomain().getVhost().toString() : null, ip, jid);
value.setBadLoginCounter(0);
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER,"Entry didn't exists. Create new one.");
}
}
if (value.getInvalidateAtTime() < currentTime) {
if (log.isLoggable(Level.FINER)) {
log.log(Level.FINER,"Entry exists and is old, reset counter.");
}
value.setBadLoginCounter(0);
}
value.setBadLoginCounter(value.getBadLoginCounter() + 1);
BruteForceLockerVHostExtension extension = session != null ? session.getDomain().getExtension(BruteForceLockerVHostExtension.class) : null;
final long lockAfterFails = extension == null ? 3 : extension.getLockAccountAfterFailedAttempt();
if (value.getBadLoginCounter() <= lockAfterFails) {
final long periodTime =
(extension == null ? 10 : extension.getPeriodTime()) * 1000;
value.setInvalidateAtTime(currentTime + periodTime);
} else {
final long lockTime = (extension == null ? 10 : extension.getLockTime()) * 1000;
value.setInvalidateAtTime(currentTime + lockTime);
}
if (log.isLoggable(Level.FINEST)) {
log.finest(
"New invalidate time for " + key + " == " + value.getInvalidateAtTime() + "; getBadLoginCounter " +
"== " + value.getBadLoginCounter());
}
map.put(key, value);
addToStatistic(value);
}
public boolean canUserBeDisabled(XMPPResourceConnection session, String ip, BareJID jid) {
final Key key = createKey(session, ip, jid);
if (!key.isJIDPresent()) {
return false;
}
Value value = map.get(key);
if (value == null) {
return false;
}
BruteForceLockerVHostExtension extension = session != null ? session.getDomain().getExtension(BruteForceLockerVHostExtension.class) : null;
final long disableAfterFails =
extension == null ? 20 : extension.getDisableAccountAfterFailedAttempts();
if (disableAfterFails == 0) {
return false;
} else {
return value.getBadLoginCounter() > disableAfterFails;
}
}
public void clearAll() {
if (map == null) {
log.warning("Brute Force Locker is no initialized yet!");
return;
}
map.clear();
}
public void clearOutdated() {
clearOutdated(System.currentTimeMillis());
}
public void clearOutdated(final long currentTime) {
if (map == null) {
log.warning("Brute Force Locker is no initialized yet!");
return;
}
final HashSet toRemove = new HashSet<>();
map.forEach((key, value) -> {
if (value.getInvalidateAtTime() < currentTime) {
toRemove.add(key);
}
});
toRemove.forEach(key -> map.remove(key));
}
@Override
public void getStatistics(String compName, StatisticsList list) {
clearOutdated();
final String keyName = compName + "/BruteForceLocker";
ArrayList l = new ArrayList<>(this.map.values());
for (Value value : l) {
list.add(keyName, "Present locks: " + value.jid + " from " + value.ip, value.badLoginCounter, Level.FINER);
}
final StatHolder tmp = new StatHolder();
this.statHolder.ips.forEach((ip, count) -> tmp.addIP(ip, count));
this.statHolder.jids.forEach((jid, count) -> tmp.addJID(jid, count));
this.otherStatHolders.values().forEach(otherSH -> {
otherSH.ips.forEach((ip, count) -> tmp.addIP(ip, count));
otherSH.jids.forEach((jid, count) -> tmp.addJID(jid, count));
});
list.add(keyName, "Blocked IPs", tmp.ips.size(), Level.INFO);
list.add(keyName, "Blocked JIDs", tmp.jids.size(), Level.INFO);
list.add(keyName, "Total blocked IP attempts", tmp.ips.values().stream().mapToInt(Integer::intValue).sum(),
Level.FINE);
list.add(keyName, "Total blocked JID attempts", tmp.jids.values().stream().mapToInt(Integer::intValue).sum(),
Level.FINE);
}
@Override
public void initialize() {
this.map = ClusterMapFactory.get().createMap(MAP_TYPE, Key.class, Value.class);
assert this.map != null : "Distributed Map is NULL!";
assert this.sessionManager != null : "SessionManager is NULL!";
if (eventBus != null) {
eventBus.registerAll(this);
}
}
public boolean isEnabled(XMPPResourceConnection session) {
BruteForceLockerVHostExtension extension = session != null ? session.getDomain().getExtension(BruteForceLockerVHostExtension.class) : null;
return extension != null && extension.isEnabled();
}
@HandleEvent(filter = HandleEvent.Type.remote)
public void handleStatisticsEmitEvent(StatisticsEmitEvent event) {
if (event.getNodeName() == null) {
return;
}
this.otherStatHolders.put(event.getNodeName(), event.getStatHolder());
}
public boolean isLoginAllowed(XMPPResourceConnection session, final String ip, final BareJID jid) {
return isLoginAllowed(session, ip, jid, System.currentTimeMillis());
}
public boolean isLoginAllowed(XMPPResourceConnection session, final String ip, final BareJID jid,
final long currentTime) {
if (ip == null) {
if (log.isLoggable(Level.FINEST)) {
log.finest("IP is null. Return true.");
}
return true;
}
if (map == null) {
log.warning("Brute Force Locker is no initialized yet!");
return false;
}
final Key key = createKey(session, ip, jid);
Value value = map.get(key);
if (value == null) {
if (log.isLoggable(Level.FINEST)) {
log.finest("No entry for " + key + ". Return true.");
}
return true;
}
return isLoginAllowed(session, key, value, currentTime);
}
@Override
public void beforeUnregister() {
eventBus.unregisterAll(this);
}
@Override
public void everyHour() {
}
@Override
public void everyMinute() {
String clusterNode = sessionManager.getComponentId().getDomain();
eventBus.fire(new StatisticsEmitEvent(clusterNode, this.statHolder));
}
@Override
public void everySecond() {
}
void setMap(HashMap map) {
this.map = map;
}
final Key createKey(XMPPResourceConnection session, String ip, BareJID jid) {
BruteForceLockerVHostExtension extension = session != null ? session.getDomain().getExtension(BruteForceLockerVHostExtension.class) : null;
final Mode mode = extension == null ? Mode.IpJid : extension.getMode();
return createKey(mode, session, ip, jid);
}
final Key createKey(final Mode mode, XMPPResourceConnection session, String ip, BareJID jid) {
final String domain = session == null ? ANY : session.getDomain().getVhost().toString();
switch (mode) {
case Jid:
return new Key(ANY, jid == null ? ANY : jid.toString(), domain);
case Ip:
return new Key(ip == null ? ANY : ip, ANY, domain);
case IpJid:
return new Key(ip == null ? ANY : ip, jid == null ? ANY : jid.toString(), domain);
default:
throw new RuntimeException("Unknown mode " + mode);
}
}
private void addToStatistic(Value v) {
if (v.ip != null) {
this.statHolder.addIP(v.ip);
}
if (v.jid != null) {
this.statHolder.addJID(v.jid);
}
}
private boolean isLoginAllowed(final XMPPResourceConnection session, final Key key, final Value value,
final long currentTime) {
if (value.getInvalidateAtTime() < currentTime) {
map.remove(key);
if (log.isLoggable(Level.FINEST)) {
log.finest("Entry existed, but was too old. Entry removed. Return true.");
}
return true;
} else {
BruteForceLockerVHostExtension extension = session != null ? session.getDomain().getExtension(BruteForceLockerVHostExtension.class) : null;
long lockAfterFails = extension == null ? 3 : extension.getLockAccountAfterFailedAttempt();
boolean r = value.badLoginCounter <= lockAfterFails;
if (log.isLoggable(Level.FINEST)) {
log.finest("Entry exist. lockAfterFails=" + lockAfterFails + ", value" + ".badLoginCounter=" +
value.badLoginCounter + ", result=" + r);
}
return r;
}
}
public static class Key
implements TypesConverter.Parcelable {
private String domain;
private String ip;
private String jid;
public Key() {
}
public Key(String ip, String jid, String domain) {
this.ip = ip;
this.jid = jid;
this.domain = domain;
}
@Override
public String[] encodeToStrings() {
return new String[]{jid, ip, domain};
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Key key = (Key) o;
if (!domain.equals(key.domain)) {
return false;
}
if (!ip.equals(key.ip)) {
return false;
}
return jid.equals(key.jid);
}
@Override
public void fillFromString(String[] encoded) {
this.jid = encoded[0];
this.ip = encoded[1];
this.domain = encoded[2];
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getJid() {
return jid;
}
public void setJid(String jid) {
this.jid = jid;
}
@Override
public int hashCode() {
int result = domain.hashCode();
result = 31 * result + ip.hashCode();
result = 31 * result + jid.hashCode();
return result;
}
public boolean isJIDPresent() {
return jid != null && !jid.equals(ANY);
}
@Override
public String toString() {
return "Key[ip=" + ip + ", jid=" + jid + ", domain=" + domain + "]";
}
}
public static class LoginLockedException
extends Exception {
}
public static class StatHolder
implements TypesConverter.Parcelable {
private final Map ips = new ConcurrentHashMap<>();
private final Map jids = new ConcurrentHashMap<>();
private final DefaultTypesConverter typesConverter = new DefaultTypesConverter();
public Map getIps() {
return ips;
}
public Map getJids() {
return jids;
}
public void clear() {
ips.clear();
jids.clear();
}
public int addIP(String ip) {
return add(ips, ip, 1);
}
public int addJID(BareJID jid) {
return add(jids, jid, 1);
}
public int addIP(String ip, int value) {
return add(ips, ip, value);
}
public int addJID(BareJID jid, int value) {
return add(jids, jid, value);
}
@Override
public String[] encodeToStrings() {
String[] r = new String[2 + ips.size() * 2 + jids.size() * 2];
r[0] = String.valueOf(ips.size());
r[1] = String.valueOf(jids.size());
fillTab(ips, r, 2);
fillTab(jids, r, 2 + ips.size() * 2);
return r;
}
@Override
public void fillFromString(String[] encoded) {
try {
final int lenIps = Integer.parseInt(encoded[0]);
final int lenJids = Integer.parseInt(encoded[1]);
ips.clear();
ips.putAll(read(encoded, 2, lenIps, key -> key));
jids.clear();
jids.putAll(read(encoded, 2 + lenIps * 2, lenJids, BareJID::bareJIDInstanceNS));
} catch (Exception e) {
throw new RuntimeException("Cannot decode parcel: " + Arrays.toString(encoded), e);
}
}
private HashMap read(final String[] src, final int offset, final int len,
Function keyCnv) {
HashMap r = new HashMap<>();
for (int i = 0; i < len; i++) {
r.put(keyCnv.apply(src[offset + 2 * i]), Integer.parseInt(src[offset + 2 * i + 1]));
}
return r;
}
private void fillTab(Map src, String[] dst, final int offset) {
int idx = offset;
for (Map.Entry x : src.entrySet()) {
String key = x.getKey().toString();
Integer value = x.getValue();
dst[idx] = key;
dst[idx + 1] = String.valueOf(value);
idx = idx + 2;
}
}
private int add(Map map, T key, int value) {
synchronized (map) {
Integer v = map.get(key);
v = (v == null ? 0 : v) + value;
map.put(key, v);
return v;
}
}
}
public static class StatisticsEmitEvent
implements Serializable, EventBusEvent {
private String nodeName;
private StatHolder statHolder;
public StatisticsEmitEvent() {
}
public StatisticsEmitEvent(String nodeName, StatHolder statHolder) {
this.nodeName = nodeName;
this.statHolder = statHolder;
}
public String getNodeName() {
return nodeName;
}
public void setNodeName(String nodeName) {
this.nodeName = nodeName;
}
public StatHolder getStatHolder() {
return statHolder;
}
public void setStatHolder(StatHolder statHolder) {
this.statHolder = statHolder;
}
}
public static class Value
implements TypesConverter.Parcelable {
private int badLoginCounter;
private String domain;
/** Invalidate this value at specific time */
private long invalidateAtTime;
private String ip;
private BareJID jid;
public Value() {
}
public Value(String domain, String ip, BareJID jid) {
this.domain = domain;
this.ip = ip;
this.jid = jid;
}
@Override
public String[] encodeToStrings() {
return new String[]{Integer.toString(badLoginCounter), Long.toString(invalidateAtTime)};
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Value value = (Value) o;
if (badLoginCounter != value.badLoginCounter) {
return false;
}
return invalidateAtTime == value.invalidateAtTime;
}
@Override
public void fillFromString(String[] encoded) {
this.badLoginCounter = Integer.valueOf(encoded[0]);
this.invalidateAtTime = Long.valueOf(encoded[1]);
}
public int getBadLoginCounter() {
return badLoginCounter;
}
public void setBadLoginCounter(int badLoginCounter) {
this.badLoginCounter = badLoginCounter;
}
public long getInvalidateAtTime() {
return invalidateAtTime;
}
public void setInvalidateAtTime(long invalidateAtTime) {
this.invalidateAtTime = invalidateAtTime;
}
@Override
public int hashCode() {
int result = badLoginCounter;
result = 31 * result + (int) (invalidateAtTime ^ (invalidateAtTime >>> 32));
return result;
}
}
@Bean(name = BruteForceLockerVHostExtension.ID, parent = VHostItemExtensionManager.class, active = true)
public static class BruteForceLockerVHostExtensionProvider
implements VHostItemExtensionProvider {
@Override
public String getId() {
return BruteForceLockerVHostExtension.ID;
}
@Override
public Class getExtensionClazz() {
return BruteForceLockerVHostExtension.class;
}
}
public static class BruteForceLockerVHostExtension
extends AbstractVHostItemExtension
implements VHostItemExtensionBackwardCompatible {
public static final String ID = "brute-force-locker";
private static final long DEF_lockAccountAfterFailedAttempt = 3l;
private static final long DEF_disableAccountAfterFailedAttempts = 20l;
private static final long DEF_periodTime = 60l;
private static final long DEF_lockTime = 60l;
private static final Mode DEF_mode = IpJid;
private boolean enabled = true;
private long lockAccountAfterFailedAttempt = DEF_lockAccountAfterFailedAttempt;
private long disableAccountAfterFailedAttempts = DEF_disableAccountAfterFailedAttempts;
private long periodTime = DEF_periodTime;
private long lockTime = DEF_lockTime;
private Mode mode = DEF_mode;
public boolean isEnabled() {
return enabled;
}
public long getLockAccountAfterFailedAttempt() {
return lockAccountAfterFailedAttempt;
}
public long getDisableAccountAfterFailedAttempts() {
return disableAccountAfterFailedAttempts;
}
public long getPeriodTime() {
return periodTime;
}
public long getLockTime() {
return lockTime;
}
public Mode getMode() {
return mode;
}
@Override
public String getId() {
return ID;
}
@Override
public void initFromElement(Element item) {
enabled = !"false".equals(item.getAttributeStaticStr("enabled"));
String tmp = item.getAttributeStaticStr("lock-after-fails");
if (tmp != null) {
lockAccountAfterFailedAttempt = Long.parseLong(tmp);
}
tmp = item.getAttributeStaticStr("disable-after-fails");
if (tmp != null) {
disableAccountAfterFailedAttempts = Long.parseLong(tmp);
}
tmp = item.getAttributeStaticStr("period-time");
if (tmp != null) {
periodTime = Long.parseLong(tmp);
}
tmp = item.getAttributeStaticStr("lock-time");
if (tmp != null) {
lockTime = Long.parseLong(tmp);
}
tmp = item.getAttributeStaticStr("mode");
if (tmp != null) {
mode = Mode.valueOf(tmp);
}
}
@Override
public void initFromCommand(String prefix, Packet packet) throws IllegalArgumentException {
Optional.ofNullable(Command.getFieldValue(packet, prefix + "-enabled"))
.ifPresent(s -> enabled = Boolean.parseBoolean(s));
String value = Command.getFieldValue(packet, prefix + "-lock-after-fails");
if (value != null) {
lockAccountAfterFailedAttempt = Long.parseLong(value);
}
value = Command.getFieldValue(packet, prefix + "-disable-after-fails");
if (value != null) {
disableAccountAfterFailedAttempts = Long.parseLong(value);
}
value = Command.getFieldValue(packet, prefix + "-period-time");
if (value != null) {
periodTime = Long.parseLong(value);
}
value = Command.getFieldValue(packet, prefix + "-lock-time");
if (value != null) {
lockTime = Long.parseLong(value);
}
value = Command.getFieldValue(packet, prefix + "-mode");
if (value != null) {
mode = Mode.valueOf(value);
}
}
@Override
public String toDebugString() {
return "enabled: " + enabled + ",mode: " + mode + ", lockAfter: " + lockAccountAfterFailedAttempt +
", disableAfter: " + disableAccountAfterFailedAttempts + ", period: " + periodTime +
", lockTime: " + lockTime;
}
@Override
public Element toElement() {
if (enabled && lockAccountAfterFailedAttempt == DEF_lockAccountAfterFailedAttempt &&
disableAccountAfterFailedAttempts == DEF_disableAccountAfterFailedAttempts &&
periodTime == DEF_periodTime && lockTime == DEF_lockTime && mode == DEF_mode) {
return null;
}
Element el = new Element(ID);
if (!enabled) {
el.setAttribute("enabled", String.valueOf(enabled));
}
if (lockAccountAfterFailedAttempt != DEF_lockAccountAfterFailedAttempt) {
el.setAttribute("lock-after-fails", String.valueOf(lockAccountAfterFailedAttempt));
}
if (disableAccountAfterFailedAttempts != DEF_disableAccountAfterFailedAttempts) {
el.setAttribute("disable-after-fails", String.valueOf(disableAccountAfterFailedAttempts));
}
if (periodTime != DEF_periodTime) {
el.setAttribute("period-time", String.valueOf(periodTime));
}
if (lockTime != DEF_lockTime) {
el.setAttribute("lock-time", String.valueOf(lockTime));
}
if (mode != DEF_mode) {
el.setAttribute("mode", mode.name());
}
return el;
}
@Override
public void addCommandFields(String prefix, Packet packet, boolean forDefault) {
Element commandEl = packet.getElemChild(Command.COMMAND_EL, Command.XMLNS);
DataForm.addFieldValue(commandEl, prefix + "-enabled", String.valueOf(enabled), "boolean",
"Brute Force Prevention Enabled");
DataForm.addFieldValue(commandEl, prefix + "-lock-after-fails",
String.valueOf(lockAccountAfterFailedAttempt), "text-single",
"Number of allowed invalid login");
DataForm.addFieldValue(commandEl, prefix + "-disable-after-fails",
String.valueOf(disableAccountAfterFailedAttempts), "text-single",
"Disable account after failed login");
DataForm.addFieldValue(commandEl, prefix + "-period-time", String.valueOf(periodTime),
"text-single", "Failed login in period of time [sec]");
DataForm.addFieldValue(commandEl, prefix + "-lock-time", String.valueOf(lockTime),
"text-single", "Lock time [sec]");
DataForm.addFieldValue(commandEl, prefix + "-mode", mode.name(), "Brute Force Prevention Mode",
new String[]{Mode.Ip.name(), Mode.Jid.name(), IpJid.name()},
new String[]{Mode.Ip.name(), Mode.Jid.name(), IpJid.name()});
}
@Override
public void initFromData(Map data) {
Boolean enabled = (Boolean) data.remove(LOCK_ENABLED_KEY);
if (enabled != null) {
this.enabled = enabled;
}
Long tmp = (Long) data.remove(LOCK_AFTER_FAILS_KEY);
if (tmp != null) {
lockAccountAfterFailedAttempt = tmp;
}
tmp = (Long) data.remove(LOCK_DISABLE_ACCOUNT_FAILS_KEY);
if (tmp != null) {
disableAccountAfterFailedAttempts = tmp;
}
tmp = (Long) data.remove(LOCK_PERIOD_TIME_KEY);
if (tmp != null) {
periodTime = tmp;
}
tmp = (Long) data.remove(LOCK_TIME_KEY);
if (tmp != null) {
lockTime = tmp;
}
String mode = (String) data.remove(LOCK_MODE_KEY);
if (mode != null) {
this.mode = Mode.valueOf(mode);
}
}
@Override
public BruteForceLockerVHostExtension mergeWithDefaults(BruteForceLockerVHostExtension defaults) {
BruteForceLockerVHostExtension merged = new BruteForceLockerVHostExtension();
merged.enabled = this.enabled || defaults.enabled;
merged.mode = this.mode.merge(defaults.mode);
merged.lockTime = Math.max(this.lockTime, defaults.lockTime);
merged.periodTime = Math.max(this.periodTime, defaults.periodTime);
merged.disableAccountAfterFailedAttempts = Math.min(this.disableAccountAfterFailedAttempts, defaults.disableAccountAfterFailedAttempts);
merged.lockAccountAfterFailedAttempt = Math.min(this.lockAccountAfterFailedAttempt, defaults.lockAccountAfterFailedAttempt);
return merged;
}
}
}
================================================
FILE: src/main/java/tigase/auth/CallbackHandlerFactory.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import tigase.auth.callbacks.CallbackHandlerFactoryIfc;
import tigase.auth.impl.PlainCallbackHandler;
import tigase.auth.impl.ScramCallbackHandler;
import tigase.auth.impl.XTokenCallbackHandler;
import tigase.auth.mechanisms.*;
import tigase.db.NonAuthUserRepository;
import tigase.kernel.beans.Bean;
import tigase.xmpp.XMPPResourceConnection;
import javax.security.auth.callback.CallbackHandler;
/**
* Factory of {@linkplain CallbackHandler CallbackHandlers}.
*/
@Bean(name = "callback-handler-factory", parent = TigaseSaslProvider.class, active = true)
public class CallbackHandlerFactory
implements CallbackHandlerFactoryIfc {
public static final String AUTH_JID = "authentication-jid";
private static final String CALLBACK_HANDLER_KEY = "callbackhandler";
@Override
public CallbackHandler create(String mechanismName, XMPPResourceConnection session, NonAuthUserRepository repo)
throws ClassNotFoundException, InstantiationException, IllegalAccessException {
String handlerClassName = getHandlerClassname(mechanismName, session, repo);
if (handlerClassName == null) {
handlerClassName = PlainCallbackHandler.class.getName();
}
@SuppressWarnings("unchecked") Class handlerClass = (Class) Class.forName(
handlerClassName);
CallbackHandler handler = handlerClass.newInstance();
if (handler instanceof SessionAware) {
((SessionAware) handler).setSession(session);
}
if (handler instanceof DomainAware) {
((DomainAware) handler).setDomain(session.getDomain().getVhost().getDomain());
}
if (handler instanceof NonAuthUserRepositoryAware) {
((NonAuthUserRepositoryAware) handler).setNonAuthUserRepository(repo);
}
if (handler instanceof AuthRepositoryAware) {
((AuthRepositoryAware) handler).setAuthRepository(session.getAuthRepository());
}
if (handler instanceof MechanismNameAware) {
((MechanismNameAware) handler).setMechanismName(mechanismName);
}
return handler;
}
protected String getHandlerClassname(String mechanismName, XMPPResourceConnection session,
NonAuthUserRepository repo) {
switch (mechanismName) {
case SaslSCRAM.NAME:
case SaslSCRAMPlus.NAME:
case SaslSCRAMSha256.NAME:
case SaslSCRAMSha256Plus.NAME:
case SaslSCRAMSha512.NAME:
case SaslSCRAMSha512Plus.NAME:
return ScramCallbackHandler.class.getName();
case SaslXTOKEN.NAME:
return XTokenCallbackHandler.class.getName();
default:
return null;
}
}
}
================================================
FILE: src/main/java/tigase/auth/CredentialsDecoderBean.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import tigase.auth.credentials.Credentials;
import tigase.db.beans.AuthRepositoryMDPoolBean;
import tigase.kernel.beans.Bean;
import tigase.kernel.beans.Inject;
import tigase.kernel.beans.RegistrarBean;
import tigase.kernel.core.Kernel;
import tigase.xmpp.jid.BareJID;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.stream.Collectors;
@Bean(name = "credentialDecoders", parent = AuthRepositoryMDPoolBean.AuthRepositoryConfigBean.class, active = true)
public class CredentialsDecoderBean
implements RegistrarBean {
@Inject
private List decoders;
public List getSupportedMechanisms() {
return decoders.stream().map(dec -> dec.getName()).collect(Collectors.toList());
}
public Credentials.Entry decode(BareJID user, String mechanism, String password) throws NoSuchAlgorithmException {
for (Credentials.Decoder decoder : decoders) {
if (mechanism.equals(decoder.getName())) {
return decoder.decode(user, password);
}
}
throw new NoSuchAlgorithmException("No password decoder for mechanism " + mechanism);
}
@Override
public void register(Kernel kernel) {
}
@Override
public void unregister(Kernel kernel) {
}
}
================================================
FILE: src/main/java/tigase/auth/CredentialsEncoderBean.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import tigase.auth.credentials.Credentials;
import tigase.db.beans.AuthRepositoryMDPoolBean;
import tigase.kernel.beans.Bean;
import tigase.kernel.beans.Inject;
import tigase.kernel.beans.RegistrarBean;
import tigase.kernel.core.Kernel;
import tigase.xmpp.jid.BareJID;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@Bean(name = "credentialEncoders", parent = AuthRepositoryMDPoolBean.AuthRepositoryConfigBean.class, active = true)
public class CredentialsEncoderBean
implements RegistrarBean {
@Inject
private List encoders;
public List getSupportedMechanisms() {
return encoders.stream().map(enc -> enc.getName()).collect(Collectors.toList());
}
public String encode(BareJID user, String mechanism, String password) throws NoSuchAlgorithmException {
for (Credentials.Encoder encoder : encoders) {
if (mechanism.equals(encoder.getName())) {
return encoder.encode(user, password);
}
}
throw new NoSuchAlgorithmException("No password encoder for mechanism " + mechanism);
}
public List encodeForAllMechanisms(BareJID user, String password) {
List entries = new ArrayList<>();
for (Credentials.Encoder enc : encoders) {
String secret = enc.encode(user, password);
if (secret != null) {
entries.add(new String[]{enc.getName(), secret});
}
}
return entries;
}
@Override
public void register(Kernel kernel) {
}
@Override
public void unregister(Kernel kernel) {
}
}
================================================
FILE: src/main/java/tigase/auth/DefaultMechanismSelector.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import tigase.auth.mechanisms.SaslEXTERNAL;
import tigase.auth.mechanisms.SaslSCRAMPlus;
import tigase.auth.mechanisms.TigaseSaslServerFactory;
import tigase.cert.CertificateUtil;
import tigase.db.AuthRepository;
import tigase.kernel.beans.Bean;
import tigase.kernel.beans.Inject;
import tigase.kernel.beans.config.ConfigField;
import tigase.vhosts.VHostItem;
import tigase.xmpp.XMPPResourceConnection;
import javax.security.sasl.SaslServerFactory;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Stream;
@Bean(name = "mechanism-selector", parent = TigaseSaslProvider.class, active = true)
public class DefaultMechanismSelector
implements MechanismSelector {
private static Logger log = Logger.getLogger(DefaultMechanismSelector.class.getName());
@ConfigField(desc = "List of allowed SASL mechanisms", alias = "allowed-mechanisms")
private HashSet allowedMechanisms = new HashSet();
@ConfigField(desc = "List of SASL mechanisms allowed with non-plain password stored in authentication repository", alias = "non-plain-password-allowed-mechanisms")
private HashSet allowedMechanismsWithNonPlainPasswordInRepository = new HashSet<>();
@ConfigField(desc = "Disable SCRAM -PLUS mechanisms")
private boolean disableScramPlus = false;
@Inject
private AuthRepository authRepository;
public DefaultMechanismSelector() {
Stream.of("ANONYMOUS", "PLAIN", "EXTERNAL").forEach(allowedMechanismsWithNonPlainPasswordInRepository::add);
}
@Override
public Collection filterMechanisms(Enumeration serverFactories,
XMPPResourceConnection session) {
final Map props = new HashMap();
final ArrayList result = new ArrayList();
while (serverFactories.hasMoreElements()) {
SaslServerFactory ss = serverFactories.nextElement();
String[] x = ss.getMechanismNames(props);
for (String name : x) {
// JKD9 introduced a change! now if factory implements more than one mechanism it will be returned multiple times!!
if (result.contains(name)) {
continue;
}
if (match(ss, name, session) && isAllowedForDomain(name, session.getDomain())) {
result.add(name);
}
}
}
return result;
}
protected boolean isAllowedForDomain(final String mechanismName, final VHostItem vhost) {
final String[] saslAllowedMechanisms = vhost.getSaslAllowedMechanisms();
if (saslAllowedMechanisms != null && saslAllowedMechanisms.length > 0) {
for (String allowed : saslAllowedMechanisms) {
if (allowed.equals(mechanismName)) {
return true;
}
}
return false;
} else if (!allowedMechanisms.isEmpty()) {
return allowedMechanisms.contains(mechanismName);
}
return true;
}
protected boolean match(SaslServerFactory factory, String mechanismName, XMPPResourceConnection session) {
if (session.isTlsRequired() && !session.isEncrypted()) {
return false;
}
if (factory instanceof TigaseSaslServerFactory) {
switch (mechanismName) {
case "EXTERNAL":
return isJIDInCertificate(session);
case "ANONYMOUS":
return session.getDomain().isAnonymousEnabled();
default:
if (mechanismName.startsWith("SCRAM-") && mechanismName.endsWith("-PLUS") &&
((!SaslSCRAMPlus.isAvailable(session)) || disableScramPlus)) {
return false;
}
return authRepository.isMechanismSupported(session.getDomain().getKey(), mechanismName);
}
}
return false;
}
private boolean isJIDInCertificate(final XMPPResourceConnection session) {
Certificate cert = (Certificate) session.getSessionData(SaslEXTERNAL.PEER_CERTIFICATE_KEY);
if (cert == null) {
return false;
}
final List authJIDs = CertificateUtil.extractXmppAddrs((X509Certificate) cert);
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "{0}, Found authJIDs: {1} in certificate: {1}",
new Object[]{session, String.valueOf(authJIDs), CertificateUtil.getCertCName(((X509Certificate) cert))});
}
return authJIDs != null && !authJIDs.isEmpty();
}
}
================================================
FILE: src/main/java/tigase/auth/DomainAware.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import javax.security.auth.callback.CallbackHandler;
/**
* Interface should be implemented by {@linkplain CallbackHandler} instance if domain name rom current XMPP Session
* should be injected.
*/
public interface DomainAware
extends Aware {
/**
* Sets name of domain from XMPP Stream.
*
* @param domain domain name
*/
void setDomain(String domain);
}
================================================
FILE: src/main/java/tigase/auth/MechanismNameAware.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
public interface MechanismNameAware {
void setMechanismName(String mechanismName);
}
================================================
FILE: src/main/java/tigase/auth/MechanismSelector.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import tigase.xmpp.XMPPResourceConnection;
import javax.security.sasl.SaslServerFactory;
import java.util.Collection;
import java.util.Enumeration;
/**
* Interface for implementing selectors of SASL mechanisms.
*/
public interface MechanismSelector {
/**
* Method filters all available SASL mechanisms from {@link SaslServerFactory factories} with current {@link
* XMPPResourceConnection session} state.
*
* @param serverFactories {@link SaslServerFactory SaslServerFactory} enumeration.
* @param session current session
*
* @return collection of all SASL mechanisms available in given session (and current XMPP Stream).
*/
Collection filterMechanisms(Enumeration serverFactories, XMPPResourceConnection session);
}
================================================
FILE: src/main/java/tigase/auth/NonAuthUserRepositoryAware.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import tigase.db.NonAuthUserRepository;
public interface NonAuthUserRepositoryAware
extends Aware {
void setNonAuthUserRepository(NonAuthUserRepository repo);
}
================================================
FILE: src/main/java/tigase/auth/PasswordResetterIfc.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import tigase.component.exceptions.RepositoryException;
import tigase.xmpp.jid.BareJID;
public interface PasswordResetterIfc {
void changePassword(String encodedToken, String password) throws RepositoryException;
void validateToken(String encodedToken) throws RepositoryException, RuntimeException;
void sendToken(BareJID bareJID, String url) throws RepositoryException, Exception;
}
================================================
FILE: src/main/java/tigase/auth/PluginSettingsAware.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import javax.security.auth.callback.CallbackHandler;
import java.util.Map;
/**
* Interface should be implemented by {@linkplain CallbackHandler} instance if plugin settings should be injected.
*
* @author Daniele Ricci
*/
public interface PluginSettingsAware {
public void setPluginSettings(Map settings);
}
================================================
FILE: src/main/java/tigase/auth/SaslInvalidLoginExcepion.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
public class SaslInvalidLoginExcepion
extends XmppSaslException {
private final String jid;
public SaslInvalidLoginExcepion(SaslError saslError, String jid) {
super(saslError);
this.jid = jid;
}
public SaslInvalidLoginExcepion(SaslError saslError, String jid, String detail) {
super(saslError, detail);
this.jid = jid;
}
public String getJid() {
return jid;
}
}
================================================
FILE: src/main/java/tigase/auth/SessionAware.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import tigase.xmpp.XMPPResourceConnection;
import javax.security.auth.callback.CallbackHandler;
/**
* Interface should be implemented by {@linkplain CallbackHandler} instance if current XMPP Session should be injected.
*/
public interface SessionAware
extends Aware {
/**
* Sets XMPP Session.
*
* @param session XMPP session.
*/
void setSession(XMPPResourceConnection session);
}
================================================
FILE: src/main/java/tigase/auth/TigaseSaslProvider.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import tigase.auth.callbacks.CallbackHandlerFactoryIfc;
import tigase.db.NonAuthUserRepository;
import tigase.kernel.beans.*;
import tigase.kernel.core.Kernel;
import tigase.server.xmppsession.SessionManager;
import tigase.xmpp.XMPPResourceConnection;
import javax.security.auth.callback.CallbackHandler;
import javax.security.sasl.SaslServerFactory;
import java.security.Provider;
import java.security.Security;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.logging.Logger;
import java.util.stream.Collectors;
/**
* Describe class TigaseSaslProvider here.
*
* Created: Sun Nov 5 22:31:20 2006
*
* @author Artur Hefczyc
*/
@Bean(name = "sasl-provider", parent = SessionManager.class, active = true)
public class TigaseSaslProvider
extends Provider
implements Initializable, UnregisterAware, RegistrarBean {
public static final String FACTORY_KEY = "factory";
private static final String INFO = "This is tigase provider (provides Tigase server specific mechanisms)";
private static final Logger log = Logger.getLogger(TigaseSaslProvider.class.getName());
private static final String MY_NAME = "tigase.sasl";
private static final long serialVersionUID = 1L;
private static final double VERSION = 1.0;
@Inject
private CallbackHandlerFactoryIfc callbackHandlerFactory;
@Inject
private MechanismSelector mechanismSelector;
@Inject(nullAllowed = true)
private CopyOnWriteArraySet saslServerFactories = new CopyOnWriteArraySet<>();
private ConcurrentHashMap> saslServerFactoriesServices = new ConcurrentHashMap<>();
@SuppressWarnings("unchecked")
public TigaseSaslProvider() {
super(MY_NAME, VERSION, INFO);
}
public void setSaslServerFactories(CopyOnWriteArraySet saslServerFactories) {
this.saslServerFactories.stream()
.filter(factory -> saslServerFactories == null || !saslServerFactories.contains(factory))
.forEach(this::unregisterFactory);
if (saslServerFactories != null) {
saslServerFactories.stream()
.filter(factory -> !this.saslServerFactories.contains(factory))
.forEach(this::registerFactory);
}
this.saslServerFactories = saslServerFactories == null ? new CopyOnWriteArraySet<>() : saslServerFactories;
}
@Override
public void beforeUnregister() {
Security.removeProvider(MY_NAME);
}
@Override
public void initialize() {
Security.insertProviderAt(this, 1);
}
public CallbackHandler create(String mechanismName, XMPPResourceConnection session, NonAuthUserRepository repo,
Map settings)
throws ClassNotFoundException, InstantiationException, IllegalAccessException {
return callbackHandlerFactory.create(mechanismName, session, repo, settings);
}
public Collection filterMechanisms(Enumeration serverFactories,
XMPPResourceConnection session) {
return mechanismSelector.filterMechanisms(serverFactories, session);
}
@Override
public void register(Kernel kernel) {
}
@Override
public void unregister(Kernel kernel) {
}
@Override
protected synchronized void putService(Service s) {
log.config("Registering SASL mechanism '" + s.getAlgorithm() + "' with factory " + s.getClassName());
super.putService(s);
}
@Override
protected synchronized void removeService(Service s) {
log.config("Unregistering SASL mechanism '" + s.getAlgorithm() + "' with factory " + s.getClassName());
super.removeService(s);
}
private void registerFactory(SaslServerFactory factory) {
String factoryClassName = factory.getClass().getName();
List services = Arrays.stream(factory.getMechanismNames(new HashMap<>()))
.map(name -> new Provider.Service(this, "SaslServerFactory", name, factoryClassName, null, null))
.collect(Collectors.toList());
services.forEach(this::putService);
saslServerFactoriesServices.put(factory, services);
}
private void unregisterFactory(SaslServerFactory factory) {
List services = saslServerFactoriesServices.remove(factory);
if (services != null) {
services.forEach(this::removeService);
}
}
}
================================================
FILE: src/main/java/tigase/auth/XmppSaslException.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth;
import tigase.db.AuthRepository;
import tigase.xml.Element;
import javax.security.sasl.SaslException;
public class XmppSaslException
extends SaslException {
private static final long serialVersionUID = 1L;
public enum SaslError {
/**
* The receiving entity acknowledges that the authentication handshake has been aborted by the initiating
* entity.
*/
aborted("aborted"),
/**
* The account of the initiating entity has been temporarily disabled.
*/
account_disabled("account-disabled"),
/**
* The authentication failed because the initiating entity provided credentials that have expired.
*/
credentials_expired("credentials-expired"),
/**
* The mechanism requested by the initiating entity cannot be used unless the confidentiality and integrity of
* the underlying stream are protected (typically via TLS).
*/
encryption_required("encryption-required"),
/**
* The data provided by the initiating entity could not be processed because the base 64 encoding is incorrect.
*/
incorrect_encoding("incorrect-encoding"),
/**
* The authzid provided by the initiating entity is invalid, either because it is incorrectly formatted or
* because the initiating entity does not have permissions to authorize that ID.
*/
invalid_authzid("invalid-authzid"),
/**
* The initiating entity did not specify a mechanism, or requested a mechanism that is not supported by the
* receiving entity.
*/
invalid_mechanism("invalid-mechanism"),
/**
* The request is malformed (e.g., the {@code } element includes initial response data but the mechanism
* does not allow that, or the data sent violates the syntax for the specified SASL mechanism).
*/
malformed_request("malformed-request"),
/**
* The mechanism requested by the initiating entity is weaker than server policy permits for that initiating
* entity.
*/
mechanism_too_weak("mechanism-too-weak"),
/**
* The authentication failed because the initiating entity did not provide proper credentials, or because some
* generic authentication failure has occurred but the receiving entity does not wish to disclose specific
* information about the cause of the failure.
*/
not_authorized("not-authorized"),
/**
* The authentication failed because of a temporary error condition within the receiving entity, and it is
* advisable for the initiating entity to try again later.
*/
temporary_auth_failure("temporary-auth-failure");
private final String elementName;
public static final String XMLNS = "urn:ietf:params:xml:ns:xmpp-sasl";
SaslError(String elementName) {
this.elementName = elementName;
}
public String getElementName() {
return elementName;
}
public Element getElement() {
Element error = new Element(getElementName());
error.setXMLNS(XMLNS);
return error;
}
}
private SaslError saslError;
public XmppSaslException(SaslError saslError) {
super();
this.saslError = saslError;
}
public XmppSaslException(SaslError saslError, String detail) {
super(detail);
this.saslError = saslError;
}
public SaslError getSaslError() {
return saslError;
}
public String getSaslErrorElementName() {
return saslError == null ? null : saslError.getElementName();
}
public static XmppSaslException getExceptionFor(AuthRepository.AccountStatus status) {
switch (status) {
case disabled:
case banned:
case spam:
case undefined_inactive:
return new XmppSaslException(SaslError.account_disabled, "Your account has been disabled, please contact the administration");
case system:
return new XmppSaslException(SaslError.invalid_authzid);
case pending:
return new XmppSaslException(SaslError.account_disabled, "Your account hasn't been activated yet. Please cheek your email for activation link");
default:
return new XmppSaslException(SaslError.not_authorized);
}
}
}
================================================
FILE: src/main/java/tigase/auth/adhoc/AbstractCredentialsCommand.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.adhoc;
import tigase.annotations.TigaseDeprecated;
import tigase.component.adhoc.AdHocCommand;
import tigase.component.adhoc.AdHocCommandException;
import tigase.component.adhoc.AdHocResponse;
import tigase.component.adhoc.AdhHocRequest;
import tigase.component.modules.impl.AdHocCommandModule;
import tigase.db.AuthRepository;
import tigase.db.TigaseDBException;
import tigase.form.Form;
import tigase.kernel.beans.Inject;
import tigase.server.CmdAcl;
import tigase.xml.Element;
import tigase.xmpp.Authorization;
import tigase.xmpp.jid.BareJID;
import tigase.xmpp.jid.JID;
import java.util.logging.Level;
import java.util.logging.Logger;
public abstract class AbstractCredentialsCommand
implements AdHocCommand {
protected static final String FIELD_JID = "jid";
protected static final String FIELD_CREDENTIAL_ID = "credentialId";
@Deprecated
@TigaseDeprecated(since = "8.1.0", note = "Using CredentialID instead of username for clarity")
protected static final String FIELD_USERNAME = FIELD_CREDENTIAL_ID;
protected static final String FIELD_PASSWORD = "password";
protected final Logger log = Logger.getLogger(this.getClass().getName());
@Inject
protected AuthRepository authRepository;
@Inject
private AdHocCommandModule.ScriptCommandProcessor scriptCommandProcessor;
protected void checkIfCanModifyJID(final AdhHocRequest request, final BareJID jidToModify)
throws AdHocCommandException {
if (!jidToModify.equals(request.getSender().getBareJID())) {
log.log(Level.FINEST, "Cannot modify credentials of different user");
throw new AdHocCommandException(Authorization.NOT_AUTHORIZED,
"You are not allowed to modify credentials " + "of user " + jidToModify);
}
}
@Override
public void execute(AdhHocRequest request, AdHocResponse response) throws AdHocCommandException {
try {
final Element data = request.getCommand().getChild("x", "jabber:x:data");
if (request.getAction() != null && "cancel".equals(request.getAction())) {
response.cancelSession();
} else if (data == null) {
processNoForm(request, response);
} else {
Form form = new Form(data);
processForm(form, request, response);
}
} catch (Exception e) {
log.log(Level.FINEST, "Error during processing command", e);
throw new AdHocCommandException(Authorization.INTERNAL_SERVER_ERROR, e.getMessage());
}
}
@Override
public boolean isAllowedFor(JID jid) {
return scriptCommandProcessor.isAllowed(getNode(), jid);
}
@Override
public CmdAcl getDefaultACL() {
return new CmdAcl("LOCAL");
}
protected abstract void processForm(Form form, AdhHocRequest request, AdHocResponse response)
throws TigaseDBException, AdHocCommandException;
protected abstract void processNoForm(AdhHocRequest request, AdHocResponse response) throws TigaseDBException;
}
================================================
FILE: src/main/java/tigase/auth/adhoc/AddUserCredentials.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.adhoc;
import tigase.auth.credentials.Credentials;
import tigase.component.adhoc.AdHocCommandException;
import tigase.component.adhoc.AdHocResponse;
import tigase.component.adhoc.AdhHocRequest;
import tigase.db.TigaseDBException;
import tigase.form.Field;
import tigase.form.Form;
import tigase.kernel.beans.Bean;
import tigase.server.xmppsession.SessionManager;
import tigase.xmpp.Authorization;
import tigase.xmpp.jid.BareJID;
@Bean(name = AddUserCredentials.NODE, parent = SessionManager.class, active = true)
public class AddUserCredentials
extends AbstractCredentialsCommand {
public static final String NODE = "auth-credentials-add";
public AddUserCredentials() {
}
@Override
public String getName() {
return "Add user credentials";
}
@Override
public String getNode() {
return NODE;
}
@Override
protected void processForm(Form form, AdhHocRequest request, AdHocResponse response)
throws TigaseDBException, AdHocCommandException {
BareJID jid = BareJID.bareJIDInstanceNS(form.getAsString(FIELD_JID));
checkIfCanModifyJID(request, jid);
String credentialId = form.getAsString(FIELD_CREDENTIAL_ID);
String password = form.getAsString(FIELD_PASSWORD);
if (credentialId == null || credentialId.trim().isEmpty()) {
credentialId = Credentials.DEFAULT_CREDENTIAL_ID;
}
if (password == null || credentialId.isEmpty()) {
throw new AdHocCommandException(Authorization.BAD_REQUEST, "Passwor cannot be null");
}
Form resp = new Form("result", null, null);
authRepository.updateCredential(jid, credentialId.trim(), password);
resp.addField(Field.fieldFixed("OK"));
response.getElements().add(resp.getElement());
response.completeSession();
}
@Override
protected void processNoForm(AdhHocRequest request, AdHocResponse response) {
Form form = new Form("form", getName(), null);
form.addField(Field.fieldJidSingle(FIELD_JID, null, "The Jabber ID for the account"));
form.addField(Field.fieldJidSingle(FIELD_CREDENTIAL_ID, null, "Credential ID"));
form.addField(Field.fieldJidSingle(FIELD_PASSWORD, null, "Password"));
response.startSession();
response.getElements().add(form.getElement());
}
}
================================================
FILE: src/main/java/tigase/auth/adhoc/DeleteUserCredentials.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.adhoc;
import tigase.auth.credentials.Credentials;
import tigase.component.adhoc.AdHocCommandException;
import tigase.component.adhoc.AdHocResponse;
import tigase.component.adhoc.AdhHocRequest;
import tigase.db.TigaseDBException;
import tigase.form.Field;
import tigase.form.Form;
import tigase.kernel.beans.Bean;
import tigase.server.xmppsession.SessionManager;
import tigase.xmpp.jid.BareJID;
@Bean(name = DeleteUserCredentials.NODE, parent = SessionManager.class, active = true)
public class DeleteUserCredentials
extends AbstractCredentialsCommand {
public static final String NODE = "auth-credentials-delete";
public DeleteUserCredentials() {
}
@Override
public String getName() {
return "Delete user credentials";
}
@Override
public String getNode() {
return NODE;
}
@Override
protected void processForm(Form form, AdhHocRequest request, AdHocResponse response)
throws TigaseDBException, AdHocCommandException {
BareJID jid = BareJID.bareJIDInstanceNS(form.getAsString(FIELD_JID));
checkIfCanModifyJID(request, jid);
String credentialId = form.getAsString(FIELD_CREDENTIAL_ID);
if (credentialId == null || credentialId.trim().isEmpty()) {
credentialId = Credentials.DEFAULT_CREDENTIAL_ID;
}
Form resp = new Form("result", null, null);
authRepository.removeCredential(jid, credentialId.trim());
resp.addField(Field.fieldFixed("OK"));
response.getElements().add(resp.getElement());
response.completeSession();
}
@Override
protected void processNoForm(AdhHocRequest request, AdHocResponse response) {
Form form = new Form("form", getName(), null);
form.addField(Field.fieldJidSingle(FIELD_JID, null, "The Jabber ID for the account"));
form.addField(Field.fieldJidSingle(FIELD_CREDENTIAL_ID, null, "Credential ID"));
response.startSession();
response.getElements().add(form.getElement());
}
}
================================================
FILE: src/main/java/tigase/auth/adhoc/ShowUserCredentials.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.adhoc;
import tigase.component.adhoc.AdHocCommandException;
import tigase.component.adhoc.AdHocResponse;
import tigase.component.adhoc.AdhHocRequest;
import tigase.db.TigaseDBException;
import tigase.form.Field;
import tigase.form.Fields;
import tigase.form.Form;
import tigase.form.MultiItemForm;
import tigase.kernel.beans.Bean;
import tigase.server.xmppsession.SessionManager;
import tigase.xmpp.jid.BareJID;
import java.util.Collection;
@Bean(name = ShowUserCredentials.NODE, parent = SessionManager.class, active = true)
public class ShowUserCredentials
extends AbstractCredentialsCommand {
public static final String NODE = "auth-credentials-list";
public ShowUserCredentials() {
}
@Override
public String getName() {
return "List user credentials";
}
@Override
public String getNode() {
return NODE;
}
@Override
protected void processForm(Form form, AdhHocRequest request, AdHocResponse response)
throws TigaseDBException, AdHocCommandException {
BareJID jid = BareJID.bareJIDInstanceNS(form.getAsString(FIELD_JID));
checkIfCanModifyJID(request, jid);
MultiItemForm resp = new MultiItemForm();
resp.setType("form");
Collection credentialIds = authRepository.getCredentialIds(jid);
for (String credentialId : credentialIds) {
Fields ff = new Fields();
ff.addField(Field.fieldTextSingle("credentialId", credentialId, "Credential ID"));
resp.addItem(ff);
}
response.getElements().add(resp.getElement());
response.completeSession();
}
@Override
protected void processNoForm(AdhHocRequest request, AdHocResponse response) {
Form form = new Form("form", getName(), null);
form.addField(Field.fieldJidSingle(FIELD_JID, null, "The Jabber ID for the account"));
response.startSession();
response.getElements().add(form.getElement());
}
}
================================================
FILE: src/main/java/tigase/auth/callbacks/AuthorizationIdCallback.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.callbacks;
import javax.security.auth.callback.Callback;
public class AuthorizationIdCallback
implements Callback, java.io.Serializable {
private final String prompt;
private String authzId;
public AuthorizationIdCallback(String prompt, String authzId) {
this.prompt = prompt;
this.authzId = authzId;
}
public String getAuthzId() {
return authzId;
}
public void setAuthzId(String authzId) {
this.authzId = authzId;
}
public String getPrompt() {
return prompt;
}
}
================================================
FILE: src/main/java/tigase/auth/callbacks/CallbackHandlerFactoryIfc.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.callbacks;
import tigase.annotations.TigaseDeprecated;
import tigase.db.NonAuthUserRepository;
import tigase.xmpp.XMPPResourceConnection;
import javax.security.auth.callback.CallbackHandler;
import java.util.Map;
/**
* Created by andrzej on 20.03.2017.
*/
public interface CallbackHandlerFactoryIfc {
CallbackHandler create(String mechanismName, XMPPResourceConnection session, NonAuthUserRepository repo)
throws ClassNotFoundException, InstantiationException, IllegalAccessException;
@Deprecated
@TigaseDeprecated(note = "Settings are not use anymore", since = "8.1.0")
default CallbackHandler create(String mechanismName, XMPPResourceConnection session, NonAuthUserRepository repo,
Map settings)
throws ClassNotFoundException, InstantiationException, IllegalAccessException {
return this.create(mechanismName, session, repo);
}
}
================================================
FILE: src/main/java/tigase/auth/callbacks/ChannelBindingCallback.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.callbacks;
import tigase.auth.mechanisms.AbstractSaslSCRAM;
import javax.security.auth.callback.Callback;
public class ChannelBindingCallback
implements Callback, java.io.Serializable {
private final String prompt;
private final AbstractSaslSCRAM.BindType requestedBindType;
private byte[] bindingData;
public ChannelBindingCallback(String prompt, AbstractSaslSCRAM.BindType requestedBindType) {
this.prompt = prompt;
this.requestedBindType = requestedBindType;
}
public byte[] getBindingData() {
return bindingData;
}
public void setBindingData(byte[] bindingData) {
this.bindingData = bindingData;
}
public String getPrompt() {
return prompt;
}
public AbstractSaslSCRAM.BindType getRequestedBindType() {
return requestedBindType;
}
}
================================================
FILE: src/main/java/tigase/auth/callbacks/PBKDIterationsCallback.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.callbacks;
import javax.security.auth.callback.Callback;
public class PBKDIterationsCallback
implements Callback, java.io.Serializable {
private static final long serialVersionUID = -4342673378785456908L;
private int interations;
private String prompt;
public PBKDIterationsCallback(String prompt) {
this.prompt = prompt;
}
/**
* @return the interations
*/
public int getInterations() {
return interations;
}
/**
* @param interations the interations to set
*/
public void setInterations(int interations) {
this.interations = interations;
}
}
================================================
FILE: src/main/java/tigase/auth/callbacks/ReplaceServerKeyCallback.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.callbacks;
import javax.security.auth.callback.Callback;
public class ReplaceServerKeyCallback
implements Callback {
private byte[] newServerKey;
public byte[] getNewServerKey() {
return newServerKey;
}
public void setNewServerKey(byte[] newServerKey) {
this.newServerKey = newServerKey;
}
}
================================================
FILE: src/main/java/tigase/auth/callbacks/SaltCallback.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.callbacks;
import javax.security.auth.callback.Callback;
public class SaltCallback
implements Callback, java.io.Serializable {
private static final long serialVersionUID = -4342673378785456908L;
private String prompt;
private byte[] salt;
public SaltCallback(String prompt) {
this.prompt = prompt;
}
/**
* @return the salt
*/
public byte[] getSalt() {
return salt;
}
/**
* @param salt the salt to set
*/
public void setSalt(byte[] salt) {
this.salt = salt;
}
}
================================================
FILE: src/main/java/tigase/auth/callbacks/ServerKeyCallback.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.callbacks;
import javax.security.auth.callback.Callback;
public class ServerKeyCallback
implements Callback, java.io.Serializable {
private final String prompt;
private byte[] serverKey;
public ServerKeyCallback(String prompt) {
this.prompt = prompt;
}
/**
* @return the ServerKey
*/
public byte[] getServerKey() {
return serverKey;
}
/**
* @param serverKey the ServerKey to set
*/
public void setServerKey(byte[] serverKey) {
this.serverKey = serverKey;
}
}
================================================
FILE: src/main/java/tigase/auth/callbacks/SharedSecretKeyCallback.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.callbacks;
import javax.security.auth.callback.Callback;
public class SharedSecretKeyCallback implements Callback, java.io.Serializable {
private byte[] secret;
public SharedSecretKeyCallback() {}
public byte[] getSecret() {
return secret;
}
public void setSecret(byte[] secret) {
this.secret = secret;
}
}
================================================
FILE: src/main/java/tigase/auth/callbacks/StoredKeyCallback.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.callbacks;
import javax.security.auth.callback.Callback;
public class StoredKeyCallback
implements Callback, java.io.Serializable {
private final String prompt;
private byte[] storedKey;
public StoredKeyCallback(String prompt) {
this.prompt = prompt;
}
/**
* @return the StoredKey
*/
public byte[] getStoredKey() {
return storedKey;
}
/**
* @param storedKey the StoredKey to set
*/
public void setStoredKey(byte[] storedKey) {
this.storedKey = storedKey;
}
}
================================================
FILE: src/main/java/tigase/auth/callbacks/ValidateCertificateData.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.callbacks;
import tigase.xmpp.jid.BareJID;
import javax.security.auth.callback.Callback;
public class ValidateCertificateData
implements Callback {
private boolean authorized;
private String authorizedID;
private BareJID defaultAuthzid;
public ValidateCertificateData() {
}
public ValidateCertificateData(BareJID jid) {
setDefaultAuthzid(jid);
}
public String getAuthorizedID() {
return authorizedID;
}
public void setAuthorizedID(String authorizedID) {
this.authorizedID = authorizedID;
}
public BareJID getDefaultAuthzid() {
return defaultAuthzid;
}
public void setDefaultAuthzid(BareJID defaultAuthzid) {
this.defaultAuthzid = defaultAuthzid;
}
public boolean isAuthorized() {
return authorized;
}
public void setAuthorized(boolean authorized) {
this.authorized = authorized;
}
}
================================================
FILE: src/main/java/tigase/auth/callbacks/VerifyPasswordCallback.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.callbacks;
import javax.security.auth.callback.Callback;
/**
* Class for validate password. Called by SASL mechanisms. If given password is valid then {@linkplain
* VerifyPasswordCallback#setVerified(boolean) setVerified(true)} must be called.
*/
public class VerifyPasswordCallback
implements Callback {
private final String password;
private boolean verified = false;
public VerifyPasswordCallback(final String password) {
this.password = password;
}
public String getPassword() {
return password;
}
public boolean isVerified() {
return verified;
}
public void setVerified(boolean verified) {
this.verified = verified;
}
}
================================================
FILE: src/main/java/tigase/auth/callbacks/XMPPSessionCallback.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.callbacks;
import tigase.xmpp.XMPPResourceConnection;
import javax.security.auth.callback.Callback;
public class XMPPSessionCallback
implements Callback, java.io.Serializable {
private final String prompt;
private XMPPResourceConnection session;
public XMPPSessionCallback(String prompt) {
this.prompt = prompt;
}
public String getPrompt() {
return prompt;
}
public XMPPResourceConnection getSession() {
return session;
}
public void setSession(XMPPResourceConnection session) {
this.session = session;
}
}
================================================
FILE: src/main/java/tigase/auth/credentials/Credentials.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.credentials;
import tigase.annotations.TigaseDeprecated;
import tigase.xmpp.jid.BareJID;
import static tigase.db.AuthRepository.AccountStatus;
/**
* Interface implemented by classes handling user login credentials. In implementations of this interface multiple
* credentials for single account may be stored but for single credentialId, ie. different credentials for different
* authentication mechanisms.
*/
public interface Credentials {
String DEFAULT_CREDENTIAL_ID = "default";
@Deprecated
@TigaseDeprecated(since = "8.1.0", note = "Username changed to CredentialId")
String DEFAULT_USERNAME = DEFAULT_CREDENTIAL_ID;
/**
* Checks if account can perform logging-in
*/
boolean canLogin();
/**
* @return account status of the account
*/
AccountStatus getAccountStatus();
/**
* Find a credential for specified encryption mechanism
*
* @return instance of an entry if available or null
*/
Entry getEntryForMechanism(String mechanism);
/**
* Returns first available instance of credentials entry
*
* @return first available instance of credentials entry
*/
Entry getFirst();
/**
* Returns bare jid of an account
*
* @return bare jid of an account
*/
BareJID getUser();
/**
* Checks if account is disabled
*/
boolean isAccountDisabled();
/**
* Interface implemented by credentials decoder converting from value stored in database to the form represented by
* implementation of Entry interface.
*/
interface Decoder {
/**
* Decode credentials stored in database to more suitable form.
*
* @return credentials stored in database in more suitable form
*/
E decode(BareJID user, String value);
/**
* Name of the encryption mechanism for which decoder works
*
* @return name of the encryption mechanism for which decoder works
*/
String getName();
}
/**
* Interface implemented by credentials encoder converting them from plaintext value to encoded form stored in the
* database.
*/
interface Encoder {
/**
* Encodes entry to store in database.
*
* @param user for which encode
* @param password plaintext password to encode
*
* @return encoded authentication data.
*/
String encode(BareJID user, String password);
/**
* Encodes entry to store in database.
*
* @param user for which encode
* @param entry to encode
*
* @return encoded authentication data.
*/
String encode(BareJID user, E entry);
/**
* Name of the encryption mechanism for which encoder works
*
* @return name of the encryption mechanism for which encoder works
*/
String getName();
}
/**
* Interface required to be implemented by classes representing credential entry.
*/
interface Entry {
/**
* Name of the encryption mechanism used to encode stored credentials.
*
* Note: Value returned by this method may be equal to SASL mechanism name used to encode this value,
* but doesn't have to be only one of SASL mechanism name, ie. for passwords encoded for PLAIN mechanism
* not stored in plain format in the repository.
*/
String getMechanism();
/**
* Check if plaintext password will match stored credential
*/
boolean verifyPlainPassword(String plain);
}
/**
* Interface implemented by classes used as DTO for credentials read from repository.s
*/
interface RawEntry {
/**
* Name of the encryption mechanism used to encode stored credentials.
*
* Note: Value returned by this method may be equal to SASL mechanism name used to encode this value,
* but doesn't have to be only one of SASL mechanism name, ie. for passwords encoded for PLAIN mechanism
* not stored in plain format in the repository.
*/
String getMechanism();
/**
* Encoded value
*/
String getValue();
/**
* Checks if the provided string matches the name of the encryption mechanism used to encode data for storage
* in the repository.
*/
default boolean isForMechanism(String mechanism) {
return mechanism.equals(getMechanism());
}
}
}
================================================
FILE: src/main/java/tigase/auth/credentials/entries/MD5PasswordCredentialsEntry.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.credentials.entries;
import tigase.annotations.TigaseDeprecated;
import tigase.auth.CredentialsDecoderBean;
import tigase.auth.CredentialsEncoderBean;
import tigase.auth.credentials.Credentials;
import tigase.kernel.beans.Bean;
import tigase.util.Algorithms;
import tigase.xmpp.jid.BareJID;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.logging.Level;
import java.util.logging.Logger;
@Deprecated
@TigaseDeprecated(since = "8.4.0", removeIn = "9.0.0", note = "SCRAM should be used for maximum security; it's possible to migrate to SCRAM seamlessly")
public class MD5PasswordCredentialsEntry
implements Credentials.Entry {
private static final Logger log = Logger.getLogger(MD5PasswordCredentialsEntry.class.getCanonicalName());
private final String passwordHash;
public MD5PasswordCredentialsEntry(String passwordHash) {
this.passwordHash = passwordHash;
}
@Override
public String getMechanism() {
return "MD5-PASSWORD";
}
@Override
public boolean verifyPlainPassword(String plain) {
try {
byte[] hash = MessageDigest.getInstance("MD5").digest(plain.getBytes(StandardCharsets.UTF_8));
return passwordHash.equalsIgnoreCase(Algorithms.bytesToHex(hash));
} catch (Exception ex) {
log.log(Level.WARNING, "failed to verify password digest", ex);
}
return false;
}
@Bean(name = "MD5-PASSWORD", parent = CredentialsDecoderBean.class, active = false)
public static class Decoder
implements Credentials.Decoder {
@Override
public MD5PasswordCredentialsEntry decode(BareJID user, String value) {
return new MD5PasswordCredentialsEntry(value);
}
@Override
public String getName() {
return "MD5-PASSWORD";
}
}
@Bean(name = "MD5-PASSWORD", parent = CredentialsEncoderBean.class, active = false)
public static class Encoder
implements Credentials.Encoder {
@Override
public String encode(BareJID user, String password) {
try {
byte[] hash = MessageDigest.getInstance("MD5").digest(password.getBytes(StandardCharsets.UTF_8));
return Algorithms.bytesToHex(hash);
} catch (Exception ex) {
throw new RuntimeException("failed to generate password hash", ex);
}
}
@Override
public String encode(BareJID user, MD5PasswordCredentialsEntry entry) {
return entry.passwordHash;
}
@Override
public String getName() {
return "MD5-PASSWORD";
}
}
}
================================================
FILE: src/main/java/tigase/auth/credentials/entries/MD5UserIdPasswordCredentialsEntry.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.credentials.entries;
import tigase.annotations.TigaseDeprecated;
import tigase.auth.CredentialsDecoderBean;
import tigase.auth.CredentialsEncoderBean;
import tigase.auth.credentials.Credentials;
import tigase.kernel.beans.Bean;
import tigase.util.Algorithms;
import tigase.xmpp.jid.BareJID;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.logging.Level;
import java.util.logging.Logger;
@Deprecated
@TigaseDeprecated(since = "8.4.0", removeIn = "9.0.0", note = "SCRAM should be used for maximum security; it's possible to migrate to SCRAM seamlessly")
public class MD5UserIdPasswordCredentialsEntry
implements Credentials.Entry {
private static final Logger log = Logger.getLogger(MD5UserIdPasswordCredentialsEntry.class.getCanonicalName());
private final String passwordHash;
private final BareJID user;
public MD5UserIdPasswordCredentialsEntry(BareJID user, String passwordHash) {
this.user = user;
this.passwordHash = passwordHash;
}
@Override
public String getMechanism() {
return "MD5-USERID-PASSWORD";
}
@Override
public boolean verifyPlainPassword(String plain) {
try {
byte[] hash = MessageDigest.getInstance("MD5")
.digest((user.toString() + plain).getBytes(StandardCharsets.UTF_8));
return passwordHash.equalsIgnoreCase(Algorithms.bytesToHex(hash));
} catch (Exception ex) {
log.log(Level.WARNING, "failed to verify password digest", ex);
}
return false;
}
@Bean(name = "MD5-USERID-PASSWORD", parent = CredentialsDecoderBean.class, active = false)
public static class Decoder
implements Credentials.Decoder {
@Override
public MD5UserIdPasswordCredentialsEntry decode(BareJID user, String value) {
return new MD5UserIdPasswordCredentialsEntry(user, value);
}
@Override
public String getName() {
return "MD5-USERID-PASSWORD";
}
}
@Bean(name = "MD5-USERID-PASSWORD", parent = CredentialsEncoderBean.class, active = false)
public static class Encoder
implements Credentials.Encoder {
@Override
public String encode(BareJID user, MD5UserIdPasswordCredentialsEntry entry) {
return entry.passwordHash;
}
@Override
public String encode(BareJID user, String password) {
try {
byte[] hash = MessageDigest.getInstance("MD5")
.digest((user.toString() + password).getBytes(StandardCharsets.UTF_8));
return Algorithms.bytesToHex(hash);
} catch (Exception ex) {
throw new RuntimeException("failed to generate password hash", ex);
}
}
@Override
public String getName() {
return "MD5-USERID-PASSWORD";
}
}
}
================================================
FILE: src/main/java/tigase/auth/credentials/entries/MD5UsernamePasswordCredentialsEntry.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.credentials.entries;
import tigase.annotations.TigaseDeprecated;
import tigase.auth.CredentialsDecoderBean;
import tigase.auth.CredentialsEncoderBean;
import tigase.auth.credentials.Credentials;
import tigase.kernel.beans.Bean;
import tigase.util.Algorithms;
import tigase.xmpp.jid.BareJID;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.logging.Level;
import java.util.logging.Logger;
@Deprecated
@TigaseDeprecated(since = "8.4.0", removeIn = "9.0.0", note = "SCRAM should be used for maximum security; it's possible to migrate to SCRAM seamlessly")
public class MD5UsernamePasswordCredentialsEntry
implements Credentials.Entry {
private static final Logger log = Logger.getLogger(MD5UsernamePasswordCredentialsEntry.class.getCanonicalName());
private final String passwordHash;
private final BareJID user;
protected static String getUsername(BareJID user) {
if (user.getLocalpart() == null) {
return user.getDomain();
} else {
return user.getLocalpart();
}
}
public MD5UsernamePasswordCredentialsEntry(BareJID user, String passwordHash) {
this.user = user;
this.passwordHash = passwordHash;
}
@Override
public String getMechanism() {
return "MD5-USERNAME-PASSWORD";
}
public String getPasswordHash() {
return passwordHash;
}
@Override
public boolean verifyPlainPassword(String plain) {
try {
byte[] hash = MessageDigest.getInstance("MD5")
.digest((getUsername(user) + plain).getBytes(StandardCharsets.UTF_8));
return passwordHash.equalsIgnoreCase(Algorithms.bytesToHex(hash));
} catch (Exception ex) {
log.log(Level.WARNING, "failed to verify password digest", ex);
}
return false;
}
@Bean(name = "MD5-USERNAME-PASSWORD", parent = CredentialsDecoderBean.class, active = false)
public static class Decoder
implements Credentials.Decoder {
@Override
public MD5UsernamePasswordCredentialsEntry decode(BareJID user, String value) {
return new MD5UsernamePasswordCredentialsEntry(user, value);
}
@Override
public String getName() {
return "MD5-USERNAME-PASSWORD";
}
}
@Bean(name = "MD5-USERNAME-PASSWORD", parent = CredentialsEncoderBean.class, active = false)
public static class Encoder
implements Credentials.Encoder {
@Override
public String encode(BareJID user, MD5UsernamePasswordCredentialsEntry entry) {
return entry.getPasswordHash();
}
@Override
public String encode(BareJID user, String password) {
try {
byte[] hash = MessageDigest.getInstance("MD5")
.digest((getUsername(user) + password).getBytes(StandardCharsets.UTF_8));
return Algorithms.bytesToHex(hash);
} catch (Exception ex) {
throw new RuntimeException("failed to generate password hash", ex);
}
}
@Override
public String getName() {
return "MD5-USERNAME-PASSWORD";
}
}
}
================================================
FILE: src/main/java/tigase/auth/credentials/entries/PlainCredentialsEntry.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.credentials.entries;
import tigase.auth.CredentialsDecoderBean;
import tigase.auth.CredentialsEncoderBean;
import tigase.auth.credentials.Credentials;
import tigase.kernel.beans.Bean;
import tigase.kernel.beans.config.ConfigField;
import tigase.xmpp.jid.BareJID;
public class PlainCredentialsEntry
implements Credentials.Entry {
private final String password;
public PlainCredentialsEntry(String password) {
this.password = password;
}
@Override
public String getMechanism() {
return "PLAIN";
}
public String getPassword() {
return password;
}
@Override
public boolean verifyPlainPassword(String plain) {
return password == plain || password.equals(plain);
}
@Bean(name = "PLAIN", parent = CredentialsDecoderBean.class, active = true)
public static class Decoder
implements Credentials.Decoder {
@ConfigField(desc = "Mechanism name")
private String name;
@Override
public PlainCredentialsEntry decode(BareJID user, String value) {
return new PlainCredentialsEntry(value);
}
@Override
public String getName() {
return name;
}
}
@Bean(name = "PLAIN", parent = CredentialsEncoderBean.class, active = false)
public static class Encoder
implements Credentials.Encoder {
@ConfigField(desc = "Mechanism name")
private String name;
@Override
public String encode(BareJID user, String password) {
return password;
}
@Override
public String encode(BareJID user, PlainCredentialsEntry entry) {
return entry.getPassword();
}
@Override
public String getName() {
return name;
}
}
}
================================================
FILE: src/main/java/tigase/auth/credentials/entries/ScramCredentialsEntry.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.credentials.entries;
import tigase.auth.credentials.Credentials;
import tigase.auth.mechanisms.SCRAMHelper;
import tigase.kernel.beans.config.ConfigField;
import tigase.util.Base64;
import tigase.xmpp.jid.BareJID;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
public class ScramCredentialsEntry
implements Credentials.Entry {
private static final Logger log = Logger.getLogger(ScramCredentialsEntry.class.getCanonicalName());
private final String algorithm;
private final int iterations;
private final byte[] salt;
private final byte[] serverKey;
private final byte[] storedKey;
public ScramCredentialsEntry(String algorithm, PlainCredentialsEntry entry)
throws NoSuchAlgorithmException, InvalidKeyException {
final SecureRandom random = new SecureRandom();
this.algorithm = algorithm;
this.iterations = 4096;
this.salt = new byte[10];
random.nextBytes(salt);
var authData = SCRAMHelper.encodePlainPassword(algorithm, salt, iterations, entry.getPassword());
this.storedKey = authData.storedKey();
this.serverKey = authData.serverKey();
}
public ScramCredentialsEntry(String algorithm, byte[] salt, int iterations, byte[] saltedPassword)
throws NoSuchAlgorithmException, InvalidKeyException {
this.algorithm = algorithm;
this.iterations = iterations;
this.salt = salt;
var authData = SCRAMHelper.transcode(algorithm, saltedPassword);
this.storedKey = authData.storedKey();
this.serverKey = authData.serverKey();
}
public ScramCredentialsEntry(String algorithm, byte[] salt, int iterations, byte[] storedKey, byte[] serverKey) {
this.algorithm = algorithm;
this.iterations = iterations;
this.salt = salt;
this.storedKey = storedKey;
this.serverKey = serverKey;
}
public int getIterations() {
return iterations;
}
@Override
public String getMechanism() {
return "SCRAM-" + algorithm;
}
public byte[] getSalt() {
return salt;
}
public byte[] getServerKey() {
return serverKey;
}
public byte[] getStoredKey() {
return storedKey;
}
@Override
public boolean verifyPlainPassword(String password) {
try {
var expAuthData = SCRAMHelper.encodePlainPassword(algorithm, salt, iterations, password);
return Arrays.equals(this.serverKey, expAuthData.serverKey()) &&
Arrays.equals(this.storedKey, expAuthData.storedKey());
} catch (InvalidKeyException | NoSuchAlgorithmException ex) {
log.log(Level.FINE, "Password comparison failed", ex);
}
return false;
}
public static class Decoder
implements Credentials.Decoder {
@ConfigField(desc = "Hash algorithm")
private String algorithm;
@ConfigField(desc = "Mechanism name")
private String name;
public Decoder() {
}
protected Decoder(String algorithm) {
this.algorithm = algorithm;
}
@Override
public ScramCredentialsEntry decode(BareJID user, String value) {
byte[] salt = null;
byte[] saltedPassword = null;
byte[] storedKey = null;
byte[] serverKey = null;
int iterations = 0;
int pos = 0;
while (pos < value.length()) {
char c = value.charAt(pos);
int x = value.indexOf(",", pos + 2);
String part = value.substring(pos + 2, x == -1 ? value.length() : x);
switch (c) {
case 's':
salt = Base64.decode(part);
break;
case 'i':
iterations = Integer.parseInt(part);
break;
case 'p':
saltedPassword = Base64.decode(part);
break;
case 't':
storedKey = Base64.decode(part);
break;
case 'e':
serverKey = Base64.decode(part);
break;
}
if (x == -1) {
break;
} else {
pos = x + 1;
}
}
if ((storedKey == null || serverKey == null) && saltedPassword != null) {
return newInstance(salt, iterations, saltedPassword);
} else if (storedKey != null && serverKey != null) {
return newInstance(salt, iterations, storedKey, serverKey);
} else {
throw new RuntimeException("saltedPassword or storedKey&serverKey pair must be not null.");
}
}
@Override
public String getName() {
return name;
}
protected ScramCredentialsEntry newInstance(byte[] salt, int iterations, byte[] saltedPassword) {
try {
return new ScramCredentialsEntry(algorithm, salt, iterations, saltedPassword);
} catch (NoSuchAlgorithmException | InvalidKeyException e) {
throw new RuntimeException(e);
}
}
protected ScramCredentialsEntry newInstance(byte[] salt, int iterations, byte[] storedKey, byte[] serverKey) {
return new ScramCredentialsEntry(algorithm, salt, iterations, storedKey, serverKey);
}
}
public static class Encoder
implements Credentials.Encoder {
@ConfigField(desc = "Number of iterations")
private final int iterations = 4096;
private final SecureRandom random = new SecureRandom();
@ConfigField(desc = "Hash algorithm")
private String algorithm;
@ConfigField(desc = "Mechanism name")
private String name;
public Encoder() {
}
protected Encoder(String algorithm) {
this.algorithm = algorithm;
}
public static String encode(byte[] salt, int iterations, byte[] storedKey, byte[] serverKey) {
return "s=" + tigase.util.Base64.encode(salt) + ",i=" + iterations + ",t=" +
tigase.util.Base64.encode(storedKey) + ",e=" +
tigase.util.Base64.encode(serverKey);
}
public static String encode(ScramCredentialsEntry entry) {
return encode(entry.getSalt(), entry.getIterations(), entry.getStoredKey(), entry.getServerKey());
}
@Override
public String encode(BareJID user, ScramCredentialsEntry entry) {
return encode(entry);
}
@Override
public String encode(BareJID user, String password) {
byte[] salt = new byte[10];
random.nextBytes(salt);
SCRAMHelper.AuthenticationData authData;
try {
authData = SCRAMHelper.encodePlainPassword(algorithm, salt, iterations, password);
} catch (InvalidKeyException | NoSuchAlgorithmException e) {
throw new RuntimeException("Could not encode password", e);
}
return encode(salt, iterations, authData.storedKey(), authData.serverKey());
}
@Override
public String getName() {
return name;
}
}
}
================================================
FILE: src/main/java/tigase/auth/credentials/entries/ScramSha1CredentialsEntry.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.credentials.entries;
import tigase.auth.CredentialsDecoderBean;
import tigase.auth.CredentialsEncoderBean;
import tigase.kernel.beans.Bean;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
public class ScramSha1CredentialsEntry
extends ScramCredentialsEntry {
private static final String ALGORITHM = "SHA1";
public ScramSha1CredentialsEntry(PlainCredentialsEntry entry) throws NoSuchAlgorithmException, InvalidKeyException {
super("SHA-1", entry);
}
public ScramSha1CredentialsEntry(byte[] salt, int iterations, byte[] saltedPassword)
throws NoSuchAlgorithmException, InvalidKeyException {
super("SHA-1", salt, iterations, saltedPassword);
}
public ScramSha1CredentialsEntry(byte[] salt, int iterations, byte[] storedKey, byte[] serverKey) {
super("SHA-1", salt, iterations, storedKey, serverKey);
}
@Bean(name = "SCRAM-SHA-1", parent = CredentialsDecoderBean.class, active = true)
public static class Decoder
extends ScramCredentialsEntry.Decoder {
public Decoder() {
super(ALGORITHM);
}
@Override
protected ScramSha1CredentialsEntry newInstance(byte[] salt, int iterations, byte[] saltedPassword) {
try {
return new ScramSha1CredentialsEntry(salt, iterations, saltedPassword);
} catch (NoSuchAlgorithmException | InvalidKeyException e) {
throw new RuntimeException(e);
}
}
protected ScramSha1CredentialsEntry newInstance(byte[] salt, int iterations, byte[] storedKey,
byte[] serverKey) {
return new ScramSha1CredentialsEntry(salt, iterations, storedKey, serverKey);
}
}
@Bean(name = "SCRAM-SHA-1", parent = CredentialsEncoderBean.class, active = true)
public static class Encoder
extends ScramCredentialsEntry.Encoder {
public Encoder() {
super(ALGORITHM);
}
}
}
================================================
FILE: src/main/java/tigase/auth/credentials/entries/ScramSha256CredentialsEntry.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.credentials.entries;
import tigase.auth.CredentialsDecoderBean;
import tigase.auth.CredentialsEncoderBean;
import tigase.kernel.beans.Bean;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
public class ScramSha256CredentialsEntry
extends ScramCredentialsEntry {
private static final String ALGORITHM = "SHA-256";
public ScramSha256CredentialsEntry(PlainCredentialsEntry entry)
throws NoSuchAlgorithmException, InvalidKeyException {
super(ALGORITHM, entry);
}
public ScramSha256CredentialsEntry(byte[] salt, int iterations, byte[] saltedPassword)
throws NoSuchAlgorithmException, InvalidKeyException {
super(ALGORITHM, salt, iterations, saltedPassword);
}
public ScramSha256CredentialsEntry(byte[] salt, int iterations, byte[] storedKey, byte[] serverKey) {
super(ALGORITHM, salt, iterations, storedKey, serverKey);
}
@Bean(name = "SCRAM-SHA-256", parent = CredentialsDecoderBean.class, active = true)
public static class Decoder
extends ScramCredentialsEntry.Decoder {
public Decoder() {
super(ALGORITHM);
}
@Override
protected ScramSha256CredentialsEntry newInstance(byte[] salt, int iterations, byte[] saltedPassword) {
try {
return new ScramSha256CredentialsEntry(salt, iterations, saltedPassword);
} catch (NoSuchAlgorithmException | InvalidKeyException e) {
throw new RuntimeException(e);
}
}
protected ScramSha256CredentialsEntry newInstance(byte[] salt, int iterations, byte[] storedKey,
byte[] serverKey) {
return new ScramSha256CredentialsEntry(salt, iterations, storedKey, serverKey);
}
}
@Bean(name = "SCRAM-SHA-256", parent = CredentialsEncoderBean.class, active = true)
public static class Encoder
extends ScramCredentialsEntry.Encoder {
public Encoder() {
super(ALGORITHM);
}
}
}
================================================
FILE: src/main/java/tigase/auth/credentials/entries/ScramSha512CredentialsEntry.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.credentials.entries;
import tigase.auth.CredentialsDecoderBean;
import tigase.auth.CredentialsEncoderBean;
import tigase.kernel.beans.Bean;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
public class ScramSha512CredentialsEntry
extends ScramCredentialsEntry {
private static final String ALGORITHM = "SHA-512";
public ScramSha512CredentialsEntry(PlainCredentialsEntry entry)
throws NoSuchAlgorithmException, InvalidKeyException {
super(ALGORITHM, entry);
}
public ScramSha512CredentialsEntry(byte[] salt, int iterations, byte[] saltedPassword)
throws NoSuchAlgorithmException, InvalidKeyException {
super(ALGORITHM, salt, iterations, saltedPassword);
}
public ScramSha512CredentialsEntry(byte[] salt, int iterations, byte[] storedKey, byte[] serverKey) {
super(ALGORITHM, salt, iterations, storedKey, serverKey);
}
@Bean(name = "SCRAM-SHA-512", parent = CredentialsDecoderBean.class, active = false)
public static class Decoder
extends ScramCredentialsEntry.Decoder {
public Decoder() {
super(ALGORITHM);
}
@Override
protected ScramSha512CredentialsEntry newInstance(byte[] salt, int iterations, byte[] saltedPassword) {
try {
return new ScramSha512CredentialsEntry(salt, iterations, saltedPassword);
} catch (NoSuchAlgorithmException | InvalidKeyException e) {
throw new RuntimeException(e);
}
}
protected ScramSha512CredentialsEntry newInstance(byte[] salt, int iterations, byte[] storedKey,
byte[] serverKey) {
return new ScramSha512CredentialsEntry(salt, iterations, storedKey, serverKey);
}
}
@Bean(name = "SCRAM-SHA-512", parent = CredentialsEncoderBean.class, active = true)
public static class Encoder
extends ScramCredentialsEntry.Encoder {
public Encoder() {
super(ALGORITHM);
}
}
}
================================================
FILE: src/main/java/tigase/auth/credentials/entries/XTokenCredentialsEntry.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.credentials.entries;
import tigase.auth.CredentialsDecoderBean;
import tigase.auth.CredentialsEncoderBean;
import tigase.auth.credentials.Credentials;
import tigase.auth.mechanisms.SaslXTOKEN;
import tigase.kernel.beans.Bean;
import tigase.kernel.beans.config.ConfigField;
import tigase.util.Base64;
import tigase.xmpp.jid.BareJID;
public class XTokenCredentialsEntry
implements Credentials.Entry {
private final byte[] secretKey;
private boolean oneTime;
public XTokenCredentialsEntry(byte[] secretKey, boolean oneTime) {
this.secretKey = secretKey;
this.oneTime = oneTime;
}
public byte[] getSecretKey() {
return secretKey;
}
public boolean isOneTime() {
return oneTime;
}
@Override
public String getMechanism() {
return SaslXTOKEN.NAME;
}
@Override
public boolean verifyPlainPassword(String plain) {
return false;
}
public String encoded() {
return "t=" + Base64.encode(getSecretKey()) + ",o=" + isOneTime();
}
@Bean(name = SaslXTOKEN.NAME, parent = CredentialsDecoderBean.class, active = false)
public static class Decoder
implements Credentials.Decoder {
@ConfigField(desc = "Mechanism name")
private String name;
@Override
public XTokenCredentialsEntry decode(BareJID user, String value) {
byte[] secretKey = null;
boolean isOT = false;
int pos = 0;
while (pos < value.length()) {
char c = value.charAt(pos);
int x = value.indexOf(",", pos + 2);
String part = value.substring(pos + 2, x == -1 ? value.length() : x);
switch (c) {
case 't':
secretKey = Base64.decode(part);
break;
case 'o':
isOT = Boolean.parseBoolean(part);
break;
}
if (x == -1) {
break;
} else {
pos = x + 1;
}
}
if (secretKey == null) {
throw new RuntimeException("secret key cannot be null!");
}
return new XTokenCredentialsEntry(secretKey, isOT);
}
@Override
public String getName() {
return name;
}
}
@Bean(name = SaslXTOKEN.NAME, parent = CredentialsEncoderBean.class, active = false)
public static class Encoder
implements Credentials.Encoder {
@ConfigField(desc = "Mechanism name")
private String name;
@Override
public String encode(BareJID user, String password) {
return null;
}
@Override
public String encode(BareJID user, XTokenCredentialsEntry entry) {
return entry.encoded();
}
@Override
public String getName() {
return name;
}
}
}
================================================
FILE: src/main/java/tigase/auth/impl/AuthRepoPlainCallbackHandler.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.impl;
import tigase.annotations.TigaseDeprecated;
import tigase.auth.AuthRepositoryAware;
import tigase.auth.DomainAware;
import tigase.auth.XmppSaslException;
import tigase.auth.callbacks.VerifyPasswordCallback;
import tigase.auth.mechanisms.AbstractSasl;
import tigase.db.AuthRepository;
import tigase.db.TigaseDBException;
import tigase.xmpp.jid.BareJID;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.sasl.AuthorizeCallback;
import javax.security.sasl.RealmCallback;
import javax.security.sasl.SaslException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import static tigase.db.AuthRepository.*;
/**
* This is implementation of {@linkplain CallbackHandler} to use with old {@linkplain AuthRepository AuthRepositories}.
* Callback {@linkplain VerifyPasswordCallback} uses method {@linkplain tigase.db.AuthRepositoryImpl#plainAuth(BareJID, String)} to
* password verification.
*/
@Deprecated
@TigaseDeprecated(since = "8.0.0")
public class AuthRepoPlainCallbackHandler
implements CallbackHandler, AuthRepositoryAware, DomainAware {
protected String domain;
protected BareJID jid = null;
protected Logger log = Logger.getLogger(this.getClass().getName());
protected AuthRepository repo;
@Override
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Callback: {0}", callbacks[i].getClass().getSimpleName());
}
handleCallback(callbacks[i]);
}
}
@Override
public void setAuthRepository(AuthRepository repo) {
this.repo = repo;
}
@Override
public void setDomain(String domain) {
this.domain = domain;
}
@SuppressWarnings("unused")
protected void handleAuthorizeCallback(AuthorizeCallback authCallback) throws SaslException {
String authenId = authCallback.getAuthenticationID();
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "AuthorizeCallback: authenId: {0}", authenId);
}
try {
final AccountStatus accountStatus = repo.getAccountStatus(jid);
if (accountStatus.isInactive()) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "User {0} is disabled, status: {1}", new Object[] {jid, accountStatus});
}
throw XmppSaslException.getExceptionFor(accountStatus);
}
} catch (TigaseDBException e) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Cannot check if user " + jid + " is enabled", e);
}
}
String authorId = authCallback.getAuthorizationID();
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "AuthorizeCallback: authorId: {0}", authorId);
}
if (AbstractSasl.isAuthzIDIgnored() || authenId.equals(authorId)) {
authCallback.setAuthorized(true);
}
}
protected void handleCallback(Callback callback) throws UnsupportedCallbackException, IOException {
if (callback instanceof RealmCallback) {
handleRealmCallback((RealmCallback) callback);
} else if (callback instanceof NameCallback) {
handleNameCallback((NameCallback) callback);
} else if (callback instanceof VerifyPasswordCallback) {
handleVerifyPasswordCallback((VerifyPasswordCallback) callback);
} else if (callback instanceof AuthorizeCallback) {
handleAuthorizeCallback((AuthorizeCallback) callback);
} else {
throw new UnsupportedCallbackException(callback, "Unrecognized Callback");
}
}
protected void handleNameCallback(NameCallback nc) throws IOException {
String user_name = nc.getDefaultName();
jid = BareJID.bareJIDInstanceNS(user_name, domain);
nc.setName(jid.toString());
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "NameCallback: {0}", user_name);
}
}
protected void handleRealmCallback(RealmCallback rc) throws IOException {
String realm = domain;
if (realm != null) {
rc.setText(realm);
} // end of if (realm == null)
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "RealmCallback: {0}", realm);
}
}
protected void handleVerifyPasswordCallback(VerifyPasswordCallback pc) throws IOException {
String passwd = pc.getPassword();
try {
Map map = new HashMap();
map.put(PROTOCOL_KEY, PROTOCOL_VAL_NONSASL);
map.put(USER_ID_KEY, jid);
map.put(PASSWORD_KEY, passwd);
map.put(REALM_KEY, jid.getDomain());
map.put(SERVER_NAME_KEY, jid.getDomain());
pc.setVerified(repo.otherAuth(map));
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "VerifyPasswordCallback: {0}", "******");
}
} catch (Exception e) {
pc.setVerified(false);
throw new IOException("Password verification problem.", e);
}
}
}
================================================
FILE: src/main/java/tigase/auth/impl/CertBasedCallbackHandler.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.impl;
import tigase.auth.SessionAware;
import tigase.auth.callbacks.ValidateCertificateData;
import tigase.auth.mechanisms.SaslEXTERNAL;
import tigase.cert.CertificateUtil;
import tigase.util.stringprep.TigaseStringprepException;
import tigase.xmpp.XMPPResourceConnection;
import tigase.xmpp.jid.BareJID;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
import java.io.IOException;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
public class CertBasedCallbackHandler
implements CallbackHandler, SessionAware {
protected Logger log = Logger.getLogger(this.getClass().getName());
private XMPPResourceConnection session;
@Override
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
try {
for (int i = 0; i < callbacks.length; i++) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Callback: {0}", callbacks[i].getClass().getSimpleName());
}
if (callbacks[i] instanceof ValidateCertificateData) {
ValidateCertificateData authCallback = ((ValidateCertificateData) callbacks[i]);
final String domain = session.getDomain().getVhost().getDomain();
final BareJID defaultAuthzid = authCallback.getDefaultAuthzid();
if (defaultAuthzid != null && !defaultAuthzid.getDomain().equals(domain)) {
return;
}
Certificate cert = (Certificate) session.getSessionData(SaslEXTERNAL.PEER_CERTIFICATE_KEY);
final List authJIDs = CertificateUtil.extractXmppAddrs((X509Certificate) cert);
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "{0}, Found authJIDs: {1} in certificate: {1}",
new Object[]{session, authJIDs, CertificateUtil.getCertCName(((X509Certificate) cert))});
}
for (String string : authJIDs) {
if (defaultAuthzid != null) {
if (string.equals(defaultAuthzid.toString())) {
authCallback.setAuthorized(true);
authCallback.setAuthorizedID(string);
}
} else if (BareJID.bareJIDInstance(string).getDomain().equals(domain)) {
authCallback.setAuthorized(true);
authCallback.setAuthorizedID(string);
}
}
} else {
throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
}
}
} catch (TigaseStringprepException e) {
throw new RuntimeException(e);
}
}
@Override
public void setSession(XMPPResourceConnection session) {
this.session = session;
}
}
================================================
FILE: src/main/java/tigase/auth/impl/PlainCallbackHandler.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.impl;
import tigase.auth.AuthRepositoryAware;
import tigase.auth.DomainAware;
import tigase.auth.SessionAware;
import tigase.auth.XmppSaslException;
import tigase.auth.callbacks.AuthorizationIdCallback;
import tigase.auth.callbacks.VerifyPasswordCallback;
import tigase.auth.credentials.Credentials;
import tigase.auth.mechanisms.AbstractSasl;
import tigase.db.AuthRepository;
import tigase.db.UserNotFoundException;
import tigase.util.stringprep.TigaseStringprepException;
import tigase.xmpp.XMPPResourceConnection;
import tigase.xmpp.jid.BareJID;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.sasl.AuthorizeCallback;
import javax.security.sasl.RealmCallback;
import javax.security.sasl.SaslException;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import static tigase.auth.CallbackHandlerFactory.AUTH_JID;
import static tigase.auth.credentials.Credentials.DEFAULT_CREDENTIAL_ID;
/**
* Implementation of CallbackHandler for authentication with SASL PLAIN or using plaintext password.
*/
public class PlainCallbackHandler
implements CallbackHandler, AuthRepositoryAware, DomainAware, SessionAware {
protected String domain;
protected BareJID jid = null;
protected Logger log = Logger.getLogger(this.getClass().getName());
protected AuthRepository repo;
private boolean loggingInForbidden = false;
private XMPPResourceConnection session;
private String credentialId;
@Override
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Callback: {0}", callbacks[i].getClass().getSimpleName());
}
handleCallback(callbacks[i]);
}
}
@Override
public void setAuthRepository(AuthRepository repo) {
this.repo = repo;
}
@Override
public void setDomain(String domain) {
this.domain = domain;
}
@Override
public void setSession(XMPPResourceConnection session) {
this.session = session;
}
protected void handleAuthorizeCallback(AuthorizeCallback authCallback) {
String authenId = authCallback.getAuthenticationID();
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "AuthorizeCallback: authenId: {0}", authenId);
}
if (loggingInForbidden) {
authCallback.setAuthorized(false);
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "User {0} is disabled", jid);
}
return;
}
String authorId = authCallback.getAuthorizationID();
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "AuthorizeCallback: authorId: {0}", authorId);
}
authCallback.setAuthorized(true);
session.removeSessionData(AUTH_JID);
}
protected void handleCallback(Callback callback) throws UnsupportedCallbackException, IOException {
if (callback instanceof RealmCallback) {
handleRealmCallback((RealmCallback) callback);
} else if (callback instanceof NameCallback) {
handleNameCallback((NameCallback) callback);
} else if (callback instanceof AuthorizationIdCallback) {
handleAuthorizationIdCallback((AuthorizationIdCallback) callback);
} else if (callback instanceof VerifyPasswordCallback) {
handleVerifyPasswordCallback((VerifyPasswordCallback) callback);
} else if (callback instanceof AuthorizeCallback) {
handleAuthorizeCallback((AuthorizeCallback) callback);
} else {
throw new UnsupportedCallbackException(callback, "Unrecognized Callback");
}
}
protected void handleNameCallback(NameCallback nc) throws IOException {
credentialId = DEFAULT_CREDENTIAL_ID;
BareJID jid = BareJID.bareJIDInstanceNS(nc.getDefaultName());
if (jid.getLocalpart() == null || !domain.equalsIgnoreCase(jid.getDomain())) {
jid = BareJID.bareJIDInstanceNS(nc.getDefaultName(), domain);
}
setJid(jid);
nc.setName(jid.toString());
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "NameCallback: {0}", credentialId);
}
}
protected void handleRealmCallback(RealmCallback rc) throws IOException {
String realm = domain;
if (realm != null) {
rc.setText(realm);
} // end of if (realm == null)
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "RealmCallback: {0}", realm);
}
}
protected void handleVerifyPasswordCallback(VerifyPasswordCallback pc) throws IOException {
final String password = pc.getPassword();
try {
Credentials credentials = repo.getCredentials(jid, credentialId);
log.log(Level.FINE,
"Fetched credentials for: " + jid + " with credentialsId: " + credentialId + ", credentials: " +
credentials);
Credentials.Entry entry = credentials.getEntryForMechanism("PLAIN");
if (entry == null) {
entry = credentials.getFirst();
}
loggingInForbidden = !credentials.canLogin();
if (loggingInForbidden) {
throw XmppSaslException.getExceptionFor(credentials.getAccountStatus());
}
final boolean verified = !loggingInForbidden && entry != null && entry.verifyPlainPassword(password);
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Verification result: {0}, loggingInForbidden: {1}, entry: {2}, credentials: {3}",
new Object[]{verified, loggingInForbidden, entry, credentials});
}
pc.setVerified(verified);
} catch (UserNotFoundException e) {
log.log(Level.FINE, "User not found: " + e);
pc.setVerified(false);
} catch (SaslException e) {
log.log(Level.FINE, "User inactive: " + e);
throw e;
} catch (Exception e) {
throw new IOException("Password verification problem.", e);
}
}
private void handleAuthorizationIdCallback(AuthorizationIdCallback callback) throws XmppSaslException {
if (!AbstractSasl.isAuthzIDIgnored() && callback.getAuthzId() != null &&
!callback.getAuthzId().equals(jid.toString())) {
try {
credentialId = jid.getLocalpart();
setJid(BareJID.bareJIDInstance(callback.getAuthzId()));
} catch (TigaseStringprepException ex) {
log.warning("Malformed AuthorizationId: " + ex.getMessage());
throw new XmppSaslException(XmppSaslException.SaslError.invalid_authzid);
}
} else {
credentialId = DEFAULT_CREDENTIAL_ID;
callback.setAuthzId(jid.toString());
}
}
private void setJid(BareJID jid) {
this.jid = jid;
if (jid != null) {
this.session.putSessionData(AUTH_JID, jid);
}
}
}
================================================
FILE: src/main/java/tigase/auth/impl/PlainSPCallbackHandler.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.impl;
import tigase.annotations.TigaseDeprecated;
import tigase.auth.AuthRepositoryAware;
import tigase.auth.DomainAware;
import tigase.auth.callbacks.VerifyPasswordCallback;
import tigase.auth.mechanisms.AbstractSasl;
import tigase.auth.mechanisms.AbstractSaslSCRAM;
import tigase.db.AuthRepository;
import tigase.db.TigaseDBException;
import tigase.util.Base64;
import tigase.xmpp.jid.BareJID;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.sasl.AuthorizeCallback;
import javax.security.sasl.RealmCallback;
import javax.security.sasl.SaslException;
import java.io.IOException;
import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* This is implementation of {@linkplain CallbackHandler} to use with old {@linkplain AuthRepository AuthRepositories}.
* Callback {@linkplain VerifyPasswordCallback} uses method {@linkplain tigase.db.AuthRepositoryImpl#plainAuth(BareJID, String)} to
* password verification.
*/
@Deprecated
@TigaseDeprecated(since = "8.0.0")
public class PlainSPCallbackHandler
implements CallbackHandler, AuthRepositoryAware, DomainAware {
protected String domain;
protected BareJID jid = null;
protected Logger log = Logger.getLogger(this.getClass().getName());
protected AuthRepository repo;
@Override
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Callback: {0}", callbacks[i].getClass().getSimpleName());
}
handleCallback(callbacks[i]);
}
}
@Override
public void setAuthRepository(AuthRepository repo) {
this.repo = repo;
}
@Override
public void setDomain(String domain) {
this.domain = domain;
}
protected void handleAuthorizeCallback(AuthorizeCallback authCallback) {
String authenId = authCallback.getAuthenticationID();
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "AuthorizeCallback: authenId: {0}", authenId);
}
try {
final AuthRepository.AccountStatus accountStatus = repo.getAccountStatus(jid);
if (accountStatus.isInactive()) {
authCallback.setAuthorized(false);
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "User {0} is disabled", jid);
}
return;
}
} catch (TigaseDBException e) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Cannot check if user " + jid + " is enabled", e);
}
}
String authorId = authCallback.getAuthorizationID();
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "AuthorizeCallback: authorId: {0}", authorId);
}
if (AbstractSasl.isAuthzIDIgnored() || authenId.equals(authorId)) {
authCallback.setAuthorized(true);
}
}
protected void handleCallback(Callback callback) throws UnsupportedCallbackException, IOException {
if (callback instanceof RealmCallback) {
handleRealmCallback((RealmCallback) callback);
} else if (callback instanceof NameCallback) {
handleNameCallback((NameCallback) callback);
} else if (callback instanceof VerifyPasswordCallback) {
handleVerifyPasswordCallback((VerifyPasswordCallback) callback);
} else if (callback instanceof AuthorizeCallback) {
handleAuthorizeCallback((AuthorizeCallback) callback);
} else {
throw new UnsupportedCallbackException(callback, "Unrecognized Callback");
}
}
protected void handleNameCallback(NameCallback nc) throws IOException {
String user_name = nc.getDefaultName();
jid = BareJID.bareJIDInstanceNS(user_name, domain);
nc.setName(jid.toString());
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "NameCallback: {0}", user_name);
}
}
protected void handleRealmCallback(RealmCallback rc) throws IOException {
String realm = domain;
if (realm != null) {
rc.setText(realm);
} // end of if (realm == null)
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "RealmCallback: {0}", realm);
}
}
protected void handleVerifyPasswordCallback(VerifyPasswordCallback pc) throws IOException {
final String password = pc.getPassword();
try {
String pwd = repo.getPassword(jid);
if (pwd == null) {
throw new SaslException("User " + jid + " not found.");
}
byte[] buffer = Base64.decode(pwd);
byte[] salt = new byte[20];
byte[] saltedPassword = new byte[20];
System.arraycopy(buffer, 0, salt, 0, salt.length);
System.arraycopy(buffer, salt.length, saltedPassword, 0, saltedPassword.length);
byte[] np = AbstractSaslSCRAM.hi("SHA1", AbstractSaslSCRAM.normalize(password), salt, 4096);
pc.setVerified(Arrays.equals(saltedPassword, np));
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "VerifyPasswordCallback: {0}", "******");
}
} catch (Exception e) {
pc.setVerified(false);
throw new IOException("Password verification problem.", e);
}
}
}
================================================
FILE: src/main/java/tigase/auth/impl/ScramCallbackHandler.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.impl;
import tigase.auth.*;
import tigase.auth.callbacks.*;
import tigase.auth.credentials.Credentials;
import tigase.auth.credentials.entries.PlainCredentialsEntry;
import tigase.auth.credentials.entries.ScramCredentialsEntry;
import tigase.auth.mechanisms.AbstractSasl;
import tigase.auth.mechanisms.AbstractSaslSCRAM;
import tigase.db.AuthRepository;
import tigase.util.Base64;
import tigase.xmpp.XMPPResourceConnection;
import tigase.xmpp.jid.BareJID;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.sasl.AuthorizeCallback;
import javax.security.sasl.SaslException;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.cert.X509Certificate;
import java.util.logging.Level;
import java.util.logging.Logger;
import static tigase.auth.CallbackHandlerFactory.AUTH_JID;
import static tigase.auth.credentials.Credentials.DEFAULT_CREDENTIAL_ID;
/**
* Implementation of CallbackHandler to support authentication using SASL SCRAM-* authentication mechanism.
*/
public class ScramCallbackHandler
implements CallbackHandler, AuthRepositoryAware, SessionAware, DomainAware, MechanismNameAware {
private static final Logger log = Logger.getLogger(ScramCallbackHandler.class.getCanonicalName());
private String credentialId = null;
private ScramCredentialsEntry credentialsEntry;
private boolean credentialsFetched;
private String domain;
private BareJID jid = null;
private boolean loggingInForbidden = false;
private String mechanismName;
private AuthRepository repo;
private XMPPResourceConnection session;
public ScramCallbackHandler() {
}
@Override
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Callback: {0}", callbacks[i].getClass().getSimpleName());
}
handleCallback(callbacks[i]);
}
}
@Override
public void setAuthRepository(AuthRepository repo) {
this.repo = repo;
}
@Override
public void setDomain(String domain) {
this.domain = domain;
}
@Override
public void setMechanismName(String mechanismName) {
this.mechanismName = mechanismName;
}
@Override
public void setSession(XMPPResourceConnection session) {
this.session = session;
}
protected void handleAuthorizeCallback(AuthorizeCallback authCallback) throws SaslException {
String authenId = authCallback.getAuthenticationID();
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "AuthorizeCallback: authenId: {0}", authenId);
}
fetchCredentials();
if (loggingInForbidden) {
authCallback.setAuthorized(false);
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "User {0} is disabled", jid);
}
return;
}
String authorId = authCallback.getAuthorizationID();
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "AuthorizeCallback: authorId: {0}", authorId);
}
authCallback.setAuthorized(true);
session.removeSessionData(AUTH_JID);
}
protected void handleCallback(Callback callback) throws UnsupportedCallbackException, IOException {
if (callback instanceof XMPPSessionCallback) {
((XMPPSessionCallback) callback).setSession(session);
} else if (callback instanceof ChannelBindingCallback) {
handleChannelBindingCallback((ChannelBindingCallback) callback);
} else if (callback instanceof PBKDIterationsCallback) {
handlePBKDIterationsCallback((PBKDIterationsCallback) callback);
} else if (callback instanceof NameCallback) {
handleNameCallback((NameCallback) callback);
} else if (callback instanceof AuthorizationIdCallback) {
handleAuthorizationIdCallback((AuthorizationIdCallback) callback);
} else if (callback instanceof SaltCallback) {
handleSaltCallback((SaltCallback) callback);
} else if (callback instanceof ServerKeyCallback serverKeyCallback) {
handleServerKeyCallback(serverKeyCallback);
} else if (callback instanceof StoredKeyCallback storedKeyCallback) {
handleStoredKeyCallback(storedKeyCallback);
} else if (callback instanceof AuthorizeCallback) {
handleAuthorizeCallback((AuthorizeCallback) callback);
} else {
throw new UnsupportedCallbackException(callback, "Unrecognized Callback " + callback);
}
}
protected void handleNameCallback(NameCallback nc) throws IOException {
credentialId = DEFAULT_CREDENTIAL_ID;
BareJID jid = BareJID.bareJIDInstanceNS(nc.getDefaultName());
if (jid.getLocalpart() == null || !domain.equalsIgnoreCase(jid.getDomain())) {
jid = BareJID.bareJIDInstanceNS(nc.getDefaultName(), domain);
}
setJid(jid);
nc.setName(jid.toString());
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "NameCallback: {0}", credentialId);
}
}
protected void handlePBKDIterationsCallback(PBKDIterationsCallback callback) throws SaslException {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "PBKDIterationsCallback: {0}", jid);
}
fetchCredentials();
if (credentialsEntry != null) {
callback.setInterations(credentialsEntry.getIterations());
}
}
protected void handleSaltCallback(SaltCallback callback) throws SaslException {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "SaltCallback: {0}", jid);
}
fetchCredentials();
if (credentialsEntry != null) {
callback.setSalt(credentialsEntry.getSalt());
} else {
callback.setSalt(null);
}
}
private void fetchCredentials() throws SaslException {
if (credentialsFetched) {
return;
}
try {
Credentials credentials = repo.getCredentials(jid, credentialId);
log.log(Level.FINE,
"Fetched credentials for: " + jid + " with credentialsId: " + credentialId + ", credentials: " +
credentials);
if (credentials == null) {
loggingInForbidden = true;
} else {
String mech = mechanismName.endsWith("-PLUS") ? mechanismName.substring(0, mechanismName.length() -
"-PLUS".length()) : mechanismName;
Credentials.Entry entry = credentials.getEntryForMechanism(mech);
if (entry == null) {
entry = credentials.getEntryForMechanism("PLAIN");
}
if (entry instanceof ScramCredentialsEntry) {
credentialsEntry = (ScramCredentialsEntry) entry;
} else if (entry instanceof PlainCredentialsEntry) {
credentialsEntry = new ScramCredentialsEntry(mech.replace("SCRAM-", ""),
(PlainCredentialsEntry) entry);
}
loggingInForbidden = !credentials.canLogin();
if (loggingInForbidden) {
throw XmppSaslException.getExceptionFor(credentials.getAccountStatus());
}
}
} catch (SaslException e) {
throw e;
} catch (Exception ex) {
log.log(Level.FINE, "Could not retrieve credentials for user " + jid + " with credentialId " + credentialId,
ex);
}
credentialsFetched = true;
}
private void handleAuthorizationIdCallback(AuthorizationIdCallback callback) {
if (!AbstractSasl.isAuthzIDIgnored() && callback.getAuthzId() != null &&
!callback.getAuthzId().equals(jid.toString())) {
try {
credentialId = jid.getLocalpart();
setJid(BareJID.bareJIDInstance(callback.getAuthzId()));
} catch (Exception ex) {
throw new RuntimeException(ex);
}
} else {
credentialId = DEFAULT_CREDENTIAL_ID;
callback.setAuthzId(jid.toString());
}
}
private void handleChannelBindingCallback(ChannelBindingCallback callback) {
if (callback.getRequestedBindType() == AbstractSaslSCRAM.BindType.tls_exporter) {
callback.setBindingData((byte[]) session.getSessionData(AbstractSaslSCRAM.TLS_EXPORTER_KEY));
} else if (callback.getRequestedBindType() == AbstractSaslSCRAM.BindType.tls_unique) {
callback.setBindingData((byte[]) session.getSessionData(AbstractSaslSCRAM.TLS_UNIQUE_ID_KEY));
} else if (callback.getRequestedBindType() == AbstractSaslSCRAM.BindType.tls_server_end_point) {
try {
X509Certificate cert = (X509Certificate) session.getSessionData(
AbstractSaslSCRAM.LOCAL_CERTIFICATE_KEY);
String usealgo;
final String algo = cert.getSigAlgName();
int withIdx = algo.indexOf("with");
if (withIdx <= 0) {
throw new RuntimeException("Unable to parse SigAlgName: " + algo);
}
usealgo = algo.substring(0, withIdx);
if (usealgo.equalsIgnoreCase("MD5") || usealgo.equalsIgnoreCase("SHA1")) {
usealgo = "SHA-256";
}
final MessageDigest md = MessageDigest.getInstance(usealgo);
final byte[] der = cert.getEncoded();
md.update(der);
callback.setBindingData(md.digest());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Channel binding {0}: {1} in session-id {2}",
new Object[]{callback.getRequestedBindType(),
callback.getBindingData() == null ? "null" : Base64.encode(callback.getBindingData()),
session});
}
}
private void handleServerKeyCallback(ServerKeyCallback callback) throws SaslException {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "ServerKeyCallback: {0}", jid);
}
fetchCredentials();
if (credentialsEntry != null) {
callback.setServerKey(credentialsEntry.getServerKey());
} else {
callback.setServerKey(null);
}
}
private void handleStoredKeyCallback(StoredKeyCallback callback) throws SaslException {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "StoredKeyCallback: {0}", jid);
}
fetchCredentials();
if (credentialsEntry != null) {
callback.setStoredKey(credentialsEntry.getStoredKey());
} else {
callback.setStoredKey(null);
}
}
private void setJid(BareJID jid) {
this.jid = jid;
if (jid != null) {
this.session.putSessionData(AUTH_JID, jid);
}
}
}
================================================
FILE: src/main/java/tigase/auth/impl/XTokenCallbackHandler.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.impl;
import tigase.auth.AuthRepositoryAware;
import tigase.auth.DomainAware;
import tigase.auth.SessionAware;
import tigase.auth.XmppSaslException;
import tigase.auth.callbacks.AuthorizationIdCallback;
import tigase.auth.callbacks.ReplaceServerKeyCallback;
import tigase.auth.callbacks.ServerKeyCallback;
import tigase.auth.callbacks.SharedSecretKeyCallback;
import tigase.auth.credentials.Credentials;
import tigase.auth.credentials.entries.XTokenCredentialsEntry;
import tigase.auth.mechanisms.AbstractSasl;
import tigase.auth.mechanisms.SaslXTOKEN;
import tigase.db.AuthRepository;
import tigase.db.TigaseDBException;
import tigase.util.Base64;
import tigase.util.stringprep.TigaseStringprepException;
import tigase.xmpp.XMPPResourceConnection;
import tigase.xmpp.jid.BareJID;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.sasl.AuthorizeCallback;
import javax.security.sasl.RealmCallback;
import javax.security.sasl.SaslException;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.logging.Level;
import java.util.logging.Logger;
import static tigase.auth.CallbackHandlerFactory.AUTH_JID;
import static tigase.auth.credentials.Credentials.DEFAULT_CREDENTIAL_ID;
public class XTokenCallbackHandler implements CallbackHandler, AuthRepositoryAware, DomainAware, SessionAware {
protected String domain;
protected BareJID jid = null;
protected Logger log = Logger.getLogger(this.getClass().getName());
protected AuthRepository repo;
private boolean loggingInForbidden = false;
private XMPPResourceConnection session;
private String credentialId;
private XTokenCredentialsEntry entry;
@Override
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Callback: {0}", callbacks[i].getClass().getSimpleName());
}
handleCallback(callbacks[i]);
}
}
@Override
public void setAuthRepository(AuthRepository repo) {
this.repo = repo;
}
@Override
public void setDomain(String domain) {
this.domain = domain;
}
@Override
public void setSession(XMPPResourceConnection session) {
this.session = session;
}
protected void handleAuthorizeCallback(AuthorizeCallback authCallback) {
String authenId = authCallback.getAuthenticationID();
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "AuthorizeCallback: authenId: {0}", authenId);
}
if (loggingInForbidden) {
authCallback.setAuthorized(false);
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "User {0} is disabled", jid);
}
return;
}
String authorId = authCallback.getAuthorizationID();
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "AuthorizeCallback: authorId: {0}", authorId);
}
authCallback.setAuthorized(true);
session.removeSessionData(AUTH_JID);
}
protected void handleCallback(Callback callback) throws UnsupportedCallbackException, IOException {
if (callback instanceof RealmCallback) {
handleRealmCallback((RealmCallback) callback);
} else if (callback instanceof NameCallback) {
handleNameCallback((NameCallback) callback);
} else if (callback instanceof AuthorizationIdCallback) {
handleAuthorizationIdCallback((AuthorizationIdCallback) callback);
} else if (callback instanceof ServerKeyCallback) {
handleServerKeyCallback((ServerKeyCallback) callback);
} else if (callback instanceof AuthorizeCallback) {
handleAuthorizeCallback((AuthorizeCallback) callback);
} else if (callback instanceof ReplaceServerKeyCallback) {
handleReplaceServerKeyCallback((ReplaceServerKeyCallback) callback);
} else if (callback instanceof SharedSecretKeyCallback) {
handleSharedSecretKeyCallback((SharedSecretKeyCallback) callback);
} else {
throw new UnsupportedCallbackException(callback, "Unrecognized Callback");
}
}
protected void handleNameCallback(NameCallback nc) throws IOException {
credentialId = DEFAULT_CREDENTIAL_ID;
BareJID jid = BareJID.bareJIDInstanceNS(nc.getDefaultName());
if (jid.getLocalpart() == null || !domain.equalsIgnoreCase(jid.getDomain())) {
jid = BareJID.bareJIDInstanceNS(nc.getDefaultName(), domain);
}
setJid(jid);
nc.setName(jid.toString());
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "NameCallback: {0}", credentialId);
}
}
protected void handleRealmCallback(RealmCallback rc) throws IOException {
String realm = domain;
if (realm != null) {
rc.setText(realm);
} // end of if (realm == null)
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "RealmCallback: {0}", realm);
}
}
protected void handleServerKeyCallback(ServerKeyCallback pc) throws IOException {
try {
Credentials credentials = repo.getCredentials(jid, credentialId);
log.log(Level.FINE,
"Fetched credentials for: " + jid + " with credentialsId: " + credentialId + ", credentials: " +
credentials);
entry = (XTokenCredentialsEntry) credentials.getEntryForMechanism(SaslXTOKEN.NAME);
loggingInForbidden = !credentials.canLogin();
if (loggingInForbidden) {
throw XmppSaslException.getExceptionFor(credentials.getAccountStatus());
}
pc.setServerKey(entry.getSecretKey());
} catch (SaslException e) {
log.log(Level.FINE, "User inactive: " + e);
throw e;
} catch (Exception ex) {
log.log(Level.FINE, "Could not retrieve credentials for user " + jid + " with credentialId " + credentialId,
ex);
}
}
private void handleAuthorizationIdCallback(AuthorizationIdCallback callback) throws XmppSaslException {
if (!AbstractSasl.isAuthzIDIgnored() && callback.getAuthzId() != null &&
!callback.getAuthzId().equals(jid.toString())) {
try {
credentialId = jid.getLocalpart();
setJid(BareJID.bareJIDInstance(callback.getAuthzId()));
} catch (TigaseStringprepException ex) {
log.warning("Malformed AuthorizationId: " + ex.getMessage());
throw new XmppSaslException(XmppSaslException.SaslError.invalid_authzid);
}
} else {
credentialId = DEFAULT_CREDENTIAL_ID;
callback.setAuthzId(jid.toString());
}
}
private void handleReplaceServerKeyCallback(ReplaceServerKeyCallback callback) throws XmppSaslException {
try {
if (entry != null && entry.isOneTime()) {
byte[] data = SaslXTOKEN.generateSecretKey();
repo.updateCredential(jid, credentialId, SaslXTOKEN.NAME, "t=" + Base64.encode(data) + ",o=" + false);
callback.setNewServerKey(data);
}
} catch (TigaseDBException e) {
throw new XmppSaslException(XmppSaslException.SaslError.temporary_auth_failure);
}
}
private void handleSharedSecretKeyCallback(SharedSecretKeyCallback sskc) {
String appKey = System.getProperty("client-application-secret");
if (appKey != null) {
sskc.setSecret(appKey.getBytes(StandardCharsets.UTF_8));
}
}
private void setJid(BareJID jid) {
this.jid = jid;
if (jid != null) {
this.session.putSessionData(AUTH_JID, jid);
}
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/AbstractSasl.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import tigase.auth.XmppSaslException;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.sasl.SaslException;
import javax.security.sasl.SaslServer;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;
public abstract class AbstractSasl
implements SaslServer {
public static final String SASL_STRICT_MODE_KEY = "sasl-strict";
public static String PASSWORD_NOT_VERIFIED_MSG = "Password not verified";
protected final CallbackHandler callbackHandler;
protected final Logger log = Logger.getLogger(this.getClass().getName());
protected final Map negotiatedProperty = new HashMap();
protected final Map super String, ?> props;
protected String authorizedId = null;
protected boolean complete = false;
public static boolean isAuthzIDIgnored() {
String x = System.getProperty(SASL_STRICT_MODE_KEY, "true");
return !Boolean.parseBoolean(x);
}
protected static final boolean isEmpty(Object x) {
return x == null || x.toString().length() == 0;
}
protected AbstractSasl(Map super String, ?> props, CallbackHandler callbackHandler) {
this.props = props;
this.callbackHandler = callbackHandler;
}
@Override
public void dispose() {
this.authorizedId = null;
}
@Override
public Object getNegotiatedProperty(String propName) {
if (!isComplete()) {
throw new IllegalStateException("Server negotiation not complete");
}
return negotiatedProperty.get(propName);
}
protected void handleCallbacks(Callback... callbacks) throws SaslException {
try {
callbackHandler.handle(callbacks);
} catch (XmppSaslException e) {
throw e;
} catch (IOException e) {
throw new SaslException(e.getMessage(), e);
} catch (UnsupportedCallbackException e) {
throw new SaslException("Callback not supported by handler", e);
}
}
@Override
public boolean isComplete() {
return complete;
}
protected String[] split(final byte[] byteArray, final String defaultValue) {
if (byteArray == null) {
return new String[]{};
}
ArrayList result = new ArrayList();
int pi = 0;
for (int i = 0; i < byteArray.length; i++) {
if (byteArray[i] == 0) {
String item;
if (pi == i) {
item = defaultValue;
pi = i + 1;
} else {
item = new String(byteArray, pi, i - pi);
pi = i + 1;
}
result.add(item);
}
}
if (pi < byteArray.length) {
String item = new String(byteArray, pi, byteArray.length - pi);
result.add(item);
} else {
result.add(defaultValue);
}
return result.toArray(new String[]{});
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/AbstractSaslSCRAM.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import tigase.auth.SaslInvalidLoginExcepion;
import tigase.auth.XmppSaslException;
import tigase.auth.XmppSaslException.SaslError;
import tigase.auth.callbacks.*;
import tigase.util.Base64;
import tigase.xml.Element;
import tigase.xmpp.XMPPResourceConnection;
import javax.crypto.Mac;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.sasl.AuthorizeCallback;
import javax.security.sasl.SaslException;
import java.io.ByteArrayOutputStream;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Map;
import java.util.Random;
import java.util.logging.Level;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public abstract class AbstractSaslSCRAM
extends AbstractSasl {
public static final String TLS_UNIQUE_ID_KEY = "TLS_UNIQUE_ID_KEY";
public static final String TLS_EXPORTER_KEY = "TLS_EXPORTER_KEY";
public static final String LOCAL_CERTIFICATE_KEY = "LOCAL_CERTIFICATE_KEY";
private static final Charset CHARSET = StandardCharsets.UTF_8;
final static byte[] DEFAULT_CLIENT_KEY = "Client Key".getBytes(CHARSET);
final static byte[] DEFAULT_SERVER_KEY = "Server Key".getBytes(CHARSET);
private final static String ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
private final static Pattern CLIENT_FIRST_MESSAGE = Pattern.compile(
"^(?(?:y|n|p=(?[a-zA-z0-9.-]+))," +
"(?:a=(?(?:[^,\\x00-\\x20]|=2C|=3D)+))?,)(?(?m=[^\\000=]+,)" +
"?n=(?(?:[^,\\x00-\\x20]|=2C|=3D)+),r=(?[^,\\x00-\\x20]+)(?:,.*)?)$");
private final static Pattern CLIENT_LAST_MESSAGE = Pattern.compile("^(?c=(?[a-zA-Z0-9/+=]+)," +
"r=(?[^,\\x00-\\x20]+)(?:,.*)?),p=(?[a-zA-Z0-9/+=]+)$");
public enum BindType {
/**
* Client doesn't support channel binding.
*/
n,
/**
* Client does support channel binding but thinks the server does not.
*/
y,
/**
* Client requires channel binding: tls-unique.
*/
tls_unique,
/**
* Client requires channel binding: tls-server-end-point.
*/
tls_server_end_point,
/**
* Client requires channel binding: tls-exporter.
*/
tls_exporter
}
private final String algorithm;
private final String hmacAlgorithm;
private final String mechanismName;
private final Random random = new SecureRandom();
private final String serverNonce;
private byte[] bindingData = null;
private String cfmAuthzid;
private String cfmBareMessage;
private String cfmGs2header;
private String cfmUsername;
private BindType requestedBindType;
private byte[] serverKey;
private String sfmMessage;
private String sfmNonce;
private Step step = Step.clientFirstMessage;
private byte[] storedKey;
public static Element getSupportedChannelBindings(XMPPResourceConnection session) {
Element bindings = new Element("sasl-channel-binding");
bindings.setXMLNS("urn:xmpp:sasl-cb:0");
bindings.addChild(new Element("channel-binding", new String[]{"type"}, new String[]{"tls-server-end-point"}));
if (session.getSessionData(AbstractSaslSCRAM.TLS_UNIQUE_ID_KEY) != null) {
bindings.addChild(new Element("channel-binding", new String[]{"type"}, new String[]{"tls-unique"}));
}
if (session.getSessionData(AbstractSaslSCRAM.TLS_EXPORTER_KEY) != null) {
bindings.addChild(new Element("channel-binding", new String[]{"type"}, new String[]{"tls-exporter"}));
}
return bindings;
}
public static byte[] h(String algorithm, byte[] data) throws NoSuchAlgorithmException {
MessageDigest digest = MessageDigest.getInstance(algorithm);
return digest.digest(data);
}
public static byte[] hi(String algorithm, byte[] password, final byte[] salt, final int iterations)
throws InvalidKeyException, NoSuchAlgorithmException {
if (algorithm.startsWith("SHA-")) {
algorithm = algorithm.replace("SHA-", "SHA");
}
final SecretKeySpec k = new SecretKeySpec(password, "Hmac" + algorithm);
byte[] z = new byte[salt.length + 4];
System.arraycopy(salt, 0, z, 0, salt.length);
System.arraycopy(new byte[]{0, 0, 0, 1}, 0, z, salt.length, 4);
byte[] u = hmac(k, z);
byte[] result = new byte[u.length];
System.arraycopy(u, 0, result, 0, result.length);
int i = 1;
while (i < iterations) {
u = hmac(k, u);
for (int j = 0; j < u.length; j++) {
result[j] ^= u[j];
}
++i;
}
return result;
}
protected static byte[] hmac(final SecretKey key, byte[] data)
throws NoSuchAlgorithmException, InvalidKeyException {
Mac mac = Mac.getInstance(key.getAlgorithm());
mac.init(key);
return mac.doFinal(data);
}
public static byte[] hmac(String algorithm, final byte[] key, byte[] data)
throws NoSuchAlgorithmException, InvalidKeyException {
if (algorithm.startsWith("SHA-")) {
algorithm = algorithm.replace("SHA-", "SHA");
}
final SecretKeySpec k = new SecretKeySpec(key, "Hmac" + algorithm);
return hmac(k, data);
}
public static byte[] normalize(String str) {
return str.getBytes(CHARSET);
}
protected AbstractSaslSCRAM(String mechanismName, String algorithm, Map super String, ?> props,
CallbackHandler callbackHandler) {
super(props, callbackHandler);
this.mechanismName = mechanismName;
this.algorithm = algorithm;
this.hmacAlgorithm = "Hmac" + (algorithm.startsWith("SHA-") ? algorithm.replace("SHA-", "SHA") : algorithm);
serverNonce = randomString();
}
protected AbstractSaslSCRAM(String mechanismName, String algorithm, Map super String, ?> props,
CallbackHandler callbackHandler, String serverOnce) {
super(props, callbackHandler);
this.mechanismName = mechanismName;
this.algorithm = algorithm;
this.hmacAlgorithm = "Hmac" + (algorithm.startsWith("SHA-") ? algorithm.replace("SHA-", "SHA") : algorithm);
this.serverNonce = serverOnce;
}
@Override
public byte[] evaluateResponse(byte[] response) throws SaslException {
try {
return switch (step) {
case clientFirstMessage -> processClientFirstMessage(response);
case clientFinalMessage -> processClientLastMessage(response);
default -> throw new SaslException(getMechanismName() + ": Server at illegal state");
};
} catch (SaslException e) {
throw e;
} catch (Exception e) {
log.log(Level.FINEST, "Error evaluating response", e);
throw new SaslException("SASL Failed", e);
}
}
@Override
public String getAuthorizationID() {
return authorizedId;
}
@Override
public String getMechanismName() {
return mechanismName;
}
@Override
public byte[] unwrap(byte[] incoming, int offset, int len) {
return null;
}
@Override
public byte[] wrap(byte[] outgoing, int offset, int len) {
return null;
}
protected byte[] calculateC() {
try {
final ByteArrayOutputStream result = new ByteArrayOutputStream();
result.write(this.cfmGs2header.getBytes(CHARSET));
if (this.requestedBindType == BindType.tls_unique ||
this.requestedBindType == BindType.tls_server_end_point ||
this.requestedBindType == BindType.tls_exporter) {
result.write(bindingData);
}
return result.toByteArray();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
protected abstract void checkRequestedBindType(BindType requestedBindType) throws SaslException;
protected byte[] h(byte[] data) throws NoSuchAlgorithmException {
MessageDigest digest = MessageDigest.getInstance(algorithm);
return digest.digest(data);
}
protected SecretKey key(final byte[] key) {
return new SecretKeySpec(key, hmacAlgorithm);
}
protected byte[] processClientFirstMessage(byte[] data) throws SaslException {
Matcher r = CLIENT_FIRST_MESSAGE.matcher(new String(data, CHARSET));
if (!r.matches()) {
throw new SaslException("Bad challenge syntax");
}
this.cfmGs2header = r.group("gs2Header");
String cfmCbname = r.group("cbName");
this.requestedBindType = createBindType(this.cfmGs2header, cfmCbname);
this.cfmAuthzid = r.group("authzid");
this.cfmBareMessage = r.group("clientFirstBare");
// final String cfmMext = r.group("mext");
this.cfmUsername = r.group("username");
final String cfmNonce = r.group("nonce");
checkRequestedBindType(requestedBindType);
final ChannelBindingCallback cc = new ChannelBindingCallback("Channel binding data", this.requestedBindType);
final NameCallback nc = new NameCallback("Authentication identity", cfmUsername);
final AuthorizationIdCallback ai = new AuthorizationIdCallback("Authorization identity", this.cfmAuthzid);
final PBKDIterationsCallback ic = new PBKDIterationsCallback("PBKD2 iterations");
final SaltCallback sc = new SaltCallback("Salt");
final ServerKeyCallback sec = new ServerKeyCallback("Server Key");
final StoredKeyCallback stc = new StoredKeyCallback("Stored Key");
handleCallbacks(nc, ai, ic, sc, sec, stc, cc);
validateKeyPresence(sec.getServerKey(), "Server Key");
this.serverKey = sec.getServerKey();
validateKeyPresence(stc.getStoredKey(), "Stored Key");
this.storedKey = stc.getStoredKey();
this.cfmAuthzid = ai.getAuthzId();
if (this.cfmAuthzid == null) {
this.cfmAuthzid = nc.getName();
}
validateBindingsData(requestedBindType, cc.getBindingData());
this.bindingData = cc.getBindingData();
this.sfmNonce = cfmNonce + serverNonce;
this.sfmMessage = "r=" + sfmNonce + "," + "s=" + Base64.encode(sc.getSalt()) + "," + "i=" + ic.getInterations();
step = Step.clientFinalMessage;
return sfmMessage.getBytes(CHARSET);
}
protected byte[] processClientLastMessage(byte[] data)
throws SaslException, InvalidKeyException, NoSuchAlgorithmException {
Matcher r = CLIENT_LAST_MESSAGE.matcher(new String(data, CHARSET));
if (!r.matches()) {
throw new SaslException("Bad challenge syntax");
}
final String clmWithoutProof = r.group("withoutProof");
final byte[] clmCb = Base64.decode(r.group("cb"));
final String clmNonce = r.group("nonce");
final String clmProof = r.group("proof");
byte[] calculatedCb = calculateC();
if (!(new String(clmCb, CHARSET)).startsWith(cfmGs2header)) {
throw new XmppSaslException(SaslError.not_authorized, "Invalid GS2 header");
} else if (!Arrays.equals(clmCb, calculatedCb)) {
if (log.isLoggable(Level.FINEST)) {
log.log(Level.FINEST, "Channel bindings does not match. expected: {0}; received: {1}",
new Object[]{calculatedCb, clmCb});
}
throw new SaslInvalidLoginExcepion(SaslError.not_authorized, cfmAuthzid, "Channel bindings does not match");
}
if (!clmNonce.equals(sfmNonce)) {
throw new SaslInvalidLoginExcepion(SaslError.not_authorized, cfmAuthzid, "Wrong nonce");
}
final String authMessage = cfmBareMessage + "," + sfmMessage + "," + clmWithoutProof;
byte[] clientSignature = hmac(key(storedKey), authMessage.getBytes(CHARSET));
byte[] clientProof = Base64.decode(clmProof);
byte[] calculatedClientKey = xor(clientProof, clientSignature);
byte[] calculatedStoredKey = h(calculatedClientKey);
boolean proofMatch = Arrays.equals(calculatedStoredKey, storedKey);
if (!proofMatch) {
throw new SaslInvalidLoginExcepion(SaslError.not_authorized, cfmAuthzid, PASSWORD_NOT_VERIFIED_MSG);
}
final AuthorizeCallback ac = new AuthorizeCallback(cfmUsername, cfmAuthzid);
handleCallbacks(ac);
if (ac.isAuthorized()) {
authorizedId = ac.getAuthorizedID();
} else {
throw new SaslInvalidLoginExcepion(SaslError.invalid_authzid, cfmAuthzid,
"SCRAM: " + cfmAuthzid + " is not authorized to act as " + cfmAuthzid);
}
byte[] serverSignature = hmac(key(serverKey), authMessage.getBytes(CHARSET));
String serverStringMessage = "v=" + Base64.encode(serverSignature);
step = Step.finished;
complete = true;
return serverStringMessage.getBytes(CHARSET);
}
protected void validateBindingsData(BindType requestedBindType, byte[] bindingData) {
if (requestedBindType == BindType.tls_server_end_point && bindingData == null) {
throw new RuntimeException("Binding data not found!");
} else if (requestedBindType == BindType.tls_unique && bindingData == null) {
throw new RuntimeException("Binding data not found!");
} else if (requestedBindType == BindType.tls_exporter && bindingData == null) {
throw new RuntimeException("Binding data not found!");
}
}
protected byte[] xor(final byte[] a, final byte[] b) {
final int l = a.length;
byte[] r = new byte[l];
for (int i = 0; i < l; i++) {
r[i] = (byte) (a[i] ^ b[i]);
}
return r;
}
private BindType createBindType(final String cfmGs2header, final String cfmCbname) throws SaslException {
final char t = cfmGs2header.charAt(0);
if ('n' == t) {
return BindType.n;
} else if ('y' == t) {
return BindType.y;
} else if ("tls-unique".equals(cfmCbname)) {
return BindType.tls_unique;
} else if ("tls-server-end-point".equals(cfmCbname)) {
return BindType.tls_server_end_point;
} else if ("tls-exporter".equals(cfmCbname)) {
return BindType.tls_exporter;
} else {
throw new SaslException("Unsupported channel binding type");
}
}
private String randomString() {
final int length = 20;
final int x = ALPHABET.length();
char[] buffer = new char[length];
for (int i = 0; i < length; i++) {
int r = random.nextInt(x);
buffer[i] = ALPHABET.charAt(r);
}
return new String(buffer);
}
private void validateKeyPresence(final byte[] key, final String keyName) throws SaslException {
if (key == null) {
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE, "There is no {1} of user {0}.", new Object[]{cfmUsername, keyName});
}
throw new SaslException("Unknown user");
} else if (key.length == 0) {
if (log.isLoggable(Level.WARNING)) {
log.log(Level.WARNING, "User {0} exists, but his {1} is empty.", new Object[]{cfmUsername, keyName});
}
throw new SaslException("Unknown user");
}
}
private enum Step {
clientFinalMessage,
clientFirstMessage,
finished
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/SCRAMHelper.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
public class SCRAMHelper {
/**
* Encode plain password to SCRAM authentication data: ServerKey and StoredKey.
*
* @param algorithm algorithm.
* @param salt salt.
* @param iterations iterations.
* @param plainPassword plain password.
*
* @return authentication data
*/
public static AuthenticationData encodePlainPassword(String algorithm, byte[] salt, int iterations,
String plainPassword)
throws NoSuchAlgorithmException, InvalidKeyException {
var saltedPassword = AbstractSaslSCRAM.hi(algorithm, AbstractSaslSCRAM.normalize(plainPassword), salt,
iterations);
return transcode(algorithm, saltedPassword);
}
/**
* Transcode Salted Password (PBKDF2) to SCRAM authentication data: ServerKey and StoredKey.
*
* @param algorithm algorithm.
* @param saltedPassword salted password to transcode.
*
* @return authentication data.
*/
public static AuthenticationData transcode(String algorithm, byte[] saltedPassword)
throws NoSuchAlgorithmException, InvalidKeyException {
byte[] ck = AbstractSaslSCRAM.hmac(algorithm, saltedPassword, AbstractSaslSCRAM.DEFAULT_CLIENT_KEY);
var storedKey = AbstractSaslSCRAM.h(algorithm, ck);
var serverKey = AbstractSaslSCRAM.hmac(algorithm, saltedPassword, AbstractSaslSCRAM.DEFAULT_SERVER_KEY);
return new AuthenticationData(algorithm, storedKey, serverKey);
}
private SCRAMHelper() {
}
public record AuthenticationData(String algorithm, byte[] storedKey, byte[] serverKey) {
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/SaslANONYMOUS.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import tigase.auth.XmppSaslException;
import tigase.auth.XmppSaslException.SaslError;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.sasl.SaslException;
import java.util.Map;
import java.util.UUID;
/**
* SASL-ANONYMOUS mechanism. Called {@linkplain Callback callbacks} in order:
{@link NameCallback}
*
*/
public class SaslANONYMOUS
extends AbstractSasl {
public static final String IS_ANONYMOUS_PROPERTY = "IS_ANONYMOUS";
public static final String NAME = "ANONYMOUS";
SaslANONYMOUS(Map super String, ?> props, CallbackHandler callbackHandler) {
super(props, callbackHandler);
negotiatedProperty.put(IS_ANONYMOUS_PROPERTY, Boolean.TRUE);
}
@Override
public byte[] evaluateResponse(byte[] response) throws SaslException {
NameCallback nc = new NameCallback("ANONYMOUS identity", UUID.randomUUID().toString());
handleCallbacks(nc);
this.authorizedId = nc.getName() != null ? nc.getName() : nc.getDefaultName();
if (this.authorizedId == null) {
throw new XmppSaslException(SaslError.temporary_auth_failure);
}
complete = true;
return null;
}
@Override
public String getAuthorizationID() {
return authorizedId;
}
@Override
public String getMechanismName() {
return NAME;
}
@Override
public byte[] unwrap(byte[] incoming, int offset, int len) {
return null;
}
@Override
public byte[] wrap(byte[] outgoing, int offset, int len) {
return null;
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/SaslEXTERNAL.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import tigase.auth.SaslInvalidLoginExcepion;
import tigase.auth.XmppSaslException;
import tigase.auth.XmppSaslException.SaslError;
import tigase.auth.callbacks.ValidateCertificateData;
import tigase.util.stringprep.TigaseStringprepException;
import tigase.xmpp.jid.BareJID;
import javax.security.auth.callback.CallbackHandler;
import javax.security.sasl.SaslException;
import java.util.Map;
public class SaslEXTERNAL
extends AbstractSasl {
public static final String PEER_CERTIFICATE_KEY = "PEER_CERTIFICATE_ENTRY_KEY";
public static final String NAME = "EXTERNAL";
SaslEXTERNAL(Map super String, ?> props, CallbackHandler callbackHandler) {
super(props, callbackHandler);
}
@Override
public byte[] evaluateResponse(byte[] response) throws SaslException {
BareJID jid;
try {
if (response != null && response.length > 0) {
jid = BareJID.bareJIDInstance(new String(response));
} else {
jid = null;
}
} catch (TigaseStringprepException e) {
throw new XmppSaslException(SaslError.malformed_request);
}
final ValidateCertificateData ac = new ValidateCertificateData(jid);
handleCallbacks(ac);
if (ac.isAuthorized() == true) {
authorizedId = ac.getAuthorizedID();
} else {
throw new SaslInvalidLoginExcepion(SaslError.invalid_authzid,jid.toString());
}
complete = true;
return null;
}
@Override
public String getAuthorizationID() {
return authorizedId;
}
@Override
public String getMechanismName() {
return NAME;
}
@Override
public byte[] unwrap(byte[] incoming, int offset, int len) {
return null;
}
@Override
public byte[] wrap(byte[] outgoing, int offset, int len) {
return null;
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/SaslPLAIN.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import tigase.auth.SaslInvalidLoginExcepion;
import tigase.auth.XmppSaslException;
import tigase.auth.XmppSaslException.SaslError;
import tigase.auth.callbacks.AuthorizationIdCallback;
import tigase.auth.callbacks.VerifyPasswordCallback;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.sasl.AuthorizeCallback;
import javax.security.sasl.SaslException;
import java.util.Map;
/**
* SASL-PLAIN mechanism. Called {@linkplain Callback callbacks} in order:
{@link NameCallback}
*
{@link VerifyPasswordCallback}
{@link AuthorizeCallback}
*/
public class SaslPLAIN
extends AbstractSasl {
public static final String NAME = "PLAIN";
SaslPLAIN(Map super String, ?> props, CallbackHandler callbackHandler) {
super(props, callbackHandler);
}
@Override
public byte[] evaluateResponse(byte[] response) throws SaslException {
String[] data = split(response, "");
if (data.length != 3) {
throw new XmppSaslException(SaslError.malformed_request, "Invalid number of message parts");
}
final String authzid = data[0];
final String authcid = data[1];
final String passwd = data[2];
if (authcid.length() < 1) {
throw new XmppSaslException(SaslError.malformed_request, "Authentication identity string is empty");
}
if (authcid.length() > 255) {
throw new XmppSaslException(SaslError.malformed_request, "Authentication identity string is too long");
}
if (!isEmpty(authzid) && authzid.length() > 255) {
throw new XmppSaslException(SaslError.malformed_request, "Authorization identity string is too long");
}
if (passwd.length() > 255) {
throw new XmppSaslException(SaslError.malformed_request, "Password string is too long");
}
final NameCallback nc = new NameCallback("Authentication identity", authcid);
final AuthorizationIdCallback ai = new AuthorizationIdCallback("Authorization identity",
isEmpty(authzid) ? null : authzid);
final VerifyPasswordCallback vpc = new VerifyPasswordCallback(passwd);
handleCallbacks(nc, ai, vpc);
if (vpc.isVerified() == false) {
throw new SaslInvalidLoginExcepion(SaslError.not_authorized, nc.getName(), PASSWORD_NOT_VERIFIED_MSG);
}
final String authorizationJID = ai.getAuthzId() == null ? nc.getName() : ai.getAuthzId();
final AuthorizeCallback ac = new AuthorizeCallback(nc.getName(), authorizationJID);
handleCallbacks(ac);
if (ac.isAuthorized() == true) {
authorizedId = ac.getAuthorizedID();
} else {
throw new SaslInvalidLoginExcepion(SaslError.invalid_authzid, nc.getName(),
"PLAIN: " + authcid + " is not authorized to act as " +
authorizationJID);
}
complete = true;
return null;
}
@Override
public String getAuthorizationID() {
return authorizedId;
}
@Override
public String getMechanismName() {
return NAME;
}
@Override
public byte[] unwrap(byte[] incoming, int offset, int len) {
return null;
}
@Override
public byte[] wrap(byte[] outgoing, int offset, int len) {
return null;
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/SaslSCRAM.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import javax.security.auth.callback.CallbackHandler;
import javax.security.sasl.SaslException;
import java.util.Map;
public class SaslSCRAM
extends AbstractSaslSCRAM {
public final static String NAME = "SCRAM-SHA-1";
protected final static String ALGO = "SHA1";
public SaslSCRAM(Map super String, ?> props, CallbackHandler callbackHandler) {
super(NAME, ALGO, props, callbackHandler);
}
SaslSCRAM(Map super String, ?> props, CallbackHandler callbackHandler, String once) {
super(NAME, ALGO, props, callbackHandler, once);
}
@Override
protected void checkRequestedBindType(BindType requestedBindType) throws SaslException {
switch (requestedBindType) {
case n:
break;
case y:
// throw new SaslException("Server supports PLUS. Please use 'p'");
break;
case tls_server_end_point:
case tls_exporter:
case tls_unique:
throw new SaslException("Invalid request for " + NAME);
}
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/SaslSCRAMPlus.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import tigase.xmpp.XMPPResourceConnection;
import javax.security.auth.callback.CallbackHandler;
import javax.security.sasl.SaslException;
import java.util.Collection;
import java.util.Map;
public class SaslSCRAMPlus
extends AbstractSaslSCRAM {
public final static String NAME = "SCRAM-SHA-1-PLUS";
protected final static String ALGO = "SHA1";
public static boolean containsScramPlus(Collection mechanisms) {
for (String name : mechanisms) {
if (name.startsWith("SCRAM-") && name.endsWith("-PLUS")) {
return true;
}
}
return false;
}
public static boolean isAvailable(XMPPResourceConnection session) {
return session.getSessionData(AbstractSaslSCRAM.TLS_UNIQUE_ID_KEY) != null ||
session.getSessionData(AbstractSaslSCRAM.LOCAL_CERTIFICATE_KEY) != null;
}
public SaslSCRAMPlus(Map super String, ?> props, CallbackHandler callbackHandler) {
super(NAME, ALGO, props, callbackHandler);
}
SaslSCRAMPlus(Map super String, ?> props, CallbackHandler callbackHandler, String once) {
super(NAME, ALGO, props, callbackHandler, once);
}
@Override
protected void checkRequestedBindType(BindType requestedBindType) throws SaslException {
switch (requestedBindType) {
case n:
throw new SaslException("Invalid request for " + NAME);
case y:
throw new SaslException("Server supports PLUS. Please use 'p'");
case tls_server_end_point:
case tls_exporter:
case tls_unique:
break;
}
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/SaslSCRAMSha256.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import javax.security.auth.callback.CallbackHandler;
import javax.security.sasl.SaslException;
import java.util.Map;
public class SaslSCRAMSha256
extends AbstractSaslSCRAM {
public final static String NAME = "SCRAM-SHA-256";
protected final static String ALGO = "SHA-256";
public SaslSCRAMSha256(Map super String, ?> props, CallbackHandler callbackHandler) {
super(NAME, ALGO, props, callbackHandler);
}
SaslSCRAMSha256(Map super String, ?> props, CallbackHandler callbackHandler, String once) {
super(NAME, ALGO, props, callbackHandler, once);
}
@Override
protected void checkRequestedBindType(BindType requestedBindType) throws SaslException {
switch (requestedBindType) {
case n:
break;
case y:
// throw new SaslException("Server supports PLUS. Please use 'p'");
break;
case tls_server_end_point:
case tls_exporter:
case tls_unique:
throw new SaslException("Invalid request for " + NAME);
}
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/SaslSCRAMSha256Plus.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import tigase.xmpp.XMPPResourceConnection;
import javax.security.auth.callback.CallbackHandler;
import javax.security.sasl.SaslException;
import java.util.Map;
public class SaslSCRAMSha256Plus
extends AbstractSaslSCRAM {
public final static String NAME = "SCRAM-SHA-256-PLUS";
protected final static String ALGO = "SHA-256";
public static boolean isAvailable(XMPPResourceConnection session) {
return session.getSessionData(AbstractSaslSCRAM.TLS_UNIQUE_ID_KEY) != null ||
session.getSessionData(AbstractSaslSCRAM.LOCAL_CERTIFICATE_KEY) != null;
}
public SaslSCRAMSha256Plus(Map super String, ?> props, CallbackHandler callbackHandler) {
super(NAME, ALGO, props, callbackHandler);
}
SaslSCRAMSha256Plus(Map super String, ?> props, CallbackHandler callbackHandler, String once) {
super(NAME, ALGO, props, callbackHandler, once);
}
@Override
protected void checkRequestedBindType(BindType requestedBindType) throws SaslException {
switch (requestedBindType) {
case n:
throw new SaslException("Invalid request for " + NAME);
case y:
throw new SaslException("Server supports PLUS. Please use 'p'");
case tls_server_end_point:
case tls_exporter:
case tls_unique:
break;
}
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/SaslSCRAMSha512.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import javax.security.auth.callback.CallbackHandler;
import javax.security.sasl.SaslException;
import java.util.Map;
public class SaslSCRAMSha512
extends AbstractSaslSCRAM {
public final static String NAME = "SCRAM-SHA-512";
protected final static String ALGO = "SHA-512";
public SaslSCRAMSha512(Map super String, ?> props, CallbackHandler callbackHandler) {
super(NAME, ALGO, props, callbackHandler);
}
SaslSCRAMSha512(Map super String, ?> props, CallbackHandler callbackHandler, String once) {
super(NAME, ALGO, props, callbackHandler, once);
}
@Override
protected void checkRequestedBindType(BindType requestedBindType) throws SaslException {
switch (requestedBindType) {
case n:
break;
case y:
// throw new SaslException("Server supports PLUS. Please use 'p'");
break;
case tls_server_end_point:
case tls_exporter:
case tls_unique:
throw new SaslException("Invalid request for " + NAME);
}
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/SaslSCRAMSha512Plus.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import tigase.xmpp.XMPPResourceConnection;
import javax.security.auth.callback.CallbackHandler;
import javax.security.sasl.SaslException;
import java.util.Map;
public class SaslSCRAMSha512Plus
extends AbstractSaslSCRAM {
public final static String NAME = "SCRAM-SHA-512-PLUS";
protected final static String ALGO = "SHA-512";
public static boolean isAvailable(XMPPResourceConnection session) {
return session.getSessionData(AbstractSaslSCRAM.TLS_UNIQUE_ID_KEY) != null ||
session.getSessionData(AbstractSaslSCRAM.LOCAL_CERTIFICATE_KEY) != null;
}
public SaslSCRAMSha512Plus(Map super String, ?> props, CallbackHandler callbackHandler) {
super(NAME, ALGO, props, callbackHandler);
}
SaslSCRAMSha512Plus(Map super String, ?> props, CallbackHandler callbackHandler, String once) {
super(NAME, ALGO, props, callbackHandler, once);
}
@Override
protected void checkRequestedBindType(BindType requestedBindType) throws SaslException {
switch (requestedBindType) {
case n:
throw new SaslException("Invalid request for " + NAME);
case y:
throw new SaslException("Server supports PLUS. Please use 'p'");
case tls_server_end_point:
case tls_exporter:
case tls_unique:
break;
}
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/SaslXTOKEN.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import tigase.auth.SaslInvalidLoginExcepion;
import tigase.auth.XmppSaslException;
import tigase.auth.callbacks.AuthorizationIdCallback;
import tigase.auth.callbacks.ReplaceServerKeyCallback;
import tigase.auth.callbacks.ServerKeyCallback;
import tigase.auth.callbacks.SharedSecretKeyCallback;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.sasl.AuthorizeCallback;
import javax.security.sasl.SaslException;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Map;
public class SaslXTOKEN
extends AbstractSasl {
public static final String NAME = "XTOKEN-HMAC-SHA-256";
private static final SecureRandom secureRandom = new SecureRandom();
public static byte[] generateSecretKey() {
byte[] data = new byte[32];
secureRandom.nextBytes(data);
return data;
}
private Step step = Step.firstMessage;
enum Step {
firstMessage,
secondMessage,
finished
}
SaslXTOKEN(Map super String, ?> props, CallbackHandler callbackHandler) {
super(props, callbackHandler);
}
@Override
public String getMechanismName() {
return NAME;
}
@Override
public byte[] evaluateResponse(byte[] response) throws SaslException {
if (response.length <= 64 || response[32] != 0x00 || response[65] != 0x00) {
throw new XmppSaslException(XmppSaslException.SaslError.malformed_request, "Invalid token format - too short");
}
byte[] data = Arrays.copyOfRange(response, 0, 32);
byte[] token = Arrays.copyOfRange(response, 33, 65);
String authcid = new String(Arrays.copyOfRange(response, 66, response.length), StandardCharsets.UTF_8);
final NameCallback nc = new NameCallback("Authentication identity", authcid);
final AuthorizationIdCallback ai = new AuthorizationIdCallback("Authorization identity", null);
final ServerKeyCallback vtc = new ServerKeyCallback(null);
final SharedSecretKeyCallback sskc = new SharedSecretKeyCallback();
handleCallbacks(nc, ai, vtc, sskc);
if (vtc.getServerKey() == null) {
throw new SaslInvalidLoginExcepion(XmppSaslException.SaslError.not_authorized, nc.getName(), PASSWORD_NOT_VERIFIED_MSG);
}
try {
SecretKeySpec secretKeySpec = new SecretKeySpec(vtc.getServerKey(), "SHA-256");
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(secretKeySpec);
mac.update(data);
if (sskc.getSecret() != null) {
mac.update(sskc.getSecret());
}
byte[] hmac = mac.doFinal();
boolean proofMatch = Arrays.equals(hmac, token);
if (!proofMatch) {
throw new SaslInvalidLoginExcepion(XmppSaslException.SaslError.not_authorized, authcid,
PASSWORD_NOT_VERIFIED_MSG);
}
final String authorizationJID = ai.getAuthzId() == null ? nc.getName() : ai.getAuthzId();
final AuthorizeCallback ac = new AuthorizeCallback(nc.getName(), authorizationJID);
handleCallbacks(ac);
if (ac.isAuthorized() == true) {
authorizedId = ac.getAuthorizedID();
} else {
throw new SaslInvalidLoginExcepion(XmppSaslException.SaslError.invalid_authzid, nc.getName(),
getMechanismName() + ": " + authcid + " is not authorized to act as " +
authorizationJID);
}
final ReplaceServerKeyCallback rtc = new ReplaceServerKeyCallback();
handleCallbacks(rtc);
complete = true;
byte[] authzidData = authorizedId.getBytes(StandardCharsets.UTF_8);
if (rtc.getNewServerKey() != null) {
byte[] result = new byte[authzidData.length + 1 + rtc.getNewServerKey().length];
System.arraycopy(authzidData, 0, result, 0, authzidData.length);
result[authzidData.length] = 0x00;
System.arraycopy(rtc.getNewServerKey(), 0, result, authzidData.length + 1, rtc.getNewServerKey().length);
return result;
}
return authzidData;
} catch (NoSuchAlgorithmException | InvalidKeyException ex) {
throw new SaslInvalidLoginExcepion(XmppSaslException.SaslError.invalid_authzid, nc.getName(),
getMechanismName() + ": " + ex.getMessage());
}
}
@Override
public String getAuthorizationID() {
return authorizedId;
}
@Override
public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException {
return null;
}
@Override
public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException {
return null;
}
}
================================================
FILE: src/main/java/tigase/auth/mechanisms/TigaseSaslServerFactory.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.auth.mechanisms;
import tigase.auth.TigaseSaslProvider;
import tigase.kernel.beans.Bean;
import javax.security.auth.callback.CallbackHandler;
import javax.security.sasl.SaslException;
import javax.security.sasl.SaslServer;
import javax.security.sasl.SaslServerFactory;
import java.util.Map;
@Bean(name = "tigaseSaslServerFactory", parent = TigaseSaslProvider.class, active = true)
public class TigaseSaslServerFactory
implements SaslServerFactory {
public static final String ANONYMOUS_MECHANISM_ALLOWED = "anonymous-mechanism-allowed";
public TigaseSaslServerFactory() {
}
@Override
public SaslServer createSaslServer(final String mechanism, final String protocol, final String serverName,
final Map props, final CallbackHandler callbackHandler)
throws SaslException {
switch (mechanism) {
case SaslSCRAM.NAME:
return new SaslSCRAM(props, callbackHandler);
case SaslSCRAMPlus.NAME:
return new SaslSCRAMPlus(props, callbackHandler);
case SaslSCRAMSha256.NAME:
return new SaslSCRAMSha256(props, callbackHandler);
case SaslSCRAMSha256Plus.NAME:
return new SaslSCRAMSha256Plus(props, callbackHandler);
case SaslSCRAMSha512.NAME:
return new SaslSCRAMSha512(props, callbackHandler);
case SaslSCRAMSha512Plus.NAME:
return new SaslSCRAMSha512Plus(props, callbackHandler);
case SaslPLAIN.NAME:
return new SaslPLAIN(props, callbackHandler);
case SaslANONYMOUS.NAME:
return new SaslANONYMOUS(props, callbackHandler);
case SaslEXTERNAL.NAME:
return new SaslEXTERNAL(props, callbackHandler);
case SaslXTOKEN.NAME:
return new SaslXTOKEN(props, callbackHandler);
default:
throw new SaslException("Mechanism not supported yet.");
}
}
@Override
public String[] getMechanismNames(Map props) {
return new String[]{SaslSCRAMSha512Plus.NAME, SaslSCRAMSha256Plus.NAME, SaslSCRAMPlus.NAME,
SaslSCRAMSha512.NAME, SaslSCRAMSha256.NAME, SaslSCRAM.NAME, "PLAIN", "EXTERNAL",
"ANONYMOUS", SaslXTOKEN.NAME};
}
}
================================================
FILE: src/main/java/tigase/cluster/AmpComponentClustered.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.cluster;
import tigase.cluster.api.*;
import tigase.kernel.beans.Bean;
import tigase.kernel.beans.Inject;
import tigase.kernel.beans.selector.ClusterModeRequired;
import tigase.kernel.beans.selector.ConfigType;
import tigase.kernel.beans.selector.ConfigTypeEnum;
import tigase.kernel.core.Kernel;
import tigase.server.Message;
import tigase.server.Packet;
import tigase.server.Priority;
import tigase.server.amp.AmpComponent;
import tigase.util.stringprep.TigaseStringprepException;
import tigase.xml.Element;
import tigase.xmpp.jid.JID;
import java.util.*;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.logging.Level;
import java.util.logging.Logger;
import static tigase.server.amp.AmpFeatureIfc.FROM_CONN_ID;
/**
* @author andrzej
*/
@Bean(name = "amp", parent = Kernel.class, active = true)
@ConfigType({ConfigTypeEnum.DefaultMode, ConfigTypeEnum.SessionManagerMode, ConfigTypeEnum.ConnectionManagersMode,
ConfigTypeEnum.ComponentMode})
@ClusterModeRequired(active = true)
public class AmpComponentClustered
extends AmpComponent
implements ClusteredComponentIfc {
private static final Logger log = Logger.getLogger(AmpComponentClustered.class.getCanonicalName());
@Inject
private ClusterControllerIfc clusterController = null;
private Set commandListeners = new CopyOnWriteArraySet();
public AmpComponentClustered() {
commandListeners.add(new PacketForwardCommand("packet-forward"));
}
@Override
public void processPacket(Packet packet) {
if (packet.getPacketFrom() == null || getComponentId().getDomain().equals(packet.getPacketFrom().getDomain())) {
if (packet.getElemName() == Message.ELEM_NAME &&
packet.getElement().getChild("broadcast", "http://tigase.org/protocol/broadcast") != null &&
packet.getAttributeStaticStr(FROM_CONN_ID) == null) {
Packet forward = packet.copyElementOnly();
forward.setStableId(packet.getStableId());
forwardPacket(forward);
}
}
super.processPacket(packet); //To change body of generated methods, choose Tools | Templates.
}
@Override
public void setClusterController(ClusterControllerIfc cl_controller) {
super.setClusterController(cl_controller);
if (clusterController != null) {
for (CommandListener listener : commandListeners) {
clusterController.removeCommandListener(listener);
}
}
clusterController = cl_controller;
if (clusterController != null) {
for (CommandListener listener : commandListeners) {
clusterController.setCommandListener(listener);
}
}
}
protected void forwardPacket(Packet packet) {
List toNodes = new ArrayList();
for (JID jid : getNodesConnected()) {
// jid of local node should not be part of getNodesConnected but let's keep this check for now
if (jid.equals(getComponentId())) {
continue;
}
toNodes.add(jid);
}
if (!toNodes.isEmpty()) {
clusterController.sendToNodes("packet-forward", null, packet.getElement(), getComponentId(), null,
toNodes.toArray(new JID[toNodes.size()]));
}
}
protected class PacketForwardCommand
extends CommandListenerAbstract {
public PacketForwardCommand(String name) {
super(name, Priority.HIGH);
}
@Override
public void executeCommand(JID fromNode, Set visitedNodes, Map data,
Queue packets) throws ClusterCommandException {
Element packetEl = null;
while ((packetEl = packets.poll()) != null) {
try {
Packet packet = Packet.packetInstance(packetEl);
packet.setPacketFrom(fromNode);
packet.setPacketTo(getComponentId());
AmpComponentClustered.this.addPacket(packet);
} catch (TigaseStringprepException ex) {
log.log(Level.WARNING, "exception converting element to packet after forwarding from other node",
ex);
}
}
}
}
}
================================================
FILE: src/main/java/tigase/cluster/BoshConnectionClustered.java
================================================
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.cluster;
import tigase.cluster.api.ClusteredComponentIfc;
import tigase.eventbus.EventListener;
import tigase.kernel.beans.Bean;
import tigase.kernel.beans.selector.ClusterModeRequired;
import tigase.kernel.beans.selector.ConfigType;
import tigase.kernel.beans.selector.ConfigTypeEnum;
import tigase.kernel.core.Kernel;
import tigase.server.ServiceChecker;
import tigase.server.bosh.BoshConnectionManager;
import tigase.server.xmppclient.SeeOtherHostIfc;
import tigase.util.common.TimerTask;
import tigase.xmpp.XMPPIOService;
import tigase.xmpp.jid.JID;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* @author andrzej
*/
@Bean(name = "bosh", parent = Kernel.class, active = true)
@ConfigType({ConfigTypeEnum.DefaultMode, ConfigTypeEnum.ConnectionManagersMode})
@ClusterModeRequired(active = true)
public class BoshConnectionClustered
extends BoshConnectionManager
implements ClusteredComponentIfc {
private static final Logger log = Logger.getLogger(BoshConnectionClustered.class.getName());
private EventListener clusterEventHandler = null;
public BoshConnectionClustered() {
delayPortListening = true;
}
@Override
public void onNodeDisconnected(JID jid) {
super.onNodeDisconnected(jid);
List connectedNodes = getNodesConnectedWithLocal();
if (see_other_host_strategy != null) {
see_other_host_strategy.setNodes(connectedNodes);
}
final String hostname = jid.getDomain();
doForAllServices(new ServiceChecker>() {
@Override
public void check(XMPPIOService