Class SQLStoreConfiguration

  • All Implemented Interfaces:
    com.nimbusds.common.config.LoggableConfiguration, org.infinispan.configuration.cache.StoreConfiguration

    @Immutable
    public class SQLStoreConfiguration
    extends org.infinispan.configuration.cache.AbstractStoreConfiguration
    implements com.nimbusds.common.config.LoggableConfiguration
    SQL store configuration.

    Example XML configuration:

     <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xsi:schemaLocation="urn:infinispan:config:8.2 http://www.infinispan.org/schemas/infinispan-config-8.2.xsd"
                      xmlns="urn:infinispan:config:8.2"
                      xmlns:sql="urn:infinispan:config:store:sql:2.2">
            
            <cache-container name="myCacheContainer" default-cache="myMap" statistics="true">
                    <jmx duplicate-domains="true"/>
                    <local-cache name="myMap">
                            <eviction type="COUNT" size="100"/>
                            <persistence passivation="false">
                                    <sql-store xmlns="urn:infinispan:config:store:sql:2.2"
                                                  shared="true"
                                                  record-transformer="com.nimbusds.infinispan.persistence.sql.UserRecordTransformer"
                                                  sql-dialect="H2"
                                                  create-table-if-missing="true">
    
                                    <property name="jdbcUrl">jdbc:h2:mem:test;DATABASE_TO_UPPER=false</property>
                                    <property name="username">admin</property>
                                    <property name="password">secret</property>
    
                                    </sql-store>
                            </persistence>
                    </local-cache>
            </cache-container>
            
     </infinispan>
     
    • Field Summary

      • Fields inherited from class org.infinispan.configuration.cache.AbstractStoreConfiguration

        attributes, FETCH_PERSISTENT_STATE, IGNORE_MODIFICATIONS, MAX_BATCH_SIZE, PRELOAD, PROPERTIES, PURGE_ON_STARTUP, SEGMENTED, SHARED, TRANSACTIONAL
      • Fields inherited from interface com.nimbusds.common.config.LoggableConfiguration

        LOG_CATEGORY
    • Constructor Summary

      Constructors 
      Constructor Description
      SQLStoreConfiguration​(org.infinispan.commons.configuration.attributes.AttributeSet attributes, org.infinispan.configuration.cache.AsyncStoreConfiguration asyncConfig, org.infinispan.configuration.cache.SingletonStoreConfiguration singletonStoreConfig)
      Creates a new SQL store configuration.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static org.infinispan.commons.configuration.attributes.AttributeSet attributeDefinitionSet()
      Returns the attribute definitions for the SQL store configuration.
      boolean createTableIfMissing()
      Returns the configured create table if missing setting.
      java.lang.Class getQueryExecutorClass()
      Returns the optional class for executing direct SQL queries against the database.
      java.lang.Class getRecordTransformerClass()
      Returns the class for transforming between Infinispan entries (key / value pairs and optional metadata) and a corresponding SQL record.
      org.jooq.SQLDialect getSQLDialect()
      Returns the configured SQL dialect.
      void log()  
      java.util.Properties properties()  
      • Methods inherited from class org.infinispan.configuration.cache.AbstractStoreConfiguration

        async, attributes, equals, fetchPersistentState, hashCode, ignoreModifications, maxBatchSize, preload, purgeOnStartup, segmented, shared, singletonStore, toString, transactional
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SQLStoreConfiguration

        public SQLStoreConfiguration​(org.infinispan.commons.configuration.attributes.AttributeSet attributes,
                                     org.infinispan.configuration.cache.AsyncStoreConfiguration asyncConfig,
                                     org.infinispan.configuration.cache.SingletonStoreConfiguration singletonStoreConfig)
        Creates a new SQL store configuration.
        Parameters:
        attributes - The configuration attributes. Must not be null.
        asyncConfig - Configuration for the async cache loader.
        singletonStoreConfig - Configuration for a singleton store.
    • Method Detail

      • attributeDefinitionSet

        public static org.infinispan.commons.configuration.attributes.AttributeSet attributeDefinitionSet()
        Returns the attribute definitions for the SQL store configuration.
        Returns:
        The attribute definitions.
      • getRecordTransformerClass

        public java.lang.Class getRecordTransformerClass()
        Returns the class for transforming between Infinispan entries (key / value pairs and optional metadata) and a corresponding SQL record.

        See SQLRecordTransformer.

        Returns:
        The record transformer class.
      • getQueryExecutorClass

        public java.lang.Class getQueryExecutorClass()
        Returns the optional class for executing direct SQL queries against the database.

        See QueryExecutor

        Returns:
        The query executor class, null if not specified.
      • getSQLDialect

        public org.jooq.SQLDialect getSQLDialect()
        Returns the configured SQL dialect.
        Returns:
        The SQL dialect.
      • createTableIfMissing

        public boolean createTableIfMissing()
        Returns the configured create table if missing setting.
        Returns:
        true to create the underlying table(s) if missing, false to skip this check.
      • properties

        public java.util.Properties properties()
        Specified by:
        properties in interface org.infinispan.configuration.cache.StoreConfiguration
        Overrides:
        properties in class org.infinispan.configuration.cache.AbstractStoreConfiguration
      • log

        public void log()
        Specified by:
        log in interface com.nimbusds.common.config.LoggableConfiguration