IdentityService
Name | IdentityService |
Class Path |
|
Versions | 11 |
Overview
The IdentityService
provides functionalities for managing users, personas, and persona definitions in the TrustBuilder Andromeda system. It enables querying, creating, updating, and deleting users and personas, along with handling persona definitions.
This service integrates with UserClient
and utilizes JSON-based interactions.
Available Functions
User Management
findUserById(String id): String
Finds a user by their unique identifier (UUID).
Parameters:
id
(String
): The UUID of the user.
Returns:
String
: JSON representation of the user details if found.null
: If the user is not found or an invalid UUID is provided.
queryUsers(String query): String
Queries users based on specified criteria.
Parameters:
query
(String
): A JSON string containing query filters.
Returns:
String
: JSON response containing paginated user data.null
: If the query format is invalid or a validation error occurs.
createUser(String userDetails): String
Creates a new user.
Parameters:
userDetails
(String
): A JSON string containing user details.
Returns:
String
: JSON representation of the created user.null
: If validation fails or JSON parsing fails.
updateUser(String id, String userDetails, long version): String
Updates an existing user.
Parameters:
id
(String
): The UUID of the user.userDetails
(String
): A JSON string containing updated user details.version
(long
): The current version of the user.
Returns:
String
: JSON representation of the updated user.null
: If validation fails, version mismatch, or JSON parsing fails.
deleteUserById(String id, long version): boolean
Deletes a user by their unique identifier.
Parameters:
id
(String
): The UUID of the user.version
(long
): The current version of the user.
Returns:
true
: If the user was successfully deleted.false
: If the user was not found, version mismatch, or an invalid UUID is provided.
Persona Management
addPersona(String userId, String personaDetails): String
Adds a persona to an existing user.
Parameters:
userId
(String
): The UUID of the user.personaDetails
(String
): A JSON string containing persona details.
Returns:
String
: JSON representation of the added persona.null
: If validation fails or JSON parsing fails.
updatePersona(String userId, String personaId, String personaDetails, long version): String
Updates a persona of a user.
Parameters:
userId
(String
): The UUID of the user.personaId
(String
): The UUID of the persona.personaDetails
(String
): A JSON string containing updated persona details.version
(long
): The current version of the persona.
Returns:
String
: JSON representation of the updated persona.null
: If validation fails, version mismatch, or JSON parsing fails.
deletePersonaById(String userId, String personaId, long version): boolean
Deletes a persona of a user.
Parameters:
userId
(String
): The UUID of the user.personaId
(String
): The UUID of the persona.version
(long
): The current version of the persona.
Returns:
true
: If the persona was successfully deleted.false
: If the persona was not found, version mismatch, or an invalid UUID is provided.
Persona Definition Management
getUserDefinition(): String
Retrieves the user definition schema.
Returns:
String
: JSON representation of the user definition.
getPersonaDefinitions(): String
Retrieves all available persona definitions.
Returns:
String
: JSON representation of persona definitions.
getPersonaDefinition(String personaDefinitionName): String
Retrieves a specific persona definition.
Parameters:
personaDefinitionName
(String
): The name of the persona definition.
Returns:
String
: JSON representation of the persona definition.null
: If not found.
addPersonaDefinition(String personaDefinition): String
Adds a new persona definition.
Parameters:
personaDefinition
(String
): A JSON string containing the new persona definition.
Returns:
String
: JSON representation of the added persona definition.null
: If validation fails or JSON parsing fails.
updatePersonaDefinition(String personaDefinitionName, String personaDefinition, long version): String
Updates an existing persona definition.
Parameters:
personaDefinitionName
(String
): The name of the persona definition.personaDefinition
(String
): A JSON string containing the updated persona definition.version
(long
): The current version of the persona definition.
Returns:
String
: JSON representation of the updated persona definition.null
: If validation fails, version mismatch, or JSON parsing fails.
Internal Utility Methods
(For internal processing, not intended for direct use.)
toWrappedTag(long tag): String
Wraps a version tag in quotes.
writeToJsonString(Object definition): String
Converts an object to a JSON string.
Summary
The IdentityService
facilitates user and persona management in the TrustBuilder Andromeda system. It provides:
CRUD operations for users and personas.
Persona definition management.
JSON-based request and response handling.
This service is essential for managing identity-related entities within the system.