Package net.ontopia.infoset.content
Class JDBCSequenceContentStore
- java.lang.Object
-
- net.ontopia.infoset.content.JDBCSequenceContentStore
-
- All Implemented Interfaces:
ContentStoreIF
public class JDBCSequenceContentStore extends Object implements ContentStoreIF
INTERNAL: Content store implementation on top of JDBC that uses native database sequences to generate keys. Note that this class requires JDBC3.
-
-
Field Summary
Fields Modifier and Type Field Description protected Connectionconnprotected Stringsql_getprotected Stringsql_putprotected Stringsql_remove
-
Constructor Summary
Constructors Constructor Description JDBCSequenceContentStore(Connection conn)JDBCSequenceContentStore(Connection conn, String tblname, String keyname, String valname, String nextseq)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intadd(InputStream data, int length)INTERNAL: Creates an entry for the specified data value.intadd(ContentInputStream data)INTERNAL: Creates an entry for the specified data value.voidclose()INTERNAL: Closes the content store.booleancontainsKey(int key)INTERNAL: Returns true if the content store contains an entry with the specified key.ContentInputStreamget(int key)INTERNAL: Gets the data value associated with the specified key.protected voidinit(String tblname, String keyname, String valname, String nextseq)protected intreadLength(InputStream stream)booleanremove(int key)INTERNAL: Removes the entry associated with the key.
-
-
-
Field Detail
-
conn
protected Connection conn
-
sql_get
protected String sql_get
-
sql_put
protected String sql_put
-
sql_remove
protected String sql_remove
-
-
Constructor Detail
-
JDBCSequenceContentStore
public JDBCSequenceContentStore(Connection conn)
-
JDBCSequenceContentStore
public JDBCSequenceContentStore(Connection conn, String tblname, String keyname, String valname, String nextseq)
-
-
Method Detail
-
containsKey
public boolean containsKey(int key) throws ContentStoreExceptionDescription copied from interface:ContentStoreIFINTERNAL: Returns true if the content store contains an entry with the specified key.- Specified by:
containsKeyin interfaceContentStoreIF- Throws:
ContentStoreException
-
get
public ContentInputStream get(int key) throws ContentStoreException
Description copied from interface:ContentStoreIFINTERNAL: Gets the data value associated with the specified key.- Specified by:
getin interfaceContentStoreIF- Throws:
ContentStoreException
-
readLength
protected int readLength(InputStream stream) throws IOException
- Throws:
IOException
-
add
public int add(ContentInputStream data) throws ContentStoreException
Description copied from interface:ContentStoreIFINTERNAL: Creates an entry for the specified data value.- Specified by:
addin interfaceContentStoreIF- Throws:
ContentStoreException
-
add
public int add(InputStream data, int length) throws ContentStoreException
Description copied from interface:ContentStoreIFINTERNAL: Creates an entry for the specified data value.- Specified by:
addin interfaceContentStoreIF- Throws:
ContentStoreException
-
remove
public boolean remove(int key) throws ContentStoreExceptionDescription copied from interface:ContentStoreIFINTERNAL: Removes the entry associated with the key. If the key is not present the call has no effect.- Specified by:
removein interfaceContentStoreIF- Returns:
- true if the key was present; false otherwise
- Throws:
ContentStoreException
-
close
public void close() throws ContentStoreExceptionDescription copied from interface:ContentStoreIFINTERNAL: Closes the content store. This allows all internal resources to be released.- Specified by:
closein interfaceContentStoreIF- Throws:
ContentStoreException
-
-