com.sap.cloud.mt.runtime.TenantProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multi-tenant-runtime Show documentation
Show all versions of multi-tenant-runtime Show documentation
Spring Boot Enablement Parent
/******************************************************************************
* © 2020 SAP SE or an SAP affiliate company. All rights reserved. *
******************************************************************************/
package com.sap.cloud.mt.runtime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.function.Supplier;
public class TenantProvider implements Supplier {
private static Logger logger = LoggerFactory.getLogger(TenantProvider.class);
private final IdentityZoneDeterminer determiner;
public TenantProvider(IdentityZoneDeterminer determiner) {
this.determiner = determiner;
}
@Override
public String get() {
try {
if (TenantOverwrite.isOverwritten()) {
return TenantOverwrite.getTenantId();
}
return determiner.getIdentityZone();
} catch (InternalError e) {
logger.error("Could not determine tenant ID");
throw new RuntimeException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy