com.sap.cloud.mt.subscription.SubscriptionPayloadAccessForSaasRegistry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multi-tenant-subscription Show documentation
Show all versions of multi-tenant-subscription Show documentation
Spring Boot Enablement Parent
/*******************************************************************************
* © 2019-2024 SAP SE or an SAP affiliate company. All rights reserved.
******************************************************************************/
package com.sap.cloud.mt.subscription;
import java.util.Map;
public class SubscriptionPayloadAccessForSaasRegistry implements SubscriptionPayloadAccess {
public static final String GLOBAL_ACCOUNT_GUID = "globalAccountGUID";
public static final String SUBACCOUNT_ID = "subscribedSubaccountId";
public static final String APP_NAME = "subscriptionAppName";
public static final String SUBSCRIBED_SUBDOMAIN = "subscribedSubdomain";
private final Map payload;
public static final String EVENT_TYPE = "eventType";
public SubscriptionPayloadAccessForSaasRegistry(Map payload) {
this.payload = payload;
}
@Override
public String getGlobalAccountId() {
return payload.containsKey(GLOBAL_ACCOUNT_GUID) ? (String) payload.get(GLOBAL_ACCOUNT_GUID) : "";
}
@Override
public String getSubAccountId() {
return payload.containsKey(SUBACCOUNT_ID) ? (String) payload.get(SUBACCOUNT_ID) : "";
}
@Override
public String getApplicationName() {
return payload.containsKey(APP_NAME) ? (String) payload.get(APP_NAME) : "";
}
@Override
public String getEventType() {
return payload.containsKey(EVENT_TYPE) ? (String) payload.get(EVENT_TYPE) : "";
}
@Override
public String getSubDomain() {
return payload.containsKey(SUBSCRIBED_SUBDOMAIN) ? (String) payload.get(SUBSCRIBED_SUBDOMAIN) : "";
}
}