### Tigase Schema Installation Log Output Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Example log output during the Tigase database schema installation process. This output shows the parameters used, connection validation, and schema loading steps, indicating successful database setup. The log details include driver availability and file loading status. ```log LogLevel: CONFIG 2017-10-12 20:05:47.987 [main] DBSchemaLoader.init() CONFIG: Parameters: [ingoreMissingFiles: false, logLevel: CONFIG, adminPassword: pass, admins: [admin@jabber.your-great.net], dbRootPass: rootpass, dbRootUser: root, dbType: derby, dbName: tigasedbx, dbHostname: localhost, dbUser: tigase_user, dbPass: tigase_pass, useSSL: false, useLegacyDatetimeCode: false, serverTimezone: null, file: null, query: null] Oct 12, 2017 8:05:48 PM tigase.util.DNSResolverDefault WARNING: Resolving default host name: ubuntu took: 7 Oct 12, 2017 8:05:49 PM tigase.db.util.SchemaManager loadSchemas INFO: found 1 data sources to upgrade... Oct 12, 2017 8:05:49 PM tigase.db.util.SchemaManager loadSchemas INFO: begining upgrade... LogLevel: CONFIG 2017-10-12 20:05:49.877 [main] DBSchemaLoader.init() CONFIG: Parameters: [ingoreMissingFiles: false, logLevel: CONFIG, adminPassword: pass, admins: [admin@jabber.your-great.net], dbRootPass: rootpass, dbRootUser: root, dbType: derby, dbName: tigasedbx, dbHostname: null, dbUser: null, dbPass: null, useSSL: null, useLegacyDatetimeCode: false, serverTimezone: null, file: null, query: null] 2017-10-12 20:05:49.877 [main] DBSchemaLoader.validateDBConnection() INFO: Validating DBConnection, URI: jdbc:derby:tigasedbx;create=true 2017-10-12 20:05:50.932 [main] DBSchemaLoader.validateDBConnection() CONFIG: DriverManager (available drivers): [org.apache.derby.jdbc.AutoloadedDriver@65262308, jTDS 1.3.1, com.mysql.jdbc.Driver@54997f67, com.mysql.fabric.jdbc.FabricMySQLDriver@189633f2, org.postgresql.Driver@76fc5687] 2017-10-12 20:05:50.932 [main] DBSchemaLoader.validateDBConnection() INFO: Connection OK 2017-10-12 20:05:50.933 [main] DBSchemaLoader.validateDBExists() INFO: Validating whether DB Exists, URI: jdbc:derby:tigasedbx;create=true 2017-10-12 20:05:50.936 [main] DBSchemaLoader.withConnection() CONFIG: DriverManager (available drivers): [org.apache.derby.jdbc.AutoloadedDriver@65262308, jTDS 1.3.1, com.mysql.jdbc.Driver@54997f67, com.mysql.fabric.jdbc.FabricMySQLDriver@189633f2, org.postgresql.Driver@76fc5687] 2017-10-12 20:05:50.937 [main] DBSchemaLoader.lambda$validateDBExists$283() INFO: Exists OK 2017-10-12 20:05:50.939 [main] DBSchemaLoader.loadSchemaFile() INFO: Loading schema from file(s): database/derby-schema-7-2.sql, URI: jdbc:derby:tigasedbx;create=true 2017-10-12 20:05:50.941 [main] DBSchemaLoader.withConnection() CONFIG: DriverManager (available drivers): [org.apache.derby.jdbc.AutoloadedDriver@65262308, jTDS 1.3.1, com.mysql.jdbc.Driver@54997f67, com.mysql.fabric.jdbc.FabricMySQLDriver@189633f2, org.postgresql.Driver@76fc5687] 2017-10-12 20:05:51.923 [main] DBSchemaLoader.lambda$loadSchemaFile$287() INFO: completed OK 2017-10-12 20:05:51.925 [main] DBSchemaLoader.loadSchemaFile() INFO: Loading schema from file(s): database/derby-message-archiving-schema-1.3.0.sql, URI: jdbc:derby:tigasedbx;create=true 2017-10-12 20:05:51.926 [main] DBSchemaLoader.withConnection() CONFIG: DriverManager (available drivers): [org.apache.derby.jdbc.AutoloadedDriver@65262308, jTDS 1.3.1, com.mysql.jdbc.Driver@54997f67, com.mysql.fabric.jdbc.FabricMySQLDriver@189633f2, org.postgresql.Driver@76fc5687] 2017-10-12 20:05:52.209 [main] DBSchemaLoader.lambda$loadSchemaFile$287() INFO: completed OK ``` -------------------------------- ### Windows Setup Script for Tigase Server Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md This batch script performs the initial setup for Tigase XMPP Server on Windows. It copies essential files like the icon, wrapper components, and scripts to their appropriate locations within the server directory structure. ```bat copy "tigase.ico" "..\" copy "wrapper\wrapper.jar" ".\jars" copy "wrapper\wrapper.dll" ".\jars" copy "wrapper\wrapper.exe" "..\" copy "wrapper\wrapper.conf" "..\" copy "wrapper\wrapper-community-license-1.2.txt" "..\" copy "scripts\*.*" "..\" ``` -------------------------------- ### Configure Tigase init.d Script for Debian Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Sets up environment variables for Tigase Server on Debian systems. Defines user credentials, installation and configuration paths, service options, and logging locations. Paths differ from RedHat conventions and should be adjusted to match your Debian installation. ```bash USERNAME=tigase USERGROUP=tigase NAME=tigase DESC="Tigase XMPP server" TIGASE_HOME=/usr/share/tigase TIGASE_CONFIG=/etc/tigase/tigase.config TIGASE_OPTIONS= TIGASE_PARAMS= PIDFILE= TIGASE_CONSOLE_LOG= ``` -------------------------------- ### Example lsof Output Showing Tigase Listening (Bash) Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md This is an example output from the `lsof -i -P` command, demonstrating that the `java` process (Tigase Server) is listening on port 8080. ```bash COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 18387 tigase 141u IPv6 22185825 0t0 TCP *:8080 (LISTEN) ``` -------------------------------- ### Configure Tigase init.d Script for RedHat Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Sets up environment variables for Tigase Server on RedHat systems. Defines Java home, user credentials, installation paths, configuration locations, and logging directories. These variables must be customized for your specific installation before the init.d script can properly start and manage the Tigase service. ```bash 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.conf TIGASE_OPTIONS= TIGASE_PARAMS= PIDFILE= TIGASE_CONSOLE_LOG= ``` -------------------------------- ### Tigase Server TDSL Configuration Example Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Example Tigase server configuration file in TDSL format showing datasource setup, virtual host configuration, and enabled components including MUC, PubSub, and Message Archive. This configuration uses a Derby embedded database with the specified URI. ```conf 'config-type' = 'default' debug = [ 'server' ] 'default-virtual-host' = [ 'ubuntu' ] dataSource () { default () { uri = 'jdbc:derby:tigasedbx;create=true' } } amp () {} bosh () {} c2s () {} eventbus () {} http () {} 'message-archive' () {} monitor () {} muc () {} pubsub () {} s2s () {} ws2s () {} ``` -------------------------------- ### Start Tigase Service with systemctl Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Starts the Tigase Server service on systemd-based Linux distributions. Uses the systemctl command with elevated privileges to bring the tigase-server service online. ```bash sudo systemctl start tigase-server ``` -------------------------------- ### Start Tigase Server (Bash) Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md This command starts the Tigase XMPP Server. It requires the `JAVA_HOME` environment variable to be set correctly. The `etc/tigase.conf` file is used for configuration. ```bash scripts/tigase.sh start etc/tigase.conf ``` -------------------------------- ### Register Tigase Service with update-rc.d on Debian Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Installs the Tigase init.d script into Debian system runlevels using update-rc.d. This command enables automatic service startup at system boot with default runlevel configuration. ```bash update-rc.d tigase defaults ``` -------------------------------- ### Install Tigase Schema with Java (Windows) Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Installs the Tigase database schema directly using the Java command on Windows systems. This method requires specifying the classpath to include necessary JAR files and the fully qualified name of the schema manager class. It mirrors the functionality of the `tigase.sh` script. ```shell C:\tigase>java -cp "jars/*" tigase.db.util.SchemaManager "install-schema" -T derby -D tigasedb -H localhost -U tigase_user -P tigase_pass -R root -A rootpass -J admin@jabber.your-great.net -N pass ``` -------------------------------- ### Start Tigase Server using Java Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md This command starts the Tigase XMPP Server using the Java runtime. It specifies the classpath to include all JAR files in the 'jars' directory and then executes the main server class. Note that this method may freeze the command window and only display Tigase output. ```bash java -cp "jars/*" tigase.server.XMPPServer ``` -------------------------------- ### Install Tigase Schema with tigase.sh (Linux) Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Installs the Tigase database schema using the `tigase.sh` script on Linux systems. This command configures a Derby database with specified user credentials and administrator details. It relies on the presence of the `tigase.sh` script in the project root. ```shell ./scripts/tigase.sh install-schema etc/tigase.conf -T derby -D tigasedb -H localhost -U tigase_user -P tigase_pass -R root -A rootpass -J admin@jabber.your-great.net -N pass ``` -------------------------------- ### Enable Tigase Service Autostart with systemctl Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Configures Tigase Server to automatically start during system boot on systemd-based distributions. Enables the tigase-server service in systemd for persistent autostart across reboots. ```bash sudo systemctl enable tigase-server ``` -------------------------------- ### Start Tigase Service on Non-systemd Linux Distributions Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Starts the Tigase Server service using the traditional service command on non-systemd Linux distributions. Launches Tigase in the background as a managed system service. ```bash service tigase start ``` -------------------------------- ### Start Tigase Server on Linux Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Start the Tigase XMPP server on Linux systems using the init.d script from the scripts sub-directory. Replace {OS} with your Linux distribution (debian, gentoo, mandriva, or redhat). The server will output a process ID upon successful startup. ```bash ./scripts/{OS}/init.d/tigase start etc/tigase.conf ``` -------------------------------- ### Restarting Tigase XMPP Server using Scripts Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md This section provides the bash commands to stop and start the Tigase XMPP Server. It is recommended to use these scripts for proper server management. Ensure you are in the Tigase base directory before executing these commands. ```bash ./scripts/tigase.sh stop ./scripts/tigase.sh start etc/tigase.conf ``` -------------------------------- ### Load Tigase Database Schema in MySQL Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Selects the tigasedb database and loads the MySQL schema file required for Tigase XMPP server. The schema file (mysql-schema.sql) contains table definitions and initial data structure. Path assumes default Windows installation at 'c:/Program Files/Tigase/'. ```sql use tigasedb; source c:/Program Files/Tigase/database/mysql-schema.sql; ``` -------------------------------- ### Verify Tigase Server Listening Port (Bash) Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md This command uses `lsof` to check if the Tigase server is listening on port 8080, which is the default for the web installer. It displays details about network connections, including listening ports. ```bash lsof -i -P ``` -------------------------------- ### Extract Tigase Server Distribution (Bash) Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md This command extracts the Tigase XMPP Server distribution archive. Ensure you replace '' with the actual version number. After extraction, navigate into the created directory. ```bash tar -xf tigase-server--dist-max.tar.gz cd tigase-server- ``` -------------------------------- ### Enable XEP-305 Quickstart Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Release_Notes/Tigase_Release_Notes.md Implements XMPP Quickstart (XEP-0305) to speed up connection establishment. This feature is specific to the 'c2s' Connection Manager (port 5222) and requires enabling 'pipelining' in the c2s configuration block within config.tdsl. ```default c2s () { 'pipelining' = true } ``` -------------------------------- ### Verifying Tigase Server is Running with Listening Ports Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md This command lists all active network connections and listening ports, helping to confirm that the Tigase XMPP Server is running and accessible on its configured ports. The output shows the command, process ID, user, file descriptor, type, device, size/off, node, and name of the listening services. ```bash $ lsof -i -P COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 18387 tigase 141u IPv6 22185825 0t0 TCP *:8080 (LISTEN) java 18387 tigase 148u IPv6 22185834 0t0 TCP *:5222 (LISTEN) java 18387 tigase 149u IPv6 22185835 0t0 TCP *:5223 (LISTEN) java 18387 tigase 150u IPv6 22185836 0t0 TCP *:5290 (LISTEN) java 18387 tigase 151u IPv6 22185837 0t0 TCP *:5280 (LISTEN) java 18387 tigase 152u IPv6 22185838 0t0 TCP *:5269 (LISTEN) ``` -------------------------------- ### Control Tigase Service State on RedHat with chkconfig Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Enables, disables, or resets the Tigase service startup behavior across runlevels on RedHat systems. Supports three options: 'on' to enable autostart, 'off' to disable autostart, and 'reset' to return to default configuration. ```bash /sbin/chkconfig tigase ``` -------------------------------- ### Register Tigase Service with chkconfig on RedHat Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Adds the Tigase init.d script to the RedHat system service configuration using chkconfig. This command registers Tigase as a managed service and enables control via chkconfig commands for runlevel management. ```bash /sbin/chkconfig --add tigase ``` -------------------------------- ### Start Tigase Server with Configuration Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Database_Management/Management.md Shell command to start the Tigase Server with the specified configuration file. The script starts the server process using the tigase.sh startup script and loads the configuration from etc/tigase.conf. ```bash ./scripts/tigase.sh start etc/tigase.conf ``` -------------------------------- ### Plugin Test Example Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Development/Tests.md A basic example of how to write tests for plugins in a simple text file. This format allows specifying expected server interactions and responses without Java code. ```text # Example for XEP-0049 Private XML Storage # Expect a certain XML stanza from the server ``` -------------------------------- ### List Log Files in Tigase Server Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md This command lists the files in the logs directory of the Tigase server. It helps in identifying the main log files, 'tigase-console.log' and 'tigase.log.0', which are crucial for checking server status and potential errors like WARNING or SEVERE entries. ```sh ls -l logs/ ``` -------------------------------- ### Javadoc Structure Example Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Development/CodeStyleGuide.md Provides an example of Javadoc comments, highlighting the required blank lines after the description, parameter, and return tags, as well as the inclusion of empty tags for @param, @return, and @throws. ```java /** * Description of the method. * * @param paramName Description of the parameter. * @return Description of the return value. * @throws SomeException Description of when this exception is thrown. */ public void exampleMethod(String paramName) throws SomeException { // method body } ``` -------------------------------- ### Tigase Startup Configuration Example (Bash) Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Configuration/_Configuration.md A sample configuration snippet for the tigase.sh startup script, demonstrating how to set environment variables for Java options, database drivers, and Tigase-specific settings. This example uses PostgreSQL and sets UTF-8 encoding for enhanced compatibility. ```bash ENC="-Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8" DRV="-Djdbc.drivers=org.postgresql.Driver" JAVA_OPTIONS="${ENC} ${DRV} -server -Xms100M -Xmx100M " CLASSPATH="" TIGASE_CONFIG="tigase-pgsql.xml" TIGASE_OPTIONS=" " ``` -------------------------------- ### Configure Domain-Specific Repository with Default Data Source Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Development/Component_Implementation.md Demonstrates configuration of separate repository instances for specific domains. The 'example.com' repository will use a data source with the same name by default, while the 'default' repository handles all other domains. ```default dataSource () { // configuration of data sources here is not complete default () { uri = "jdbc:derby:/database" } 'example.com' () { uri = "jdbc:derby/example" } } test(class: TestComponent) { repository () { default () { } 'example.com' () { } } } ``` -------------------------------- ### Restart Tigase Service on Non-systemd Linux Distributions Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Restarts the Tigase Server service using the traditional service command on non-systemd systems. Stops and then starts the service sequentially, useful for applying configuration changes. ```bash service tigase restart ``` -------------------------------- ### Tigase Test Suite Configuration File Example Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Development/Tests.md An example of the `scripts/tests-runner-settings.sh` file used to customize Tigase Test Suite runs. This file allows defining database credentials, test targets, server settings, and memory configurations, simplifying complex command-line arguments. ```bash #!/bin/bash func_rep="func-rep.html" perf_rep="perf-rep.html" db_name="tigasetest" db_user="tigase" db_pass="tigase" root_user="root" root_pass="root" TESTS=("derby" "mysql" "pgsql" "mssql") IPS=("127.0.0.1" "127.0.0.1" "127.0.0.1" "127.0.0.1") server_timeout=10 server_dir="/home/tigase/tigase-server" database="derby" #database="mysql" server_ip="127.0.0.1" MS_MEM=100 MX_MEM=1000 SMALL_MS_MEM=10 SMALL_MX_MEM=50 ``` -------------------------------- ### Create Tigase Database in MySQL Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Creates a new MySQL database named 'tigasedb' for use with Tigase XMPP server. This command is executed in the MySQL console after starting the MySQL server. The database will store all Tigase server data and configuration. ```sql create database tigasedb; ``` -------------------------------- ### Stop Tigase Service with systemctl Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Stops the Tigase Server service on systemd-based Linux distributions. Uses systemctl to gracefully terminate the tigase-server service. ```bash sudo systemctl stop tigase-server ``` -------------------------------- ### Tigase Repository Utility Preset Configurations Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Database_Management/Management.md Example preset configurations for XML and MySQL repositories within the `repo.sh` script, demonstrating how to define source repository class names and initialization strings. ```bash XML_REP="-sc tigase.db.xml.XMLRepository -su ../testsuite/user-repository.xml_200k_backup" MYSQL_REP="-sc tigase.db.jdbc.JDBCRepository -su jdbc:mysql://localhost/tigase?user=root&password=mypass" PGSQL_REP="-sc tigase.db.jdbc.JDBCRepository -su jdbc:postgresql://localhost/tigase?user=tigase" ``` -------------------------------- ### Database Initialization Query Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Security/_Security.md A database initialization query run after the server starts. This example updates the 'online_status' column in the 'tig_users' table to 0. Note: The 'online_status' column may need to be added. ```SQL update tig_users set online_status = 0 ``` -------------------------------- ### Stop Tigase Service on Non-systemd Linux Distributions Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Stops the Tigase Server service using the traditional service command. Terminates the running Tigase process managed through the init.d service framework. ```bash service tigase stop ``` -------------------------------- ### Tigase Component Implementation with Service Discovery in Java Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Development/Component_Implementation.md Complete example of a spam filtering component extending AbstractKernelBasedComponent with service discovery configuration, module injection, packet processing, and threading setup. Includes methods for component versioning, discovery description, hash code calculation, and thread pool management. ```java public class TestComponent extends AbstractKernelBasedComponent { private static final Logger log = Logger.getLogger(TestComponent.class.getName()); @Inject private TestModule testModule; @Override public synchronized void everyMinute() { super.everyMinute(); testModule.everyMinute(); } @Override public String getComponentVersion() { String version = this.getClass().getPackage().getImplementationVersion(); return version == null ? "0.0.0" : version; } @Override public String getDiscoDescription() { return "Spam filtering"; } @Override public String getDiscoCategoryType() { return "spam"; } @Override public int hashCodeForPacket(Packet packet) { if (packet.getElemTo() != null) { return packet.getElemTo().hashCode(); } if (packet.getStanzaFrom() != null) { return packet.getStanzaFrom().hashCode(); } return 1; } @Override public boolean isDiscoNonAdmin() { return false; } @Override public int processingInThreads() { return Runtime.getRuntime().availableProcessors(); } @Override public int processingOutThreads() { return Runtime.getRuntime().availableProcessors(); } @Override protected void registerModules(Kernel kernel) { } } ``` -------------------------------- ### Tigase Data Source and Repository Implementations Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/index.md Demonstrates the implementation of data sources and user/authentication repositories in Tigase. This is crucial for managing user data, authentication credentials, and other persistent information required by the server. It covers basic data sources and custom authentication repository designs. ```Java /** * Interface for a generic data repository. */ public interface DataRepository { T findById(String id); void save(T data); } /** * Interface for user and authentication repositories. */ public interface AuthRepository { boolean authenticate(String username, String password); User findUser(String username); } /** * Simplest implementation of an AuthRepository using hardcoded credentials. * For demonstration purposes only. */ public class SimpleAuthRepository implements AuthRepository { private Map users = new HashMap<>(); public SimpleAuthRepository() { users.put("admin", "password123"); } @Override public boolean authenticate(String username, String password) { return users.containsKey(username) && users.get(username).equals(password); } @Override public User findUser(String username) { if (users.containsKey(username)) { return new User(username); } return null; } // Inner class to represent a User private static class User { private String username; public User(String username) { this.username = username; } public String getUsername() { return username; } } } ``` -------------------------------- ### Grant Database User Permissions in MySQL Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Quick_Start_Guide/Intro.md Sets up database user 'tigase_user' with password 'tigase_passwd' and grants all privileges on the tigasedb database. Commands establish access from any host (%), localhost, and the local machine. FLUSH PRIVILEGES reloads the privilege tables to apply changes immediately. ```sql GRANT ALL ON tigasedb.* TO tigase_user@'%' IDENTIFIED BY 'tigase_passwd'; GRANT ALL ON tigasedb.* TO tigase_user@'localhost' IDENTIFIED BY 'tigase_passwd'; GRANT ALL ON tigasedb.* TO tigase_user IDENTIFIED BY 'tigase_passwd'; FLUSH PRIVILEGES; ``` -------------------------------- ### Tigase Repository Utility Script Help Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Database_Management/Management.md Displays the help message for the Tigase repository utility script (`repo.sh`), listing all available parameters for managing user data. ```bash ./scripts/repo.sh -h ``` -------------------------------- ### Detailed Custom Port Configuration for Tigase Cluster Source: https://github.com/tigase/tigase-server/blob/master/src/main/restructured/Tigase_Administration/Using_Tigase/_using_tigase.md Provides a detailed example of configuring a specific port (4250) within the Tigase cluster component. This allows fine-grained control over network interfaces, remote host settings, socket types, and TLS requirements. This is optional and typically not needed for basic setups. It influences how the cluster component listens for and establishes connections. ```default 'cl-comp' { connections { 4250 { ifc = [ '*' ] 'remote-host' = 'localhost' socket = 'plain' type = 'accept' connections { tls { required = false } } } } } ```