XmlBlaster Logo

REQUIREMENT

interface.unSubscribe

XmlBlaster Logo


Type NEW
Priority HIGH
Status CLOSED
Topic Message subscriptions are canceled with the unSubscribe() method
Des
cription

The unSubscribe() method allows to cancel message subscriptions in xmlBlaster. To unSubscribe you pass the subscriptionId you got from subscribe().

Method detail (CORBA IDL notation):

   typedef string XmlType;

   XmlTypeArr unSubscribe(in XmlType xmlKey, in XmlType qos) raises(XmlBlasterException);
      
ParameterTypeDescription
xmlKeystringThe XML encoded key containing the subscriptionId
xmlQosstringThe XML encoded Quality of Service QoS (see UnSubscribeQos link below)
returnstring[]An array of XML formatted return strings each of them containing more details of the matching subscription cancellation. If no unsubscribe matched the array has zero length.
XmlBlasterExceptionexceptionThrown on error
Example
XML

Here is an example of an unSubscribe:

Key<key oid='__subId:7' />
QoS<qos/>

And a return value:

<qos>
   <subscribe id='__subId:3'/>
   <isUnSubscribe/>
</qos>
   
Example
XML

Here is an example of an XPATH unSubscribe:

Key<key queryType='XPATH'>//key</key>
QoS<qos/>

And a return value matching three previous subscribes:

<qos>
  <subscribe id='__subId:xmlBlaster_192_168_1_4_3412-18'/>
  <isUnSubscribe/>
</qos>
<qos>
  <subscribe id='__subId:xmlBlaster_192_168_1_4_3412-16'/>
  <isUnSubscribe/>
</qos>
<qos>
  <subscribe id='__subId:xmlBlaster_192_168_1_4_3412-17'/>
  <isUnSubscribe/>
</qos>
   
Example
XmlRpc

This is the XmlRpc server interface variant:

   public String[] unSubscribe(String sessionId, String xmlKey_literal, String qos_literal)
                                                         throws XmlBlasterException
      
Example
RMI

This is the RMI server interface variant:

   public void unSubscribe(String sessionId, String xmlKey_literal, String qos_literal)
                           throws RemoteException, XmlBlasterException
      
Example
Java

A typical Java client code to unSubscribe:

   import org.xmlBlaster.client.key.SubscribeKey;
   import org.xmlBlaster.client.qos.*;

   ...

   // subscribe:

   SubscribeKey sk = new SubscribeKey(glob, "MyOid");

   SubscribeQos sq = new SubscribeQos(glob);

   SubscribeReturnQos sr = con.subscribe(sk.toXml(), sq.toXml());

   ...

   // unSubscribe:

   UnSubscribeKey uk = new UnSubscribeKey(glob, sr.getSubscriptionId());

   UnSubscribeQos uq = new UnSubscribeQos(glob);

   con.unSubscribe(uk.toXml(), uq.toXml());
      

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.
Columns named Impl tells you if the feature is implemented.
Columns named Hot tells you if the configuration is changeable in hot operation.

See REQ interface
See API org.xmlBlaster.client.key.UnSubscribeKey
See API org.xmlBlaster.client.qos.UnSubscribeQos
See API org.xmlBlaster.protocol.xmlrpc.XmlBlasterImpl
See API org.xmlBlaster.protocol.rmi.XmlBlasterImpl
See API org.xmlBlaster.client.I_XmlBlasterAccess
See TEST org.xmlBlaster.test.qos.TestUnSub
See TEST org.xmlBlaster.test.qos.TestSubNoDup

This page is generated from the requirement XML file xmlBlaster/doc/requirements/interface.unSubscribe.xml

Back to overview