Class GridRestProtocolAdapter

    • Field Detail

      • secretKey

        protected final String secretKey
        Secret key.
      • host

        protected InetAddress host
        Host used by this protocol.
      • port

        protected int port
        Port used by this protocol.
    • Constructor Detail

      • GridRestProtocolAdapter

        protected GridRestProtocolAdapter​(GridKernalContext ctx)
        Parameters:
        ctx - Context.
    • Method Detail

      • authenticate

        protected boolean authenticate​(@Nullable
                                       @Nullable String tok)
        Authenticates current request.

        Token consists of 2 parts separated by semicolon:

        1. Timestamp (time in milliseconds)
        2. Base64 encoded SHA1 hash of {1}:{secretKey}
        Parameters:
        tok - Authentication token.
        Returns:
        true if authentication info provided in request is correct.
      • startInfo

        protected String startInfo()
        Returns:
        Start information string.
      • stopInfo

        protected String stopInfo()
        Returns:
        Stop information string.
      • getAddressPropertyName

        protected abstract String getAddressPropertyName()
        Return node attribute name to store used address.
        Returns:
        Node attribute name.
      • getHostNamePropertyName

        protected abstract String getHostNamePropertyName()
        Return node attribute name to store used host name.
        Returns:
        Node attribute name.
      • getPortPropertyName

        protected abstract String getPortPropertyName()
        Return node attribute name to store used port number.
        Returns:
        Node attribute name.