org.nuiton.wikitty.jdbc
Class WikittyStorageJDBC

java.lang.Object
  extended by org.nuiton.wikitty.jdbc.WikittyStorageJDBC
All Implemented Interfaces:
WikittyStorage

public class WikittyStorageJDBC
extends Object
implements WikittyStorage

Version:
$Revision: 219 $ Last update: $Date: 2010-08-03 15:37:36 +0200 (mar., 03 août 2010) $ by : $Author: bleny $
Author:
morin

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.nuiton.wikitty.WikittyStorage
WikittyStorage.Scanner
 
Field Summary
protected  Properties conf
          Properties file
protected  WikittyExtensionStorage extensionStorage
           
protected static org.apache.commons.logging.Log log
          to use log facility, just put in your code: log.info(\"...\");
 
Constructor Summary
WikittyStorageJDBC(WikittyExtensionStorage extensionStorage)
           
WikittyStorageJDBC(WikittyExtensionStorage extensionStorage, Properties properties)
           
 
Method Summary
 void clear(WikittyTransaction transaction)
           
protected  Wikitty constructWikitty(WikittyTransaction transaction, String id, String version, String extensionList, ResultSet resultSet, String... fqFieldName)
          Create Wikitty from jdbc tables.
 UpdateResponse delete(WikittyTransaction transaction, Collection<String> ids)
           
 boolean exists(WikittyTransaction transaction, String id)
           
protected  String getColName(FieldType.TYPE type)
           
protected  boolean isAcceptedField(Set<String> acceptedField, String fqfieldName)
          Test if fqfieldName is in acceptedField
 boolean isDeleted(WikittyTransaction transaction, String id)
           
 Wikitty restore(WikittyTransaction transaction, String id, String... fqFieldName)
           
 void scanWikitties(WikittyTransaction transaction, WikittyStorage.Scanner scanner)
           
 UpdateResponse store(WikittyTransaction transaction, Collection<Wikitty> wikitties, boolean disableAutoVersionIncrement)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
to use log facility, just put in your code: log.info(\"...\");


conf

protected final Properties conf
Properties file


extensionStorage

protected WikittyExtensionStorage extensionStorage
Constructor Detail

WikittyStorageJDBC

public WikittyStorageJDBC(WikittyExtensionStorage extensionStorage)

WikittyStorageJDBC

public WikittyStorageJDBC(WikittyExtensionStorage extensionStorage,
                          Properties properties)
Method Detail

getColName

protected String getColName(FieldType.TYPE type)

store

public UpdateResponse store(WikittyTransaction transaction,
                            Collection<Wikitty> wikitties,
                            boolean disableAutoVersionIncrement)
                     throws WikittyException
Specified by:
store in interface WikittyStorage
Throws:
WikittyException

exists

public boolean exists(WikittyTransaction transaction,
                      String id)
Specified by:
exists in interface WikittyStorage

isDeleted

public boolean isDeleted(WikittyTransaction transaction,
                         String id)
Specified by:
isDeleted in interface WikittyStorage

restore

public Wikitty restore(WikittyTransaction transaction,
                       String id,
                       String... fqFieldName)
                throws WikittyException
Specified by:
restore in interface WikittyStorage
Throws:
WikittyException

delete

public UpdateResponse delete(WikittyTransaction transaction,
                             Collection<String> ids)
                      throws WikittyException
Specified by:
delete in interface WikittyStorage
Throws:
WikittyException

scanWikitties

public void scanWikitties(WikittyTransaction transaction,
                          WikittyStorage.Scanner scanner)
Specified by:
scanWikitties in interface WikittyStorage

constructWikitty

protected Wikitty constructWikitty(WikittyTransaction transaction,
                                   String id,
                                   String version,
                                   String extensionList,
                                   ResultSet resultSet,
                                   String... fqFieldName)
                            throws SQLException
Create Wikitty from jdbc tables.

Parameters:
id - the id of the wikitty to restore
version - the version of the wikitty to restore
extensionList - the list of the extensions of the wikitty to restore
resulSet - the ResultSet as the result of the selection of the in the data table
fqFieldName - minimum field to restore
Returns:
Throws:
SQLException

isAcceptedField

protected boolean isAcceptedField(Set<String> acceptedField,
                                  String fqfieldName)
Test if fqfieldName is in acceptedField

Parameters:
acceptedField - list of all accepted field
fqfieldName - fully qualified field name with potential [n/m] at end
Returns:
if fqfieldName without potential [n/m] is in acceptedField or if acceptedField is empty

clear

public void clear(WikittyTransaction transaction)
Specified by:
clear in interface WikittyStorage


Copyright © 2009-2010 CodeLutin. All Rights Reserved.