Package com.appiancorp.suiteapi.common
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 Summary
ModifierConstructorDescriptionCredentials Empty constructor.Credentials
(com.appiancorp.ag.ImmutableCredentials copySource, String tenant, boolean includeGroupMembership) Credentials copy constructor with tenant modification.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. -
Method Summary
Modifier and TypeMethodDescriptionGroup IDs for those groups where the user is an administrator.Gets the username of the user to whom these credentials belong.Group IDs for those groups where the user is a member.Returns the UUIDs of the groups where the user is a member.Returns the credentials in the format that is expected by the backend when they are passed along with an API call.Tenant's identifierint
User's typevoid
setAdminGroups
(Set<Long> adminGroups_) Sets the Group IDs for those groups where the user is an administrator.void
setIdentity
(String username_) Sets the username of the user to whom these credentials belong.void
setMemberGroups
(Set<Long> memberGroups_) Sets the Group IDs for those groups where the user is a member.void
setMemberGroupUuids
(Set<String> memberGroupUuids) Sets the UUIDs of the groups where the user is a member.void
Sets the user's tenant identifiervoid
setUserGroupsLocalId
(Integer userGroupsLocalId_) void
setUserType
(int userType_) Sets the user's typevoid
setUserUuid
(String userUuid_) toString()
Debug representation of Credentials.
-
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
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
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
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
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
Returns the UUIDs of the groups where the user is a member. -
setMemberGroupUuids
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
Sets the username of the user to whom these credentials belong.- Parameters:
username_
-
-
getIdentity
Gets the username of the user to whom these credentials belong.- Specified by:
getIdentity
in interfacecom.appian.komodo.api.EngineCredentials
-
getTenant
Tenant's identifier- Returns:
- The current tenant identifier
-
setTenant
Sets the user's tenant identifier- Parameters:
tenant_
- tenant identifier
-
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 interfacecom.appian.komodo.api.EngineCredentials
-
getUserUuid
-
setUserUuid
-
getUserGroupsLocalId
-
setUserGroupsLocalId
-
toString
Debug representation of Credentials.
-