Class EntityCapabilities1
- java.lang.Object
-
- rocks.xmpp.core.stream.model.StreamFeature
-
- rocks.xmpp.extensions.caps.model.EntityCapabilities1
-
- All Implemented Interfaces:
Comparable<StreamFeature>,EntityCapabilities,Hashed
public final class EntityCapabilities1 extends StreamFeature implements EntityCapabilities, Hashed
The implementation of the<c/>element in thehttp://jabber.org/protocol/caps.This class is immutable.
- See Also:
- XEP-0115: Entity Capabilities, XML Schema
-
-
Constructor Summary
Constructors Constructor Description EntityCapabilities1(String node, DiscoverableInfo discoverableInfo, MessageDigest messageDigest)Creates an entity caps from discoverable info and hash function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreateCapabilityHashNode(Hashed hashed)Creates the Capability Hash Node.byte[]createVerificationString(DiscoverableInfo discoverableInfo)Creates an UTF-8 encoded verification string from a disco#info query.booleanequals(Object o)Set<Hashed>getCapabilityHashSet()Gets the capability hash set.StringgetHashAlgorithm()Gets the hash algorithm.byte[]getHashValue()Gets the hash value.StringgetNode()Gets the node.StringgetVerificationString()Gets the verification string that is used to verify the identity and supported features of the entity.inthashCode()StringtoString()-
Methods inherited from class rocks.xmpp.core.stream.model.StreamFeature
compareTo, getPriority, isMandatory, requiresRestart
-
-
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
"http://jabber.org/protocol/caps"- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EntityCapabilities1
public EntityCapabilities1(String node, DiscoverableInfo discoverableInfo, MessageDigest messageDigest)
Creates an entity caps from discoverable info and hash function.- Parameters:
node- The node.discoverableInfo- The discoverable info.messageDigest- The hash function.
-
-
Method Detail
-
getHashAlgorithm
public final String getHashAlgorithm()
Description copied from interface:HashedGets the hash algorithm.- Specified by:
getHashAlgorithmin interfaceHashed- Returns:
- The hash algorithm.
-
getHashValue
public final byte[] getHashValue()
Description copied from interface:HashedGets the hash value.- Specified by:
getHashValuein interfaceHashed- Returns:
- The hash value.
-
getNode
public final String getNode()
Gets the node.A URI that uniquely identifies a software application, typically a URL at the website of the project or company that produces the software.
It is RECOMMENDED for the value of the 'node' attribute to be an HTTP URL at which a user could find further information about the software product, such as "http://psi-im.org" for the Psi client; this enables a processing application to also determine a unique string for the generating application, which it could maintain in a list of known software implementations (e.g., associating the name received via the disco#info reply with the URL found in the caps data).
- Returns:
- The node.
-
getVerificationString
public final String getVerificationString()
Gets the verification string that is used to verify the identity and supported features of the entity.- Returns:
- The verification string.
-
getCapabilityHashSet
public final Set<Hashed> getCapabilityHashSet()
Description copied from interface:EntityCapabilitiesGets the capability hash set.- Specified by:
getCapabilityHashSetin interfaceEntityCapabilities- Returns:
- The capability hash set.
-
createVerificationString
public final byte[] createVerificationString(DiscoverableInfo discoverableInfo)
Description copied from interface:EntityCapabilitiesCreates an UTF-8 encoded verification string from a disco#info query.The returned byte array is neither hashed nor base64 encoded. It should be used as input for generating the capability hash set.
- Specified by:
createVerificationStringin interfaceEntityCapabilities- Parameters:
discoverableInfo- The query.- Returns:
- The caps string, aka. verification string.
-
createCapabilityHashNode
public final String createCapabilityHashNode(Hashed hashed)
Description copied from interface:EntityCapabilitiesCreates the Capability Hash Node.This node is used to query the generating entity via a Service Discovery Info query (disco#info).
- Specified by:
createCapabilityHashNodein interfaceEntityCapabilities- Parameters:
hashed- The pair of hash algorithm and value.- Returns:
- The node.
-
-