use of org.finos.waltz.model.changelog.ChangeLog in project waltz by khartec.
the class ExternalIdentifierService method logChange.
private void logChange(String userId, EntityReference ref, String message, Operation operation) {
ChangeLog logEntry = ImmutableChangeLog.builder().parentReference(ref).message(message).severity(Severity.INFORMATION).userId(userId).operation(operation).build();
changeLogService.write(logEntry);
}
use of org.finos.waltz.model.changelog.ChangeLog in project waltz by khartec.
the class CustomEnvironmentUsageService method addAsset.
public Long addAsset(CustomEnvironmentUsage usage, String username) throws InsufficientPrivelegeException {
CustomEnvironment customEnvironment = customEnvironmentService.getById(usage.customEnvironmentId());
ensureUserHasPermission(customEnvironment, username, Operation.ADD);
Long usageId = customEnvironmentUsageDao.addAsset(usage, username);
CustomEnvironmentUsageInfo usageInfo = customEnvironmentUsageDao.getUsageInfoById(usageId);
String message = format("Added asset: %s to custom environment: %s/%s", pretty(usageInfo.asset().entityReference()), customEnvironment.groupName(), customEnvironment.name());
ChangeLog changeLog = mkChangeLog(customEnvironment.owningEntity(), username, message, Operation.ADD);
changeLogService.write(changeLog);
return usageId;
}
use of org.finos.waltz.model.changelog.ChangeLog in project waltz by khartec.
the class CustomEnvironmentUsageService method remove.
public Boolean remove(Long usageId, String username) throws InsufficientPrivelegeException {
CustomEnvironmentUsageInfo usageInfo = customEnvironmentUsageDao.getUsageInfoById(usageId);
CustomEnvironment customEnvironment = customEnvironmentService.getById(usageInfo.usage().customEnvironmentId());
ensureUserHasPermission(customEnvironment, username, Operation.REMOVE);
boolean remove = customEnvironmentUsageDao.remove(usageId);
if (remove) {
String message = format("Removed asset: %s from custom environment: %s/%s", pretty(usageInfo.asset().entityReference()), customEnvironment.groupName(), customEnvironment.name());
ChangeLog changeLog = mkChangeLog(customEnvironment.owningEntity(), username, message, Operation.REMOVE);
changeLogService.write(changeLog);
}
return remove;
}
Aggregations