Class JivePropertiesManager


  • public class JivePropertiesManager
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static void addProperty​(org.jivesoftware.smack.packet.StanzaBuilder<?> stanzaBuilder, java.lang.String name, java.lang.Object value)
      Convenience method to add a property to a stanza.
      static void addProperty​(org.jivesoftware.smack.packet.Stanza packet, java.lang.String name, java.lang.Object value)
      static java.util.Map<java.lang.String,​java.lang.Object> getProperties​(org.jivesoftware.smack.packet.Stanza packet)
      Return a map of all properties of the given packet.
      static java.util.Collection<java.lang.String> getPropertiesNames​(org.jivesoftware.smack.packet.Stanza packet)
      Return a collection of the names of all properties of the given packet.
      static java.lang.Object getProperty​(org.jivesoftware.smack.packet.StanzaView packet, java.lang.String name)
      Convenience method to get a property from a packet.
      static boolean isJavaObjectEnabled()  
      static void setJavaObjectEnabled​(boolean enabled)
      Enables deserialization of Java objects embedded in the 'properties' stanza extension.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JivePropertiesManager

        public JivePropertiesManager()
    • Method Detail

      • setJavaObjectEnabled

        public static void setJavaObjectEnabled​(boolean enabled)
        Enables deserialization of Java objects embedded in the 'properties' stanza extension. Since this is a security sensitive feature, it is disabled per default in Smack. Only enable it if you are sure that you understand the potential security implications it can cause.

        See also:

        Parameters:
        enabled - true to enable Java object deserialization
      • isJavaObjectEnabled

        public static boolean isJavaObjectEnabled()
      • addProperty

        @Deprecated
        public static void addProperty​(org.jivesoftware.smack.packet.Stanza packet,
                                       java.lang.String name,
                                       java.lang.Object value)
        Convenience method to add a property to a packet.
        Parameters:
        packet - the stanza to add the property to.
        name - the name of the property to add.
        value - the value of the property to add.
      • addProperty

        public static void addProperty​(org.jivesoftware.smack.packet.StanzaBuilder<?> stanzaBuilder,
                                       java.lang.String name,
                                       java.lang.Object value)
        Convenience method to add a property to a stanza.
        Parameters:
        stanzaBuilder - the stanza to add the property to.
        name - the name of the property to add.
        value - the value of the property to add.
      • getProperty

        public static java.lang.Object getProperty​(org.jivesoftware.smack.packet.StanzaView packet,
                                                   java.lang.String name)
        Convenience method to get a property from a packet. Will return null if the stanza contains not property with the given name.
        Parameters:
        packet - TODO javadoc me please
        name - TODO javadoc me please
        Returns:
        the property or null if none found.
      • getPropertiesNames

        public static java.util.Collection<java.lang.String> getPropertiesNames​(org.jivesoftware.smack.packet.Stanza packet)
        Return a collection of the names of all properties of the given packet. If the packet contains no properties extension, then an empty collection will be returned.
        Parameters:
        packet - TODO javadoc me please
        Returns:
        a collection of the names of all properties.
      • getProperties

        public static java.util.Map<java.lang.String,​java.lang.Object> getProperties​(org.jivesoftware.smack.packet.Stanza packet)
        Return a map of all properties of the given packet. If the stanza contains no properties extension, an empty map will be returned.
        Parameters:
        packet - TODO javadoc me please
        Returns:
        a map of all properties of the given packet.