Class JsonProductStorage

All Implemented Interfaces:
ProductStorage, Configurable, AutoCloseable

public class JsonProductStorage extends JDBCConnection implements ProductStorage
Store Products in a database. Note that this storage does not store Product Content, and is intended for Products that use URLContent and can be serialized using JsonProduct. Only SQLITE or local development should rely on createSchema. Products (data column) have exceeded 64kb, plan accordingly. Mysql Schema Example:
 CREATE TABLE IF NOT EXISTS indexer_storage
 (id INTEGER PRIMARY KEY AUTO_INCREMENT
 , source VARCHAR(255)
 , type VARCHAR(255)
 , code VARCHAR(255)
 , updatetime BIGINT
 , data LONGTEXT
 , UNIQUE KEY product_index (source, type, code, updatetime)
 ) ENGINE=innodb CHARSET=utf8;
 
  • Field Details

  • Constructor Details

    • JsonProductStorage

      public JsonProductStorage()
      Create a JsonProductStorage using defaults.
    • JsonProductStorage

      public JsonProductStorage(String driver, String url)
      Create a JsonProductStorage with a default table.
      Parameters:
      driver - Driver to use
      url - URL to use
    • JsonProductStorage

      public JsonProductStorage(String driver, String url, String table)
      Create a JsonProductStorage with a custom driver, url, and table.
      Parameters:
      driver - Driver to use
      url - URL to use
      table - Table to use
  • Method Details