Class Schema


  • public class Schema
    extends java.lang.Object
    • Method Detail

      • initialize

        public static Schema initialize​(com.zaxxer.hikari.HikariDataSource dataSource)
                                 throws java.sql.SQLException
        Initialize the database Schema and the Channels Cache.
        Parameters:
        dataSource - a HikariDataSource
        Returns:
        the Schema
        Throws:
        java.sql.SQLException - on error
      • getChannel

        public Schema.ChannelRecord getChannel​(java.sql.Connection con,
                                               java.lang.String edgeId,
                                               java.lang.String channelAddress,
                                               com.google.gson.JsonElement value)
                                        throws java.sql.SQLException
        Gets the Channel for the given Point. Adds it if it was not existing before.
        Parameters:
        con - a database Connection, in case the entry needs to be added
        edgeId - the Edge-ID
        channelAddress - the Channel-Address
        value - the JsonElement value
        Returns:
        the Schema.ChannelRecord; or null if not in Cache and type cannot be detected
        Throws:
        java.sql.SQLException - on error while adding
      • getChannelFromCache

        public Schema.ChannelRecord getChannelFromCache​(java.lang.String edgeId,
                                                        java.lang.String channelAddress)
        Gets the Schema.ChannelRecord from local Cache.
        Parameters:
        edgeId - the Edge-ID
        channelAddress - the Channel-Address
        Returns:
        the Schema.ChannelRecord with a database ID for table 'channel', null if there is no entry yet