com.sap.cds.feature.messaging.em.mt.SubdomainUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cds-feature-enterprise-messaging Show documentation
Show all versions of cds-feature-enterprise-messaging Show documentation
Enterprise Messaging feature for CDS Services Java
The newest version!
/**************************************************************************
* (C) 2019-2024 SAP SE or an SAP affiliate company. All rights reserved. *
**************************************************************************/
package com.sap.cds.feature.messaging.em.mt;
import java.util.function.Consumer;
import com.sap.cds.services.request.RequestContext;
import com.sap.cds.services.runtime.CdsRuntime;
public class SubdomainUtils {
public static final String USER_INFO_SUBDOMAIN = "subDomain";
private final CdsRuntime runtime;
public SubdomainUtils(CdsRuntime runtime) {
this.runtime = runtime;
}
public void requestContextWithSubdomain(String tenantId, String subDomain, Consumer consumer) {
// set the tenant context
runtime.requestContext().systemUser(tenantId)
.modifyUser(user -> user.setAdditionalAttribute(USER_INFO_SUBDOMAIN, subDomain)).run(consumer);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy