Class PostgresJsonStore
- java.lang.Object
-
- org.opennms.features.distributed.kvstore.api.AbstractKeyValueStore<T>
-
- org.opennms.features.distributed.kvstore.api.AbstractAsyncKeyValueStore<T>
-
- org.opennms.features.distributed.kvstore.pgshared.AbstractPostgresKeyValueStore<java.lang.String,java.lang.String>
-
- org.opennms.features.distributed.kvstore.json.postgres.PostgresJsonStore
-
- All Implemented Interfaces:
JsonStore
,KeyValueStore<java.lang.String>
public class PostgresJsonStore extends AbstractPostgresKeyValueStore<java.lang.String,java.lang.String> implements JsonStore
-
-
Constructor Summary
Constructors Constructor Description PostgresJsonStore(javax.sql.DataSource dataSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
getPkConstraintName()
protected java.lang.String
getTableName()
protected java.lang.String
getValueStatementPlaceholder()
Sub classes should override this to add additional specificity to the SQL placeholder in the prepared statements if necessary.protected java.lang.String
getValueTypeFromSQLType(java.sql.ResultSet resultSet, java.lang.String columnName)
Sub classes must override this method to provide handling for converting from the JDBC result to type T.-
Methods inherited from class org.opennms.features.distributed.kvstore.pgshared.AbstractPostgresKeyValueStore
delete, enumerateContext, get, getIfStale, getLastUpdated, getName, getSQLTypeFromValueType, put, truncateContext
-
Methods inherited from class org.opennms.features.distributed.kvstore.api.AbstractAsyncKeyValueStore
deleteAsync, enumerateContextAsync, getAsync, getIfStaleAsync, getLastUpdatedAsync, putAsync, truncateContextAsync
-
Methods inherited from class org.opennms.features.distributed.kvstore.api.AbstractKeyValueStore
put, putAsync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.features.distributed.kvstore.api.KeyValueStore
delete, deleteAsync, enumerateContext, enumerateContextAsync, get, getAsync, getIfStale, getIfStaleAsync, getLastUpdated, getLastUpdatedAsync, getName, put, put, putAsync, putAsync, truncateContext, truncateContextAsync
-
-
-
-
Method Detail
-
getTableName
protected java.lang.String getTableName()
- Specified by:
getTableName
in classAbstractPostgresKeyValueStore<java.lang.String,java.lang.String>
- Returns:
- the name of the table for this store
-
getValueStatementPlaceholder
protected java.lang.String getValueStatementPlaceholder()
Description copied from class:AbstractPostgresKeyValueStore
Sub classes should override this to add additional specificity to the SQL placeholder in the prepared statements if necessary.- Overrides:
getValueStatementPlaceholder
in classAbstractPostgresKeyValueStore<java.lang.String,java.lang.String>
-
getValueTypeFromSQLType
protected java.lang.String getValueTypeFromSQLType(java.sql.ResultSet resultSet, java.lang.String columnName) throws java.sql.SQLException
Description copied from class:AbstractPostgresKeyValueStore
Sub classes must override this method to provide handling for converting from the JDBC result to type T.- Specified by:
getValueTypeFromSQLType
in classAbstractPostgresKeyValueStore<java.lang.String,java.lang.String>
- Throws:
java.sql.SQLException
-
getPkConstraintName
protected java.lang.String getPkConstraintName()
- Specified by:
getPkConstraintName
in classAbstractPostgresKeyValueStore<java.lang.String,java.lang.String>
- Returns:
- the name of the primary key constraint for the table this store persists to
-
-