H2NVCache

org.eso.ias.utils.pcache.impl.H2NVCache
See theH2NVCache companion object
sealed abstract class H2NVCache(val dbUrl: String, val userName: String, val password: String) extends NonVolatileCache

A non volatile cache of objects persisted with H2 (https://www.h2database.com/html/main).

The URl allows to create the DB in,memory, on a file on disk, or to connect to a remote DB: see H2 URL for a detailed discussion.

Objects of this class cannot be instantiated directly but must be instantiate with one of the case classes provided in the companion object.

This class is not thread safe.

Value parameters

dbUrl

The URL of the DB (see H2 for the format)

password

The password for the login

userName

The user name to log into the RDMS

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def shutdown(): Unit

Concrete methods

override def clear(): Unit

Empty the cache

Empty the cache

Attributes

Definition Classes
override def del(key: String): Boolean

Remove an object from the cache

Remove an object from the cache

Value parameters

key

The key of the object to remove

Attributes

Returns

True if the object has been removed, False otherwise (for example the object was not in the cache)

Definition Classes
override def get(key: String): Option[String]

Get an object from the cache

Get an object from the cache

Value parameters

key

The key of the object

Attributes

Returns

The Object in the cache if it exists, empty otherwise

Definition Classes
def isTableCreated(): Boolean

Check if the table already exists in the DB

Check if the table already exists in the DB

Attributes

Returns

true if the table exists, false otherwise

override def keySet: Set[String]

Collects all keys of this map in a set

Collects all keys of this map in a set

Attributes

Definition Classes
override def put(key: String, value: String): Boolean

Puts/update a value in the cache

Puts/update a value in the cache

Value parameters

key

The unique key to identify the object

value

: The string to store in the cache

Attributes

Returns

true if the object has been stored in the cache, false otherwise

Definition Classes
override def size: Int

Attributes

Returns

the number of objects in the cache (both in memory and persisted)

Definition Classes

Concrete fields

val dbUrl: String
val h2FileName: String

The name of the file(s) used by H2

The name of the file(s) used by H2

Attributes

val password: String
val userName: String