Class EntityCapabilities1

    • 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: Hashed
        Gets the hash algorithm.
        Specified by:
        getHashAlgorithm in interface Hashed
        Returns:
        The hash algorithm.
      • getHashValue

        public final byte[] getHashValue()
        Description copied from interface: Hashed
        Gets the hash value.
        Specified by:
        getHashValue in interface Hashed
        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.
      • createVerificationString

        public final byte[] createVerificationString​(DiscoverableInfo discoverableInfo)
        Description copied from interface: EntityCapabilities
        Creates 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:
        createVerificationString in interface EntityCapabilities
        Parameters:
        discoverableInfo - The query.
        Returns:
        The caps string, aka. verification string.
      • createCapabilityHashNode

        public final String createCapabilityHashNode​(Hashed hashed)
        Description copied from interface: EntityCapabilities
        Creates the Capability Hash Node.

        This node is used to query the generating entity via a Service Discovery Info query (disco#info).

        Specified by:
        createCapabilityHashNode in interface EntityCapabilities
        Parameters:
        hashed - The pair of hash algorithm and value.
        Returns:
        The node.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object