Class ExchangeContextOperations

java.lang.Object
co.ankatech.ankasecure.keymanagement.ExchangeContextOperations

public final class ExchangeContextOperations extends Object
The tenant's exchange contexts: the bounded settings, owned by the tenant, in which actors exchange protected data with a counterparty; every capability grant names one. Obtained from AuthenticatedKeyManagementSdk.exchangeContexts().

 ExchangeContextResponse context = sdk.exchangeContexts().create(
         new CreateExchangeContextRequest().name("supplier-invoices"));
 
  • Method Details

    • list

      Lists the tenant's exchange contexts (GET /tenants/{t}/exchange-contexts).
      Parameters:
      query - the page; must not be null
      Returns:
      one page of contexts
      Throws:
      KeyManagementSdkException - when the call is refused
    • get

      public ExchangeContextResponse get(UUID contextId)
      Reads one exchange context (GET /tenants/{t}/exchange-contexts/{c}).
      Parameters:
      contextId - the context; must not be null
      Returns:
      the context
      Throws:
      KeyManagementSdkException - when the call is refused
    • create

      Creates an exchange context owned by the tenant (POST /tenants/{t}/exchange-contexts).
      Parameters:
      request - the context; must not be null
      Returns:
      the created context
      Throws:
      KeyManagementSdkException - when the call is refused
    • update

      public ExchangeContextResponse update(UUID contextId, UpdateExchangeContextRequest request)
      Updates an exchange context (PATCH /tenants/{t}/exchange-contexts/{c}).
      Parameters:
      contextId - the context; must not be null
      request - the members to change; must not be null
      Returns:
      the updated context
      Throws:
      KeyManagementSdkException - when the call is refused
    • delete

      public void delete(UUID contextId)
      Deletes an exchange context (DELETE /tenants/{t}/exchange-contexts/{c}).
      Parameters:
      contextId - the context; must not be null
      Throws:
      KeyManagementSdkException - when the call is refused
    • suspend

      public ExchangeContextResponse suspend(UUID contextId, SuspendExchangeContextRequest request)
      Suspends an exchange context (POST /tenants/{t}/exchange-contexts/{c}/suspend).
      Parameters:
      contextId - the context; must not be null
      request - the suspension reason; must not be null
      Returns:
      the suspended context
      Throws:
      KeyManagementSdkException - when the call is refused
    • resume

      public ExchangeContextResponse resume(UUID contextId)
      Resumes a suspended exchange context (POST /tenants/{t}/exchange-contexts/{c}/resume).
      Parameters:
      contextId - the context; must not be null
      Returns:
      the resumed context
      Throws:
      KeyManagementSdkException - when the call is refused
    • close

      public ExchangeContextResponse close(UUID contextId, CloseExchangeContextRequest request)
      Closes an exchange context for good (POST /tenants/{t}/exchange-contexts/{c}/close); the close is terminal: in the same transaction it revokes every non-terminal exchange in the context and retires every live grant in it.
      Parameters:
      contextId - the context; must not be null
      request - the audited reason for the close, required; must not be null
      Returns:
      the closed context
      Throws:
      KeyManagementSdkException - when the call is refused