Search in sources :

Example 1 with ImmutableChangeLog

use of com.khartec.waltz.model.changelog.ImmutableChangeLog in project waltz by khartec.

the class MeasurableRelationshipService method writeLog.

private void writeLog(Operation op, EntityReference a, String message, String username) {
    ImmutableChangeLog logEntry = ImmutableChangeLog.builder().severity(Severity.INFORMATION).operation(op).parentReference(a).userId(username).message(message).build();
    changeLogService.write(logEntry);
}
Also used : ImmutableChangeLog(com.khartec.waltz.model.changelog.ImmutableChangeLog)

Example 2 with ImmutableChangeLog

use of com.khartec.waltz.model.changelog.ImmutableChangeLog in project waltz by khartec.

the class InvolvementService method logChange.

private void logChange(EntityReference entityReference, String userId, EntityInvolvementChangeCommand command) {
    String message = String.format("Involvement kind (%s) %s for person: %s", resolvePrettyInvolvementKind(command.involvementKindId()), command.operation().name().toLowerCase(), resolveName(command.personEntityRef()));
    ImmutableChangeLog changeLog = ImmutableChangeLog.builder().parentReference(entityReference).message(message).userId(userId).childKind(command.personEntityRef().kind()).operation(command.operation()).build();
    changeLogService.write(changeLog);
}
Also used : ImmutableChangeLog(com.khartec.waltz.model.changelog.ImmutableChangeLog)

Example 3 with ImmutableChangeLog

use of com.khartec.waltz.model.changelog.ImmutableChangeLog in project waltz by khartec.

the class LogicalFlowService method auditFlowChange.

private void auditFlowChange(String verb, EntityReference source, EntityReference target, String username, Operation operation) {
    ImmutableChangeLog logEntry = ImmutableChangeLog.builder().parentReference(source).severity(Severity.INFORMATION).userId(username).message(String.format("Flow %s between: %s and %s", verb, source.name().orElse(Long.toString(source.id())), target.name().orElse(Long.toString(target.id())))).childKind(LOGICAL_DATA_FLOW).operation(operation).build();
    changeLogService.write(logEntry);
    changeLogService.write(logEntry.withParentReference(target));
}
Also used : ImmutableChangeLog(com.khartec.waltz.model.changelog.ImmutableChangeLog)

Example 4 with ImmutableChangeLog

use of com.khartec.waltz.model.changelog.ImmutableChangeLog in project waltz by khartec.

the class PhysicalSpecDataTypeService method audit.

private void audit(String verb, Set<Long> dataTypeIds, long specificationId, String username) {
    ImmutableChangeLog logEntry = ImmutableChangeLog.builder().parentReference(mkRef(EntityKind.PHYSICAL_SPECIFICATION, specificationId)).userId(username).severity(Severity.INFORMATION).message(String.format("%s data types: %s", verb, dataTypeIds.toString())).childKind(EntityKind.DATA_TYPE).operation(Operation.UPDATE).build();
    changeLogService.write(logEntry);
}
Also used : ImmutableChangeLog(com.khartec.waltz.model.changelog.ImmutableChangeLog)

Example 5 with ImmutableChangeLog

use of com.khartec.waltz.model.changelog.ImmutableChangeLog in project waltz by khartec.

the class LogicalFlowDecoratorService method mkChangeLogEntries.

private List<ChangeLog> mkChangeLogEntries(String verb, Collection<EntityReference> decorators, LogicalFlow flow, String username) {
    checkNotEmpty(verb, "verb cannot be empty");
    checkNotNull(decorators, "decorators cannot be null");
    checkNotNull(flow, "flow cannot be null");
    checkNotEmpty(username, "username cannot be empty");
    if (isEmpty(decorators)) {
        return Collections.emptyList();
    }
    ImmutableChangeLog sourceCL = ImmutableChangeLog.builder().parentReference(flow.source()).userId(username).severity(Severity.INFORMATION).message(String.format("%s characteristics: %s, for flow between %s and %s", verb, decorators.toString(), flow.source().name().orElse(Long.toString(flow.source().id())), flow.target().name().orElse(Long.toString(flow.target().id())))).childKind(EntityKind.LOGICAL_DATA_FLOW).operation(Operation.UPDATE).build();
    ImmutableChangeLog targetCL = sourceCL.withParentReference(flow.target());
    return ListUtilities.newArrayList(sourceCL, targetCL);
}
Also used : ImmutableChangeLog(com.khartec.waltz.model.changelog.ImmutableChangeLog)

Aggregations

ImmutableChangeLog (com.khartec.waltz.model.changelog.ImmutableChangeLog)6