Class ExplicitMessageEncryptionElement
java.lang.Object
org.jivesoftware.smackx.eme.element.ExplicitMessageEncryptionElement
- All Implemented Interfaces:
org.jivesoftware.smack.packet.Element,org.jivesoftware.smack.packet.ExtensionElement,org.jivesoftware.smack.packet.NamedElement,org.jivesoftware.smack.packet.XmlElement,org.jivesoftware.smack.packet.XmlLangElement
public class ExplicitMessageEncryptionElement
extends Object
implements org.jivesoftware.smack.packet.ExtensionElement
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExplicitMessageEncryptionElement(String encryptionNamespace) ExplicitMessageEncryptionElement(String encryptionNamespace, String name) ExplicitMessageEncryptionElement(ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol) -
Method Summary
Modifier and TypeMethodDescriptionfrom(org.jivesoftware.smack.packet.Message message) getName()Get the optional name of the encryption method.static booleanhasProtocol(org.jivesoftware.smack.packet.MessageView message, String protocolNamespace) Return true, if themessagealready contains an EME element with the specifiedprotocolNamespace.static booleanhasProtocol(org.jivesoftware.smack.packet.MessageView message, ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol) Return true, if themessagealready contains an EME element with the specified protocol namespace.static voidset(org.jivesoftware.smack.packet.MessageBuilder message, ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol) Add an EME element containing the specifiedprotocolnamespace to the message.org.jivesoftware.smack.util.XmlStringBuildertoXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jivesoftware.smack.packet.Element
toXML, toXMLMethods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getQName
-
Field Details
-
ELEMENT
- See Also:
-
NAMESPACE
- See Also:
-
QNAME
-
-
Constructor Details
-
ExplicitMessageEncryptionElement
public ExplicitMessageEncryptionElement(ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol) -
ExplicitMessageEncryptionElement
-
ExplicitMessageEncryptionElement
-
-
Method Details
-
getProtocol
-
getEncryptionNamespace
-
getName
Get the optional name of the encryption method.- Returns:
- the name of the encryption method or
null.
-
getElementName
- Specified by:
getElementNamein interfaceorg.jivesoftware.smack.packet.NamedElement
-
getNamespace
- Specified by:
getNamespacein interfaceorg.jivesoftware.smack.packet.XmlElement
-
toXML
public org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) - Specified by:
toXMLin interfaceorg.jivesoftware.smack.packet.Element
-
from
-
hasProtocol
public static boolean hasProtocol(org.jivesoftware.smack.packet.MessageView message, String protocolNamespace) Return true, if themessagealready contains an EME element with the specifiedprotocolNamespace.- Parameters:
message- messageprotocolNamespace- 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 themessagealready contains an EME element with the specified protocol namespace.- Parameters:
message- messageprotocol- 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 specifiedprotocolnamespace to the message. In case there is already an element with that protocol, we do nothing.- Parameters:
message- a message builder.protocol- encryption protocol
-