Class ExplicitMessageEncryptionElement
java.lang.Object
org.jivesoftware.smackx.eme.element.ExplicitMessageEncryptionElement
- All Implemented Interfaces:
Element
,ExtensionElement
,NamedElement
,XmlElement
,XmlLangElement
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
-
Field Summary
-
Constructor Summary
ConstructorDescriptionExplicitMessageEncryptionElement
(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 boolean
hasProtocol
(MessageView message, String protocolNamespace) Return true, if themessage
already contains an EME element with the specifiedprotocolNamespace
.static boolean
hasProtocol
(MessageView message, ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol) Return true, if themessage
already contains an EME element with the specified protocol namespace.static void
set
(MessageBuilder message, ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol) Add an EME element containing the specifiedprotocol
namespace to the message.toXML
(XmlEnvironment enclosingNamespace) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
Description copied from interface:XmlElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceXmlElement
- Returns:
- the namespace.
-
toXML
-
from
-
hasProtocol
Return true, if themessage
already 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 themessage
already 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 specifiedprotocol
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
-