Interface Subscriber

All Known Implementing Classes:
SubscriberImpl, SubscriberSidecarImpl, SubscriberStreamlinedMtx

public interface Subscriber
Interface Subscriber provides methods to subscribe new tenants, start hdi deployments and unsubscribe tenants. It works together with the Hana instance manager, that provides a rest API to create and delete hdi containers for tenants, and the dynamic HDI deployment app, a node.js application that contains the database artifacts definitions and deploys them into an hdi container if called via its rest API.
  • Method Details

    • unsubscribe

      void unsubscribe(String tenantId, DeletePayload deletePayload, String jwt) throws InternalError, ParameterError, AuthorityError
      Unsubscribes the specified tenant synchronously
      Parameters:
      tenantId - the tenant identifier
      deletePayload - Information provided by CIS about the subscribed application
      jwt - OAuth2 authorization token
      Throws:
      InternalError - is thrown if instance manager reports an error
      AuthorityError - is thrown in case of missing authority
      ParameterError - is thrown if needed configuration parameters aren't set
    • getApplicationDependencies

      List<ApplicationDependency> getApplicationDependencies() throws AuthorityError
      Returns the list of microservices the program depends on
      Returns:
      list of dependent microservices
      Throws:
      AuthorityError
    • subscribe

      String subscribe(String tenantId, SubscriptionPayload subscriptionPayload, String jwt) throws InternalError, ParameterError, AuthorityError
      Subscribes the specified tenant synchronously.
      Parameters:
      tenantId - is the tenant identifier
      subscriptionPayload - is provided by CIS and describes the subscribing application
      jwt - OAuth2 authorization token
      Returns:
      The URL of the application UI
      Throws:
      InternalError - is thrown if instance manager or hdi deployment app report an error
      AuthorityError - is thrown in case of missing authority
      ParameterError - is thrown if needed configuration parameters aren't set
    • getSubscribeUrl

      String getSubscribeUrl(SubscriptionPayload subscriptionPayload) throws InternalError, ParameterError, AuthorityError
      Gets the URL of the saas application
      Parameters:
      subscriptionPayload - is provided by CIS and describes the subscribing application
      Returns:
      The URL of the application UI
      Throws:
      InternalError - is thrown if instance manager or hdi deployment app report an error
      AuthorityError - is thrown in case of missing authority
      ParameterError - is thrown if needed configuration parameters aren't set
    • setupDbTables

      void setupDbTables(List<String> tenants) throws InternalError, NotSupported, ParameterError, AuthorityError
      Starts hdi deployment for the specified already subscribed tenants.
      Parameters:
      tenants - is the list of tenant identifiers, if it contains only one entry "all" all tenants are updated
      Throws:
      InternalError - is thrown if the hdi deployment app reports an error
      AuthorityError - is thrown in case of missing authority
      ParameterError - is thrown if needed configuration parameters aren't set
      NotSupported
    • setupDbTablesAsync

      String setupDbTablesAsync(List<String> tenants) throws InternalError, ParameterError, AuthorityError
      Starts hdi deployment for the specified already subscribed tenants asynchronously.
      Parameters:
      tenants - is the list of tenant identifiers, if it contains only one entry "all" all tenants are updated
      Returns:
      JobId if sidecar is used, otherwise empty
      Throws:
      InternalError - is thrown if the hdi deployment app or sidecar reports an error
      AuthorityError - is thrown in case of missing authority
      ParameterError - is thrown if needed configuration parameters aren't set
    • updateStatus

      Returns the status of an asynchronous upgrade operation. Only supported for sidecar.
      Parameters:
      jobId - returned from sidecar
      Returns:
      Returns a sidecar json :{ "error": null, "status": "RUNNING", "result": null }
      Throws:
      InternalError - is thrown if sidecar cannot be accessed.
      AuthorityError - is thrown in case of missing authority
      ParameterError - is thrown if needed configuration parameters aren't set
      NotSupported - is thrown if operation is not supported by subscriber implementation
      NotFound - is thrown if is jobId not found
    • callSaasRegistry

      void callSaasRegistry(boolean ok, String message, String applicationUrl, String saasRegistryUrl) throws InternalError
      Calls the saas registry.
      Parameters:
      ok - Operation worked.
      message - Message returned to customers.
      applicationUrl - Must be filled in case of subscription. The URL under which the UI of the subscribed application can be reached.
      saasRegistryUrl - The callback URL provided by CIS.
      Throws:
      InternalError - Thrown in case the saas registry couldn't be called.
    • checkAuthority

      void checkAuthority(SecurityChecker.Authority authority) throws AuthorityError
      Throws:
      AuthorityError - thrown if authority is missing