use of org.summerb.properties.api.exceptions.PropertyServiceUnexpectedException in project summerb by skarpushin.
the class PropertyServiceImpl method putSubjectProperties.
@Transactional(rollbackFor = Throwable.class)
@Override
public void putSubjectProperties(String appName, String domainName, String subjectId, List<NamedProperty> namedProperties) {
if (CollectionUtils.isEmpty(namedProperties)) {
return;
}
checkArgumentsHaveText(appName, domainName, subjectId);
String currentPropertyName = null;
try {
long appId = appNameAlias.getAliasFor(appName);
long domainId = domainNameAlias.getAliasFor(domainName);
for (NamedProperty namedProperty : namedProperties) {
currentPropertyName = namedProperty.getName();
long propertyNameId = propertyNameAlias.getAliasFor(currentPropertyName);
String value = namedProperty.getPropertyValue();
propertyDao.putProperty(appId, domainId, subjectId, propertyNameId, value);
}
} catch (Throwable t) {
propagatePropertyNameIfTruncationError(t, currentPropertyName);
throw new PropertyServiceUnexpectedException("Failed to put subject properties", t);
}
}
Aggregations