Package rocks.xmpp.extensions.shim
Class StanzaHeadersAndInternetMetadataProtocol
- java.lang.Object
-
- rocks.xmpp.extensions.shim.StanzaHeadersAndInternetMetadataProtocol
-
- All Implemented Interfaces:
ExtensionProtocol,DiscoverableInfo,InfoProvider,HeaderManager
public class StanzaHeadersAndInternetMetadataProtocol extends Object implements HeaderManager, DiscoverableInfo
Implementation of XEP-0131: Stanza Headers and Internet Metadata.
-
-
Constructor Summary
Constructors Constructor Description StanzaHeadersAndInternetMetadataProtocol(ServiceDiscoveryManager serviceDiscoveryManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddSupportedHeader(String header)Adds a supported header.AsyncResult<List<String>>discoverSupportedHeaders(Jid jid)Discovers the supported headers of another entity.Set<String>getFeatures()DiscoverableInfogetInfo(Jid to, Jid from, String node, Locale locale)StringgetNamespace()Set<String>getSupportedHeaders()Gets the supported headers as unmodifiable set.booleanisEnabled()booleanremoveSupportedHeader(String header)Removes a supported header.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface rocks.xmpp.extensions.disco.model.info.DiscoverableInfo
getExtensions, getIdentities
-
-
-
-
Constructor Detail
-
StanzaHeadersAndInternetMetadataProtocol
public StanzaHeadersAndInternetMetadataProtocol(ServiceDiscoveryManager serviceDiscoveryManager)
-
-
Method Detail
-
getSupportedHeaders
public final Set<String> getSupportedHeaders()
Description copied from interface:HeaderManagerGets the supported headers as unmodifiable set.If you want to advertise support for a specific header, add it to this set. Service discovery requests to the 'header' node will then reveal supported headers.
- Specified by:
getSupportedHeadersin interfaceHeaderManager- Returns:
- The supported headers.
-
addSupportedHeader
public boolean addSupportedHeader(String header)
Description copied from interface:HeaderManagerAdds a supported header. Adding a header automatically includes this protocol in service discovery responses.- Specified by:
addSupportedHeaderin interfaceHeaderManager- Parameters:
header- The header.- Returns:
- True, if the header was added.
- See Also:
HeaderManager.removeSupportedHeader(String)
-
removeSupportedHeader
public boolean removeSupportedHeader(String header)
Description copied from interface:HeaderManagerRemoves a supported header. If there are no headers left, this protocol is no longer included in service discovery responses.- Specified by:
removeSupportedHeaderin interfaceHeaderManager- Parameters:
header- The header.- Returns:
- True, if the header was removed.
- See Also:
HeaderManager.addSupportedHeader(String)
-
discoverSupportedHeaders
public final AsyncResult<List<String>> discoverSupportedHeaders(Jid jid)
Description copied from interface:HeaderManagerDiscovers the supported headers of another entity.- Specified by:
discoverSupportedHeadersin interfaceHeaderManager- Parameters:
jid- The JID.- Returns:
- The async result with the list of supported headers.
-
getNamespace
public final String getNamespace()
- Specified by:
getNamespacein interfaceExtensionProtocol- Returns:
- "http://jabber.org/protocol/shim"
-
isEnabled
public final boolean isEnabled()
- Specified by:
isEnabledin interfaceExtensionProtocol
-
getFeatures
public final Set<String> getFeatures()
- Specified by:
getFeaturesin interfaceDiscoverableInfo
-
getInfo
public final DiscoverableInfo getInfo(Jid to, Jid from, String node, Locale locale)
- Specified by:
getInfoin interfaceInfoProvider
-
-