Class ExchangeContextOperations

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

public final class ExchangeContextOperations extends Object
The tenant's exchange contexts: the bounded settings in which an application's actors exchange protected data with a counterparty. Obtained from AuthenticatedKeyManagementSdk.exchangeContexts().

 ExchangeContextResponse context = sdk.exchangeContexts().create(applicationId,
         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
    • listForApplication

      public List<ExchangeContextResponse> listForApplication(UUID applicationId)
      Lists the exchange contexts of one application (GET /tenants/{t}/applications/{a}/exchange-contexts).
      Parameters:
      applicationId - the application; must not be null
      Returns:
      the application's contexts, as the Admin API answers them (empty when it has none)
      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

      public ExchangeContextResponse create(UUID applicationId, CreateExchangeContextRequest request)
      Creates an exchange context for an application (POST /tenants/{t}/applications/{a}/exchange-contexts).
      Parameters:
      applicationId - the application; must not be null
      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)
      Closes an exchange context for good (POST /tenants/{t}/exchange-contexts/{c}/close).
      Parameters:
      contextId - the context; must not be null
      Returns:
      the closed context
      Throws:
      KeyManagementSdkException - when the call is refused