xmlBlaster 2.2.0 API

org.xmlBlaster.contrib.db
Class DbStorage

java.lang.Object
  extended by org.xmlBlaster.contrib.db.DbStorage

public class DbStorage
extends java.lang.Object

DbStorage

Author:
Michele Laghi

Field Summary
private  java.lang.String addSql
           
private  java.lang.String cleanSql
           
private  java.lang.String context
           
private static int CONTEXT
           
private  java.lang.String createSql
           
private  DbMetaHelper dbHelper
           
private  java.lang.String deleteSql
           
private static int ENCODING
           
private  java.lang.String getKeysSql
           
private  java.lang.String getSql
           
private static int KEY
           
private static java.util.logging.Logger log
           
private  java.lang.String modifySql
           
private  I_DbPool pool
           
private  java.lang.String tableName
           
private static int TYPE
           
private static int VALUE
           
 
Constructor Summary
DbStorage(I_Info info, I_DbPool pool, java.lang.String context)
           
 
Method Summary
 boolean addProperty(ClientProperty prop)
          Adds a new property to the Table.
 int clean()
          Removes all the properties of this context.
private  void createTableOrReadColumnNames(java.lang.String[] originalNames, I_Info info)
           
 java.util.Set getKeys()
           
 ClientProperty getProperty(java.lang.String key)
          Modifies an existing property.
 boolean modifyProperty(ClientProperty prop)
          Modifies an existing property.
private  void prepareSql(I_Info info, java.lang.String ctx)
           
 void put(ClientProperty prop)
          This method tries first to update the entry.
 boolean remove(java.lang.String key)
          Removes the property with the given key.
private  boolean tableExists()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static java.util.logging.Logger log

CONTEXT

private static final int CONTEXT
See Also:
Constant Field Values

KEY

private static final int KEY
See Also:
Constant Field Values

VALUE

private static final int VALUE
See Also:
Constant Field Values

TYPE

private static final int TYPE
See Also:
Constant Field Values

ENCODING

private static final int ENCODING
See Also:
Constant Field Values

context

private java.lang.String context

pool

private I_DbPool pool

dbHelper

private DbMetaHelper dbHelper

tableName

private java.lang.String tableName

createSql

private java.lang.String createSql

modifySql

private java.lang.String modifySql

addSql

private java.lang.String addSql

getSql

private java.lang.String getSql

cleanSql

private java.lang.String cleanSql

deleteSql

private java.lang.String deleteSql

getKeysSql

private java.lang.String getKeysSql
Constructor Detail

DbStorage

public DbStorage(I_Info info,
                 I_DbPool pool,
                 java.lang.String context)
          throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

prepareSql

private final void prepareSql(I_Info info,
                              java.lang.String ctx)
                       throws java.lang.Exception
Throws:
java.lang.Exception

tableExists

private final boolean tableExists()
                           throws java.lang.Exception
Throws:
java.lang.Exception

createTableOrReadColumnNames

private void createTableOrReadColumnNames(java.lang.String[] originalNames,
                                          I_Info info)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

addProperty

public boolean addProperty(ClientProperty prop)
                    throws java.lang.Exception
Adds a new property to the Table. If the entry already exists, an exception is thrown.

Parameters:
prop -
Throws:
java.lang.Exception

modifyProperty

public boolean modifyProperty(ClientProperty prop)
                       throws java.lang.Exception
Modifies an existing property. If the property does not exist, an exception is thrown.

Parameters:
prop -
Throws:
java.lang.Exception

getProperty

public ClientProperty getProperty(java.lang.String key)
                           throws java.lang.Exception
Modifies an existing property. If the property does not exist, an exception is thrown.

Parameters:
prop -
Throws:
java.lang.Exception

remove

public boolean remove(java.lang.String key)
               throws java.lang.Exception
Removes the property with the given key. If none found, nothing happens.

Parameters:
key -
Returns:
true if the entry was removed, false otherwise (i.e. if the entry was not found).
Throws:
java.lang.Exception

clean

public int clean()
          throws java.lang.Exception
Removes all the properties of this context.

Returns:
the number of entries removed.
Throws:
java.lang.Exception

put

public void put(ClientProperty prop)
         throws java.lang.Exception
This method tries first to update the entry. If an exception, then presumably the entry did not exist, so an insert is made. If this fails too, then an exception is thrown.

Parameters:
prop -
Throws:
java.lang.Exception

getKeys

public java.util.Set getKeys()
                      throws java.lang.Exception
Throws:
java.lang.Exception

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.