|
xmlBlaster 1.6.2 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.xmlBlaster.engine.mime.demo.PublishLenChecker
This demo plugin filters away all messages having a content longer than the given filter length.
Published messages which are longer then the max length are rejected. Please register this plugin in xmlBlaster.properties:MimePublishPlugin[PublishLenChecker][1.0]=org.xmlBlaster.engine.mime.demo.PublishLenCheckerPlugins must implement the I_Plugin interface to be loadable by the PluginManager and must implement the I_PublishFilter interface to be usable as a filter.
| Field Summary | |
private long |
DEFAULT_MAX_LEN
Limits max message size to 1 MB as a default |
private ServerScope |
glob
|
private static java.util.logging.Logger |
log
|
private java.lang.String |
ME
|
private int |
THROW_EXCEPTION_FOR_LEN
For testsuite TestPublish.java only to force an XmlBlasterException |
| Constructor Summary | |
PublishLenChecker()
|
|
| Method Summary | |
java.lang.String[] |
getMimeExtended()
Get the content MIME version number for which this plugin applies |
java.lang.String[] |
getMimeTypes()
Get the content MIME type for which this plugin applies |
java.lang.String |
getName()
Get a human readable name of this filter implementation |
java.lang.String |
getType()
Return plugin type for Plugin loader |
java.lang.String |
getVersion()
Return plugin version for Plugin loader |
void |
init(Global glob,
PluginInfo pluginInfo)
This method is called by the PluginManager (enforced by I_Plugin). |
void |
initialize(ServerScope glob)
This is called after instantiation of the plugin |
java.lang.String |
intercept(SubjectInfo publisher,
MsgUnit msgUnit)
Check if the filter rule matches for this message. |
void |
shutdown()
Cleans up the resource. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private final java.lang.String ME
private ServerScope glob
private static java.util.logging.Logger log
private long DEFAULT_MAX_LEN
private int THROW_EXCEPTION_FOR_LEN
| Constructor Detail |
public PublishLenChecker()
| Method Detail |
public void initialize(ServerScope glob)
initialize in interface I_PublishFilterglob - The Global handle of this xmlBlaster server instance.
public void init(Global glob,
PluginInfo pluginInfo)
init in interface I_PluginI_Plugin.init(org.xmlBlaster.util.Global,org.xmlBlaster.util.plugin.PluginInfo)public java.lang.String getType()
getType in interface I_Pluginpublic java.lang.String getVersion()
getVersion in interface I_Pluginpublic java.lang.String getName()
getName in interface I_PublishFilterpublic java.lang.String[] getMimeTypes()
getMimeTypes in interface I_PublishFilterpublic java.lang.String[] getMimeExtended()
getMimeExtended in interface I_PublishFilter
public java.lang.String intercept(SubjectInfo publisher,
MsgUnit msgUnit)
throws XmlBlasterException
intercept in interface I_PublishFilterpublisher - The subject object describing the publishermsgUnit - The message to check
XmlBlasterException - Is thrown on problems, for example if the MIME type
does not fit to message content.I_PublisheFilter#intercept(SubjectInfo, MsgUnit)public void shutdown()
I_Plugin
shutdown in interface I_Plugin
|
xmlBlaster 1.6.2 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||