xmlBlaster 2.2.0 client API

org.xmlBlaster.util.xbformat
Interface I_MsgInfoParser

All Known Implementing Classes:
XbfParser, XmlScriptParser

public interface I_MsgInfoParser

Interface to support different serialization formats of messages. Those serialized messages can, for example, be send over the SOCKET protocol or as email attachments.

Author:
xmlBlaster@marcelruff.info
See Also:
The protocol.socket requirement

Method Summary
 byte[] createRawMsg(MsgInfo msgInfo)
          Dumps the given MsgInfo to a byte array
 java.lang.String getExtension(boolean isCompressed)
          Get a specific extension for this format.
 java.lang.String getMimetype(boolean isCompressed)
          Get a specific extension for this format.
 void init(Global glob, I_ProgressListener progressListener, I_PluginConfig pluginConfig)
          Is guaranteed to be called by the MsgInfoParserFactory after construction.
 MsgInfo[] parse(java.io.InputStream in)
          Parses a serialized message from input stream
 java.lang.String toLiteral(byte[] arr)
          Get the raw messages as a string, for tests and for dumping only.
 java.lang.String toLiteral(MsgInfo msgInfo)
          Get the raw messages as a string, for tests and for dumping only.
 

Method Detail

init

void init(Global glob,
          I_ProgressListener progressListener,
          I_PluginConfig pluginConfig)
          throws XmlBlasterException
Is guaranteed to be called by the MsgInfoParserFactory after construction.

Parameters:
glob -
progressListener -
pluginConfig - Can be null
Throws:
XmlBlasterException

parse

MsgInfo[] parse(java.io.InputStream in)
                throws java.io.IOException,
                       java.lang.IllegalArgumentException,
                       XmlBlasterException
Parses a serialized message from input stream

Parameters:
in - The raw, serialized data
Returns:
The messages read, usually only one but for XmlScript multiple could be bundled, is never null
Throws:
java.io.IOException
java.lang.IllegalArgumentException
XmlBlasterException

createRawMsg

byte[] createRawMsg(MsgInfo msgInfo)
                    throws XmlBlasterException
Dumps the given MsgInfo to a byte array

Parameters:
msgInfo -
Returns:
The serializd message
Throws:
XmlBlasterException

toLiteral

java.lang.String toLiteral(MsgInfo msgInfo)
                           throws XmlBlasterException
Get the raw messages as a string, for tests and for dumping only.

Returns:
The stringified message, null bytes are replaced by '*'
Throws:
XmlBlasterException

toLiteral

java.lang.String toLiteral(byte[] arr)
Get the raw messages as a string, for tests and for dumping only.

Parameters:
arr - The raw blob
Returns:
The stringified message, null bytes are replaced by '*'

getMimetype

java.lang.String getMimetype(boolean isCompressed)
Get a specific extension for this format.

Returns:
For example XBFORMAT_MIMETYPE = "application/xmlBlaster-xbf" or XBFORMAT_MIMETYPE_ZLIB = "application/xmlBlaster-xbfz"

getExtension

java.lang.String getExtension(boolean isCompressed)
Get a specific extension for this format.

Returns:
For example XBFORMAT_EXTENSION = ".xbf" or XBFORMAT_ZLIB_EXTENSION = ".xbfz"

xmlBlaster 2.2.0 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.