TSK-53 Comments from Holger

This commit is contained in:
BerndBreier 2017-12-04 09:46:58 +01:00
parent 7fb36ac156
commit 3db95975a1
4 changed files with 23 additions and 23 deletions

View File

@ -83,7 +83,7 @@ public class ClassificationServiceImpl implements ClassificationService {
this.setDefaultValues(classification);
classificationMapper.insert(classification);
LOGGER.info("Method addClassification added classification {}.", classification);
LOGGER.debug("Method addClassification added classification {}.", classification);
} finally {
taskanaEngineImpl.returnConnection();
LOGGER.debug("exit from addClassification()");
@ -100,25 +100,25 @@ public class ClassificationServiceImpl implements ClassificationService {
Classification oldClassification = null;
try {
oldClassification = this.getClassification(classification.getId(), classification.getDomain());
LOGGER.info("Method updateClassification() inserted classification {}.", classification);
LOGGER.debug("Method updateClassification() inserted classification {}.", classification);
// ! If you update an classification twice the same day,
// the older version is valid from today until yesterday.
if (!oldClassification.getDomain().equals(classification.getDomain())) {
classification.setCreated(Date.valueOf(LocalDate.now()));
classificationMapper.insert(classification);
LOGGER.info("Method updateClassification() inserted classification {}.", classification);
LOGGER.debug("Method updateClassification() inserted classification {}.", classification);
} else {
oldClassification.setValidUntil(Date.valueOf(LocalDate.now().minusDays(1)));
classificationMapper.update(oldClassification);
classificationMapper.insert(classification);
LOGGER.info("Method updateClassification() updated old classification {} and inserted new {}.", oldClassification, classification);
LOGGER.debug("Method updateClassification() updated old classification {} and inserted new {}.", oldClassification, classification);
}
} catch (ClassificationNotFoundException e) {
classification.setId(IdGenerator.generateWithPrefix(ID_PREFIX_CLASSIFICATION));
classification.setCreated(Date.valueOf(LocalDate.now()));
classificationMapper.insert(classification);
LOGGER.info("Method updateClassification() inserted classification {}.", classification);
LOGGER.debug("Method updateClassification() inserted classification {}.", classification);
}
} finally {
taskanaEngineImpl.returnConnection();

View File

@ -35,8 +35,8 @@ public class SummaryServiceImpl implements SummaryService {
taskanaEngineImpl.openConnection();
taskSummaries = summaryMapper.findTasksummariesByWorkbasketId(workbasketId);
} catch (Exception ex) {
LOGGER.warn("Getting TASKSUMMARY failed internally.", ex);
} finally {
LOGGER.error("Getting TASKSUMMARY failed internally.", ex);
} finally {
if (taskSummaries == null) {
taskSummaries = new ArrayList<>();
}

View File

@ -71,7 +71,7 @@ public class TaskServiceImpl implements TaskService {
task.setClaimed(now);
task.setState(TaskState.CLAIMED);
taskMapper.update(task);
LOGGER.info("Method claim() claimed task '{}' for user '{}'.", id, userName);
LOGGER.debug("Method claim() claimed task '{}' for user '{}'.", id, userName);
} else {
LOGGER.warn("Method claim() didn't find task with id {}. Throwing TaskNotFoundException", id);
throw new TaskNotFoundException(id);
@ -96,7 +96,7 @@ public class TaskServiceImpl implements TaskService {
task.setModified(now);
task.setState(TaskState.COMPLETED);
taskMapper.update(task);
LOGGER.info("Method complete() completed Task '{}'.", id);
LOGGER.debug("Method complete() completed Task '{}'.", id);
} else {
LOGGER.warn("Method complete() didn't find task with id {}. Throwing TaskNotFoundException", id);
throw new TaskNotFoundException(id);
@ -119,7 +119,7 @@ public class TaskServiceImpl implements TaskService {
this.taskMapper.insert(task);
LOGGER.info("Method create() created Task '{}'.", task.getId());
LOGGER.debug("Method create() created Task '{}'.", task.getId());
return task;
} finally {
taskanaEngineImpl.returnConnection();
@ -161,7 +161,7 @@ public class TaskServiceImpl implements TaskService {
this.taskMapper.insert(task);
LOGGER.info("Method create() created Task '{}'.", task.getId());
LOGGER.debug("Method create() created Task '{}'.", task.getId());
return task;
} finally {
taskanaEngineImpl.returnConnection();
@ -256,7 +256,7 @@ public class TaskServiceImpl implements TaskService {
taskMapper.update(task);
result = getTaskById(taskId);
LOGGER.info("Method transfer() transferred Task '{}' to destination workbasket {}", taskId, destinationWorkbasketId);
LOGGER.debug("Method transfer() transferred Task '{}' to destination workbasket {}", taskId, destinationWorkbasketId);
return result;
} finally {
taskanaEngineImpl.returnConnection();
@ -299,7 +299,7 @@ public class TaskServiceImpl implements TaskService {
task.setModified(Timestamp.valueOf(LocalDateTime.now()));
taskMapper.update(task);
result = getTaskById(taskId);
LOGGER.info("Method setTaskRead() set read property of Task '{}' to {} ", result, isRead);
LOGGER.debug("Method setTaskRead() set read property of Task '{}' to {} ", result, isRead);
return result;
} finally {
taskanaEngineImpl.returnConnection();

View File

@ -124,17 +124,17 @@ public class WorkbasketServiceImpl implements WorkbasketService {
workbasket.setId(IdGenerator.generateWithPrefix(ID_PREFIX_WORKBASKET));
}
workbasketMapper.insert(workbasket);
LOGGER.info("Method createWorkbasket() created Workbasket '{}'", workbasket);
LOGGER.debug("Method createWorkbasket() created Workbasket '{}'", workbasket);
if (workbasket.getDistributionTargets() != null) {
for (Workbasket distributionTarget : workbasket.getDistributionTargets()) {
if (workbasketMapper.findById(distributionTarget.getId()) == null) {
distributionTarget.setCreated(now);
distributionTarget.setModified(now);
workbasketMapper.insert(distributionTarget);
LOGGER.info("Method createWorkbasket() created distributionTarget '{}'", distributionTarget);
LOGGER.debug("Method createWorkbasket() created distributionTarget '{}'", distributionTarget);
}
distributionTargetMapper.insert(workbasket.getId(), distributionTarget.getId());
LOGGER.info("Method createWorkbasket() created distributiontarget for source '{}' and target {}", workbasket.getId(), distributionTarget.getId());
LOGGER.debug("Method createWorkbasket() created distributiontarget for source '{}' and target {}", workbasket.getId(), distributionTarget.getId());
}
}
result = workbasketMapper.findById(workbasket.getId());
@ -153,24 +153,24 @@ public class WorkbasketServiceImpl implements WorkbasketService {
taskanaEngineImpl.openConnection();
workbasket.setModified(new Timestamp(System.currentTimeMillis()));
workbasketMapper.update(workbasket);
LOGGER.info("Method updateWorkbasket() updated workbasket '{}'", workbasket.getId());
LOGGER.debug("Method updateWorkbasket() updated workbasket '{}'", workbasket.getId());
List<String> oldDistributionTargets = distributionTargetMapper.findBySourceId(workbasket.getId());
List<Workbasket> distributionTargets = workbasket.getDistributionTargets();
for (Workbasket distributionTarget : distributionTargets) {
if (!oldDistributionTargets.contains(distributionTarget.getId())) {
if (workbasketMapper.findById(distributionTarget.getId()) == null) {
workbasketMapper.insert(distributionTarget);
LOGGER.info(" Method updateWorkbasket() created distributionTarget '{}'", distributionTarget);
LOGGER.debug(" Method updateWorkbasket() created distributionTarget '{}'", distributionTarget);
}
distributionTargetMapper.insert(workbasket.getId(), distributionTarget.getId());
LOGGER.info("Method updateWorkbasket() created distributionTarget for '{}' and '{}'", workbasket.getId(), distributionTarget.getId());
LOGGER.debug("Method updateWorkbasket() created distributionTarget for '{}' and '{}'", workbasket.getId(), distributionTarget.getId());
} else {
oldDistributionTargets.remove(distributionTarget.getId());
}
}
distributionTargetMapper.deleteMultiple(workbasket.getId(), oldDistributionTargets);
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Method updateWorkbasket() deleted distributionTargets for '{}' and old distribution targets {}",
LOGGER.debug("Method updateWorkbasket() deleted distributionTargets for '{}' and old distribution targets {}",
workbasket.getId(), LoggerUtils.listToString(oldDistributionTargets));
}
result = workbasketMapper.findById(workbasket.getId());
@ -188,7 +188,7 @@ public class WorkbasketServiceImpl implements WorkbasketService {
taskanaEngineImpl.openConnection();
workbasketAccessItem.setId(IdGenerator.generateWithPrefix(ID_PREFIX_WORKBASKET_AUTHORIZATION));
workbasketAccessMapper.insert(workbasketAccessItem);
LOGGER.info("Method createWorkbasketAuthorization() created workbaskteAccessItem {}", workbasketAccessItem);
LOGGER.debug("Method createWorkbasketAuthorization() created workbaskteAccessItem {}", workbasketAccessItem);
return workbasketAccessItem;
} finally {
taskanaEngineImpl.returnConnection();
@ -216,7 +216,7 @@ public class WorkbasketServiceImpl implements WorkbasketService {
try {
taskanaEngineImpl.openConnection();
workbasketAccessMapper.delete(id);
LOGGER.info("Method deleteWorkbasketAuthorization() deleted workbasketAccessItem wit Id {}", id);
LOGGER.debug("Method deleteWorkbasketAuthorization() deleted workbasketAccessItem wit Id {}", id);
} finally {
taskanaEngineImpl.returnConnection();
LOGGER.debug("exit from deleteWorkbasketAuthorization(id).");
@ -280,7 +280,7 @@ public class WorkbasketServiceImpl implements WorkbasketService {
try {
taskanaEngineImpl.openConnection();
workbasketAccessMapper.update(workbasketAccessItem);
LOGGER.info("Method updateWorkbasketAuthorization() updated workbasketAccessItem {}", workbasketAccessItem);
LOGGER.debug("Method updateWorkbasketAuthorization() updated workbasketAccessItem {}", workbasketAccessItem);
return workbasketAccessItem;
} finally {
taskanaEngineImpl.returnConnection();