tigase.db

## Class AuthRepositoryPool

- java.lang.Object
- - tigase.db.AuthRepositoryPool

- All Implemented Interfaces:
    AuthRepository, Repository, RepositoryPool<AuthRepository>

      public class AuthRepositoryPool
      extends Object
      implements AuthRepository, RepositoryPool<AuthRepository>

  Pool for authentication repositories. *
  This pool should be used if connection to authentication storage is blocking or synchronized, ie. implemented using single connection.*
  If implementation of `AuthRepository` uses connection pool or non blocking, concurrent access to authentication storage (ie. `DataSourcePool`), then this pool is not need.
  Created: Mar 27, 2010 11:31:17 PM
  Author:
    Artur Hefczyc

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface tigase.db.AuthRepository

      `AuthRepository.AccountStatus, AuthRepository.DefaultCredentials, AuthRepository.SingleCredential`

    - ### Nested classes/interfaces inherited from interface tigase.db.Repository

      `Repository.Meta, Repository.SchemaId`

  - ### Field Summary

    - ### Fields inherited from interface tigase.db.AuthRepository

      `DATA_KEY, DIGEST_ID_KEY, DIGEST_KEY, MACHANISM_KEY, PASSWORD_KEY, PROTOCOL_KEY, PROTOCOL_VAL_NONSASL, PROTOCOL_VAL_SASL, REALM_KEY, RESULT_KEY, SERVER_NAME_KEY, USER_ID_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AuthRepositoryPool()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRepo(AuthRepository repo)` Method called to add instance of a repository to the repository pool.
    `void` | `addUser(BareJID user, String password)`
    `AuthRepository.AccountStatus` | `getAccountStatus(BareJID user)`
    `Collection<String>` | `getCredentialIds(BareJID user)`
    `Credentials` | `getCredentials(BareJID user, String credentialId)`
    `String` | `getPassword(BareJID user)`
    `String` | `getResourceUri()` `getResourceUri` method returns database connection string.
    `long` | `getUsersCount()` This method is only used by the server statistics component to report number of registered users.
    `long` | `getUsersCount(String domain)` This method is only used by the server statistics component to report number of registered users for given domain.
    `void` | `initRepository(String resource_uri, Map<String,String> params)` Deprecated.
    `boolean` | `isMechanismSupported(String domain, String mechanism)`
    `boolean` | `isUserDisabled(BareJID user)`
    `void` | `loggedIn(BareJID user)` Do some actions on repository, when user logs in.
    `void` | `logout(BareJID user)`
    `boolean` | `otherAuth(Map<String,Object> authProps)`
    `void` | `queryAuth(Map<String,Object> authProps)` `queryAuth` returns mechanisms available for authentication.
    `void` | `removeCredential(BareJID user, String credentialId)`
    `void` | `removeUser(BareJID user)`
    `void` | `setAccountStatus(BareJID user, AuthRepository.AccountStatus status)`
    `void` | `setUserDisabled(BareJID user, Boolean value)`
    `AuthRepository` | `takeRepo()`
    `void` | `updateCredential(BareJID user, String credentialId, String password)`
    `void` | `updatePassword(BareJID user, String password)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface tigase.db.AuthRepository

      `getUsernames, setCredentialsCodecs`

- - ### Constructor Detail

    - #### AuthRepositoryPool

          public AuthRepositoryPool()

  - ### Method Detail

    - #### addRepo

          public void addRepo(AuthRepository repo)

      Description copied from interface: `RepositoryPool`
      Method called to add instance of a repository to the repository pool.
      Specified by:
        `addRepo` in interface `RepositoryPool<AuthRepository>`
      Parameters:
        `repo` - instance of a repository

    - #### addUser

          public void addUser(BareJID user,
                              String password)
                       throws TigaseDBException

      Specified by:
        `addUser` in interface `AuthRepository`
      Throws:
        `TigaseDBException`

    - #### getAccountStatus

          public AuthRepository.AccountStatus getAccountStatus(BareJID user)
                                                        throws TigaseDBException

      Specified by:
        `getAccountStatus` in interface `AuthRepository`
      Throws:
        `TigaseDBException`

    - #### getCredentials

          public Credentials getCredentials(BareJID user,
                                            String credentialId)
                                     throws TigaseDBException

      Specified by:
        `getCredentials` in interface `AuthRepository`
      Throws:
        `TigaseDBException`

    - #### getPassword

          public String getPassword(BareJID user)
                             throws TigaseDBException

      Specified by:
        `getPassword` in interface `AuthRepository`
      Throws:
        `TigaseDBException`

    - #### getResourceUri

          public String getResourceUri()

      Description copied from interface: `AuthRepository`
      `getResourceUri` method returns database connection string.
      Specified by:
        `getResourceUri` in interface `AuthRepository`
      Returns:
        a `String` value of database connection string.

    - #### getCredentialIds

          public Collection<String> getCredentialIds(BareJID user)
                                              throws TigaseDBException

      Specified by:
        `getCredentialIds` in interface `AuthRepository`
      Throws:
        `TigaseDBException`

    - #### getUsersCount

          public long getUsersCount()

      Description copied from interface: `AuthRepository`
      This method is only used by the server statistics component to report number of registered users.
      Specified by:
        `getUsersCount` in interface `AuthRepository`
      Returns:
        a `long` number of registered users in the repository.

    - #### getUsersCount

          public long getUsersCount(String domain)

      Description copied from interface: `AuthRepository`
      This method is only used by the server statistics component to report number of registered users for given domain.
      Specified by:
        `getUsersCount` in interface `AuthRepository`
      Parameters:
        `domain` - for which get the statistics
      Returns:
        a `long` number of registered users in the repository.

    - #### initRepository

          @Deprecated
          public void initRepository(String resource_uri,
                                                 Map<String,String> params)
                                          throws DBInitException

      Deprecated.
      Description copied from interface: `Repository`
      Method is deprecated and should not be user any more.
      The method is called to initialize the data repository. Depending on the implementation all the initialization parameters can be passed either via `resource_uri` parameter as the database connection string or via `params` map if the required repository parameters are more complex or both.
      Specified by:
        `initRepository` in interface `Repository`
      Parameters:
        `resource_uri` - value in most cases representing the database connection string.
        `params` - is a `Map` with repository properties necessary to initialize and perform all the functions. The initialization parameters are implementation dependent.
      Throws:
        `DBInitException` - if there was an error during repository initialization. Some implementations, though, perform so called lazy initialization so even though there is a problem with the underlying repository it may not be signaled through this method call.

    - #### isMechanismSupported

          public boolean isMechanismSupported(String domain,
                                              String mechanism)

      Specified by:
        `isMechanismSupported` in interface `AuthRepository`

    - #### isUserDisabled

          public boolean isUserDisabled(BareJID user)
                                 throws TigaseDBException

      Specified by:
        `isUserDisabled` in interface `AuthRepository`
      Throws:
        `TigaseDBException`

    - #### loggedIn

          public void loggedIn(BareJID user)
                        throws TigaseDBException

      Description copied from interface: `AuthRepository`
      Do some actions on repository, when user logs in. (for example update `last_login_time`)
      Specified by:
        `loggedIn` in interface `AuthRepository`
      Parameters:
        `user` - JID of logged user.
      Throws:
        `TigaseDBException` - if an error occurs

    - #### logout

          public void logout(BareJID user)
                      throws TigaseDBException

      Specified by:
        `logout` in interface `AuthRepository`
      Throws:
        `TigaseDBException`

    - #### otherAuth

          public boolean otherAuth(Map<String,Object> authProps)
                            throws TigaseDBException,
                                   AuthorizationException

      Specified by:
        `otherAuth` in interface `AuthRepository`
      Throws:
        `TigaseDBException`
        `AuthorizationException`

    - #### queryAuth

          public void queryAuth(Map<String,Object> authProps)

      Description copied from interface: `AuthRepository`
      `queryAuth` returns mechanisms available for authentication.
      Specified by:
        `queryAuth` in interface `AuthRepository`
      Parameters:
        `authProps` - a `Map` value with parameters for authentication.

    - #### removeCredential

          public void removeCredential(BareJID user,
                                       String credentialId)
                                throws TigaseDBException

      Specified by:
        `removeCredential` in interface `AuthRepository`
      Throws:
        `TigaseDBException`

    - #### removeUser

          public void removeUser(BareJID user)
                          throws TigaseDBException

      Specified by:
        `removeUser` in interface `AuthRepository`
      Throws:
        `TigaseDBException`

    - #### setAccountStatus

          public void setAccountStatus(BareJID user,
                                       AuthRepository.AccountStatus status)
                                throws TigaseDBException

      Specified by:
        `setAccountStatus` in interface `AuthRepository`
      Throws:
        `TigaseDBException`

    - #### setUserDisabled

          public void setUserDisabled(BareJID user,
                                      Boolean value)
                               throws TigaseDBException

      Specified by:
        `setUserDisabled` in interface `AuthRepository`
      Throws:
        `TigaseDBException`

    - #### takeRepo

          public AuthRepository takeRepo()

    - #### updateCredential

          public void updateCredential(BareJID user,
                                       String credentialId,
                                       String password)
                                throws TigaseDBException

      Specified by:
        `updateCredential` in interface `AuthRepository`
      Throws:
        `TigaseDBException`

    - #### updatePassword

          public void updatePassword(BareJID user,
                                     String password)
                              throws TigaseDBException

      Specified by:
        `updatePassword` in interface `AuthRepository`
      Throws:
        `TigaseDBException`

Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.