Class ExchangeOperations
java.lang.Object
co.ankatech.ankasecure.keymanagement.ExchangeOperations
The tenant's cryptographic exchanges: drafts, validation, activation and the lifecycle of an active
exchange. Obtained from
AuthenticatedKeyManagementSdk.exchanges(). The exchange routes carry
no tenant in their path: the Admin API takes it from the token, like every other operation here.
ExchangeDetailResponse draft = sdk.exchanges().create(new ExchangeCreateRequest().name("payroll-to-bank"));
ValidationResultResponse verdict = sdk.exchanges().validate(draft.getId());
-
Method Summary
Modifier and TypeMethodDescriptionactivate(UUID id, ActivateRequest request) Activates a validated exchange (POST /exchanges/{id}/activate).cloneExchange(UUID id, CloneRequest request) Clones an exchange into a new draft (POST /exchanges/{id}/clone).create(ExchangeCreateRequest request) Creates a draft exchange (POST /exchanges).voiddiscardDraft(UUID id, int version) Discards a draft exchange (DELETE /exchanges/{id}).Reads one exchange (GET /exchanges/{id}).list(ExchangeListQuery query) Lists exchanges (GET /exchanges).previewActivation(UUID id, String capability) Previews what an activation would grant (GET /exchanges/{id}/activation-preview).resume(UUID id, ResumeExchangeRequest request) Resumes a suspended exchange (POST /exchanges/{id}/resume).revoke(UUID id, RevokeExchangeRequest request) Revokes an exchange for good (POST /exchanges/{id}/revoke).suspend(UUID id, SuspendExchangeRequest request) Suspends an active exchange (POST /exchanges/{id}/suspend).update(UUID id, ExchangeUpdateRequest request) Updates an exchange (PATCH /exchanges/{id}).Validates a draft exchange (POST /exchanges/{id}/validate).
-
Method Details
-
list
Lists exchanges (GET /exchanges).- Parameters:
query- the filters and page; must not benull- Returns:
- one page of exchanges
- Throws:
KeyManagementSdkException- when the call is refused
-
create
Creates a draft exchange (POST /exchanges).- Parameters:
request- the exchange; must not benull- Returns:
- the created draft
- Throws:
KeyManagementSdkException- when the call is refused
-
get
Reads one exchange (GET /exchanges/{id}).- Parameters:
id- the exchange; must not benull- Returns:
- the exchange
- Throws:
KeyManagementSdkException- when the call is refused
-
update
Updates an exchange (PATCH /exchanges/{id}).- Parameters:
id- the exchange; must not benullrequest- the members to change, with the version read; must not benull- Returns:
- the updated exchange
- Throws:
KeyManagementSdkException- when the call is refused (a stale version is 409)
-
discardDraft
Discards a draft exchange (DELETE /exchanges/{id}).- Parameters:
id- the exchange; must not benullversion- the version read, so a concurrent change is refused (409)- Throws:
KeyManagementSdkException- when the call is refused
-
cloneExchange
Clones an exchange into a new draft (POST /exchanges/{id}/clone).- Parameters:
id- the exchange to clone; must not benullrequest- the clone's settings, ornullfor the defaults- Returns:
- the new draft
- Throws:
KeyManagementSdkException- when the call is refused
-
validate
Validates a draft exchange (POST /exchanges/{id}/validate).- Parameters:
id- the exchange; must not benull- Returns:
- the validation verdict and its findings
- Throws:
KeyManagementSdkException- when the call is refused
-
previewActivation
Previews what an activation would grant (GET /exchanges/{id}/activation-preview).- Parameters:
id- the exchange; must not benullcapability-ENCRYPT,DECRYPT,SIGNorVERIFYto preview one capability, ornullfor all- Returns:
- the preview
- Throws:
KeyManagementSdkException- when the call is refused
-
activate
Activates a validated exchange (POST /exchanges/{id}/activate).- Parameters:
id- the exchange; must not benullrequest- the activation; must not benull- Returns:
- the active exchange
- Throws:
KeyManagementSdkException- when the call is refused
-
suspend
Suspends an active exchange (POST /exchanges/{id}/suspend).- Parameters:
id- the exchange; must not benullrequest- the suspension; must not benull- Returns:
- the suspended exchange
- Throws:
KeyManagementSdkException- when the call is refused
-
resume
Resumes a suspended exchange (POST /exchanges/{id}/resume).- Parameters:
id- the exchange; must not benullrequest- the resumption; must not benull- Returns:
- the resumed exchange
- Throws:
KeyManagementSdkException- when the call is refused
-
revoke
Revokes an exchange for good (POST /exchanges/{id}/revoke).- Parameters:
id- the exchange; must not benullrequest- the revocation; must not benull- Returns:
- the revoked exchange
- Throws:
KeyManagementSdkException- when the call is refused
-