Interface Subscriber
- All Known Implementing Classes:
SubscriberImpl,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 Summary
Modifier and TypeMethodDescriptionvoidcallSaasRegistry(boolean ok, String message, String applicationUrl, String saasRegistryUrl) Calls the saas registry.voidcheckAuthority(SecurityChecker.Authority authority) Returns the list of microservices the program depends ongetSubscribeUrl(SubscriptionPayload subscriptionPayload) Gets the URL of the saas applicationvoidsetupDbTables(List<String> tenants) Starts hdi deployment for the specified already subscribed tenants.setupDbTablesAsync(List<String> tenants) Starts hdi deployment for the specified already subscribed tenants asynchronously.subscribe(String tenantId, SubscriptionPayload subscriptionPayload) Subscribes the specified tenant synchronously.voidunsubscribe(String tenantId, DeletePayload deletePayload) Unsubscribes the specified tenant synchronouslyupdateStatus(String jobId) Returns the status of an asynchronous upgrade operation.
-
Method Details
-
unsubscribe
void unsubscribe(String tenantId, DeletePayload deletePayload) throws InternalError, ParameterError, AuthorityError Unsubscribes the specified tenant synchronously- Parameters:
tenantId- the tenant identifierdeletePayload- Information provided by CIS about the subscribed application- Throws:
InternalError- is thrown if instance manager reports an errorAuthorityError- is thrown in case of missing authorityParameterError- is thrown if needed configuration parameters aren't set
-
getApplicationDependencies
Returns the list of microservices the program depends on- Returns:
- list of dependent microservices
- Throws:
AuthorityError
-
subscribe
String subscribe(String tenantId, SubscriptionPayload subscriptionPayload) throws InternalError, ParameterError, AuthorityError Subscribes the specified tenant synchronously.- Parameters:
tenantId- is the tenant identifiersubscriptionPayload- 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 errorAuthorityError- is thrown in case of missing authorityParameterError- 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 errorAuthorityError- is thrown in case of missing authorityParameterError- 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 errorAuthorityError- is thrown in case of missing authorityParameterError- is thrown if needed configuration parameters aren't setNotSupported
-
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 errorAuthorityError- is thrown in case of missing authorityParameterError- is thrown if needed configuration parameters aren't set
-
updateStatus
String updateStatus(String jobId) throws NotSupported, InternalError, ParameterError, NotFound, AuthorityError 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 authorityParameterError- is thrown if needed configuration parameters aren't setNotSupported- is thrown if operation is not supported by subscriber implementationNotFound- 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
- Throws:
AuthorityError- thrown if authority is missing
-