Class ExplicitMessageEncryptionElement
java.lang.Object
org.jivesoftware.smackx.eme.element.ExplicitMessageEncryptionElement
- All Implemented Interfaces:
Element,ExtensionElement,NamedElement,XmlElement,XmlLangElement
-
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 TypeMethodDescriptionReturns the root element name.getName()Get the optional name of the encryption method.Returns the root element XML namespace.static booleanhasProtocol(MessageView message, String protocolNamespace) Return true, if themessagealready contains an EME element with the specifiedprotocolNamespace.static booleanhasProtocol(MessageView message, ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol) Return true, if themessagealready contains an EME element with the specified protocol namespace.static voidset(MessageBuilder message, ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol) Add an EME element containing the specifiedprotocolnamespace to the message.toXML(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.XmlElement
getLanguage, getQName
-
Field Details
-
ELEMENT
- See Also:
-
NAMESPACE
- See Also:
-
QNAME
-
-
Constructor Details
-
ExplicitMessageEncryptionElement
-
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
Description copied from interface:NamedElementReturns the root element name.- Specified by:
getElementNamein interfaceNamedElement- Returns:
- the element name.
-
getNamespace
Description copied from interface:XmlElementReturns the root element XML namespace.- Specified by:
getNamespacein interfaceXmlElement- Returns:
- the namespace.
-
toXML
-
from
-
hasProtocol
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(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(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
-