|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface I_DataConverter
Interface which hides specific JDBC ResultSet to XML converters.
Principally the output can be, depending on the plugin, any string like XML, HTML, CSV etc. For the generated format consult the implementing plugin.
Instances of classes implementing this interface can be reused by calling these tuples:
Plugins are not expected to be thread save, please use separate instances if used by multiple threads.
Field Summary | |
---|---|
static int |
ALL
Possible settings for what argument of #addInfo(ResultSet, int) . |
static java.lang.String |
BASE64
The Base64 encoding marker string |
static java.lang.String |
IGNORE_MESSAGE
Used to pass the information from the converter to the publisher that this message shall not be sent (i.e. |
static int |
META_ONLY
Possible settings for what argument of #addInfo(ResultSet, int) . |
static int |
ROW_ONLY
Possible settings for what argument of #addInfo(ResultSet, int) . |
Method Summary | |
---|---|
void |
addInfo(java.sql.Connection conn,
java.sql.ResultSet rs,
int what)
Add another result set to the XML string. |
void |
addInfo(java.util.Map attributeMap)
Add a map with attributes to the XML string. |
int |
done()
After the last addInfo() call this method to complete the XML dump. |
long |
getCurrentMessageSize()
Returns the size of the message as it is at the current moment |
java.lang.String |
getPostStatement()
Gets the statement (if any) to be executed after processing one message.In case of the DbWatcher to be used to send/publish messages on detected changes, this can be used to delete entries in a queue. |
void |
init(I_Info info)
Needs to be called after construction. |
void |
setOutputStream(java.io.OutputStream out,
java.lang.String command,
java.lang.String ident,
ChangeEvent event)
This has to be called before the first addInfo(Map)
or #addInfo(ResultSet, int) call. |
void |
shutdown()
Cleanup resources. |
Field Detail |
---|
static final int ALL
#addInfo(ResultSet, int)
.
Deliver meta info and data itself
static final int META_ONLY
#addInfo(ResultSet, int)
.
Deliver meta info only
static final int ROW_ONLY
#addInfo(ResultSet, int)
.
Deliver data only
static final java.lang.String BASE64
static final java.lang.String IGNORE_MESSAGE
Method Detail |
---|
void init(I_Info info) throws java.lang.Exception
info
- The configuration environment
java.lang.Exception
void setOutputStream(java.io.OutputStream out, java.lang.String command, java.lang.String ident, ChangeEvent event) throws java.lang.Exception
addInfo(Map)
or #addInfo(ResultSet, int)
call.
out
- The stream to dump the converted data tocommand
- An optional command string or nullident
- the identity or optionally null.event
- The ChangeEvent associated to this invocation. Is never null.
java.lang.Exception
- of any typevoid addInfo(java.util.Map attributeMap) throws java.lang.Exception
I_AttributeTransformer
class.
attributeMap
- A map containing key/values to dump
java.lang.Exception
- of any typevoid addInfo(java.sql.Connection conn, java.sql.ResultSet rs, int what) throws java.lang.Exception
rs
- The JDBC result setwhat
- One of ALL
, META_ONLY
or
ROW_ONLY
.
META_ONLY
is useful for an empty table where rs access fails.
java.lang.Exception
- of any typeint done() throws java.lang.Exception
setOutputStream(java.io.OutputStream, java.lang.String, java.lang.String, org.xmlBlaster.contrib.dbwatcher.ChangeEvent)
again to reuse
this instance.
java.lang.Exception
- typically java.io.UnsupportedEncodingException, java.io.IOExceptionvoid shutdown() throws java.lang.Exception
java.lang.Exception
- of any typejava.lang.String getPostStatement()
long getCurrentMessageSize()
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |