|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.contrib.mime.DropIfNotDeliverable
public class DropIfNotDeliverable
Throw away callback messages and unsubscribe all subscriptions if a client gows to polling.
If a client callback goes to polling, this plugin removes all existing subscriptions
and clears all messages in the callback queue.
The client needs to add a filter Qos to its SubscribeQos to activate the plugin.
In a next step we could add configuration parameters to only
remove specific subscriptions (and not remove other callback queue entries).
Configuration example (put to xmlBlaster.properties):
MimeAccessPlugin[DropIfNotDeliverable][1.0]=\ org.xmlBlaster.contrib.mime.DropIfNotDeliverable,dropper.types=*dropper.types=* is default and activates the plugin for any published message where a subscriber has set this filter,
<qos> <multiSubscribe>false</multiSubscribe> <local>false</local> <initialUpdate>false</initialUpdate> <updateOneway>false</updateOneway> <notify>false</notify> <persistent>false</persistent> <filter type='DropIfNotDeliverable'> <![CDATA[_]]> </filter> </qos>
The query statement '_' is ignored by this plugin.
This plugin is a singleton and loaded once only for multiple subscribers configuring it
Field Summary | |
---|---|
private Global |
glob
|
private static java.util.logging.Logger |
log
|
private java.lang.String |
ME
|
static java.lang.String |
MIME_TYPES
|
private java.lang.String[] |
mimeTypes
|
private PluginInfo |
pluginInfo
|
Constructor Summary | |
---|---|
DropIfNotDeliverable()
|
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, currently { "*" }. |
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 serverScope)
This is called after instantiation of the plugin |
boolean |
match(SessionInfo receiver,
MsgUnit msgUnit,
Query query)
Check if the filter rule matches for this message. |
void |
shutdown()
Cleans up the resource. |
void |
toAlive(I_DispatchManager dispatchManager,
ConnectionStateEnum oldState)
|
void |
toAliveSync(I_DispatchManager dispatchManager,
ConnectionStateEnum oldState)
|
void |
toDead(I_DispatchManager dispatchManager,
ConnectionStateEnum oldState,
XmlBlasterException xmlBlasterException)
|
void |
toPolling(I_DispatchManager dispatchManager,
ConnectionStateEnum oldState)
|
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 Global glob
private static java.util.logging.Logger log
private java.lang.String[] mimeTypes
private PluginInfo pluginInfo
public static final java.lang.String MIME_TYPES
Constructor Detail |
---|
public DropIfNotDeliverable()
Method Detail |
---|
public void initialize(ServerScope serverScope)
initialize
in interface I_AccessFilter
glob
- The Global handle of this xmlBlaster server instance.public void init(Global glob, PluginInfo pluginInfo) throws XmlBlasterException
init
in interface I_Plugin
XmlBlasterException
I_Plugin.init(org.xmlBlaster.util.Global,org.xmlBlaster.util.plugin.PluginInfo)
public java.lang.String getType()
getType
in interface I_Plugin
public java.lang.String getVersion()
getVersion
in interface I_Plugin
public java.lang.String getName()
getName
in interface I_AccessFilter
public java.lang.String[] getMimeTypes()
getMimeTypes
in interface I_AccessFilter
public java.lang.String[] getMimeExtended()
getMimeExtended
in interface I_AccessFilter
public boolean match(SessionInfo receiver, MsgUnit msgUnit, Query query) throws XmlBlasterException
I_AccessFilter
Note that you are not allowed to manipulate the content or XmlKey or QoS of a message with your plugin as this would affect all other subscribers (you are working on a reference to the original message). You can find out the publisher name like msgUnit.getQosData().getSender()
match
in interface I_AccessFilter
receiver
- The session object describing the receiver, is never null.msgUnit
- The message to check, is never null.query
- The query containing the filter rule on subscribe/get usually
the client defines his own rule which is passed here.XmlBlasterException
- Is thrown on problems, for example if the MIME type
does not fit to message content.public void shutdown()
I_Plugin
shutdown
in interface I_AccessFilter
shutdown
in interface I_Plugin
public void toAlive(I_DispatchManager dispatchManager, ConnectionStateEnum oldState)
toAlive
in interface I_ConnectionStatusListener
public void toAliveSync(I_DispatchManager dispatchManager, ConnectionStateEnum oldState)
toAliveSync
in interface I_ConnectionStatusListener
public void toDead(I_DispatchManager dispatchManager, ConnectionStateEnum oldState, XmlBlasterException xmlBlasterException)
toDead
in interface I_ConnectionStatusListener
xmlBlasterException
- Can be nullpublic void toPolling(I_DispatchManager dispatchManager, ConnectionStateEnum oldState)
toPolling
in interface I_ConnectionStatusListener
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |