com.h3c.api.auth

## Class DefaultAuthentication

- java.lang.Object
- - com.h3c.api.auth.DefaultAuthentication

- All Implemented Interfaces:
    Authentication, Serializable

      public class DefaultAuthentication
      extends Object
      implements Authentication, Serializable

  Simple carrier of authentication record.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultAuthentication(String token, long expiration, String userId, String userName, String roles, String domainId, String domainName)` Create an authentication descriptor using the supplied information.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `domainId()` Get the authentication domain.
    `String` | `domainName()` Get the authentication domain name.
    `boolean` | `equals(Object obj)`
    `long` | `expiration()` Get the authentication expiration date/time in number of milliseconds since start of epoch.
    `int` | `hashCode()`
    `Set<String>` | `roles()` Get a set of user roles.
    `String` | `token()` Authentication token uniquely identifying this authentication.
    `String` | `userId()` Get the user id.
    `String` | `userName()` Get the user name.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultAuthentication

          public DefaultAuthentication(String token,
                               long expiration,
                               String userId,
                               String userName,
                               String roles,
                               String domainId,
                               String domainName)

      Create an authentication descriptor using the supplied information.
      Parameters:
        `token` - token identifying the authentication
        `expiration` - time specified in number of milliseconds since start of UTC epoch
        `userId` - user unique id
        `userName` - user name
        `roles` - user roles as a comma-separated list
        `domainId` - id of the issuing authentication domain
        `domainName` - authentication domain name

  - ### Method Detail

    - #### token

          public String token()

      Description copied from interface: `Authentication`
      Authentication token uniquely identifying this authentication.
      Specified by:
        `token` in interface `Authentication`
      Returns:
        authentication token

    - #### expiration

          public long expiration()

      Description copied from interface: `Authentication`
      Get the authentication expiration date/time in number of milliseconds since start of epoch.
      Specified by:
        `expiration` in interface `Authentication`
      Returns:
        expiration milliseconds since start of UTC epoch

    - #### userId

          public String userId()

      Description copied from interface: `Authentication`
      Get the user id.
      Specified by:
        `userId` in interface `Authentication`
      Returns:
        unique user id

    - #### userName

          public String userName()

      Description copied from interface: `Authentication`
      Get the user name.
      Specified by:
        `userName` in interface `Authentication`
      Returns:
        user name

    - #### roles

          public Set<String> roles()

      Description copied from interface: `Authentication`
      Get a set of user roles.
      Specified by:
        `roles` in interface `Authentication`
      Returns:
        set of user roles

    - #### domainId

          public String domainId()

      Description copied from interface: `Authentication`
      Get the authentication domain.
      Specified by:
        `domainId` in interface `Authentication`
      Returns:
        unique domain id

    - #### domainName

          public String domainName()

      Description copied from interface: `Authentication`
      Get the authentication domain name.
      Specified by:
        `domainName` in interface `Authentication`
      Returns:
        domain name

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

Copyright © 2014. All Rights Reserved.