Class ApiKey


  • public final class ApiKey
    extends java.lang.Object
    API key information
    • Constructor Summary

      Constructors 
      Constructor Description
      ApiKey​(java.lang.String name, java.lang.String id, java.time.Instant creation, java.time.Instant expiration, boolean invalidated, java.lang.String username, java.lang.String realm)  
    • Constructor Detail

      • ApiKey

        public ApiKey​(java.lang.String name,
                      java.lang.String id,
                      java.time.Instant creation,
                      java.time.Instant expiration,
                      boolean invalidated,
                      java.lang.String username,
                      java.lang.String realm)
    • Method Detail

      • getId

        public java.lang.String getId()
      • getName

        public java.lang.String getName()
      • getCreation

        public java.time.Instant getCreation()
        Returns:
        a instance of Instant when this API key was created.
      • getExpiration

        public java.time.Instant getExpiration()
        Returns:
        a instance of Instant when this API key will expire. In case the API key does not expire then will return null
      • isInvalidated

        public boolean isInvalidated()
        Returns:
        true if this API key has been invalidated else returns false
      • getUsername

        public java.lang.String getUsername()
        Returns:
        the username for which this API key was created.
      • getRealm

        public java.lang.String getRealm()
        Returns:
        the realm name of the user for which this API key was created.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • fromXContent

        public static ApiKey fromXContent​(XContentParser parser)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object