Class SubscriberStreamlinedMtx
java.lang.Object
com.sap.cds.feature.mt.lib.subscription.SubscriberStreamlinedMtx
- All Implemented Interfaces:
Subscriber
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
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.
-
Field Details
-
ALL_TENANTS
- See Also:
-
-
Method Details
-
subscribe
public String subscribe(String tenantId, SubscriptionPayload subscriptionPayload) throws InternalError, ParameterError, AuthorityError Description copied from interface:SubscriberSubscribes the specified tenant synchronously.- Specified by:
subscribein interfaceSubscriber- 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 errorParameterError- is thrown if needed configuration parameters aren't setAuthorityError- is thrown in case of missing authority
-
getSubscribeUrl
public String getSubscribeUrl(SubscriptionPayload subscriptionPayload) throws InternalError, ParameterError, AuthorityError Description copied from interface:SubscriberGets the URL of the saas application- Specified by:
getSubscribeUrlin interfaceSubscriber- 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 errorParameterError- is thrown if needed configuration parameters aren't setAuthorityError- is thrown in case of missing authority
-
unsubscribe
public void unsubscribe(String tenantId, DeletePayload deletePayload) throws InternalError, ParameterError, AuthorityError Description copied from interface:SubscriberUnsubscribes the specified tenant synchronously- Specified by:
unsubscribein interfaceSubscriber- Parameters:
tenantId- the tenant identifierdeletePayload- Information provided by CIS about the subscribed application- Throws:
InternalError- is thrown if instance manager reports an errorParameterError- is thrown if needed configuration parameters aren't setAuthorityError- is thrown in case of missing authority
-
getApplicationDependencies
Description copied from interface:SubscriberReturns the list of microservices the program depends on- Specified by:
getApplicationDependenciesin interfaceSubscriber- Returns:
- list of dependent microservices
- Throws:
AuthorityError
-
setupDbTables
public void setupDbTables(List<String> tenants) throws InternalError, AuthorityError, ParameterError Description copied from interface:SubscriberStarts hdi deployment for the specified already subscribed tenants.- Specified by:
setupDbTablesin interfaceSubscriber- 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 set
-
setupDbTablesAsync
public String setupDbTablesAsync(List<String> tenants) throws InternalError, AuthorityError, ParameterError Description copied from interface:SubscriberStarts hdi deployment for the specified already subscribed tenants asynchronously.- Specified by:
setupDbTablesAsyncin interfaceSubscriber- 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
public String updateStatus(String jobId) throws InternalError, ParameterError, NotFound, AuthorityError Description copied from interface:SubscriberReturns the status of an asynchronous upgrade operation. Only supported for sidecar.- Specified by:
updateStatusin interfaceSubscriber- 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.ParameterError- is thrown if needed configuration parameters aren't setNotFound- is thrown if is jobId not foundAuthorityError- is thrown in case of missing authority
-
callSaasRegistry
public void callSaasRegistry(boolean ok, String message, String applicationUrl, String saasRegistryUrl) throws InternalError Description copied from interface:SubscriberCalls the saas registry.- Specified by:
callSaasRegistryin interfaceSubscriber- 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
- Specified by:
checkAuthorityin interfaceSubscriber- Throws:
AuthorityError- thrown if authority is missing
-