@ApplicationScoped @Path(value="/absSync/users") public class KernelUserRestServices extends Object
Constructor and Description |
---|
KernelUserRestServices() |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
addOrOverwriteUser(String tenantId,
String userId,
UserData userData)
Adds or replaces a user.
|
javax.ws.rs.core.Response |
addOrOverwriteUserAffiliations(String tenantId,
String userId,
UserAffiliations userAffiliations)
Adds or replaces user affiliations.
|
javax.ws.rs.core.Response |
addOrOverwriteUserAttributes(String tenantId,
String userId,
String attributeType,
Map<String,String> attributes)
Adds or replaces user attributes.
|
javax.ws.rs.core.Response |
addRemoveOrUpdateUserAffiliations(String tenantId,
String userId,
UserAffiliations userAffiliations,
String operation)
Adds, Removes or Updates user affiliations.
|
javax.ws.rs.core.Response |
addRemoveOrUpdateUserAttributes(String tenantId,
String userId,
String attributeType,
Map<String,String> attributes,
String operation)
Adds, Removes or Updates user attributes.
|
javax.ws.rs.core.Response |
deleteUser(String tenantId,
String userId)
Deletes a user.
|
javax.ws.rs.core.Response |
deleteUserAffiliations(String tenantId,
String userId)
Deletes a user affiliations.
|
javax.ws.rs.core.Response |
deleteUserAttributes(String tenantId,
String userId,
String attributeType)
Deletes a user attributes.
|
javax.ws.rs.core.Response |
getUser(String tenantId,
String userId)
Gets a user from Address Book Server.
|
javax.ws.rs.core.Response |
getUserAffiliations(String tenantId,
String userId)
Gets a list of user affiliations.
|
javax.ws.rs.core.Response |
getUserAttributes(String tenantId,
String userId,
String attributeType)
Gets a list of user attributes.
|
javax.ws.rs.core.Response |
getUserLists(String tenantId,
String userId)
Get all lists of the user referenced by userId and tenantId.
|
@PUT @Produces(value="application/json") @Path(value="{tenantId}/{userId}") public javax.ws.rs.core.Response addOrOverwriteUser(@PathParam(value="tenantId") String tenantId, @PathParam(value="userId") String userId, UserData userData)
tenantId
- The id of tenantuserId
- The id of useruserData
- The UserData
object contains data related to userResponse
object with HTTP Status Code CREATED
, if user is added or overwritten successfully.javax.ws.rs.WebApplicationException
- If user is not added successfully. It contains Response
object with following HTTP Response.Status
codes and response body.
Response.Status.BAD_REQUEST
, if invalid user input. The Response
body contains error code - details as follows
INVALID_DATA
- Invalid tenantId
INVALID_DATA
- Invalid userId
INVALID_DATA
- User data missing.
INVALID_DATA
- userType missing in User Data.
Response.Status.SERVICE_UNAVAILABLE
, if services not available due to heavy load. The Response
body contains error code - details as follows
SERVICE_UNAVAILABLE
- The server is currently unable to handle the request due to a temporary overloading, please try again later.
Response.Status.INTERNAL_SERVER_ERROR
, if internal server error on synchronizing data or Operation timeout. The Response
body contains error code - details as follows
REQUEST_TIMEOUT
- Operation timeout, but it might processed successfully at server.
GENERAL_ERROR
- Address Book Synchronization is disabled. Enable it by providing AddressBook Server Configuration in Administration -> Advanced Settings tab."
GENERAL_ERROR
- Internal Server Error. Please try again after some time.
@GET @Produces(value="application/json") @Path(value="{tenantId}/{userId}") public javax.ws.rs.core.Response getUser(@PathParam(value="tenantId") String tenantId, @PathParam(value="userId") String userId)
tenantId
- The id of tenantuserId
- The id of userResponse
object with a JSON Body containing the user's staticAttributes, if user is fetched successfully.javax.ws.rs.WebApplicationException
- If user couldn't be fetched successfully. It contains Response
object with following HTTP Response.Status
codes and response body.
Response.Status.BAD_REQUEST
, if invalid user input. The Response
body contains error code - details as follows
INVALID_DATA
- Invalid tenantId
INVALID_DATA
- Invalid userId
Response.Status.SERVICE_UNAVAILABLE
, if services not available due to heavy load. The Response
body contains error code - details as follows
SERVICE_UNAVAILABLE
- The server is currently unable to handle the request due to a temporary overloading, please try again later.
Response.Status.INTERNAL_SERVER_ERROR
, if internal server error on synchronizing data or Operation timeout. The Response
body contains error code - details as follows
REQUEST_TIMEOUT
- Operation timeout, but it might processed successfully at server.
GENERAL_ERROR
- Address Book Synchronization is disabled. Enable it by providing AddressBook Server Configuration in Administration -> Advanced Settings tab."
GENERAL_ERROR
- Internal Server Error. Please try again after some time.
@DELETE @Produces(value="application/json") @Path(value="{tenantId}/{userId}") public javax.ws.rs.core.Response deleteUser(@PathParam(value="tenantId") String tenantId, @PathParam(value="userId") String userId)
tenantId
- The id of tenantuserId
- The id of userResponse
object with HTTP Status Code OK
, if user is deleted successfully.javax.ws.rs.WebApplicationException
- if user is not deleted successfully. It contains Response
object with following HTTP Response.Status
codes and response body.
Response.Status.BAD_REQUEST
, if invalid user input. The Response
body contains error code - details as follows
INVALID_DATA
- Invalid tenantId
INVALID_DATA
- Invalid userId
NOT_FOUND
, if requested user not found. The Response
body contains error code - details as follows
NOT_FOUND
- User [$userId] does not exist.
Response.Status.SERVICE_UNAVAILABLE
, if services not available due to heavy load. The Response
body contains error code - details as follows
SERVICE_UNAVAILABLE
- The server is currently unable to handle the request due to a temporary overloading, please try again later.
Response.Status.INTERNAL_SERVER_ERROR
, if internal server error on synchronizing data or Operation timeout. The Response
body contains error code - details as follows
REQUEST_TIMEOUT
- Operation timeout, but it might processed successfully at server.
GENERAL_ERROR
- Address Book Synchronization is disabled. Enable it by providing AddressBook Server Configuration in Administration -> Advanced Settings tab."
GENERAL_ERROR
- Internal Server Error. Please try again after some time.
@PUT @Consumes(value="application/json") @Produces(value="application/json") @Path(value="{tenantId}/{userId}/attributes") public javax.ws.rs.core.Response addOrOverwriteUserAttributes(@PathParam(value="tenantId") String tenantId, @PathParam(value="userId") String userId, @QueryParam(value="attributeType") String attributeType, Map<String,String> attributes)
tenantId
- The id of tenantuserId
- The id of userattributeType
- The type of attribute like 'static'attributes
- The Map
object contains user attributes like "firstName" as a key and "Bob" as a valueResponse
object with HTTP Status Code CREATED
, if user attributes are added or overwritten successfully.javax.ws.rs.WebApplicationException
- if user attributes are not added successfully. It contains Response
object with following HTTP Response.Status
codes and response body.
Response.Status.BAD_REQUEST
, if invalid user input. The Response
body contains error code - details as follows
INVALID_DATA
- Invalid tenantId
INVALID_DATA
- Invalid userId
INVALID_DATA
- Invalid attributeType
INVALID_DATA
- Unknown attributeType
INVALID_DATA
- Attributes data missing.
NOT_FOUND
, if requested user not found. The Response
body contains error code - details as follows
NOT_FOUND
- User [$userId] does not exist.
Response.Status.SERVICE_UNAVAILABLE
, if services not available due to heavy load. The Response
body contains error code - details as follows
SERVICE_UNAVAILABLE
- The server is currently unable to handle the request due to a temporary overloading, please try again later.
Response.Status.INTERNAL_SERVER_ERROR
, if internal server error on synchronizing data or Operation timeout. The Response
body contains error code - details as follows
REQUEST_TIMEOUT
- Operation timeout, but it might processed successfully at server.
GENERAL_ERROR
- Address Book Synchronization is disabled. Enable it by providing AddressBook Server Configuration in Administration -> Advanced Settings tab."
GENERAL_ERROR
- Internal Server Error. Please try again after some time.
@POST @Consumes(value="application/json") @Produces(value="application/json") @Path(value="{tenantId}/{userId}/attributes") public javax.ws.rs.core.Response addRemoveOrUpdateUserAttributes(@PathParam(value="tenantId") String tenantId, @PathParam(value="userId") String userId, @QueryParam(value="attributeType") String attributeType, Map<String,String> attributes, @QueryParam(value="op") String operation)
tenantId
- The id of tenantuserId
- The id of userattributeType
- The type of attribute like 'static'attributes
- The Map
object contains user attributes like "firstName" as a key and "Bob" as a valueop
- The operation like 'add' or 'remove'Response
object with HTTP Status Code CREATED
, if user attributes are added, updated or removed successfully.javax.ws.rs.WebApplicationException
- if user attributes are not added successfully. It contains Response
object with following HTTP Response.Status
codes and response body.
Response.Status.BAD_REQUEST
, if invalid user input. The Response
body contains error code - details as follows
INVALID_DATA
- Invalid tenantId
INVALID_DATA
- Invalid userId
INVALID_DATA
- Invalid attributeType
INVALID_DATA
- Unknown attributeType
INVALID_DATA
- Invalid op/operation parameter
INVALID_DATA
- Unknown op/operation parameter
INVALID_DATA
- Attributes data missing.
NOT_FOUND
, if requested user not found. The Response
body contains error code - details as follows
NOT_FOUND
- User [$userId] does not exist.
Response.Status.SERVICE_UNAVAILABLE
, if services not available due to heavy load. The Response
body contains error code - details as follows
SERVICE_UNAVAILABLE
- The server is currently unable to handle the request due to a temporary overloading, please try again later.
Response.Status.INTERNAL_SERVER_ERROR
, if internal server error on synchronizing data or Operation timeout. The Response
body contains error code - details as follows
REQUEST_TIMEOUT
- Operation timeout, but it might processed successfully at server.
GENERAL_ERROR
- Address Book Synchronization is disabled. Enable it by providing AddressBook Server Configuration in Administration -> Advanced Settings tab."
GENERAL_ERROR
- Internal Server Error. Please try again after some time.
@DELETE @Produces(value="application/json") @Path(value="{tenantId}/{userId}/attributes") public javax.ws.rs.core.Response deleteUserAttributes(@PathParam(value="tenantId") String tenantId, @PathParam(value="userId") String userId, @QueryParam(value="attributeType") String attributeType)
tenantId
- The id of tenantuserId
- The id of userattributeType
- The type of attribute like 'static'Response
object with HTTP Status Code OK
, if user attributes are deleted successfully.javax.ws.rs.WebApplicationException
- if user attributes are not deleted successfully. It contains Response
object with following HTTP Response.Status
codes and response body.
Response.Status.BAD_REQUEST
, if invalid user input. The Response
body contains error code - details as follows
INVALID_DATA
- Invalid tenantId
INVALID_DATA
- Invalid userId
INVALID_DATA
- Invalid attributeType
INVALID_DATA
- Unknown attributeType
NOT_FOUND
, if requested user not found. The Response
body contains error code - details as follows
NOT_FOUND
- User [$userId] does not exist.
Response.Status.SERVICE_UNAVAILABLE
, if services not available due to heavy load. The Response
body contains error code - details as follows
SERVICE_UNAVAILABLE
- The server is currently unable to handle the request due to a temporary overloading, please try again later.
Response.Status.INTERNAL_SERVER_ERROR
, if internal server error on synchronizing data or Operation timeout. The Response
body contains error code - details as follows
REQUEST_TIMEOUT
- Operation timeout, but it might processed successfully at server.
GENERAL_ERROR
- Address Book Synchronization is disabled. Enable it by providing AddressBook Server Configuration in Administration -> Advanced Settings tab."
GENERAL_ERROR
- Internal Server Error. Please try again after some time.
@GET @Consumes(value="application/json") @Produces(value="application/json") @Path(value="{tenantId}/{userId}/attributes") public javax.ws.rs.core.Response getUserAttributes(@PathParam(value="tenantId") String tenantId, @PathParam(value="userId") String userId, @QueryParam(value="attributeType") String attributeType)
tenantId
- The id of tenantuserId
- The id of userattributeType
- The type of the attributeResponse
object with a JSON Body containing a list of user attributes, if user attributes are fetched successfully.javax.ws.rs.WebApplicationException
- If user attributes couldn't be fetched successfully. It contains Response
object with following HTTP Response.Status
codes and response body.
Response.Status.BAD_REQUEST
, if invalid user input. The Response
body contains error code - details as follows
INVALID_DATA
- Invalid tenantId
INVALID_DATA
- Invalid userId
INVALID_DATA
- Invalid attributeType
INVALID_DATA
- Unknown attributeType
Response.Status.SERVICE_UNAVAILABLE
, if services not available due to heavy load. The Response
body contains error code - details as follows
SERVICE_UNAVAILABLE
- The server is currently unable to handle the request due to a temporary overloading, please try again later.
Response.Status.INTERNAL_SERVER_ERROR
, if internal server error on synchronizing data or Operation timeout. The Response
body contains error code - details as follows
REQUEST_TIMEOUT
- Operation timeout, but it might processed successfully at server.
GENERAL_ERROR
- Address Book Synchronization is disabled. Enable it by providing AddressBook Server Configuration in Administration -> Advanced Settings tab."
GENERAL_ERROR
- Internal Server Error. Please try again after some time.
@PUT @Consumes(value="application/json") @Produces(value="application/json") @Path(value="{tenantId}/{userId}/affiliations") public javax.ws.rs.core.Response addOrOverwriteUserAffiliations(@PathParam(value="tenantId") String tenantId, @PathParam(value="userId") String userId, UserAffiliations userAffiliations)
tenantId
- The id of tenantuserId
- The id of useruserAffiliations
- The UserAffiliations
object contains user relation to listsResponse
object with HTTP Status code CREATED
, if user affiliations are added or overwritten successfully.javax.ws.rs.WebApplicationException
- if user affiliations are not added successfully. It contains Response
object with following HTTP Response.Status
codes and response body.
Response.Status.BAD_REQUEST
, if invalid user input. The Response
body contains error code - details as follows
INVALID_DATA
- Invalid tenantId
INVALID_DATA
- Invalid userId
INVALID_DATA
- Affiliation data missing.
NOT_FOUND
, if requested user not found. The Response
body contains error code - details as follows
NOT_FOUND
- User [$userId] does not exist.
Response.Status.SERVICE_UNAVAILABLE
, if services not available due to heavy load. The Response
body contains error code - details as follows
SERVICE_UNAVAILABLE
- The server is currently unable to handle the request due to a temporary overloading, please try again later.
Response.Status.INTERNAL_SERVER_ERROR
, if internal server error on synchronizing data or Operation timeout. The Response
body contains error code - details as follows
REQUEST_TIMEOUT
- Operation timeout, but it might processed successfully at server.
GENERAL_ERROR
- Address Book Synchronization is disabled. Enable it by providing AddressBook Server Configuration in Administration -> Advanced Settings tab."
GENERAL_ERROR
- Internal Server Error. Please try again after some time.
@POST @Consumes(value="application/json") @Produces(value="application/json") @Path(value="{tenantId}/{userId}/affiliations") public javax.ws.rs.core.Response addRemoveOrUpdateUserAffiliations(@PathParam(value="tenantId") String tenantId, @PathParam(value="userId") String userId, UserAffiliations userAffiliations, @QueryParam(value="op") String operation)
tenantId
- The id of tenantuserId
- The id of useruserAffiliations
- The UserAffiliations
object contains user relation to listsop
- The operation like 'add' or 'remove'Response
object with HTTP Status code CREATED
, if user affiliations are added, updated or removed successfully.javax.ws.rs.WebApplicationException
- if user affiliations are not added successfully. It contains Response
object with following HTTP Response.Status
codes and response body.
Response.Status.BAD_REQUEST
, if invalid user input. The Response
body contains error code - details as follows
INVALID_DATA
- Invalid tenantId
INVALID_DATA
- Invalid userId
INVALID_DATA
- Invalid op/operation parameter
INVALID_DATA
- Unknown op/operation parameter
INVALID_DATA
- Affiliation data missing.
NOT_FOUND
, if requested user not found. The Response
body contains error code - details as follows
NOT_FOUND
- User [$userId] does not exist.
Response.Status.SERVICE_UNAVAILABLE
, if services not available due to heavy load. The Response
body contains error code - details as follows
SERVICE_UNAVAILABLE
- The server is currently unable to handle the request due to a temporary overloading, please try again later.
Response.Status.INTERNAL_SERVER_ERROR
, if internal server error on synchronizing data or Operation timeout. The Response
body contains error code - details as follows
REQUEST_TIMEOUT
- Operation timeout, but it might processed successfully at server.
GENERAL_ERROR
- Address Book Synchronization is disabled. Enable it by providing AddressBook Server Configuration in Administration -> Advanced Settings tab."
GENERAL_ERROR
- Internal Server Error. Please try again after some time.
@GET @Produces(value="application/json") @Path(value="{tenantId}/{userId}/affiliations") public javax.ws.rs.core.Response getUserAffiliations(@PathParam(value="tenantId") String tenantId, @PathParam(value="userId") String userId)
tenantId
- The id of tenantuserId
- The id of userResponse
object with HTTP Status code OK
, if user affiliations got successfully.javax.ws.rs.WebApplicationException
- if user affiliations got unsuccessfully. It contains Response
object with following HTTP Response.Status
codes and response body.
Response.Status.BAD_REQUEST
, if invalid user input. The Response
body contains error code - details as follows
INVALID_DATA
- Invalid tenantId
INVALID_DATA
- Invalid userId
NOT_FOUND
, if requested user not found. The Response
body contains error code - details as follows
NOT_FOUND
- User [$userId] does not exist.
Response.Status.SERVICE_UNAVAILABLE
, if services not available due to heavy load. The Response
body contains error code - details as follows
SERVICE_UNAVAILABLE
- The server is currently unable to handle the request due to a temporary overloading, please try again later.
Response.Status.INTERNAL_SERVER_ERROR
, if internal server error on synchronizing data or Operation timeout. The Response
body contains error code - details as follows
REQUEST_TIMEOUT
- Operation timeout, but it might processed successfully at server.
GENERAL_ERROR
- Address Book Synchronization is disabled. Enable it by providing AddressBook Server Configuration in Administration -> Advanced Settings tab."
GENERAL_ERROR
- Internal Server Error. Please try again after some time.
@GET @Produces(value="application/json") @Path(value="{tenantId}/{userId}/lists") public javax.ws.rs.core.Response getUserLists(@PathParam(value="tenantId") String tenantId, @PathParam(value="userId") String userId)
tenantId
- The id of tenantuserId
- The id of userResponse
object with HTTP Status code OK
, if lists got successfully successfully.javax.ws.rs.WebApplicationException
- if lists got unsuccessfully. It contains Response
object with following HTTP Response.Status
codes and response body.
Response.Status.BAD_REQUEST
, if invalid user input. The Response
body contains error code - details as follows
INVALID_DATA
- Invalid tenantId
INVALID_DATA
- Invalid userId
NOT_FOUND
, if requested user not found. The Response
body contains error code - details as follows
NOT_FOUND
- User [$userId] does not exist.
Response.Status.SERVICE_UNAVAILABLE
, if services not available due to heavy load. The Response
body contains error code - details as follows
SERVICE_UNAVAILABLE
- The server is currently unable to handle the request due to a temporary overloading, please try again later.
Response.Status.INTERNAL_SERVER_ERROR
, if internal server error on synchronizing data or Operation timeout. The Response
body contains error code - details as follows
REQUEST_TIMEOUT
- Operation timeout, but it might processed successfully at server.
GENERAL_ERROR
- Address Book Synchronization is disabled. Enable it by providing AddressBook Server Configuration in Administration -> Advanced Settings tab."
GENERAL_ERROR
- Internal Server Error. Please try again after some time.
@DELETE @Produces(value="application/json") @Path(value="{tenantId}/{userId}/affiliations") public javax.ws.rs.core.Response deleteUserAffiliations(@PathParam(value="tenantId") String tenantId, @PathParam(value="userId") String userId)
tenantId
- The id of tenantuserId
- The id of userResponse
object with HTTP Status Code OK
, if user affiliations are deleted successfully.javax.ws.rs.WebApplicationException
- if user affiliations are not deleted successfully. It contains Response
object with following HTTP Response.Status
codes and response body.
Response.Status.BAD_REQUEST
, if invalid user input. The Response
body contains error code - details as follows
INVALID_DATA
- Invalid tenantId
INVALID_DATA
- Invalid userId
NOT_FOUND
, if requested user not found. The Response
body contains error code - details as follows
NOT_FOUND
- User [$userId] does not exist.
Response.Status.SERVICE_UNAVAILABLE
, if services not available due to heavy load. The Response
body contains error code - details as follows
SERVICE_UNAVAILABLE
- The server is currently unable to handle the request due to a temporary overloading, please try again later.
Response.Status.INTERNAL_SERVER_ERROR
, if internal server error on synchronizing data or Operation timeout. The Response
body contains error code - details as follows
REQUEST_TIMEOUT
- Operation timeout, but it might processed successfully at server.
GENERAL_ERROR
- Address Book Synchronization is disabled. Enable it by providing AddressBook Server Configuration in Administration -> Advanced Settings tab."
GENERAL_ERROR
- Internal Server Error. Please try again after some time.
Copyright © 2022 KOBIL Systems GmbH. All rights reserved.