StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
RegistryConstants.PATH_SEPARATOR + tenantId;
ThrottlingAccessValidation accessValidation = throttlingDataContext.getAccessValidation();
try {
Registry governanceSystemRegistry = Util.getSuperTenantGovernanceSystemRegistry();
Resource tenantValidationInfoResource;
if (governanceSystemRegistry.resourceExists(tenantValidationInfoResourcePath)) {
tenantValidationInfoResource =
governanceSystemRegistry.get(tenantValidationInfoResourcePath);
} else {
tenantValidationInfoResource = governanceSystemRegistry.newResource();
}
Set<String> actions = accessValidation.getActions();
for (String action : actions) {
boolean blockAction = accessValidation.isTenantBlocked(action);
String blockActionMsg = accessValidation.getTenantBlockedMsg(action);
tenantValidationInfoResource.setProperty(MeteringAccessValidationUtils
.generateIsBlockedPropertyKey(action), blockAction ? "true" : "false");
tenantValidationInfoResource.setProperty(MeteringAccessValidationUtils
.generateErrorMsgPropertyKey(action), blockActionMsg);
}
governanceSystemRegistry.put(tenantValidationInfoResourcePath,
tenantValidationInfoResource);
} catch (RegistryException e) {
String msg =
"Error in storing the tenant validation info. tenant id: " + tenantId + ".";
log.error(msg, e);