|
REQUIREMENT interface.erase |
| Type | NEW |
| Priority | HIGH |
| Status | CLOSED |
| Topic | Messages are deleted with the erase() method | |||||||||||||||
|
Des cription |
The erase() method allows to erase messages in xmlBlaster. Method detail (CORBA IDL notation):
typedef string XmlType;
typedef sequence<string> StringArr;
StringArr erase(in XmlType xmlKey, in XmlType qos) raises(XmlBlasterException);
Here is an overview of all available erase QoS:
<qos>
<!-- Kill a topic even if there are pending updates or subscriptions (default: false) -->
<erase forceDestroy='true'/>
</qos>
|
|||||||||||||||
|
Example XML |
Here is an example key and QoS with its default settings:
and a example where the topic with its subscribers remain and only all message instances inside the topic are destroyed:
And a return value:
Note that erasing a topic
sends to all subscribers an update
with the update QoS state id set to ERASED, see HelloWorld4.java as an example.
<qos>
<state id='ERASED'/>
<sender>/node/heron/client/subby/3</sender>
<subscribe id='__subId:heron-7'/>
</qos>
A subscriber can decide to suppress those erase events with a specific
The |
|||||||||||||||
|
Example XML |
Here is an example erasing multiple topics identified by an XPath query:
And a returned QoS array:
|
|||||||||||||||
|
Example XmlRpc |
This is the XmlRpc server interface variant:
public Vector erase(String sessionId, String xmlKey_literal, String qos_literal)
throws XmlBlasterException
|
|||||||||||||||
|
Example Java |
A typical Java client code in Erase/Subscribe mode:
import org.xmlBlaster.client.key.SubscribeKey;
import org.xmlBlaster.client.qos.*;
...
EraseQos eq = new EraseQos(glob);
EraseKey ek = new EraseKey(glob, "HelloWorld4");
try {
EraseReturnQos[] er = con.erase(ek.toXml(), eq.toXml());
} catch(XmlBlasterException e) {
e.printStackTrace();
}
See xmlBlaster/demo/HelloWorld*.java for more examples. |
|||||||||||||||
| Configure |
NOTE: Configuration parameters are specified on command line (-someValue 17) or in the
xmlBlaster.properties file (someValue=17). See requirement "util.property" for details. |
|||||||||||||||
| See REQ | interface | |||||||||||||||
| See REQ | engine.message.lifecycle | |||||||||||||||
| See API | org.xmlBlaster.engine.xml2java.XmlKey | |||||||||||||||
| See API | org.xmlBlaster.client.qos.EraseQos | |||||||||||||||
| See API | org.xmlBlaster.client.qos.EraseReturnQos | |||||||||||||||
| See API | org.xmlBlaster.client.I_XmlBlasterAccess | |||||||||||||||
| See API | org.xmlBlaster.protocol.xmlrpc.XmlBlasterImpl | |||||||||||||||
| See API | org.xmlBlaster.util.def.Constants | |||||||||||||||
| See TEST | org.xmlBlaster.test.qos.TestSubXPathMany | |||||||||||||||
| See TEST | org.xmlBlaster.test.qos.TestErase | |||||||||||||||
| See TEST | org.xmlBlaster.test.cluster.EraseTest | |||||||||||||||
| See TEST | org.xmlBlaster.test.classtest.EraseReturnQosTest |
This page is generated from the requirement XML file xmlBlaster/doc/requirements/interface.erase.xml