com.ansys.ingress.client.api

## Class Credentials

- java.lang.Object
- - com.ansys.ingress.client.api.Credentials

-     public class Credentials
      extends java.lang.Object

  Credentials define the tokens used to authenticate with an EKM repository.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `CACHE_USER_TYPE` CACHE_USER_TYPE needs to be kept in sync with core AuthenticationToken.CACHE_USER_TYPE.
    `static int` | `FTC_USER_TYPE` FTC_USER_TYPE
    `static int` | `PDM_USER_TYPE` PDM_USER_TYPE needs to be kept in sync with core AuthenticationToken.PDM_USER_TYPE.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Credentials()` Creates a new instance of Credentials.
    `Credentials(int userType, java.lang.String token, java.lang.String workspace)` Creates a new instance of Credentials.
    `Credentials(java.lang.String username, char[] password, java.lang.String workspace)` Creates a new instance of Credentials.
    `Credentials(java.lang.String username, char[] password, java.lang.String workspace, boolean closeExistingSession)` Creates a new instance of Credentials.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `credentialsMatch(java.lang.String username, java.lang.String password, java.lang.String workspace)` Determines if the given credentials match these credentials.
    `boolean` | `equals(java.lang.Object obj)`
    `char[]` | `getPassword()`
    `java.lang.String` | `getToken()`
    `java.lang.String` | `getUsername()`
    `int` | `getUserType()`
    `java.lang.String` | `getWorkspace()`
    `boolean` | `isCloseExistingSession()`
    `void` | `setCloseExistingSession(boolean closeExistingSession)` Sets the flag indicacting if existing sessions should be closed or not.
    `void` | `setPassword(char[] password)` Sets the password.
    `void` | `setToken(java.lang.String token)` Sets the token used for authentication.
    `void` | `setUsername(java.lang.String username)` Sets the username.
    `void` | `setUserType(int userType)` Sets the user type if doing token-based authentication.
    `void` | `setWorkspace(java.lang.String workspace)` Sets the workspace.
    `java.lang.String` | `toString()`

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

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

- - ### Field Detail

    - #### FTC_USER_TYPE

          public static final int FTC_USER_TYPE

      FTC_USER_TYPE

    - #### CACHE_USER_TYPE

          public static final int CACHE_USER_TYPE

      CACHE_USER_TYPE needs to be kept in sync with core AuthenticationToken.CACHE_USER_TYPE.

    - #### PDM_USER_TYPE

          public static final int PDM_USER_TYPE

      PDM_USER_TYPE needs to be kept in sync with core AuthenticationToken.PDM_USER_TYPE.

  - ### Constructor Detail

    - #### Credentials

          public Credentials()

      Creates a new instance of Credentials.

    - #### Credentials

          public Credentials(java.lang.String username,
                             char[] password,
                             java.lang.String workspace)

      Creates a new instance of Credentials.
      Parameters:
        `username` - - the username
        `password` - - the password
        `workspace` - - the workspace

    - #### Credentials

          public Credentials(java.lang.String username,
                             char[] password,
                             java.lang.String workspace,
                             boolean closeExistingSession)

      Creates a new instance of Credentials.
      Parameters:
        `username` - - the username
        `password` - - the password
        `workspace` - - the workspace
        `closeExistingSession` - - if an existing session should be closed or not

    - #### Credentials

          public Credentials(int userType,
                             java.lang.String token,
                             java.lang.String workspace)

      Creates a new instance of Credentials.
      Parameters:
        `userType` - the user type
        `token` - the token for authentication
        `workspace` - the workspace

  - ### Method Detail

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### getPassword

          public char[] getPassword()

      Returns:
        Returns the password.

    - #### getToken

          public java.lang.String getToken()

      Returns:
        Returns the token used to authenticate the user.

    - #### getUsername

          public java.lang.String getUsername()

      Returns:
        Returns the username.

    - #### getUserType

          public int getUserType()

      Returns:
        Returns the user type if token based authentication.

    - #### getWorkspace

          public java.lang.String getWorkspace()

      Returns:
        Returns the workspace

    - #### isCloseExistingSession

          public boolean isCloseExistingSession()

      Returns:
        Returns true if an existing session should be closed.

    - #### setCloseExistingSession

          public void setCloseExistingSession(boolean closeExistingSession)

      Sets the flag indicacting if existing sessions should be closed or not.
      Parameters:
        `closeExistingSession` - the value to set

    - #### setPassword

          public void setPassword(char[] password)

      Sets the password.
      Parameters:
        `password` - - the password

    - #### setToken

          public void setToken(java.lang.String token)

      Sets the token used for authentication.
      Parameters:
        `token` - the token

    - #### setUsername

          public void setUsername(java.lang.String username)

      Sets the username.
      Parameters:
        `username` - - the username

    - #### setUserType

          public void setUserType(int userType)

      Sets the user type if doing token-based authentication.
      Parameters:
        `userType` - - the user type

    - #### setWorkspace

          public void setWorkspace(java.lang.String workspace)

      Sets the workspace.
      Parameters:
        `workspace` - - the workspace

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### credentialsMatch

          public boolean credentialsMatch(java.lang.String username,
                                          java.lang.String password,
                                          java.lang.String workspace)

      Determines if the given credentials match these credentials.
      Parameters:
        `username` - the username
        `password` - the password
        `workspace` - the workspace
      Returns:
        Returns true if the credentials match.