Package tigase.db.converter.converters

## Class UserCredentialsConverter

- java.lang.Object
- - tigase.db.converter.converters.UserCredentialsConverter

- All Implemented Interfaces:
    `Convertible<UserEntity>`

      public class UserCredentialsConverter
      extends java.lang.Object
      implements Convertible<UserEntity>

  Class responsible for converting user-data Based on: https://docs.ejabberd.im/developer/sql-schema/ https://github.com/processone/ejabberd/tree/master/sql

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `UserCredentialsConverter()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.util.Map<java.lang.String,​java.lang.String>` | `getAdditionalQueriesToInitialise()` | Method allows providing additional queries that needs to be initialised in `DataRepository` for future use
    `java.util.Optional<java.lang.String>` | `getMainQuery()` | Principal query used to retrieve data from source repository.
    `void` | `initialise​(Converter.ConverterProperties properties)` | Method is responsible for initialising converter based on ConverterProperties.
    `java.util.Optional<UserEntity>` | `processResultSet​(java.sql.ResultSet rs)` | Process `ResultSet` to produce object extending `RowEntity`
    `boolean` | `storeEntity​(UserEntity entity)` | Method stores `RowEntity` in the destination repositories.

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

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

    - ### Methods inherited from interface tigase.db.converter.Convertible

      `dependsOn, getParentBean`

- - ### Constructor Detail

    - #### UserCredentialsConverter

          public UserCredentialsConverter()

  - ### Method Detail

    - #### initialise

          public void initialise​(Converter.ConverterProperties properties)

      Description copied from interface: `Convertible`
      Method is responsible for initialising converter based on ConverterProperties.
      Specified by:
        `initialise` in interface `Convertible<UserEntity>`
      Parameters:
        `properties` - various properties allowing determine appropriate set of queries and applied processing.

    - #### getMainQuery

          public java.util.Optional<java.lang.String> getMainQuery()

      Description copied from interface: `Convertible`
      Principal query used to retrieve data from source repository. It's used to determine if implementation offers support for particular combination of source XMPP Server and database type (empty Optional indicates lack of support resulting in skipping implementation).
      Specified by:
        `getMainQuery` in interface `Convertible<UserEntity>`

    - #### processResultSet

          public java.util.Optional<UserEntity> processResultSet​(java.sql.ResultSet rs)
                                                          throws java.lang.Exception

      Description copied from interface: `Convertible`
      Process `ResultSet` to produce object extending `RowEntity`
      Specified by:
        `processResultSet` in interface `Convertible<UserEntity>`
      Parameters:
        `rs` - result set to be processed
      Returns:
        `RowEntity` with all data from single Row
      Throws:
        `java.lang.Exception` - indicates any problem with processing of the data

    - #### storeEntity

          public boolean storeEntity​(UserEntity entity)
                              throws java.lang.Exception

      Description copied from interface: `Convertible`
      Method stores `RowEntity` in the destination repositories.
      Specified by:
        `storeEntity` in interface `Convertible<UserEntity>`
      Parameters:
        `entity` - `RowEntity` to be stored
      Returns:
        value indicating if storing was successful
      Throws:
        `java.lang.Exception` - indicates any problem with storing of the `RowEntity`

    - #### getAdditionalQueriesToInitialise

          public java.util.Map<java.lang.String,​java.lang.String> getAdditionalQueriesToInitialise()

      Description copied from interface: `Convertible`
      Method allows providing additional queries that needs to be initialised in `DataRepository` for future use
      Specified by:
        `getAdditionalQueriesToInitialise` in interface `Convertible<UserEntity>`
      Returns:
        `Map` with key-value pair of query ID and actual query to be initialised