Project

General

Profile

Additional properties for user repository object

Robert Larsen
Added almost 5 years ago

Hi

I have implemented my own AuthRepository and UserRepository classes and I would like to pass some configuration options to them, but I cannot see how to format the option names so that they are passed on to them. No matter what I try putting into init.properties I end up with only auth-repo-pool-size, data-repo-pool-size and database-type, and those seem to be provided by code and not the config file.

I see that something adds tables (cluster_nodes, msg_history and user_jid) to my database and that is what I would like to prevent, so I could give Tigase another database that it can mess up as it likes, and then I could have my code access my database the way I want it to by providing connection details differently.


Replies (3)

Added by Wojciech Kapcia TigaseTeam almost 5 years ago

Starting from the end:

  • cluster_nodes is created by tigase.cluster.repo.ClConSQLRepository and it's used for clustering auto-discovery feature - it always use default repository and creates table if not present (when clustering is enabled);

  • msg_history and user_jid on the other hand are used by the AMP component and you can specify any repo URI for it:

amp/amp-repo-uri[S]=jdbc:…

As for passing additional properties - have you tried:

basic-conf/(auth|user|data)-repo-params/[domain_name/]property=value

You should then get all the properties in initRepository pertaining to particular repository type that.

Added by Robert Larsen almost 5 years ago

Bloody marvelous! That did the trick.

It seems that '--user-db-uri' is used as the default database. Is there a more "logical" name I can use to change it? Just so that I can keep the '--user-db-uri' and '--auth-db-uri'.

Added by Wojciech Kapcia TigaseTeam almost 5 years ago

Robert Larsen wrote:

It seems that '--user-db-uri' is used as the default database. Is there a more "logical" name I can use to change it? Just so that I can keep the '--user-db-uri' and '--auth-db-uri'.

Just a bit of background - all properties from init.properties prefixed with double dash (@--@) are converted to java properties so you can access them from anywhere.

With that in mind... I'm not sure I'm following - most of the time components fall back to --user-db-uri if no URI is provided as this should be the most basic/default URI for the default repository for user data (i.e. user-repository).

    (1-3/3)