net.ontopia.infoset.content
Class JDBCSequenceContentStore

java.lang.Object
  extended by net.ontopia.infoset.content.JDBCSequenceContentStore
All Implemented Interfaces:
ContentStoreIF

public class JDBCSequenceContentStore
extends java.lang.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
protected  java.sql.Connection conn
           
protected  java.lang.String sql_get
           
protected  java.lang.String sql_put
           
protected  java.lang.String sql_remove
           
 
Constructor Summary
JDBCSequenceContentStore(java.sql.Connection conn)
           
JDBCSequenceContentStore(java.sql.Connection conn, java.lang.String tblname, java.lang.String keyname, java.lang.String valname, java.lang.String nextseq)
           
 
Method Summary
 int add(ContentInputStream data)
          INTERNAL: Creates an entry for the specified data value.
 int add(java.io.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.
 ContentInputStream get(int key)
          INTERNAL: Gets the data value associated with the specified key.
protected  void init(java.lang.String tblname, java.lang.String keyname, java.lang.String valname, java.lang.String nextseq)
           
protected  int readLength(java.io.InputStream stream)
           
 boolean remove(int key)
          INTERNAL: Removes the entry associated with the key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conn

protected java.sql.Connection conn

sql_get

protected java.lang.String sql_get

sql_put

protected java.lang.String sql_put

sql_remove

protected java.lang.String sql_remove
Constructor Detail

JDBCSequenceContentStore

public JDBCSequenceContentStore(java.sql.Connection conn)

JDBCSequenceContentStore

public JDBCSequenceContentStore(java.sql.Connection conn,
                                java.lang.String tblname,
                                java.lang.String keyname,
                                java.lang.String valname,
                                java.lang.String nextseq)
Method Detail

init

protected void init(java.lang.String tblname,
                    java.lang.String keyname,
                    java.lang.String valname,
                    java.lang.String nextseq)

containsKey

public boolean containsKey(int key)
                    throws ContentStoreException
Description copied from interface: ContentStoreIF
INTERNAL: Returns true if the content store contains an entry with the specified key.

Specified by:
containsKey in interface ContentStoreIF
Throws:
ContentStoreException

get

public ContentInputStream get(int key)
                       throws ContentStoreException
Description copied from interface: ContentStoreIF
INTERNAL: Gets the data value associated with the specified key.

Specified by:
get in interface ContentStoreIF
Throws:
ContentStoreException

readLength

protected int readLength(java.io.InputStream stream)
                  throws java.io.IOException
Throws:
java.io.IOException

add

public int add(ContentInputStream data)
        throws ContentStoreException
Description copied from interface: ContentStoreIF
INTERNAL: Creates an entry for the specified data value.

Specified by:
add in interface ContentStoreIF
Throws:
ContentStoreException

add

public int add(java.io.InputStream data,
               int length)
        throws ContentStoreException
Description copied from interface: ContentStoreIF
INTERNAL: Creates an entry for the specified data value.

Specified by:
add in interface ContentStoreIF
Throws:
ContentStoreException

remove

public boolean remove(int key)
               throws ContentStoreException
Description copied from interface: ContentStoreIF
INTERNAL: Removes the entry associated with the key. If the key is not present the call has no effect.

Specified by:
remove in interface ContentStoreIF
Returns:
true if the key was present; false otherwise
Throws:
ContentStoreException

close

public void close()
           throws ContentStoreException
Description copied from interface: ContentStoreIF
INTERNAL: Closes the content store. This allows all internal resources to be released.

Specified by:
close in interface ContentStoreIF
Throws:
ContentStoreException


Copyright © 2000-2012 Ontopia.