Class ExplicitMessageEncryptionElement
- java.lang.Object
-
- org.jivesoftware.smackx.eme.element.ExplicitMessageEncryptionElement
-
- All Implemented Interfaces:
Element,ExtensionElement,FullyQualifiedElement,NamedElement,XmlLangElement
public class ExplicitMessageEncryptionElement extends java.lang.Object implements ExtensionElement
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol
-
Constructor Summary
Constructors Constructor Description ExplicitMessageEncryptionElement(java.lang.String encryptionNamespace)ExplicitMessageEncryptionElement(java.lang.String encryptionNamespace, java.lang.String name)ExplicitMessageEncryptionElement(ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExplicitMessageEncryptionElementfrom(Message message)java.lang.StringgetElementName()Returns the root element name.java.lang.StringgetEncryptionNamespace()java.lang.StringgetName()Get the optional name of the encryption method.java.lang.StringgetNamespace()Returns the root element XML namespace.ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocolgetProtocol()static booleanhasProtocol(MessageView message, java.lang.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.XmlStringBuildertoXML(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.FullyQualifiedElement
getLanguage, getQName
-
-
-
-
Field Detail
-
ELEMENT
public static final java.lang.String ELEMENT
- See Also:
- Constant Field Values
-
NAMESPACE
public static final java.lang.String NAMESPACE
- See Also:
- Constant Field Values
-
QNAME
public static final javax.xml.namespace.QName QNAME
-
-
Constructor Detail
-
ExplicitMessageEncryptionElement
public ExplicitMessageEncryptionElement(ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol protocol)
-
ExplicitMessageEncryptionElement
public ExplicitMessageEncryptionElement(java.lang.String encryptionNamespace)
-
ExplicitMessageEncryptionElement
public ExplicitMessageEncryptionElement(java.lang.String encryptionNamespace, java.lang.String name)
-
-
Method Detail
-
getProtocol
public ExplicitMessageEncryptionElement.ExplicitMessageEncryptionProtocol getProtocol()
-
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()
Description copied from interface:NamedElementReturns the root element name.- Specified by:
getElementNamein interfaceNamedElement- Returns:
- the element name.
-
getNamespace
public java.lang.String getNamespace()
Description copied from interface:FullyQualifiedElementReturns the root element XML namespace.- Specified by:
getNamespacein interfaceFullyQualifiedElement- Returns:
- the namespace.
-
toXML
public XmlStringBuilder toXML(XmlEnvironment enclosingNamespace)
-
from
public static ExplicitMessageEncryptionElement from(Message message)
-
hasProtocol
public static boolean hasProtocol(MessageView message, java.lang.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(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
-
-