#include <dbobjsetstreamer.hpp>
Inheritance diagram for DBOBJSetStreamer:
Definition at line 74 of file dbobjsetstreamer.hpp.
Public Methods | |
DBOBJSetStreamer (const XMLStreamerFactory *p_pParent, StreamerParams *p_pParameters, XMLFlowContext *p_pContext, XMLStreamConsumer *p_pOutput) | |
~DBOBJSetStreamer () | |
Destructor. Releases private data members. | |
bool | initStream () |
Stream beginning notifier. This function is called before receiving any byte of the input XML stream. It should performs init tasks. | |
void | writeData (const char *p_pszData, unsigned int p_uiDataLen) |
XML Stream reception function. This function is called to write input XML stream to the Streamer. | |
bool | commitStream (bool p_fFinal=false) |
xML Stream commit function. This function is called to commit a chunk or the whole of the input XML stream. A partial commit means that the data provided since last commit is OK for processing. A final commit means that the whole input stream has been provided and that the streamer should consider the input XML document as complete. | |
virtual void | makeReport () |
Called after request processing. | |
virtual bool | transformObject (DBObjectNode *p_pDBObjectNode) |
Transforms object and returns TRUE if it is to be mapped on DB. | |
virtual void | processObject (DBObjectNode *p_pDBObjectNode) |
Builds mapping SQL statements for given object, stacks it and launches SQL execution if pack is full. If no object is provided, lauches mapping for left stacked objects. | |
virtual void | commitObjects () |
void | rollBackObjects () |
Protected Methods | |
void | processNode (DBObjectNode *p_pDBObjectNode, DBOBJSetAction p_intParentAction) |
void | sendNodeToDB (DBObjectNode *p_pDBObjectNode, DBOBJSetAction l_iCurAction) |
void | sendRecordToDB (DBObjectNode *p_pDBObjectNode, otl_stream *p_pOTLStream, const char *p_pszFieldList, int p_iDescLen, otl_var_desc *p_varsDesc) |
bool | buildINSERTStatement (DBObjectNode *p_pDBObjectNode, char **l_ppszStatement, char **l_ppszFields) |
Builds INSERT SQL statement corresponding to the provided node. | |
bool | buildUPDATEStatement (DBObjectNode *p_pDBObjectNode, char **l_ppszStatement, char **l_ppszFields) |
Builds UPDATE SQL statement corresponding to the provided node. | |
bool | buildDELETEStatement (DBObjectNode *p_pDBObjectNode, char **l_ppszStatement, char **l_ppszFields) |
Builds DELETE SQL statement corresponding to the provided node. | |
bool | buildWHEREclause (DBObjectNode *p_pDBObjectNode, char **l_ppszStatement, char **l_ppszFields) |
Builds WHERE clause to modify the provided node. | |
bool | buildCHECKStatement (DBObjectNode *p_pDBObjectNode, char **l_ppszStatement, char **l_ppszFields, bool p_boolPre) |
Builds check SQL statements given by the provided node's definition. | |
bool | buildEventStatement (DBObjectNode *p_pDBObjectNode, const char *l_pszEnventString, char **l_ppszStatement, char **l_ppszFields) |
char * | getSQLInsert (DBObjectField *l_pDBObjectField, bool *p_pfCachable, char **p_ppszFields) |
char * | getFieldValue (DBObjectField *p_pDBObjectField) |
Extract field value. | |
char * | getFieldBindVar (DBObjectField *l_pDBObjectField) |
void | stackObject (DBObjectNode *p_pDBObjectNode) |
Stacks an object. | |
void | deStackObjects (XMLStreamConsumer *p_pBufferXML, bool l_fCount) |
Destacks objects and serializes them in given buffer. | |
void | countObjectNodes (DBObjectNode *p_pDBObjectNode) |
Count the number of ecach node type in the given object. | |
Protected Attributes | |
StreamSAX2Parser * | m_pStreamParser |
XDFLSaxErrorReporter * | m_pErrorReporter |
DBStreamerFactory * | m_pParent |
DBObjectSAXBuilder * | m_pHandler |
|
Definition at line 57 of file dbobjsetstreamer.cpp. References DEBUG_CREATE, m_pErrorReporter, m_pHandler, and m_pStreamParser. |
|
Destructor. Releases private data members.
Definition at line 73 of file dbobjsetstreamer.cpp. References DEBUG_DEL, DEBUG_ECHO, VAarray< int >::empty(), VAarray< stream_cache * >::empty(), VAarray< DBObjectNode * >::empty(), _stream_cache::fieldList, XMLFlowContext::getThreadId(), m_pErrorReporter, m_pHandler, m_pParent, m_pStreamParser, OTL_releaseDataStream(), _stream_cache::otlStream, VAarray< int >::pop(), VAarray< stream_cache * >::pop(), VAarray< DBObjectNode * >::pop(), releaseCharBuffer(), and _stream_cache::varDesc. |
|
Builds check SQL statements given by the provided node's definition.
Definition at line 966 of file dbobjsetstreamer.cpp. References buildEventStatement(), DEBUG_FUNC, DBOBJDefinitionNode::getCheckPost(), DBOBJDefinitionNode::getCheckPre(), and DBObjectNode::getDefinition(). Referenced by sendNodeToDB(). |
|
Builds DELETE SQL statement corresponding to the provided node.
Definition at line 879 of file dbobjsetstreamer.cpp. References buildEventStatement(), buildWHEREclause(), concatCharBuffer(), copyCharBuffer(), DEBUG_IN, DEBUG_OUT, DBOBJDefinitionNode::getDBTable(), DBObjectNode::getDefinition(), DBOBJDefinitionNode::getOnDelete(), and releaseCharBuffer(). Referenced by sendNodeToDB(). |
|
Definition at line 981 of file dbobjsetstreamer.cpp. References DBObjectNode::calculateRelValue(), and releaseCharBuffer(). Referenced by buildCHECKStatement(), buildDELETEStatement(), buildINSERTStatement(), and buildUPDATEStatement(). |
|
Builds INSERT SQL statement corresponding to the provided node.
Definition at line 731 of file dbobjsetstreamer.cpp. References buildEventStatement(), concatCharBuffer(), copyCharBuffer(), DEBUG_IN, DEBUG_OUT, DBOBJDefinitionField::getDBField(), DBOBJDefinitionNode::getDBTable(), DBObjectField::getDefinition(), DBObjectNode::getDefinition(), DBObjectNode::getField(), DBOBJDefinitionNode::getField(), DBOBJDefinitionNode::getFieldsCount(), DBOBJDefinitionField::getName(), DBOBJDefinitionNode::getOnInsert(), getSQLInsert(), and releaseCharBuffer(). Referenced by sendNodeToDB(). |
|
Builds UPDATE SQL statement corresponding to the provided node.
Definition at line 806 of file dbobjsetstreamer.cpp. References buildEventStatement(), buildWHEREclause(), concatCharBuffer(), copyCharBuffer(), DEBUG_IN, DEBUG_OUT, DBOBJDefinitionField::getDBField(), DBOBJDefinitionNode::getDBTable(), DBObjectNode::getDefinition(), DBObjectNode::getField(), DBOBJDefinitionNode::getField(), DBOBJDefinitionNode::getFieldsCount(), DBOBJDefinitionField::getName(), DBOBJDefinitionNode::getOnUpdate(), getSQLInsert(), DBOBJDefinitionField::isPkey(), and releaseCharBuffer(). Referenced by sendNodeToDB(). |
|
Builds WHERE clause to modify the provided node.
Definition at line 917 of file dbobjsetstreamer.cpp. References concatCharBuffer(), DEBUG_IN, DEBUG_OUT, DBOBJDefinitionField::getDBField(), DBObjectNode::getDefinition(), DBObjectNode::getField(), DBOBJDefinitionField::getName(), DBOBJDefinitionNode::getPkey(), DBOBJDefinitionNode::getPkeysCount(), getSQLInsert(), and releaseCharBuffer(). Referenced by buildDELETEStatement(), and buildUPDATEStatement(). |
|
Definition at line 392 of file dbobjsetstreamer.cpp. References DBOBJSETSTREAMER_TAGNAME, DEBUG_IN, DEBUG_OUT, deStackObjects(), rollBackObjects(), VAarray< DBObjectNode * >::size(), and THROW_XMLFLOW_EXCEPTION. Referenced by commitStream(), and processObject(). |
|
xML Stream commit function.
Reimplemented from XMLStreamer. Definition at line 223 of file dbobjsetstreamer.cpp. References CATCH_XML_FLOW_ERROR_RELEASE_AND_RETURN, commitObjects(), XMLStreamConsumer::commitStream(), DBOBJSETSTREAMER_TAGNAME, DEBUG_IN, DEBUG_OUT, DBObjectSAXBuilder::getObjectsCount(), m_pHandler, XMLStreamer::m_pOutput, m_pStreamParser, makeReport(), ON_XML_FLOW_ERROR_THROW, DBObjectSAXBuilder::popObject(), PREP_CATCH_XML_FLOW_ERROR, processObject(), and WATCH_XML_FLOW_ERROR. |
|
Count the number of ecach node type in the given object.
Definition at line 1235 of file dbobjsetstreamer.cpp. References VAarray< int >::add(), concatCharBuffer(), DBObjectNode::getAction(), DBObjectNode::getChildNode(), DBObjectNode::getChildNodesCount(), DBObjectNode::getName(), releaseCharBuffer(), VAarray< int >::remove(), and DBObjectSAXBuilder::translateAction(). Referenced by deStackObjects(). |
|
Destacks objects and serializes them in given buffer.
Definition at line 1201 of file dbobjsetstreamer.cpp. References VAarray< DBObjectNode * >::bottom(), XMLStreamConsumer::commitStream(), countObjectNodes(), DBOBJSETSTREAMER_TAGNAME, DEBUG_FUNC, VAarray< DBObjectNode * >::empty(), DBObjectNode::getXML(), XMLStreamer::m_pOutput, and VAarray< DBObjectNode * >::remove(). Referenced by commitObjects(), and rollBackObjects(). |
|
|
Extract field value.
Definition at line 1067 of file dbobjsetstreamer.cpp. References concatCharBuffer(), copyCharBuffer(), DEBUG_FUNC, DBOBJDefinitionField::getDateFormat(), DBObjectField::getDefinition(), DBOBJDefinitionField::getMap(), DBObjectField::getValue(), releaseCharBuffer(), and replaceInCharBuffer(). Referenced by getSQLInsert(). |
|
Definition at line 1036 of file dbobjsetstreamer.cpp. References concatCharBuffer(), getFieldBindVar(), getFieldValue(), and DBObjectField::getName(). Referenced by buildINSERTStatement(), buildUPDATEStatement(), and buildWHEREclause(). |
|
Stream beginning notifier.
Reimplemented from XMLStreamer. Definition at line 120 of file dbobjsetstreamer.cpp. References DBOBJaction_Delete, DBOBJaction_Insert, DBOBJaction_None, DBOBJaction_Update, DBObjectSAXBuilder, DEBUG_IN, DEBUG_OUT, XMLFlowContext::getNamedBuffer(), XMLStreamer::getParamValue(), XMLFlowContext::getThreadId(), importCharBuffer(), m_pErrorReporter, m_pHandler, XMLStreamer::m_pOutput, m_pParent, and m_pStreamParser. |
|
Called after request processing.
Definition at line 282 of file dbobjsetstreamer.cpp. References VAarray< int >::get(), VAarray< int >::getKey(), VAarray< int >::remove(), and VAarray< int >::size(). Referenced by commitStream(). |
|
|
Builds mapping SQL statements for given object, stacks it and launches SQL execution if pack is full. If no object is provided, lauches mapping for left stacked objects.
Definition at line 327 of file dbobjsetstreamer.cpp. References CATCH_XML_FLOW_ERROR, commitObjects(), DEBUG_FUNC, XMLValuable::getValuer(), PREP_CATCH_XML_FLOW_ERROR, processNode(), rollBackObjects(), DBObjectNode::setValuable(), stackObject(), transformObject(), and WATCH_XML_FLOW_ERROR. Referenced by commitStream(). |
|
Definition at line 422 of file dbobjsetstreamer.cpp. References DBOBJSETSTREAMER_TAGNAME, deStackObjects(), and VAarray< DBObjectNode * >::size(). Referenced by commitObjects(), and processObject(). |
|
|
Definition at line 631 of file dbobjsetstreamer.cpp. References copyCharBuffer(), DEBUG_IN, DEBUG_OUT, DBObjectNode::getName(), DBObjectField::getValue(), MAKE_XMLFLOW_EXCEPTION, ON_XML_FLOW_ERROR_THROW, OTL_insertInVar(), PREP_CATCH_XML_FLOW_ERROR, releaseCharBuffer(), and DBObjectNode::selectSingleNode(). Referenced by sendNodeToDB(). |
|
Stacks an object.
Definition at line 1191 of file dbobjsetstreamer.cpp. References DEBUG_FUNC, and VAarray< DBObjectNode * >::push(). Referenced by processObject(). |
|
Transforms object and returns TRUE if it is to be mapped on DB.
Definition at line 382 of file dbobjsetstreamer.cpp. References DEBUG_FUNC. Referenced by processObject(). |
|
XML Stream reception function.
Reimplemented from XMLStreamer. Definition at line 210 of file dbobjsetstreamer.cpp. References DEBUG_IN, DEBUG_OUT, and m_pStreamParser. |
|
Definition at line 110 of file dbobjsetstreamer.hpp. Referenced by DBOBJSetStreamer(), initStream(), and ~DBOBJSetStreamer(). |
|
Definition at line 112 of file dbobjsetstreamer.hpp. Referenced by commitStream(), DBOBJSetStreamer(), initStream(), and ~DBOBJSetStreamer(). |
|
Reimplemented from XMLStreamer. Definition at line 111 of file dbobjsetstreamer.hpp. Referenced by initStream(), and ~DBOBJSetStreamer(). |
|
Definition at line 109 of file dbobjsetstreamer.hpp. Referenced by commitStream(), DBOBJSetStreamer(), initStream(), writeData(), and ~DBOBJSetStreamer(). |