|
7 | 7 | import com.sap.cds.services.auditlog.AuditLogService; |
8 | 8 | import com.sap.cds.services.handler.EventHandler; |
9 | 9 | import com.sap.cds.services.handler.annotations.After; |
10 | | -import com.sap.cds.services.handler.annotations.Before; |
11 | 10 | 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; |
15 | 13 |
|
16 | 14 | /** |
17 | 15 | * Handler that implements subscription logic |
18 | 16 | */ |
19 | 17 | @Component |
20 | 18 | @Profile("cloud") |
21 | | -@ServiceName(MtSubscriptionService.DEFAULT_NAME) |
| 19 | +@ServiceName(DeploymentService.DEFAULT_NAME) |
22 | 20 | class SubscriptionHandler implements EventHandler { |
23 | 21 |
|
24 | 22 | @Autowired |
25 | 23 | private AuditLogService auditLog; |
26 | 24 |
|
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()); |
36 | 28 |
|
37 | 29 | // send audit log security message to provider tenant as user's tenant is null |
38 | 30 | auditLog.logSecurityEvent("tenant subscribed", msg); |
|
0 commit comments