public class JDBCContentStore extends Object implements ContentStoreIF
| Modifier and Type | Field and Description |
|---|---|
protected Connection |
conn |
protected KeyGeneratorIF |
keygen |
protected String |
sql_get |
protected String |
sql_put |
protected String |
sql_remove |
| Constructor and Description |
|---|
JDBCContentStore(Connection conn,
ConnectionFactoryIF connfactory) |
JDBCContentStore(Connection conn,
ConnectionFactoryIF connfactory,
String tblname,
String keyname,
String valname) |
| Modifier and Type | Method and Description |
|---|---|
int |
add(ContentInputStream data)
INTERNAL: Creates an entry for the specified data value.
|
int |
add(InputStream data,
int length)
INTERNAL: Creates an entry for the specified data value.
|
void |
close()
INTERNAL: Closes the content store.
|
boolean |
containsKey(int key)
INTERNAL: Returns true if the content store contains an entry with
the specified key.
|
protected int |
generateId() |
ContentInputStream |
get(int key)
INTERNAL: Gets the data value associated with the specified key.
|
static ContentStoreIF |
getInstance(TopicMapIF topicmap) |
protected void |
init(String tblname,
String keyname,
String valname) |
protected int |
readLength(InputStream stream) |
boolean |
remove(int key)
INTERNAL: Removes the entry associated with the key.
|
protected Connection conn
protected KeyGeneratorIF keygen
protected String sql_get
protected String sql_put
protected String sql_remove
public JDBCContentStore(Connection conn, ConnectionFactoryIF connfactory)
public JDBCContentStore(Connection conn, ConnectionFactoryIF connfactory, String tblname, String keyname, String valname)
public static ContentStoreIF getInstance(TopicMapIF topicmap)
public boolean containsKey(int key)
throws ContentStoreException
ContentStoreIFcontainsKey in interface ContentStoreIFContentStoreExceptionpublic ContentInputStream get(int key) throws ContentStoreException
ContentStoreIFget in interface ContentStoreIFContentStoreExceptionprotected int readLength(InputStream stream) throws IOException
IOExceptionprotected int generateId()
public int add(ContentInputStream data) throws ContentStoreException
ContentStoreIFadd in interface ContentStoreIFContentStoreExceptionpublic int add(InputStream data, int length) throws ContentStoreException
ContentStoreIFadd in interface ContentStoreIFContentStoreExceptionpublic boolean remove(int key)
throws ContentStoreException
ContentStoreIFremove in interface ContentStoreIFContentStoreExceptionpublic void close()
throws ContentStoreException
ContentStoreIFclose in interface ContentStoreIFContentStoreException