congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Subscription.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
org.jivesoftware.smackx.pubsub.Subscription

Best Java code snippets using org.jivesoftware.smackx.pubsub.Subscription.getId (Showing top 2 results out of 315)

origin: igniterealtime/Smack

  @Test
  public void subscriptionsOwnerResultTest() throws Exception {
    // @formatter:off
    final String resultStanza =
     "<iq from='pubsub.example.org' to='julia@example.org/Smack' id='HaT4m-13' type='result'>" +
      "<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>" +
       "<subscriptions node='test'>" +
        "<subscription jid='foo@example.org/Smack' subscription='subscribed' subid='58C1A6F99F2A7'/>" +
        "<subscription jid='julia@example.org/Smack' subscription='subscribed' subid='58C18F8917321'/>" +
       "</subscriptions>" +
      "</pubsub>" +
     "</iq>";
    // @formatter:on
    XmlPullParser parser = TestUtils.getIQParser(resultStanza);
    PubSub pubsubResult = (PubSub) PacketParserUtils.parseIQ(parser);
    SubscriptionsExtension subElem = pubsubResult.getExtension(PubSubElementType.SUBSCRIPTIONS_OWNER);
    List<Subscription> subscriptions = subElem.getSubscriptions();
    assertEquals(2, subscriptions.size());

    Subscription sub1 = subscriptions.get(0);
    assertThat("foo@example.org/Smack", equalsCharSequence(sub1.getJid()));
    assertEquals(Subscription.State.subscribed, sub1.getState());
    assertEquals("58C1A6F99F2A7", sub1.getId());

    Subscription sub2 = subscriptions.get(1);
    assertThat("julia@example.org/Smack", equalsCharSequence(sub2.getJid()));
    assertEquals(Subscription.State.subscribed, sub2.getState());
    assertEquals("58C18F8917321", sub2.getId());
  }
}
origin: org.renci/xmpp-pubsub

/**
 * 
 * @param nodeName - node name
 * @param s - subscription
 */
public synchronized void unsubscribeFromNode(String nodeName, Subscription s) {
  try {
    LeafNode node = (LeafNode)manager.getNode(nodeName);
    node.unsubscribe(s.getJid(), s.getId());
  } catch (XMPPException e) {
    logger.error("XMPP Error unsubscribing from XMPP pubsub node: " + e);
  } catch (Exception e) {
    logger.error("Error unsubscribing from XMPP pubsub node: " + e);
  }
}
org.jivesoftware.smackx.pubsubSubscriptiongetId

Javadoc

Gets the subscription id

Popular methods of Subscription

  • <init>
    Construct a subscription change request to the specified state.
  • getNode
  • toXML
  • appendAttribute
  • getJid
    Gets the JID the subscription is created for.
  • getState
    Gets the current subscription state.

Popular in Java

  • Running tasks concurrently on multiple threads
  • notifyDataSetChanged (ArrayAdapter)
  • setScale (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now