Interface Convertible<T extends RowEntity>

  • All Known Implementing Classes:
    UserCredentialsConverter

    public interface Convertible<T extends RowEntity>
    Interface for all converters of data from other servers. In principle it makes a query to database, process each row creating an object of RowEntity and then insets it to Tigase repository
    • Method Detail

      • getMainQuery

        java.util.Optional<java.lang.String> getMainQuery()
        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).
      • initialise

        void initialise​(Converter.ConverterProperties properties)
        Method is responsible for initialising converter based on ConverterProperties.
        Parameters:
        properties - various properties allowing determine appropriate set of queries and applied processing.
      • processResultSet

        java.util.Optional<T> processResultSet​(java.sql.ResultSet rs)
                                        throws java.lang.Exception
        Process ResultSet to produce object extending RowEntity
        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

        boolean storeEntity​(T entity)
                     throws java.lang.Exception
        Method stores RowEntity in the destination repositories.
        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

        default 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
        Returns:
        Map with key-value pair of query ID and actual query to be initialised
      • getParentBean

        default java.util.Optional<java.lang.Class> getParentBean()
      • dependsOn

        default java.util.Optional<java.lang.Class<? extends Convertible>> dependsOn()