Class Credentials

java.lang.Object
com.appiancorp.suiteapi.common.Credentials
All Implemented Interfaces:
com.appian.komodo.api.EngineCredentials, Serializable

public class Credentials extends Object implements com.appian.komodo.api.EngineCredentials, Serializable
Bean that represents a User's credentials
See Also:
  • Constructor Details

    • Credentials

      public Credentials()
      Credentials Empty constructor.
    • Credentials

      public Credentials(com.appiancorp.ag.ImmutableCredentials copySource, String tenant, boolean includeGroupMembership)
      Credentials copy constructor with tenant modification.
      Parameters:
      copySource -
      tenant -
      includeGroupMembership - true for engines other than Process, which retains cached groups itself for background processing
    • Credentials

      protected Credentials(com.google.common.collect.ImmutableSet<Long> adminGroups, com.google.common.collect.ImmutableSet<Long> memberGroups, com.google.common.collect.ImmutableSet<String> memberGroupUuids, int userType, String username, String tenant, String userUuid, Integer userGroupsLocalId)
      Constructs the bean that represents a User's credentials. The bean is created automatically by the system and should not be constructed by third-party developers in plug-ins. Expects ImmutableSets to be used in creating Credentials. To be used in subclasses that do not want to be able to modify fields of Credentials.
  • Method Details

    • getAdminGroups

      public Set<Long> getAdminGroups()
      Group IDs for those groups where the user is an administrator.
      Returns:
      Set of group IDs for those where the user is an administrator.
    • setAdminGroups

      public void setAdminGroups(Set<Long> adminGroups_)
      Sets the Group IDs for those groups where the user is an administrator.
      Parameters:
      adminGroups_ - Set with the group IDs for the groups where the user is an administrator.
    • getMemberGroups

      public Set<Long> getMemberGroups()
      Group IDs for those groups where the user is a member.
      Returns:
      Set of group IDs for those where the user is a member.
    • setMemberGroups

      public void setMemberGroups(Set<Long> memberGroups_)
      Sets the Group IDs for those groups where the user is a member.
      Parameters:
      memberGroups_ - Set with the group IDs for the groups where the user is a member.
    • getMemberGroupUuids

      public Set<String> getMemberGroupUuids()
      Returns the UUIDs of the groups where the user is a member.
    • setMemberGroupUuids

      public void setMemberGroupUuids(Set<String> memberGroupUuids)
      Sets the UUIDs of the groups where the user is a member.
    • getUserType

      public int getUserType()
      User's type
      Returns:
      The user's type.
    • setUserType

      public void setUserType(int userType_)
      Sets the user's type
      Parameters:
      userType_ -
    • setIdentity

      public void setIdentity(String username_)
      Sets the username of the user to whom these credentials belong.
      Parameters:
      username_ -
    • getIdentity

      public String getIdentity()
      Gets the username of the user to whom these credentials belong.
      Specified by:
      getIdentity in interface com.appian.komodo.api.EngineCredentials
    • getTenant

      public String getTenant()
      Tenant's identifier
      Returns:
      The current tenant identifier
    • setTenant

      public void setTenant(String tenant_)
      Sets the user's tenant identifier
      Parameters:
      tenant_ - tenant identifier
    • getPayload

      public Object getPayload()
      Returns the credentials in the format that is expected by the backend when they are passed along with an API call. The format is an array with elements. The elements are: (0) Username (String) (1) Member groups (int[]) (2) Admin groups (int[]) (3) User type (Integer) (4) Tenant (String) (5) Current thread hashcode (Integer) (6) Designate as migration call (Integer) - always 0 here (7) User UUID (8) User Groups Local ID Note that the groups must be passed as int[], because the K engines do not support Long[] or Integer[]. The user type must be passed as Integer for the same reason.
      Specified by:
      getPayload in interface com.appian.komodo.api.EngineCredentials
    • getUserUuid

      public String getUserUuid()
    • setUserUuid

      public void setUserUuid(String userUuid_)
    • getUserGroupsLocalId

      public Integer getUserGroupsLocalId()
    • setUserGroupsLocalId

      public void setUserGroupsLocalId(Integer userGroupsLocalId_)
    • toString

      public String toString()
      Debug representation of Credentials.
      Overrides:
      toString in class Object
      Returns:
      String