tigase.db.jdbc

## Class DrupalWPAuth

- java.lang.Object
- - tigase.db.jdbc.DrupalWPAuth

- All Implemented Interfaces:
    AuthRepository, Repository

      public class DrupalWPAuth
      extends Object
      implements AuthRepository

  Describe class DrupalWPAuth here. Created: Sat Nov 11 22:22:04 2006
  Version:
    $Rev$
  Author:
    Artur Hefczyc

- - ### Nested Class Summary

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

      `Repository.Meta`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DRUPAL_NAME_FLD` Field description
    `static int` | `DRUPAL_OK_STATUS_VAL` Field description
    `static String` | `DRUPAL_PASS_FLD` Field description
    `static String` | `DRUPAL_STATUS_FLD` Field description
    `static String` | `DRUPAL_USERS_TBL` Field description
    `static String` | `WP_NAME_FLD` Field description
    `static int` | `WP_OK_STATUS_VAL` Field description
    `static String` | `WP_PASS_FLD` Field description
    `static String` | `WP_STATUS_FLD` Field description
    `static String` | `WP_USERS_TBL` Field description

    - ### 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, USERNAME_KEY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DrupalWPAuth()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addUser(BareJID user, String password)` Describe `addUser` method here.
    `boolean` | `digestAuth(BareJID user, String digest, String id, String alg)` Deprecated.
    `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 connection_str, Map<String,String> params)` The method is called to initialize the data repository.
    `boolean` | `isUserDisabled(BareJID user)`
    `void` | `logout(BareJID user)` Describe `logout` method here.
    `boolean` | `otherAuth(Map<String,Object> props)` Describe `otherAuth` method here.
    `boolean` | `plainAuth(BareJID user, String password)` Deprecated.
    `void` | `queryAuth(Map<String,Object> authProps)` `queryAuth` returns mechanisms available for authentication.
    `void` | `removeUser(BareJID user)` Describe `removeUser` method here.
    `void` | `setUserDisabled(BareJID user, Boolean value)`
    `void` | `updatePassword(BareJID user, String password)` Describe `updatePassword` method here.

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

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

- - ### Field Detail

    - #### DRUPAL_USERS_TBL

          public static final String DRUPAL_USERS_TBL

      Field description
      See Also:
        Constant Field Values

    - #### DRUPAL_NAME_FLD

          public static final String DRUPAL_NAME_FLD

      Field description
      See Also:
        Constant Field Values

    - #### DRUPAL_PASS_FLD

          public static final String DRUPAL_PASS_FLD

      Field description
      See Also:
        Constant Field Values

    - #### DRUPAL_STATUS_FLD

          public static final String DRUPAL_STATUS_FLD

      Field description
      See Also:
        Constant Field Values

    - #### DRUPAL_OK_STATUS_VAL

          public static final int DRUPAL_OK_STATUS_VAL

      Field description
      See Also:
        Constant Field Values

    - #### WP_USERS_TBL

          public static final String WP_USERS_TBL

      Field description
      See Also:
        Constant Field Values

    - #### WP_NAME_FLD

          public static final String WP_NAME_FLD

      Field description
      See Also:
        Constant Field Values

    - #### WP_PASS_FLD

          public static final String WP_PASS_FLD

      Field description
      See Also:
        Constant Field Values

    - #### WP_STATUS_FLD

          public static final String WP_STATUS_FLD

      Field description
      See Also:
        Constant Field Values

    - #### WP_OK_STATUS_VAL

          public static final int WP_OK_STATUS_VAL

      Field description
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DrupalWPAuth

          public DrupalWPAuth()

  - ### Method Detail

    - #### addUser

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

      Description copied from interface: `AuthRepository`
      Describe `addUser` method here.
      Specified by:
        `addUser` in interface `AuthRepository`
      Parameters:
        `user` - a `BareJID` value
        `password` - a `String` value
      Throws:
        `UserExistsException` - if an error occurs
        `TigaseDBException` - if an error occurs

    - #### digestAuth

          @Deprecated
          public boolean digestAuth(BareJID user,
                                                String digest,
                                                String id,
                                                String alg)
                                         throws UserNotFoundException,
                                                TigaseDBException,
                                                AuthorizationException

      Deprecated.
      Description copied from interface: `AuthRepository`
      `digestAuth` method performs non-sasl, digest authentication as described in non-sasl authentication XEP-0078 For now it is empty and always returns `false` as I don't have description for database with passwords.
      Specified by:
        `digestAuth` in interface `AuthRepository`
      Parameters:
        `user` - a `BareJID` value of user name
        `digest` - a `String` value password digest sum
        `id` - a `String` value session ID used for digest sum calculation.
        `alg` - a `String` value of algorithm ID used for digest sum calculation.
      Returns:
        a `boolean` value `true` on successful authentication, `false` on authentication failure.
      Throws:
        `UserNotFoundException` - if an given user name is not found in the authentication repository.
        `TigaseDBException` - if an error occurs during during accessing database;
        `AuthorizationException` - if an error occurs during authentication process.

    - #### 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.

    - #### 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`
      Returns:
        a `long` number of registered users in the repository.

    - #### initRepository

          public void initRepository(String connection_str,
                                     Map<String,String> params)
                              throws DBInitException

      Description copied from interface: `Repository`
      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:
        `connection_str` - 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.

    - #### logout

          public void logout(BareJID user)
                      throws UserNotFoundException,
                             TigaseDBException

      Description copied from interface: `AuthRepository`
      Describe `logout` method here.
      Specified by:
        `logout` in interface `AuthRepository`
      Parameters:
        `user` - a `BareJID` value
      Throws:
        `UserNotFoundException` - if an error occurs
        `TigaseDBException` - if an error occurs

    - #### otherAuth

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

      Description copied from interface: `AuthRepository`
      Describe `otherAuth` method here.
      Specified by:
        `otherAuth` in interface `AuthRepository`
      Parameters:
        `props` - a `Map` value
      Returns:
        a `boolean` value
      Throws:
        `UserNotFoundException` - if an error occurs
        `TigaseDBException` - if an error occurs
        `AuthorizationException` - if an error occurs

    - #### plainAuth

          @Deprecated
          public boolean plainAuth(BareJID user,
                                               String password)
                                        throws UserNotFoundException,
                                               TigaseDBException,
                                               AuthorizationException

      Deprecated.
      Description copied from interface: `AuthRepository`
      `plainAuth` method performs non-sasl, plain authentication as described in non-sasl authentication XEP-0078.
      Specified by:
        `plainAuth` in interface `AuthRepository`
      Parameters:
        `user` - a `BareJID` value of user name
        `password` - a `String` value of plain user password.
      Returns:
        a `boolean` value `true` on successful authentication, `false` on authentication failure.
      Throws:
        `UserNotFoundException` - if an given user name is not found in the authentication repository.
        `TigaseDBException` - if an error occurs during during accessing database;
        `AuthorizationException` - if an error occurs during authentication process.

    - #### 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.

    - #### removeUser

          public void removeUser(BareJID user)
                          throws UserNotFoundException,
                                 TigaseDBException

      Description copied from interface: `AuthRepository`
      Describe `removeUser` method here.
      Specified by:
        `removeUser` in interface `AuthRepository`
      Parameters:
        `user` - a `BareJID` value
      Throws:
        `UserNotFoundException` - if an error occurs
        `TigaseDBException` - if an error occurs

    - #### updatePassword

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

      Description copied from interface: `AuthRepository`
      Describe `updatePassword` method here.
      Specified by:
        `updatePassword` in interface `AuthRepository`
      Parameters:
        `user` - a `BareJID` value
        `password` - a `String` value
      Throws:
        `UserNotFoundException`
        `TigaseDBException` - if an error occurs

    - #### getPassword

          public String getPassword(BareJID user)
                             throws UserNotFoundException,
                                    TigaseDBException

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

    - #### isUserDisabled

          public boolean isUserDisabled(BareJID user)
                                 throws UserNotFoundException,
                                        TigaseDBException

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

    - #### setUserDisabled

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

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

Copyright © 2022 "Tigase, Inc.". All rights reserved.