Package tigase.db.converter.converters

# Class UserCredentialsConverter

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

All Implemented Interfaces:
  `Convertible<UserEntity>`

public class UserCredentialsConverter extends 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

  Modifier and Type
  Method
  Description
  `Map<String,String>`
  `getAdditionalQueriesToInitialise()`
  Method allows providing additional queries that needs to be initialised in `DataRepository` for future use
  `Optional<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.
  `Optional<UserEntity>`
  `processResultSet(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 Details

  - ### UserCredentialsConverter

    public UserCredentialsConverter()

- ## Method Details

  - ### 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 Optional<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 Optional<UserEntity> processResultSet(ResultSet rs) throws 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:
      `Exception` - indicates any problem with processing of the data

  - ### storeEntity

    public boolean storeEntity(UserEntity entity) throws 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:
      `Exception` - indicates any problem with storing of the `RowEntity`

  - ### getAdditionalQueriesToInitialise

    public Map<String,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