Skip to content

Commit da9906a

Browse files
authored
Update CDS Services to 1.32.0 (#210)
1 parent 4d58810 commit da9906a

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

mta-multi-tenant.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ resources:
112112
appUrls:
113113
getDependencies: ~{srv/url}/mt/v1.0/subscriptions/dependencies
114114
onSubscription: ~{srv/url}/mt/v1.0/subscriptions/tenants/{tenantId}
115+
onSubscriptionAsync: true
116+
onUnSubscriptionAsync: true
117+
onUpdateDependenciesAsync: true
118+
callbackTimeoutMillis: 3600000
115119
requires:
116120
- name: srv
117121
- name: cf-logging

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
<!-- DEPENDENCIES VERSION -->
1818
<jdk.version>17</jdk.version>
19-
<cds.services.version>1.31.1</cds.services.version>
19+
<cds.services.version>1.32.0</cds.services.version>
2020
<spring.boot.version>2.7.8</spring.boot.version>
21-
<cloud.sdk.version>4.5.0</cloud.sdk.version>
21+
<cloud.sdk.version>4.8.0</cloud.sdk.version>
2222
<xsuaa.version>2.13.5</xsuaa.version>
2323
<cf-java-logging-support.version>3.6.3</cf-java-logging-support.version>
2424
<cds.install-cdsdk.version>6.5.2</cds.install-cdsdk.version>

srv/src/main/java/my/bookshop/handlers/SubscriptionHandler.java

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,24 @@
77
import com.sap.cds.services.auditlog.AuditLogService;
88
import com.sap.cds.services.handler.EventHandler;
99
import com.sap.cds.services.handler.annotations.After;
10-
import com.sap.cds.services.handler.annotations.Before;
1110
import com.sap.cds.services.handler.annotations.ServiceName;
12-
import com.sap.cds.services.mt.MtSubscribeEventContext;
13-
import com.sap.cds.services.mt.MtSubscriptionService;
14-
import com.sap.cds.services.mt.MtUnsubscribeEventContext;
11+
import com.sap.cds.services.mt.DeploymentService;
12+
import com.sap.cds.services.mt.SubscribeEventContext;
1513

1614
/**
1715
* Handler that implements subscription logic
1816
*/
1917
@Component
2018
@Profile("cloud")
21-
@ServiceName(MtSubscriptionService.DEFAULT_NAME)
19+
@ServiceName(DeploymentService.DEFAULT_NAME)
2220
class SubscriptionHandler implements EventHandler {
2321

2422
@Autowired
2523
private AuditLogService auditLog;
2624

27-
@Before(event = MtSubscriptionService.EVENT_UNSUBSCRIBE)
28-
public void beforeUnsubscribe(MtUnsubscribeEventContext context) {
29-
// always delete the subscription
30-
context.setDelete(true);
31-
}
32-
33-
@After(event = MtSubscriptionService.EVENT_SUBSCRIBE)
34-
public void afterSubscribe(MtSubscribeEventContext context) {
35-
String msg = String.format("New tenant '%s' subscribed.", context.getTenantId());
25+
@After
26+
public void afterSubscribe(SubscribeEventContext context) {
27+
String msg = String.format("New tenant '%s' subscribed.", context.getTenant());
3628

3729
// send audit log security message to provider tenant as user's tenant is null
3830
auditLog.logSecurityEvent("tenant subscribed", msg);

srv/src/main/resources/application.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ spring:
88
enabled: true
99
cds:
1010
odata-v4.endpoint.path: "/api"
11-
multi-tenancy.mtxs.enabled: true
11+
multi-tenancy:
12+
compatibility.enabled: false
13+
mtxs.enabled: true
1214
security:
1315
authentication.normalize-provider-tenant: true
1416
mock.users:

0 commit comments

Comments
 (0)