Class ExplicitMessageEncryptionElement

  • All Implemented Interfaces:
    org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.ExtensionElement, org.jivesoftware.smack.packet.FullyQualifiedElement, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.XmlLangElement

    public class ExplicitMessageEncryptionElement
    extends java.lang.Object
    implements org.jivesoftware.smack.packet.ExtensionElement
    • Field Detail

      • QNAME

        public static final javax.xml.namespace.QName QNAME
    • Constructor Detail

      • ExplicitMessageEncryptionElement

        public ExplicitMessageEncryptionElement​(java.lang.String encryptionNamespace)
      • ExplicitMessageEncryptionElement

        public ExplicitMessageEncryptionElement​(java.lang.String encryptionNamespace,
                                                java.lang.String name)
    • Method Detail

      • getEncryptionNamespace

        public java.lang.String getEncryptionNamespace()
      • getName

        public java.lang.String getName()
        Get the optional name of the encryption method.
        Returns:
        the name of the encryption method or null.
      • getElementName

        public java.lang.String getElementName()
        Specified by:
        getElementName in interface org.jivesoftware.smack.packet.NamedElement
      • getNamespace

        public java.lang.String getNamespace()
        Specified by:
        getNamespace in interface org.jivesoftware.smack.packet.FullyQualifiedElement
      • toXML

        public org.jivesoftware.smack.util.XmlStringBuilder toXML​(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
        Specified by:
        toXML in interface org.jivesoftware.smack.packet.Element
      • hasProtocol

        public static boolean hasProtocol​(org.jivesoftware.smack.packet.MessageView message,
                                          java.lang.String protocolNamespace)
        Return true, if the message already contains an EME element with the specified protocolNamespace.
        Parameters:
        message - message
        protocolNamespace - namespace
        Returns:
        true if message has EME element for that namespace, otherwise false
      • hasProtocol

        public static boolean hasProtocol​(org.jivesoftware.smack.packet.MessageView message,
                                          ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol)
        Return true, if the message already contains an EME element with the specified protocol namespace.
        Parameters:
        message - message
        protocol - protocol
        Returns:
        true if message has EME element for that namespace, otherwise false
      • set

        public static void set​(org.jivesoftware.smack.packet.MessageBuilder message,
                               ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol)
        Add an EME element containing the specified protocol namespace to the message. In case there is already an element with that protocol, we do nothing.
        Parameters:
        message - a message builder.
        protocol - encryption protocol