Packet.getExtension
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.jivesoftware.smack.packet.Packet.getExtension(Showing top 15 results out of 315)

origin: org.igniterealtime.smack/smack

/**
 * Returns the first extension of this packet that has the given namespace.
 *
 * @param namespace the namespace of the extension that is desired.
 * @return the packet extension with the given namespace.
 */
public PacketExtension getExtension(String namespace) {
  return getExtension(null, namespace);
}
origin: jivesoftware/smackx

  public boolean accept(Packet packet) {
    OfflineMessageInfo info = (OfflineMessageInfo) packet.getExtension("offline",
        namespace);
    return nodes.contains(info.getNode());
  }
});
origin: org.igniterealtime.smack/smackx

  public void processPacket(Packet packet)
  {
    EventElement event = (EventElement)packet.getExtension("event", PubSubNamespace.EVENT.getXmlns());
    ItemsExtension itemsElem = (ItemsExtension)event.getEvent();
    DelayInformation delay = (DelayInformation)packet.getExtension("delay", "urn:xmpp:delay");
    
    // If there was no delay based on XEP-0203, then try XEP-0091 for backward compatibility
    if (delay == null)
    {
      delay = (DelayInformation)packet.getExtension("x", "jabber:x:delay");
    }
    ItemPublishEvent eventItems = new ItemPublishEvent(itemsElem.getNode(), (List<Item>)itemsElem.getItems(), getSubscriptionIds(packet), (delay == null ? null : delay.getStamp()));
    listener.handlePublishedItems(eventItems);
  }
}
origin: org.igniterealtime.smack/smackx

  public void processPacket(Packet packet) {
    // Get the MUCUser extension
    MUCUser mucUser =
      (MUCUser) packet.getExtension("x", "http://jabber.org/protocol/muc#user");
    // Check if the MUCUser extension includes an invitation
    if (mucUser.getInvite() != null &&
        ((Message) packet).getType() != Message.Type.error) {
      // Fire event for invitation listeners
      fireInvitationListeners(packet.getFrom(), mucUser.getInvite().getFrom(),
          mucUser.getInvite().getReason(), mucUser.getPassword(), (Message) packet);
    }
  }
};
origin: jivesoftware/smackx

/**
 * Gets the subscriptions on the root node.
 * 
 * @return List of exceptions
 * 
 * @throws XMPPException
 */
public List<Subscription> getSubscriptions()
  throws XMPPException
{
  Packet reply = sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.SUBSCRIPTIONS));
  SubscriptionsExtension subElem = (SubscriptionsExtension)reply.getExtension(PubSubElementType.SUBSCRIPTIONS.getElementName(), PubSubElementType.SUBSCRIPTIONS.getNamespace().getXmlns());
  return subElem.getSubscriptions();
}
 
origin: org.igniterealtime.smack/smackx

  public void processPacket(Packet packet)
  {
    EventElement event = (EventElement)packet.getExtension("event", PubSubNamespace.EVENT.getXmlns());
    ConfigurationEvent config = (ConfigurationEvent)event.getEvent();
    listener.handleNodeConfiguration(config);
  }
}
origin: jivesoftware/smack

/**
 * Returns the first extension of this packet that has the given namespace.
 *
 * @param namespace the namespace of the extension that is desired.
 * @return the packet extension with the given namespace.
 */
public PacketExtension getExtension(String namespace) {
  return getExtension(null, namespace);
}
origin: jivesoftware/smackx

  public void processPacket(Packet packet)
  {
    EventElement event = (EventElement)packet.getExtension("event", PubSubNamespace.EVENT.getXmlns());
    ConfigurationEvent config = (ConfigurationEvent)event.getEvent();
    listener.handleNodeConfiguration(config);
  }
}
origin: org.igniterealtime.smack/smackx

  public boolean accept(Packet packet) {
    OfflineMessageInfo info = (OfflineMessageInfo) packet.getExtension("offline",
        namespace);
    return nodes.contains(info.getNode());
  }
});
origin: jivesoftware/smackx

  public void processPacket(Packet packet) {
    // Get the MUCUser extension
    MUCUser mucUser =
      (MUCUser) packet.getExtension("x", "http://jabber.org/protocol/muc#user");
    // Check if the MUCUser extension includes an invitation
    if (mucUser.getInvite() != null &&
        ((Message) packet).getType() != Message.Type.error) {
      // Fire event for invitation listeners
      fireInvitationListeners(packet.getFrom(), mucUser.getInvite().getFrom(),
          mucUser.getInvite().getReason(), mucUser.getPassword(), (Message) packet);
    }
  }
};
origin: org.igniterealtime.smack/smack

  public boolean accept(Packet packet) {
    return packet.getExtension(elementName, namespace) != null;
  }
}
origin: jivesoftware/smack

  public boolean accept(Packet packet) {
    return packet.getExtension(elementName, namespace) != null;
  }
}
origin: jivesoftware/smackx

/**
 * Returns the MUCUser packet extension included in the packet or <tt>null</tt> if none.
 *
 * @param packet the packet that may include the MUCUser extension.
 * @return the MUCUser found in the packet.
 */
private MUCUser getMUCUserExtension(Packet packet) {
  if (packet != null) {
    // Get the MUC User extension
    return (MUCUser) packet.getExtension("x", "http://jabber.org/protocol/muc#user");
  }
  return null;
}
origin: org.igniterealtime.smack/smackx

/**
 * Returns the MUCUser packet extension included in the packet or <tt>null</tt> if none.
 *
 * @param packet the packet that may include the MUCUser extension.
 * @return the MUCUser found in the packet.
 */
private MUCUser getMUCUserExtension(Packet packet) {
  if (packet != null) {
    // Get the MUC User extension
    return (MUCUser) packet.getExtension("x", "http://jabber.org/protocol/muc#user");
  }
  return null;
}
origin: jivesoftware/smackx

  public void processPacket(Packet packet)
  {
    EventElement event = (EventElement)packet.getExtension("event", PubSubNamespace.EVENT.getXmlns());
    ItemsExtension itemsElem = (ItemsExtension)event.getEvent();
    DelayInformation delay = (DelayInformation)packet.getExtension("delay", "urn:xmpp:delay");
    
    // If there was no delay based on XEP-0203, then try XEP-0091 for backward compatibility
    if (delay == null)
    {
      delay = (DelayInformation)packet.getExtension("x", "jabber:x:delay");
    }
    ItemPublishEvent eventItems = new ItemPublishEvent(itemsElem.getNode(), (List<Item>)itemsElem.getItems(), getSubscriptionIds(packet), (delay == null ? null : delay.getStamp()));
    listener.handlePublishedItems(eventItems);
  }
}
org.jivesoftware.smack.packetPacketgetExtension

Javadoc

Returns the first extension of this stanza(/packet) that has the given namespace.

When possible, use #getExtension(String,String) instead.

Popular methods of Packet

  • toXML
    Returns the packet as XML. Every concrete extension of Packet must implement this method. In additio
  • getFrom
    Returns who the stanza(/packet) is being sent "from" or null if the value is not set. The XMPP proto
  • getPacketID
    Get the stanza id.
  • getTo
    Returns who the stanza(/packet) is being sent "to", or null if the value is not set. The XMPP protoc
  • getError
    Returns the error associated with this packet, or null if there are no errors.
  • addExtension
    Adds a packet extension to the packet.
  • getProperty
    Returns the packet property with the specified name or null if the property doesn't exist. Property
  • getPropertyNames
    Returns an unmodifiable collection of all the property names that are set.
  • setTo
    Sets who the stanza(/packet) is being sent "to". The XMPP protocol often makes the "to" attribute op
  • getDefaultLanguage
    Returns the default language used for all messages containing localized content.
  • getExtensions
    Return a set of all extensions with the given element name and namespace. Changes to the returned s
  • nextID
    Returns the next unique id. Each id made up of a short alphanumeric prefix along with a unique numer
  • getExtensions,
  • nextID,
  • toString

Popular classes and methods

  • getOriginalFilename (MultipartFile)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • Kernel (java.awt.image)
  • LinkedHashMap (java.util)
    Hash table implementation of the Map interface with predictable iteration order. [Sun docs] [http:/
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on *
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Notification (javax.management)
    Notifications are events emitted by NotificationEmitters
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)