Package ca.cdr.test.app.clients
Class AdminJsonRestClient
java.lang.Object
ca.cdr.test.app.clients.AdminJsonRestClient
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Exception thrown when a forbidden operation is attempted -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic AdminJsonRestClient
static AdminJsonRestClient
buildAnonymous
(String theBaseUrl) void
cancelBatchJob
(String theModuleId, String theJobId) Cancel a batch job<T> T
convertJsonNodeToModel
(com.fasterxml.jackson.databind.JsonNode jsonNode, Class<T> modelClass) Since many methods currently return JsonNode, if you have a known model you would like to bind to, you can convert a json object to it using this method<T> com.fasterxml.jackson.databind.JsonNode
convertModelToJsonNode
(T model) createOAuthClient
(String theNodeId, String theModuleId, OAuth2WritableClientDetailsJson theClientDetails) Create an OAuth client for a specific modulecom.fasterxml.jackson.databind.JsonNode
createOidcServer
(String theNodeId, String theModuleId, com.fasterxml.jackson.databind.JsonNode theServerDetails) Create an OIDC server for a specific modulevoid
deleteOAuthClient
(String theNodeId, String theModuleId, String theClientId) Delete an OAuth clientcom.fasterxml.jackson.databind.JsonNode
getHealthChecks
(boolean theOnlyRunning) Get health checks for all modulescom.fasterxml.jackson.databind.JsonNode
getMdmDuplicateGoldenResources
(String theModuleId) Get MDM duplicate golden resourcescom.fasterxml.jackson.databind.JsonNode
getMdmLinks
(String theModuleId) Get MDM linkscom.fasterxml.jackson.databind.JsonNode
getModuleConfig
(String theNodeId, String theModuleId) Get the module configuration for a specific node and moduleGet the node configurations from the admin API.com.fasterxml.jackson.databind.JsonNode
Get node statusesgetOAuthClient
(String theNodeId, String theModuleId, String theClientId) Get an OAuth clientcom.fasterxml.jackson.databind.JsonNode
getOidcServer
(String theNodeId, String theModuleId, String theServerId) Get an OIDC serverint
getPortFromModule
(String theModuleId) Get the port number for a specific module from the node configurations.com.fasterxml.jackson.databind.JsonNode
getRestorePoint
(String theNodeId, Long theId) Get a specific restore pointcom.fasterxml.jackson.databind.JsonNode
getRestorePoints
(String theNodeId, String theVersion, String theFromDate, String theToDate, int theOffset, int theCount) Get a list of restore points for a nodegetTransactionLogEvent
(Long theEventId, boolean theIncludeBody) Get a specific transaction log event with its bodyGet transaction logscom.fasterxml.jackson.databind.JsonNode
mergeMdmGoldenResources
(String theModuleId, Object theRequest) Merge MDM golden resourcesprocessBulkImport
(String theModuleId, String theFilename, String theContent) Process a bulk ETL import filecom.fasterxml.jackson.databind.JsonNode
restartModule
(String theNodeId, String theModuleId) Request to restart a module on all processesvoid
restoreSystem
(String theNodeId, Long theRestorePointId) Restore the system to a specific restore pointcom.fasterxml.jackson.databind.JsonNode
stopModule
(String theNodeId, String theModuleId) Request to stop a module on all processes ModuleProcessesStatusChangeResponseJsonsubmitMdmOperation
(String theModuleId, IBaseParameters theParameters) Submit an MDM operation to perform batch matching on all resourcesstatic String
toJsonString
(IBaseResource theResource) com.fasterxml.jackson.databind.JsonNode
updateMdmLink
(String theModuleId, Object theRequest) Update MDM linkcom.fasterxml.jackson.databind.JsonNode
updateModuleConfig
(String theNodeId, String theModuleId, com.fasterxml.jackson.databind.JsonNode theOptions, boolean theRestart, boolean theReload) Update the configuration for a specific moduleupdateOAuthClient
(String theNodeId, String theModuleId, String theClientId, OAuth2WritableClientDetailsJson theClientDetails) Update an OAuth client for a specific modulecom.fasterxml.jackson.databind.JsonNode
updateOidcServer
(String theNodeId, String theModuleId, String theServerId, com.fasterxml.jackson.databind.JsonNode theServerDetails) Update an OIDC serveruserCreate
(String theNode, String theModuleId, UserDetailsJson userDetails) userFetchByPid
(String theNodeId, String theModuleId, Long thePid) com.fasterxml.jackson.databind.JsonNode
userFindAll
(String theNodeId, String theModuleId, int thePageSize) userFindAllAsString
(String theNodeId, String theModuleId, int thePageSize) Find all users and return the result as a String that can be used with ObjectMappercom.fasterxml.jackson.databind.JsonNode
userFindByUsername
(String theNodeId, String theModuleId, String theUsername) userFindByUsernameAsString
(String theNodeId, String theModuleId, String theUsername) Find users by username and return the result as a String that can be used with ObjectMapperuserUpdate
(UserDetailsJson theUserDetails)
-
Field Details
-
DEFAULT_FHIR_ENDPOINT_PORT
- See Also:
-
-
Method Details
-
build
-
buildAnonymous
-
userCreate
@Nonnull public UserDetailsJson userCreate(String theNode, String theModuleId, UserDetailsJson userDetails) -
userUpdate
-
userFindByUsername
@Nonnull public com.fasterxml.jackson.databind.JsonNode userFindByUsername(String theNodeId, String theModuleId, String theUsername) -
userFindByUsernameAsString
@Nonnull public String userFindByUsernameAsString(String theNodeId, String theModuleId, String theUsername) Find users by username and return the result as a String that can be used with ObjectMapper- Parameters:
theNodeId
- The node IDtheModuleId
- The module IDtheUsername
- The username to search for- Returns:
- The JSON string representation of the result
-
userFindAll
@Nonnull public com.fasterxml.jackson.databind.JsonNode userFindAll(String theNodeId, String theModuleId, int thePageSize) -
userFindAllAsString
Find all users and return the result as a String that can be used with ObjectMapper- Parameters:
theNodeId
- The node IDtheModuleId
- The module IDthePageSize
- The page size- Returns:
- The JSON string representation of the result
-
userFetchByPid
-
getModuleConfig
@Nonnull public com.fasterxml.jackson.databind.JsonNode getModuleConfig(String theNodeId, String theModuleId) Get the module configuration for a specific node and module -
updateModuleConfig
@Nonnull public com.fasterxml.jackson.databind.JsonNode updateModuleConfig(String theNodeId, String theModuleId, com.fasterxml.jackson.databind.JsonNode theOptions, boolean theRestart, boolean theReload) Update the configuration for a specific module -
stopModule
@Nonnull public com.fasterxml.jackson.databind.JsonNode stopModule(String theNodeId, String theModuleId) Request to stop a module on all processes ModuleProcessesStatusChangeResponseJson -
restartModule
@Nonnull public com.fasterxml.jackson.databind.JsonNode restartModule(String theNodeId, String theModuleId) Request to restart a module on all processes -
getRestorePoints
@Nonnull public com.fasterxml.jackson.databind.JsonNode getRestorePoints(String theNodeId, String theVersion, String theFromDate, String theToDate, int theOffset, int theCount) Get a list of restore points for a node -
getRestorePoint
@Nonnull public com.fasterxml.jackson.databind.JsonNode getRestorePoint(String theNodeId, Long theId) Get a specific restore point -
restoreSystem
Restore the system to a specific restore point -
getHealthChecks
Get health checks for all modules -
getNodeStatuses
Get node statuses -
cancelBatchJob
Cancel a batch job -
processBulkImport
Process a bulk ETL import file -
getTransactionLogs
Get transaction logs -
getTransactionLogEvent
@Nonnull public TransactionLogEventsJson.TransactionLogEventJson getTransactionLogEvent(Long theEventId, boolean theIncludeBody) Get a specific transaction log event with its body -
createOAuthClient
@Nonnull public OAuth2ClientDetailsJson createOAuthClient(String theNodeId, String theModuleId, OAuth2WritableClientDetailsJson theClientDetails) Create an OAuth client for a specific module -
updateOAuthClient
@Nonnull public OAuth2ClientDetailsJson updateOAuthClient(String theNodeId, String theModuleId, String theClientId, OAuth2WritableClientDetailsJson theClientDetails) Update an OAuth client for a specific module -
deleteOAuthClient
Delete an OAuth client -
getOAuthClient
@Nonnull public OAuth2ClientDetailsJson getOAuthClient(String theNodeId, String theModuleId, String theClientId) Get an OAuth client -
createOidcServer
@Nonnull public com.fasterxml.jackson.databind.JsonNode createOidcServer(String theNodeId, String theModuleId, com.fasterxml.jackson.databind.JsonNode theServerDetails) Create an OIDC server for a specific module -
getOidcServer
@Nonnull public com.fasterxml.jackson.databind.JsonNode getOidcServer(String theNodeId, String theModuleId, String theServerId) Get an OIDC server -
updateOidcServer
@Nonnull public com.fasterxml.jackson.databind.JsonNode updateOidcServer(String theNodeId, String theModuleId, String theServerId, com.fasterxml.jackson.databind.JsonNode theServerDetails) Update an OIDC server -
getMdmLinks
Get MDM links -
mergeMdmGoldenResources
@Nonnull public com.fasterxml.jackson.databind.JsonNode mergeMdmGoldenResources(String theModuleId, Object theRequest) Merge MDM golden resources -
updateMdmLink
@Nonnull public com.fasterxml.jackson.databind.JsonNode updateMdmLink(String theModuleId, Object theRequest) Update MDM link -
getMdmDuplicateGoldenResources
@Nonnull public com.fasterxml.jackson.databind.JsonNode getMdmDuplicateGoldenResources(String theModuleId) Get MDM duplicate golden resources -
submitMdmOperation
Submit an MDM operation to perform batch matching on all resources- Parameters:
theModuleId
- The module IDtheParameters
- The parameters for the MDM operation- Returns:
- The response as a String
-
toJsonString
-
getNodeConfigurations
Get the node configurations from the admin API.- Returns:
- The node configurations
-
getPortFromModule
Get the port number for a specific module from the node configurations.- Parameters:
theModuleId
- The ID of the module to get the port for- Returns:
- The port number, or the default FHIR port (8000) if not found
-
convertJsonNodeToModel
public <T> T convertJsonNodeToModel(com.fasterxml.jackson.databind.JsonNode jsonNode, Class<T> modelClass) throws com.fasterxml.jackson.core.JsonProcessingException Since many methods currently return JsonNode, if you have a known model you would like to bind to, you can convert a json object to it using this method- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
convertModelToJsonNode
public <T> com.fasterxml.jackson.databind.JsonNode convertModelToJsonNode(T model) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-