TSK-1596: Automatic TraceLogging (#1577)
This commit is contained in:
parent
2f1c0972d6
commit
bfcabea610
|
@ -230,6 +230,7 @@ jobs:
|
||||||
- taskana-common
|
- taskana-common
|
||||||
- taskana-common-security
|
- taskana-common-security
|
||||||
- taskana-common-data
|
- taskana-common-data
|
||||||
|
- taskana-common-logging
|
||||||
- taskana-common-test
|
- taskana-common-test
|
||||||
- taskana-core
|
- taskana-core
|
||||||
- taskana-cdi
|
- taskana-cdi
|
||||||
|
@ -367,7 +368,8 @@ jobs:
|
||||||
./mvnw -B deploy -P $([[ "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "release" || echo "snapshot") \
|
./mvnw -B deploy -P $([[ "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "release" || echo "snapshot") \
|
||||||
--settings ci/mvnsettings.xml -DskipTests -Dcheckstyle.skip -Dasciidoctor.skip -Djacoco.skip \
|
--settings ci/mvnsettings.xml -DskipTests -Dcheckstyle.skip -Dasciidoctor.skip -Djacoco.skip \
|
||||||
-pl :taskana-parent,\
|
-pl :taskana-parent,\
|
||||||
:taskana-common-parent,:taskana-common,:taskana-common-security,:taskana-common-data,:taskana-common-test,\
|
:taskana-common-parent,:taskana-common-logging,:taskana-common,:taskana-common-security,\
|
||||||
|
:taskana-common-data,:taskana-common-test,\
|
||||||
:taskana-lib-parent,:taskana-core,:taskana-cdi,:taskana-spring,\
|
:taskana-lib-parent,:taskana-core,:taskana-cdi,:taskana-spring,\
|
||||||
:taskana-rest-parent,:taskana-web,:taskana-rest-spring,\
|
:taskana-rest-parent,:taskana-web,:taskana-rest-spring,\
|
||||||
:taskana-history-parent,:taskana-simplehistory-provider,:taskana-simplehistory-rest-spring,:taskana-loghistory-provider,\
|
:taskana-history-parent,:taskana-simplehistory-provider,:taskana-simplehistory-rest-spring,:taskana-loghistory-provider,\
|
||||||
|
|
|
@ -17,6 +17,11 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- all common dependencies -->
|
<!-- all common dependencies -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-common</artifactId>
|
<artifactId>taskana-common</artifactId>
|
||||||
|
|
|
@ -21,5 +21,6 @@
|
||||||
<module>taskana-common-security</module>
|
<module>taskana-common-security</module>
|
||||||
<module>taskana-common-data</module>
|
<module>taskana-common-data</module>
|
||||||
<module>taskana-common-test</module>
|
<module>taskana-common-test</module>
|
||||||
|
<module>taskana-common-logging</module>
|
||||||
</modules>
|
</modules>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mybatis</groupId>
|
<groupId>org.mybatis</groupId>
|
||||||
<artifactId>mybatis</artifactId>
|
<artifactId>mybatis</artifactId>
|
||||||
|
|
|
@ -51,43 +51,29 @@ public class SampleDataGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generateSampleData() {
|
public void generateSampleData() {
|
||||||
LOGGER.debug("entry to generateSampleData()");
|
|
||||||
clearDb();
|
clearDb();
|
||||||
Stream<String> scripts = SampleDataProvider.getSampleDataCreationScripts();
|
Stream<String> scripts = SampleDataProvider.getSampleDataCreationScripts();
|
||||||
executeAndCacheScripts(scripts, CACHED_SAMPLE);
|
executeAndCacheScripts(scripts, CACHED_SAMPLE);
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("exit from generateSampleData()");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generateTestData() {
|
public void generateTestData() {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("entry to generateTestData()");
|
|
||||||
}
|
|
||||||
Stream<String> scripts = SampleDataProvider.getTestDataScripts();
|
Stream<String> scripts = SampleDataProvider.getTestDataScripts();
|
||||||
executeAndCacheScripts(scripts, CACHED_TEST);
|
executeAndCacheScripts(scripts, CACHED_TEST);
|
||||||
LOGGER.debug("exit from generateTestData()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void generateMonitorData() {
|
public void generateMonitorData() {
|
||||||
LOGGER.debug("entry to generateMonitorData()");
|
|
||||||
Stream<String> scripts = SampleDataProvider.getMonitorDataScripts();
|
Stream<String> scripts = SampleDataProvider.getMonitorDataScripts();
|
||||||
executeAndCacheScripts(scripts, CACHED_MONITOR);
|
executeAndCacheScripts(scripts, CACHED_MONITOR);
|
||||||
LOGGER.debug("exit from generateMonitorData()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearDb() {
|
public void clearDb() {
|
||||||
LOGGER.debug("entry to clearDb()");
|
|
||||||
Stream<String> scripts = SampleDataProvider.getScriptsToClearDatabase();
|
Stream<String> scripts = SampleDataProvider.getScriptsToClearDatabase();
|
||||||
executeAndCacheScripts(scripts, CACHED_CLEAR_DB);
|
executeAndCacheScripts(scripts, CACHED_CLEAR_DB);
|
||||||
LOGGER.debug("exit from clearDb()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dropDb() {
|
public void dropDb() {
|
||||||
LOGGER.debug("entry to dropDb()");
|
|
||||||
Stream<String> scripts = SampleDataProvider.getScriptsToDropDatabase();
|
Stream<String> scripts = SampleDataProvider.getScriptsToDropDatabase();
|
||||||
executeAndCacheScripts(scripts, CACHED_DROP_DB);
|
executeAndCacheScripts(scripts, CACHED_DROP_DB);
|
||||||
LOGGER.debug("exit from dropDb()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> parseScripts(Stream<String> scripts) {
|
private List<String> parseScripts(Stream<String> scripts) {
|
||||||
|
@ -127,7 +113,6 @@ public class SampleDataGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void executeAndCacheScripts(Stream<String> scripts, String cacheKey) {
|
private void executeAndCacheScripts(Stream<String> scripts, String cacheKey) {
|
||||||
LOGGER.debug("entry to executeAndCacheScripts(scripts = {}, cacheKey = {})", scripts, cacheKey);
|
|
||||||
runScripts(
|
runScripts(
|
||||||
runner ->
|
runner ->
|
||||||
CACHED_SCRIPTS.computeIfAbsent(cacheKey, key -> parseScripts(scripts)).stream()
|
CACHED_SCRIPTS.computeIfAbsent(cacheKey, key -> parseScripts(scripts)).stream()
|
||||||
|
@ -135,7 +120,6 @@ public class SampleDataGenerator {
|
||||||
.map(ByteArrayInputStream::new)
|
.map(ByteArrayInputStream::new)
|
||||||
.map(s -> new InputStreamReader(s, StandardCharsets.UTF_8))
|
.map(s -> new InputStreamReader(s, StandardCharsets.UTF_8))
|
||||||
.forEach(runner::runScript));
|
.forEach(runner::runScript));
|
||||||
LOGGER.debug("exit from executeAndCacheScripts()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ScriptRunner getScriptRunner(
|
private ScriptRunner getScriptRunner(
|
||||||
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
|
||||||
|
<name>${project.groupId}:${project.artifactId}</name>
|
||||||
|
<description>The global trace logging implementation</description>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<artifactId>taskana-common-parent</artifactId>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<version>4.6.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.aspectj</groupId>
|
||||||
|
<artifactId>aspectjrt</artifactId>
|
||||||
|
<version>${version.aspectj}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- test dependencies -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>uk.org.lidalia</groupId>
|
||||||
|
<artifactId>slf4j-test</artifactId>
|
||||||
|
<version>${version.slf4j-test}</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.assertj</groupId>
|
||||||
|
<artifactId>assertj-core</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.nickwongdev</groupId>
|
||||||
|
<artifactId>aspectj-maven-plugin</artifactId>
|
||||||
|
<version>${version.aspectj-maven-plugin}</version>
|
||||||
|
<configuration>
|
||||||
|
<aspectLibraries combine.self="override"/>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,85 @@
|
||||||
|
package pro.taskana.common.internal.logging;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import org.aspectj.lang.JoinPoint;
|
||||||
|
import org.aspectj.lang.annotation.AfterReturning;
|
||||||
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
|
import org.aspectj.lang.annotation.Before;
|
||||||
|
import org.aspectj.lang.annotation.Pointcut;
|
||||||
|
import org.aspectj.lang.reflect.MethodSignature;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@Aspect
|
||||||
|
public class LoggingAspect {
|
||||||
|
|
||||||
|
private static final Map<String, Logger> CLASS_TO_LOGGER = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
@Pointcut(
|
||||||
|
"!@annotation(pro.taskana.common.internal.logging.NoLogging)"
|
||||||
|
+ " && execution(* *(..))"
|
||||||
|
+ " && !execution(* lambda*(..))"
|
||||||
|
+ " && !execution(String *.toString())"
|
||||||
|
+ " && !execution(int *.hashCode())"
|
||||||
|
+ " && !execution(boolean *.canEqual(Object))"
|
||||||
|
+ " && !execution(boolean *.equals(Object))")
|
||||||
|
public void traceLogging() {}
|
||||||
|
|
||||||
|
@Before("traceLogging()")
|
||||||
|
public void beforeMethodExecuted(JoinPoint joinPoint) {
|
||||||
|
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
|
||||||
|
String declaringTypeName = methodSignature.getDeclaringTypeName();
|
||||||
|
Logger currentLogger =
|
||||||
|
CLASS_TO_LOGGER.computeIfAbsent(declaringTypeName, LoggerFactory::getLogger);
|
||||||
|
|
||||||
|
if (currentLogger.isTraceEnabled()) {
|
||||||
|
String methodName = methodSignature.getName();
|
||||||
|
Object[] values = joinPoint.getArgs();
|
||||||
|
String[] parameterNames = methodSignature.getParameterNames();
|
||||||
|
String parametersValues = mapParametersNameValue(parameterNames, values);
|
||||||
|
|
||||||
|
currentLogger.trace("entry to {}({})", methodName, parametersValues);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@AfterReturning(pointcut = "traceLogging()", returning = "returnedObject")
|
||||||
|
public void afterMethodExecuted(JoinPoint joinPoint, Object returnedObject) {
|
||||||
|
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
|
||||||
|
String declaringTypeName = methodSignature.getDeclaringTypeName();
|
||||||
|
Logger currentLogger =
|
||||||
|
CLASS_TO_LOGGER.computeIfAbsent(declaringTypeName, LoggerFactory::getLogger);
|
||||||
|
|
||||||
|
if (currentLogger.isTraceEnabled()) {
|
||||||
|
String methodName = methodSignature.getName();
|
||||||
|
// unfortunately necessary, because this method returns a raw type
|
||||||
|
Class<?> returnType = methodSignature.getReturnType();
|
||||||
|
if (returnType.isAssignableFrom(void.class)) {
|
||||||
|
currentLogger.trace("exit from {}.", methodName);
|
||||||
|
} else {
|
||||||
|
currentLogger.trace(
|
||||||
|
"exit from {}. Returning: '{}'", methodName, Objects.toString(returnedObject, "null"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NoLogging
|
||||||
|
private static String mapParametersNameValue(String[] parameterNames, Object[] values) {
|
||||||
|
Map<String, Object> parametersNameToValue = new HashMap<>();
|
||||||
|
|
||||||
|
if (parameterNames.length > 0) {
|
||||||
|
for (int i = 0; i < parameterNames.length; i++) {
|
||||||
|
parametersNameToValue.put(parameterNames[i], values[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
|
for (Entry<String, Object> parameter : parametersNameToValue.entrySet()) {
|
||||||
|
stringBuilder.append(parameter.getKey()).append(" = ").append(parameter.getValue());
|
||||||
|
}
|
||||||
|
return stringBuilder.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package pro.taskana.common.internal.logging;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||||
|
public @interface NoLogging {}
|
|
@ -0,0 +1,177 @@
|
||||||
|
package pro.taskana.common.internal.logging;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
import org.assertj.core.api.Condition;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import uk.org.lidalia.slf4jext.Level;
|
||||||
|
import uk.org.lidalia.slf4jtest.LoggingEvent;
|
||||||
|
import uk.org.lidalia.slf4jtest.TestLogger;
|
||||||
|
import uk.org.lidalia.slf4jtest.TestLoggerFactory;
|
||||||
|
|
||||||
|
class LoggingAspectTest {
|
||||||
|
|
||||||
|
TestLogger logger = TestLoggerFactory.getTestLogger(LoggingTestClass.class);
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
public void clearLoggers() {
|
||||||
|
TestLoggerFactory.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void should_Log_For_InternalMethod() {
|
||||||
|
LoggingTestClass loggingTestClass = new LoggingTestClass();
|
||||||
|
|
||||||
|
loggingTestClass.logInternalMethod();
|
||||||
|
|
||||||
|
verifyLoggingStatement("logInternalMethod", "", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void should_Log_For_InternalMethodWithReturnValue() {
|
||||||
|
LoggingTestClass loggingTestClass = new LoggingTestClass();
|
||||||
|
|
||||||
|
loggingTestClass.logInternalMethodWithReturnValue();
|
||||||
|
|
||||||
|
verifyLoggingStatement("logInternalMethodWithReturnValue", "", "test string");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void should_Log_For_InternalMethodWithReturnValueNull() {
|
||||||
|
LoggingTestClass loggingTestClass = new LoggingTestClass();
|
||||||
|
|
||||||
|
loggingTestClass.logInternalMethodWithReturnValueNull();
|
||||||
|
|
||||||
|
verifyLoggingStatement("logInternalMethodWithReturnValueNull", "", "null");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void should_Log_For_InternalMethodWithArguments() {
|
||||||
|
LoggingTestClass loggingTestClass = new LoggingTestClass();
|
||||||
|
|
||||||
|
loggingTestClass.logInternalMethodWithArguments("message");
|
||||||
|
|
||||||
|
verifyLoggingStatement("logInternalMethodWithArguments", "param = message", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void should_Log_For_InternalMethodWithReturnValueAndArguments() {
|
||||||
|
LoggingTestClass loggingTestClass = new LoggingTestClass();
|
||||||
|
|
||||||
|
loggingTestClass.logInternalMethodWithReturnValueAndArguments("message");
|
||||||
|
|
||||||
|
verifyLoggingStatement(
|
||||||
|
"logInternalMethodWithReturnValueAndArguments", "param = message", "return value");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void should_NotLog_For_ExternalMethod() {
|
||||||
|
LoggingTestClass loggingTestClass = new LoggingTestClass();
|
||||||
|
|
||||||
|
loggingTestClass.callsExternalMethod();
|
||||||
|
|
||||||
|
verifyLoggingStatement("callsExternalMethod", "", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void should_LogMultipleMethods_When_SubMethodIsCalled() {
|
||||||
|
LoggingTestClass loggingTestClass = new LoggingTestClass();
|
||||||
|
|
||||||
|
loggingTestClass.logInternalMethodWrapper();
|
||||||
|
assertThat(logger.getLoggingEvents())
|
||||||
|
.extracting(LoggingEvent::getMessage)
|
||||||
|
.areExactly(2, new Condition<>(message -> message.startsWith("entry to"), "entry log"))
|
||||||
|
.areExactly(2, new Condition<>(message -> message.startsWith("exit from"), "exit log"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void should_NotLogInternalMethod_When_MethodIsAnnotatedWithNoLogging() {
|
||||||
|
LoggingTestClass loggingTestClass = new LoggingTestClass();
|
||||||
|
|
||||||
|
loggingTestClass.doNotLogInternalMethod();
|
||||||
|
|
||||||
|
assertThat(logger.getLoggingEvents()).isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void should_NotLogInternalMethod_When_ClassIsAnnotatedWithNoLogging() {
|
||||||
|
NoLoggingTestClass noLoggingTestClass = new NoLoggingTestClass();
|
||||||
|
|
||||||
|
noLoggingTestClass.doNotLogInternalMethod();
|
||||||
|
|
||||||
|
assertThat(logger.getLoggingEvents()).isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void should_NotLogInternalMethod_When_SuperClassIsAnnotatedWithNoLogging() {
|
||||||
|
NoLoggingTestSubClass noLoggingTestSubClass = new NoLoggingTestSubClass();
|
||||||
|
|
||||||
|
noLoggingTestSubClass.doNotLogInternalMethod();
|
||||||
|
|
||||||
|
assertThat(logger.getLoggingEvents()).isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void verifyLoggingStatement(String methodName, String arguments, Object returnValue) {
|
||||||
|
assertThat(logger.getLoggingEvents()).hasSize(2);
|
||||||
|
LoggingEvent entryLoggingEvent = logger.getLoggingEvents().get(0);
|
||||||
|
assertThat(entryLoggingEvent.getLevel()).isEqualTo(Level.TRACE);
|
||||||
|
assertThat(entryLoggingEvent.getMessage()).startsWith("entry to");
|
||||||
|
assertThat(entryLoggingEvent.getArguments()).containsExactly(methodName, arguments);
|
||||||
|
|
||||||
|
LoggingEvent exitLoggingEvent = logger.getLoggingEvents().get(1);
|
||||||
|
|
||||||
|
assertThat(exitLoggingEvent.getLevel()).isEqualTo(Level.TRACE);
|
||||||
|
assertThat(exitLoggingEvent.getMessage()).startsWith("exit from");
|
||||||
|
|
||||||
|
if (returnValue == null) {
|
||||||
|
assertThat(exitLoggingEvent.getArguments()).containsExactly(methodName);
|
||||||
|
} else {
|
||||||
|
assertThat(exitLoggingEvent.getMessage()).contains("Returning: ");
|
||||||
|
assertThat(exitLoggingEvent.getArguments()).containsExactly(methodName, returnValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static class LoggingTestClass {
|
||||||
|
public void logInternalMethod() {}
|
||||||
|
|
||||||
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
|
String logInternalMethodWithReturnValue() {
|
||||||
|
return "test string";
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
|
public String logInternalMethodWithReturnValueNull() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public void logInternalMethodWithArguments(String param) {}
|
||||||
|
|
||||||
|
@SuppressWarnings({"UnusedReturnValue", "unused"})
|
||||||
|
public String logInternalMethodWithReturnValueAndArguments(String param) {
|
||||||
|
return "return value";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void logInternalMethodWrapper() {
|
||||||
|
logInternalMethodPrivate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public void callsExternalMethod() {
|
||||||
|
String sum = String.valueOf(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NoLogging
|
||||||
|
public void doNotLogInternalMethod() {}
|
||||||
|
|
||||||
|
private void logInternalMethodPrivate() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NoLogging
|
||||||
|
static class NoLoggingTestClass {
|
||||||
|
public void doNotLogInternalMethod() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
static class NoLoggingTestSubClass extends NoLoggingTestClass {}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Configuration status="info">
|
||||||
|
<Appenders>
|
||||||
|
|
||||||
|
<Console name="Console" target="SYSTEM_OUT">
|
||||||
|
<PatternLayout
|
||||||
|
pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
|
||||||
|
</Console>
|
||||||
|
|
||||||
|
</Appenders>
|
||||||
|
|
||||||
|
<Loggers>
|
||||||
|
<Root level="TRACE">
|
||||||
|
<AppenderRef ref="Console" />
|
||||||
|
</Root>
|
||||||
|
|
||||||
|
</Loggers>
|
||||||
|
</Configuration>
|
|
@ -15,6 +15,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
|
|
@ -30,10 +30,14 @@ public class CurrentUserContextImpl implements CurrentUserContext {
|
||||||
this.shouldUseLowerCaseForAccessIds = shouldUseLowerCaseForAccessIds;
|
this.shouldUseLowerCaseForAccessIds = shouldUseLowerCaseForAccessIds;
|
||||||
try {
|
try {
|
||||||
Class.forName(WSSUBJECT_CLASSNAME);
|
Class.forName(WSSUBJECT_CLASSNAME);
|
||||||
LOGGER.debug("WSSubject detected. Assuming that Taskana runs on IBM WebSphere.");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("WSSubject detected. Assuming that Taskana runs on IBM WebSphere.");
|
||||||
|
}
|
||||||
runningOnWebSphere = true;
|
runningOnWebSphere = true;
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
LOGGER.debug("No WSSubject detected. Using JAAS subject further on.");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("No WSSubject detected. Using JAAS subject further on.");
|
||||||
|
}
|
||||||
runningOnWebSphere = false;
|
runningOnWebSphere = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,10 +83,14 @@ public class CurrentUserContextImpl implements CurrentUserContext {
|
||||||
Method getCallerSubjectMethod =
|
Method getCallerSubjectMethod =
|
||||||
wsSubjectClass.getMethod(GET_CALLER_SUBJECT_METHOD, (Class<?>[]) null);
|
wsSubjectClass.getMethod(GET_CALLER_SUBJECT_METHOD, (Class<?>[]) null);
|
||||||
Subject callerSubject = (Subject) getCallerSubjectMethod.invoke(null, (Object[]) null);
|
Subject callerSubject = (Subject) getCallerSubjectMethod.invoke(null, (Object[]) null);
|
||||||
LOGGER.debug("Subject of caller: {}", callerSubject);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Subject of caller: {}", callerSubject);
|
||||||
|
}
|
||||||
if (callerSubject != null) {
|
if (callerSubject != null) {
|
||||||
Set<Object> publicCredentials = callerSubject.getPublicCredentials();
|
Set<Object> publicCredentials = callerSubject.getPublicCredentials();
|
||||||
LOGGER.debug("Public credentials of caller: {}", publicCredentials);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Public credentials of caller: {}", publicCredentials);
|
||||||
|
}
|
||||||
return publicCredentials.stream()
|
return publicCredentials.stream()
|
||||||
.map(
|
.map(
|
||||||
// we could use CheckedFunction#wrap here, but this either requires a dependency
|
// we could use CheckedFunction#wrap here, but this either requires a dependency
|
||||||
|
|
|
@ -16,6 +16,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-common</artifactId>
|
<artifactId>taskana-common</artifactId>
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-common-security</artifactId>
|
<artifactId>taskana-common-security</artifactId>
|
||||||
|
@ -36,6 +41,11 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- test dependencies -->
|
<!-- test dependencies -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-simple</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter</artifactId>
|
<artifactId>junit-jupiter</artifactId>
|
||||||
|
|
|
@ -56,10 +56,12 @@ public class DbSchemaCreator {
|
||||||
*/
|
*/
|
||||||
public void run() throws SQLException {
|
public void run() throws SQLException {
|
||||||
try (Connection connection = dataSource.getConnection()) {
|
try (Connection connection = dataSource.getConnection()) {
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Using database of type {} with url '{}'",
|
LOGGER.debug(
|
||||||
connection.getMetaData().getDatabaseProductName(),
|
"Using database of type {} with url '{}'",
|
||||||
connection.getMetaData().getURL());
|
connection.getMetaData().getDatabaseProductName(),
|
||||||
|
connection.getMetaData().getURL());
|
||||||
|
}
|
||||||
ScriptRunner runner = getScriptRunnerInstance(connection);
|
ScriptRunner runner = getScriptRunnerInstance(connection);
|
||||||
String dbProductId =
|
String dbProductId =
|
||||||
DB.getDatabaseProductId(connection.getMetaData().getDatabaseProductName());
|
DB.getDatabaseProductId(connection.getMetaData().getDatabaseProductName());
|
||||||
|
@ -72,7 +74,9 @@ public class DbSchemaCreator {
|
||||||
runner.runScript(getSqlSchemaNameParsed(reader));
|
runner.runScript(getSqlSchemaNameParsed(reader));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug(outWriter.toString());
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug(outWriter.toString());
|
||||||
|
}
|
||||||
if (!errorWriter.toString().trim().isEmpty()) {
|
if (!errorWriter.toString().trim().isEmpty()) {
|
||||||
LOGGER.error(errorWriter.toString());
|
LOGGER.error(errorWriter.toString());
|
||||||
}
|
}
|
||||||
|
@ -82,7 +86,9 @@ public class DbSchemaCreator {
|
||||||
try (Connection connection = dataSource.getConnection()) {
|
try (Connection connection = dataSource.getConnection()) {
|
||||||
connection.setSchema(this.schemaName);
|
connection.setSchema(this.schemaName);
|
||||||
SqlRunner runner = new SqlRunner(connection);
|
SqlRunner runner = new SqlRunner(connection);
|
||||||
LOGGER.debug(connection.getMetaData().toString());
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug(connection.getMetaData().toString());
|
||||||
|
}
|
||||||
|
|
||||||
String query =
|
String query =
|
||||||
"select VERSION from TASKANA_SCHEMA_VERSION where "
|
"select VERSION from TASKANA_SCHEMA_VERSION where "
|
||||||
|
@ -100,7 +106,9 @@ public class DbSchemaCreator {
|
||||||
expectedMinVersion);
|
expectedMinVersion);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
LOGGER.debug("Schema version is valid.");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Schema version is valid.");
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,13 +172,17 @@ public class DbSchemaCreator {
|
||||||
BufferedReader reader = new BufferedReader(inputReader)) {
|
BufferedReader reader = new BufferedReader(inputReader)) {
|
||||||
runner.runScript(getSqlSchemaNameParsed(reader));
|
runner.runScript(getSqlSchemaNameParsed(reader));
|
||||||
} catch (RuntimeSqlException | IOException e) {
|
} catch (RuntimeSqlException | IOException e) {
|
||||||
LOGGER.debug("Schema does not exist.");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
if (!errorWriter.toString().trim().isEmpty()) {
|
LOGGER.debug("Schema does not exist.");
|
||||||
LOGGER.debug(errorWriter.toString());
|
if (!errorWriter.toString().trim().isEmpty()) {
|
||||||
|
LOGGER.debug(errorWriter.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LOGGER.debug("Schema does exist.");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Schema does exist.");
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,6 @@ public class SecurityVerifier {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkSecureAccess(boolean securityEnabled) {
|
public void checkSecureAccess(boolean securityEnabled) {
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
String.format(
|
|
||||||
"Entering checkSecureAccess with securityEnabled set to %b", securityEnabled));
|
|
||||||
}
|
|
||||||
|
|
||||||
try (Connection connection = dataSource.getConnection()) {
|
try (Connection connection = dataSource.getConnection()) {
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
@ -54,14 +47,18 @@ public class SecurityVerifier {
|
||||||
}
|
}
|
||||||
} catch (SQLException ex) {
|
} catch (SQLException ex) {
|
||||||
|
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
String.format(
|
LOGGER.debug(
|
||||||
"Security-mode is not yet set. Setting security flag to %b", securityEnabled));
|
String.format(
|
||||||
|
"Security-mode is not yet set. Setting security flag to %b", securityEnabled));
|
||||||
|
}
|
||||||
|
|
||||||
setInitialSecurityMode(securityEnabled);
|
setInitialSecurityMode(securityEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug("Security-mode is enabled");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Security-mode is enabled");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setInitialSecurityMode(boolean securityEnabled) {
|
private void setInitialSecurityMode(boolean securityEnabled) {
|
||||||
|
|
|
@ -22,7 +22,9 @@ public class MapTypeHandler extends BaseTypeHandler<Map<String, Object>> {
|
||||||
PreparedStatement ps, int i, Map<String, Object> parameter, JdbcType jdbcType)
|
PreparedStatement ps, int i, Map<String, Object> parameter, JdbcType jdbcType)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
if (parameter != null && parameter.size() > 0) {
|
if (parameter != null && parameter.size() > 0) {
|
||||||
LOGGER.debug("Input-Map before serializing: {}", parameter);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Input-Map before serializing: {}", parameter);
|
||||||
|
}
|
||||||
// Convert Map to JSON string
|
// Convert Map to JSON string
|
||||||
JSONObject jsonObj = new JSONObject(parameter);
|
JSONObject jsonObj = new JSONObject(parameter);
|
||||||
ps.setString(i, jsonObj.toString());
|
ps.setString(i, jsonObj.toString());
|
||||||
|
|
|
@ -9,15 +9,11 @@ import java.util.Optional;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.common.api.exceptions.SystemException;
|
import pro.taskana.common.api.exceptions.SystemException;
|
||||||
|
|
||||||
public class ObjectAttributeChangeDetector {
|
public class ObjectAttributeChangeDetector {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ObjectAttributeChangeDetector.class);
|
|
||||||
|
|
||||||
private ObjectAttributeChangeDetector() {}
|
private ObjectAttributeChangeDetector() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,11 +26,6 @@ public class ObjectAttributeChangeDetector {
|
||||||
* @throws SystemException when any parameter is null
|
* @throws SystemException when any parameter is null
|
||||||
*/
|
*/
|
||||||
public static <T> String determineChangesInAttributes(T oldObject, T newObject) {
|
public static <T> String determineChangesInAttributes(T oldObject, T newObject) {
|
||||||
LOGGER.debug(
|
|
||||||
"Entry to determineChangesInAttributes (oldObject = {}, newObject = {}",
|
|
||||||
oldObject,
|
|
||||||
newObject);
|
|
||||||
|
|
||||||
List<Field> fields = new ArrayList<>();
|
List<Field> fields = new ArrayList<>();
|
||||||
|
|
||||||
if (Objects.isNull(oldObject) || Objects.isNull(newObject)) {
|
if (Objects.isNull(oldObject) || Objects.isNull(newObject)) {
|
||||||
|
@ -85,10 +76,6 @@ public class ObjectAttributeChangeDetector {
|
||||||
JSONObject changes = new JSONObject();
|
JSONObject changes = new JSONObject();
|
||||||
changes.put("changes", changedAttributes);
|
changes.put("changes", changedAttributes);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from determineChangesInAttributes(), returning {}", changes);
|
|
||||||
}
|
|
||||||
|
|
||||||
return changes.toString();
|
return changes.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,12 +87,6 @@ public class ObjectAttributeChangeDetector {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static <T> String compareLists(T oldObject, T newObject) {
|
private static <T> String compareLists(T oldObject, T newObject) {
|
||||||
|
|
||||||
LOGGER.debug(
|
|
||||||
"Entry to determineChangesInAttributes (oldObject = {}, newObject = {}",
|
|
||||||
oldObject,
|
|
||||||
newObject);
|
|
||||||
|
|
||||||
if (!oldObject.equals(newObject)) {
|
if (!oldObject.equals(newObject)) {
|
||||||
JSONObject changedAttribute = new JSONObject();
|
JSONObject changedAttribute = new JSONObject();
|
||||||
|
|
||||||
|
@ -116,16 +97,8 @@ public class ObjectAttributeChangeDetector {
|
||||||
|
|
||||||
changes.put("changes", changedAttribute);
|
changes.put("changes", changedAttribute);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from determineChangesInAttributes(), returning {}", changes);
|
|
||||||
}
|
|
||||||
return changes.toString();
|
return changes.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug(
|
|
||||||
"Exit from determineChangesInAttributes(), "
|
|
||||||
+ "returning empty String because there are no changed attributes");
|
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-core</artifactId>
|
<artifactId>taskana-core</artifactId>
|
||||||
|
|
|
@ -105,13 +105,17 @@ public class LogfileHistoryServiceImpl implements TaskanaHistory {
|
||||||
LOGGER.error("taskana properties file {} was not found on classpath.", propertiesFile);
|
LOGGER.error("taskana properties file {} was not found on classpath.", propertiesFile);
|
||||||
} else {
|
} else {
|
||||||
props.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
|
props.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
|
||||||
LOGGER.debug("properties were loaded from file {} from classpath.", propertiesFile);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("properties were loaded from file {} from classpath.", propertiesFile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try (FileInputStream stream = new FileInputStream(propertiesFile)) {
|
try (FileInputStream stream = new FileInputStream(propertiesFile)) {
|
||||||
props.load(stream);
|
props.load(stream);
|
||||||
}
|
}
|
||||||
LOGGER.debug("properties were loaded from file {}.", propertiesFile);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("properties were loaded from file {}.", propertiesFile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOGGER.error("caught IOException when processing properties file {}.", propertiesFile);
|
LOGGER.error("caught IOException when processing properties file {}.", propertiesFile);
|
||||||
|
|
|
@ -16,6 +16,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-core</artifactId>
|
<artifactId>taskana-core</artifactId>
|
||||||
|
|
|
@ -414,7 +414,6 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ClassificationHistoryEvent> list() {
|
public List<ClassificationHistoryEvent> list() {
|
||||||
LOGGER.debug("entry to list(), this = {}", this);
|
|
||||||
List<ClassificationHistoryEvent> result = new ArrayList<>();
|
List<ClassificationHistoryEvent> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaHistoryEngine.openConnection();
|
taskanaHistoryEngine.openConnection();
|
||||||
|
@ -425,16 +424,11 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(). Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ClassificationHistoryEvent> list(int offset, int limit) {
|
public List<ClassificationHistoryEvent> list(int offset, int limit) {
|
||||||
LOGGER.debug("entry to list({},{}), this = {}", offset, limit, this);
|
|
||||||
List<ClassificationHistoryEvent> result = new ArrayList<>();
|
List<ClassificationHistoryEvent> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaHistoryEngine.openConnection();
|
taskanaHistoryEngine.openConnection();
|
||||||
|
@ -446,23 +440,12 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(offset,limit). Returning {} resulting Objects: {} ",
|
|
||||||
result.size(),
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> listValues(
|
public List<String> listValues(
|
||||||
ClassificationHistoryQueryColumnName dbColumnName, SortDirection sortDirection) {
|
ClassificationHistoryQueryColumnName dbColumnName, SortDirection sortDirection) {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to listValues() of column {} with sortDirection {}, this {}",
|
|
||||||
dbColumnName,
|
|
||||||
sortDirection,
|
|
||||||
this);
|
|
||||||
List<String> result = new ArrayList<>();
|
List<String> result = new ArrayList<>();
|
||||||
this.columnName = dbColumnName;
|
this.columnName = dbColumnName;
|
||||||
List<String> cacheOrderBy = new ArrayList<>(this.orderBy);
|
List<String> cacheOrderBy = new ArrayList<>(this.orderBy);
|
||||||
|
@ -481,16 +464,11 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
||||||
this.columnName = null;
|
this.columnName = null;
|
||||||
this.orderColumns.remove(orderColumns.size() - 1);
|
this.orderColumns.remove(orderColumns.size() - 1);
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"Exit from listValues. Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ClassificationHistoryEvent single() {
|
public ClassificationHistoryEvent single() {
|
||||||
LOGGER.debug("entry to single(), this = {}", this);
|
|
||||||
ClassificationHistoryEvent result = null;
|
ClassificationHistoryEvent result = null;
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
@ -503,13 +481,11 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
LOGGER.debug("exit from single(). Returning result {} ", result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long count() {
|
public long count() {
|
||||||
LOGGER.debug("entry to count(), this = {}", this);
|
|
||||||
Long rowCount = null;
|
Long rowCount = null;
|
||||||
try {
|
try {
|
||||||
taskanaHistoryEngine.openConnection();
|
taskanaHistoryEngine.openConnection();
|
||||||
|
@ -520,7 +496,6 @@ public class ClassificationHistoryQueryImpl implements ClassificationHistoryQuer
|
||||||
return -1;
|
return -1;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
LOGGER.debug("exit from count(). Returning result {} ", rowCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,6 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
|
||||||
LOGGER.error("Error while inserting task history event into database", e);
|
LOGGER.error("Error while inserting task history event into database", e);
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
LOGGER.debug("Exit from create(TaskHistoryEvent event). Returning object = {}.", event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +78,6 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
|
||||||
LOGGER.error("Error while inserting workbasket history event into database", e);
|
LOGGER.error("Error while inserting workbasket history event into database", e);
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
LOGGER.debug("Exit from create(WorkbasketHistoryEvent event). Returning object = {}.", event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,19 +94,12 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
|
||||||
LOGGER.error("Error while inserting classification history event into database", e);
|
LOGGER.error("Error while inserting classification history event into database", e);
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
LOGGER.debug(
|
|
||||||
"Exit from create(ClassificationHistoryEvent event). Returning object = {}.", event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteHistoryEventsByTaskIds(List<String> taskIds)
|
public void deleteHistoryEventsByTaskIds(List<String> taskIds)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("entry to deleteHistoryEventsByTaskIds(taskIds = {})", taskIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
taskanaHistoryEngine.checkRoleMembership(TaskanaRole.ADMIN);
|
taskanaHistoryEngine.checkRoleMembership(TaskanaRole.ADMIN);
|
||||||
|
|
||||||
if (taskIds == null) {
|
if (taskIds == null) {
|
||||||
|
@ -123,14 +114,12 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
LOGGER.error("Caught exception while trying to delete history events", e);
|
LOGGER.error("Caught exception while trying to delete history events", e);
|
||||||
} finally {
|
} finally {
|
||||||
LOGGER.debug("exit from deleteHistoryEventsByTaskIds()");
|
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public TaskHistoryEvent getTaskHistoryEvent(String historyEventId)
|
public TaskHistoryEvent getTaskHistoryEvent(String historyEventId)
|
||||||
throws TaskanaHistoryEventNotFoundException {
|
throws TaskanaHistoryEventNotFoundException {
|
||||||
LOGGER.debug("entry to getTaskHistoryEvent (id = {})", historyEventId);
|
|
||||||
TaskHistoryEvent resultEvent = null;
|
TaskHistoryEvent resultEvent = null;
|
||||||
try {
|
try {
|
||||||
taskanaHistoryEngine.openConnection();
|
taskanaHistoryEngine.openConnection();
|
||||||
|
@ -149,7 +138,6 @@ public class SimpleHistoryServiceImpl implements TaskanaHistory {
|
||||||
return resultEvent;
|
return resultEvent;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
LOGGER.debug("exit from getHistoryEvent(). Returning result {} ", resultEvent);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -625,7 +625,6 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TaskHistoryEvent> list() {
|
public List<TaskHistoryEvent> list() {
|
||||||
LOGGER.debug("entry to list(), this = {}", this);
|
|
||||||
List<TaskHistoryEvent> result = new ArrayList<>();
|
List<TaskHistoryEvent> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaHistoryEngine.openConnection();
|
taskanaHistoryEngine.openConnection();
|
||||||
|
@ -636,16 +635,11 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(). Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TaskHistoryEvent> list(int offset, int limit) {
|
public List<TaskHistoryEvent> list(int offset, int limit) {
|
||||||
LOGGER.debug("entry to list({},{}), this = {}", offset, limit, this);
|
|
||||||
List<TaskHistoryEvent> result = new ArrayList<>();
|
List<TaskHistoryEvent> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaHistoryEngine.openConnection();
|
taskanaHistoryEngine.openConnection();
|
||||||
|
@ -657,23 +651,12 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(offset,limit). Returning {} resulting Objects: {} ",
|
|
||||||
result.size(),
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> listValues(
|
public List<String> listValues(
|
||||||
TaskHistoryQueryColumnName dbColumnName, SortDirection sortDirection) {
|
TaskHistoryQueryColumnName dbColumnName, SortDirection sortDirection) {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to listValues() of column {} with sortDirection {}, this {}",
|
|
||||||
dbColumnName,
|
|
||||||
sortDirection,
|
|
||||||
this);
|
|
||||||
List<String> result = new ArrayList<>();
|
List<String> result = new ArrayList<>();
|
||||||
this.columnName = dbColumnName;
|
this.columnName = dbColumnName;
|
||||||
this.orderBy.clear();
|
this.orderBy.clear();
|
||||||
|
@ -689,16 +672,11 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
|
||||||
} finally {
|
} finally {
|
||||||
this.orderColumns.remove(orderColumns.size() - 1);
|
this.orderColumns.remove(orderColumns.size() - 1);
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"Exit from listValues. Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TaskHistoryEvent single() {
|
public TaskHistoryEvent single() {
|
||||||
LOGGER.debug("entry to single(), this = {}", this);
|
|
||||||
TaskHistoryEvent result = null;
|
TaskHistoryEvent result = null;
|
||||||
try {
|
try {
|
||||||
taskanaHistoryEngine.openConnection();
|
taskanaHistoryEngine.openConnection();
|
||||||
|
@ -711,13 +689,11 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
LOGGER.debug("exit from single(). Returning result {} ", result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long count() {
|
public long count() {
|
||||||
LOGGER.debug("entry to count(), this = {}", this);
|
|
||||||
Long rowCount = null;
|
Long rowCount = null;
|
||||||
try {
|
try {
|
||||||
taskanaHistoryEngine.openConnection();
|
taskanaHistoryEngine.openConnection();
|
||||||
|
@ -728,7 +704,6 @@ public class TaskHistoryQueryImpl implements TaskHistoryQuery {
|
||||||
return -1;
|
return -1;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
LOGGER.debug("exit from count(). Returning result {} ", rowCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -466,7 +466,6 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WorkbasketHistoryEvent> list() {
|
public List<WorkbasketHistoryEvent> list() {
|
||||||
LOGGER.debug("entry to list(), this = {}", this);
|
|
||||||
List<WorkbasketHistoryEvent> result = new ArrayList<>();
|
List<WorkbasketHistoryEvent> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaHistoryEngine.openConnection();
|
taskanaHistoryEngine.openConnection();
|
||||||
|
@ -477,16 +476,11 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(). Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WorkbasketHistoryEvent> list(int offset, int limit) {
|
public List<WorkbasketHistoryEvent> list(int offset, int limit) {
|
||||||
LOGGER.debug("entry to list({},{}), this = {}", offset, limit, this);
|
|
||||||
List<WorkbasketHistoryEvent> result = new ArrayList<>();
|
List<WorkbasketHistoryEvent> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaHistoryEngine.openConnection();
|
taskanaHistoryEngine.openConnection();
|
||||||
|
@ -498,23 +492,12 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(offset,limit). Returning {} resulting Objects: {} ",
|
|
||||||
result.size(),
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> listValues(
|
public List<String> listValues(
|
||||||
WorkbasketHistoryQueryColumnName dbColumnName, SortDirection sortDirection) {
|
WorkbasketHistoryQueryColumnName dbColumnName, SortDirection sortDirection) {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to listValues() of column {} with sortDirection {}, this {}",
|
|
||||||
dbColumnName,
|
|
||||||
sortDirection,
|
|
||||||
this);
|
|
||||||
List<String> result = new ArrayList<>();
|
List<String> result = new ArrayList<>();
|
||||||
this.columnName = dbColumnName;
|
this.columnName = dbColumnName;
|
||||||
List<String> cacheOrderBy = this.orderBy;
|
List<String> cacheOrderBy = this.orderBy;
|
||||||
|
@ -533,16 +516,11 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
||||||
this.columnName = null;
|
this.columnName = null;
|
||||||
this.orderColumns.remove(orderColumns.size() - 1);
|
this.orderColumns.remove(orderColumns.size() - 1);
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"Exit from listValues. Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorkbasketHistoryEvent single() {
|
public WorkbasketHistoryEvent single() {
|
||||||
LOGGER.debug("entry to single(), this = {}", this);
|
|
||||||
WorkbasketHistoryEvent result = null;
|
WorkbasketHistoryEvent result = null;
|
||||||
try {
|
try {
|
||||||
taskanaHistoryEngine.openConnection();
|
taskanaHistoryEngine.openConnection();
|
||||||
|
@ -554,13 +532,11 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
LOGGER.debug("exit from single(). Returning result {} ", result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long count() {
|
public long count() {
|
||||||
LOGGER.debug("entry to count(), this = {}", this);
|
|
||||||
Long rowCount = null;
|
Long rowCount = null;
|
||||||
try {
|
try {
|
||||||
taskanaHistoryEngine.openConnection();
|
taskanaHistoryEngine.openConnection();
|
||||||
|
@ -571,7 +547,6 @@ public class WorkbasketHistoryQueryImpl implements WorkbasketHistoryQuery {
|
||||||
return -1;
|
return -1;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaHistoryEngine.returnConnection();
|
taskanaHistoryEngine.returnConnection();
|
||||||
LOGGER.debug("exit from count(). Returning result {} ", rowCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -196,12 +196,6 @@ public class HistoryCleanupJob extends AbstractTaskanaJob {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int deleteHistoryEventsTransactionally(List<String> taskIdsToDeleteHistoryEventsFor) {
|
private int deleteHistoryEventsTransactionally(List<String> taskIdsToDeleteHistoryEventsFor) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to deleteHistoryEventsTransactionally(taskIdsToDeleteHistoryEventsFor = {})",
|
|
||||||
taskIdsToDeleteHistoryEventsFor);
|
|
||||||
}
|
|
||||||
|
|
||||||
int deletedEventsCount = 0;
|
int deletedEventsCount = 0;
|
||||||
if (txProvider != null) {
|
if (txProvider != null) {
|
||||||
int count =
|
int count =
|
||||||
|
@ -215,7 +209,6 @@ public class HistoryCleanupJob extends AbstractTaskanaJob {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
LOGGER.debug("exit from deleteHistoryEventsTransactionally(), returning {}", count);
|
|
||||||
return count;
|
return count;
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
@ -224,19 +217,11 @@ public class HistoryCleanupJob extends AbstractTaskanaJob {
|
||||||
LOGGER.warn("Could not delete history events.", e);
|
LOGGER.warn("Could not delete history events.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug(
|
|
||||||
"exit from deleteHistoryEventsTransactionally()(), returning {}", deletedEventsCount);
|
|
||||||
return deletedEventsCount;
|
return deletedEventsCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int deleteEvents(List<String> taskIdsToDeleteHistoryEventsFor)
|
private int deleteEvents(List<String> taskIdsToDeleteHistoryEventsFor)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to deleteEvents(taskIdsToDeleteHistoryEventsFor = {})",
|
|
||||||
taskIdsToDeleteHistoryEventsFor);
|
|
||||||
}
|
|
||||||
|
|
||||||
SimpleHistoryServiceImpl simpleHistoryService =
|
SimpleHistoryServiceImpl simpleHistoryService =
|
||||||
(SimpleHistoryServiceImpl) taskanaHistoryEngine.getTaskanaHistoryService();
|
(SimpleHistoryServiceImpl) taskanaHistoryEngine.getTaskanaHistoryService();
|
||||||
|
|
||||||
|
@ -250,19 +235,18 @@ public class HistoryCleanupJob extends AbstractTaskanaJob {
|
||||||
|
|
||||||
simpleHistoryService.deleteHistoryEventsByTaskIds(taskIdsToDeleteHistoryEventsFor);
|
simpleHistoryService.deleteHistoryEventsByTaskIds(taskIdsToDeleteHistoryEventsFor);
|
||||||
|
|
||||||
LOGGER.debug("{} events deleted.", deletedTasksCount);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("{} events deleted.", deletedTasksCount);
|
||||||
|
}
|
||||||
|
|
||||||
LOGGER.debug("exit from deleteEvents(), returning {}", taskIdsToDeleteHistoryEventsFor.size());
|
|
||||||
return deletedTasksCount;
|
return deletedTasksCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void scheduleNextCleanupJob() {
|
private void scheduleNextCleanupJob() {
|
||||||
LOGGER.debug("Entry to scheduleNextCleanupJob.");
|
|
||||||
ScheduledJob job = new ScheduledJob();
|
ScheduledJob job = new ScheduledJob();
|
||||||
job.setType(Type.HISTORYCLEANUPJOB);
|
job.setType(Type.HISTORYCLEANUPJOB);
|
||||||
job.setDue(getNextDueForCleanupJob());
|
job.setDue(getNextDueForCleanupJob());
|
||||||
taskanaEngineImpl.getJobService().createJob(job);
|
taskanaEngineImpl.getJobService().createJob(job);
|
||||||
LOGGER.debug("Exit from scheduleNextCleanupJob.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initJobParameters(Properties props) {
|
private void initJobParameters(Properties props) {
|
||||||
|
@ -294,11 +278,13 @@ public class HistoryCleanupJob extends AbstractTaskanaJob {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug("Configured number of history events per transaction: {}", batchSize);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug("HistoryCleanupJob configuration: runs every {}", runEvery);
|
LOGGER.debug("Configured number of history events per transaction: {}", batchSize);
|
||||||
LOGGER.debug(
|
LOGGER.debug("HistoryCleanupJob configuration: runs every {}", runEvery);
|
||||||
"HistoryCleanupJob configuration: minimum age of history events to be cleanup up is {}",
|
LOGGER.debug(
|
||||||
minimumAge);
|
"HistoryCleanupJob configuration: minimum age of history events to be cleanup up is {}",
|
||||||
|
minimumAge);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Properties readPropertiesFromFile(String propertiesFile) {
|
private Properties readPropertiesFromFile(String propertiesFile) {
|
||||||
|
@ -312,13 +298,17 @@ public class HistoryCleanupJob extends AbstractTaskanaJob {
|
||||||
LOGGER.error("taskana properties file {} was not found on classpath.", propertiesFile);
|
LOGGER.error("taskana properties file {} was not found on classpath.", propertiesFile);
|
||||||
} else {
|
} else {
|
||||||
props.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
|
props.load(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"taskana properties were loaded from file {} from classpath.", propertiesFile);
|
LOGGER.debug(
|
||||||
|
"taskana properties were loaded from file {} from classpath.", propertiesFile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try (FileInputStream fileInputStream = new FileInputStream(propertiesFile)) {
|
try (FileInputStream fileInputStream = new FileInputStream(propertiesFile)) {
|
||||||
props.load(fileInputStream);
|
props.load(fileInputStream);
|
||||||
LOGGER.debug("taskana properties were loaded from file {}.", propertiesFile);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("taskana properties were loaded from file {}.", propertiesFile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
@ -26,8 +26,7 @@ class DeleteHistoryEventsOnTaskDeletionAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@WithAccessId(user = "admin")
|
@WithAccessId(user = "admin")
|
||||||
void should_DeleteHistoryEvents_When_TaskIsDeleted_With_HistoryDeletionEnabled()
|
void should_DeleteHistoryEvents_When_TaskIsDeletedWithHistoryDeletionEnabled() throws Exception {
|
||||||
throws Exception {
|
|
||||||
|
|
||||||
final String taskid = "TKI:000000000000000000000000000000000036";
|
final String taskid = "TKI:000000000000000000000000000000000036";
|
||||||
taskanaEngineConfiguration.setDeleteHistoryOnTaskDeletionEnabled(true);
|
taskanaEngineConfiguration.setDeleteHistoryOnTaskDeletionEnabled(true);
|
||||||
|
@ -57,7 +56,7 @@ class DeleteHistoryEventsOnTaskDeletionAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@WithAccessId(user = "admin")
|
@WithAccessId(user = "admin")
|
||||||
void should_DeleteHistoryEvents_When_TasksAreDeleted_With_HistoryDeletionEnabled()
|
void should_DeleteHistoryEvents_When_TasksAreDeletedWithHistoryDeletionEnabled()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
|
||||||
final String taskId_1 = "TKI:000000000000000000000000000000000037";
|
final String taskId_1 = "TKI:000000000000000000000000000000000037";
|
||||||
|
@ -97,7 +96,7 @@ class DeleteHistoryEventsOnTaskDeletionAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@WithAccessId(user = "admin")
|
@WithAccessId(user = "admin")
|
||||||
void should_NotDeleteHistoryEvents_When_TaskIsDeleted_With_HistoryDeletionDisabled()
|
void should_NotDeleteHistoryEvents_When_TaskIsDeletedWithHistoryDeletionDisabled()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
|
||||||
final String taskId = "TKI:000000000000000000000000000000000039";
|
final String taskId = "TKI:000000000000000000000000000000000039";
|
||||||
|
@ -129,7 +128,7 @@ class DeleteHistoryEventsOnTaskDeletionAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@WithAccessId(user = "admin")
|
@WithAccessId(user = "admin")
|
||||||
void should_NotDeleteHistoryEvents_When_TasksAreDeleted_With_HistoryDeletionDisabled()
|
void should_NotDeleteHistoryEvents_When_TasksAreDeletedWithHistoryDeletionDisabled()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
final String taskId_1 = "TKI:000000000000000000000000000000000040";
|
final String taskId_1 = "TKI:000000000000000000000000000000000040";
|
||||||
final String taskId_2 = "TKI:000000000000000000000000000000000068";
|
final String taskId_2 = "TKI:000000000000000000000000000000000068";
|
||||||
|
|
|
@ -16,6 +16,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana.history</groupId>
|
<groupId>pro.taskana.history</groupId>
|
||||||
<artifactId>taskana-simplehistory-provider</artifactId>
|
<artifactId>taskana-simplehistory-provider</artifactId>
|
||||||
|
|
|
@ -5,8 +5,6 @@ import java.sql.SQLException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||||
|
@ -38,8 +36,6 @@ import pro.taskana.spi.history.api.exceptions.TaskanaHistoryEventNotFoundExcepti
|
||||||
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
|
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
|
||||||
public class TaskHistoryEventController {
|
public class TaskHistoryEventController {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TaskHistoryEventController.class);
|
|
||||||
|
|
||||||
private final SimpleHistoryServiceImpl simpleHistoryService;
|
private final SimpleHistoryServiceImpl simpleHistoryService;
|
||||||
private final TaskHistoryEventRepresentationModelAssembler assembler;
|
private final TaskHistoryEventRepresentationModelAssembler assembler;
|
||||||
|
|
||||||
|
@ -91,10 +87,6 @@ public class TaskHistoryEventController {
|
||||||
ResponseEntity<TaskHistoryEventPagedRepresentationModel> response =
|
ResponseEntity<TaskHistoryEventPagedRepresentationModel> response =
|
||||||
ResponseEntity.ok(pagedResources);
|
ResponseEntity.ok(pagedResources);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getTaskHistoryEvents(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,21 +103,9 @@ public class TaskHistoryEventController {
|
||||||
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
||||||
public ResponseEntity<TaskHistoryEventRepresentationModel> getTaskHistoryEvent(
|
public ResponseEntity<TaskHistoryEventRepresentationModel> getTaskHistoryEvent(
|
||||||
@PathVariable String historyEventId) throws TaskanaHistoryEventNotFoundException {
|
@PathVariable String historyEventId) throws TaskanaHistoryEventNotFoundException {
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Entry to getTaskHistoryEvent(historyEventId= {})", historyEventId);
|
|
||||||
}
|
|
||||||
|
|
||||||
TaskHistoryEvent resultEvent = simpleHistoryService.getTaskHistoryEvent(historyEventId);
|
TaskHistoryEvent resultEvent = simpleHistoryService.getTaskHistoryEvent(historyEventId);
|
||||||
|
|
||||||
TaskHistoryEventRepresentationModel taskEventResource = assembler.toModel(resultEvent);
|
TaskHistoryEventRepresentationModel taskEventResource = assembler.toModel(resultEvent);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"Exit from getTaskHistoryEvent, returning {}",
|
|
||||||
new ResponseEntity<>(taskEventResource, HttpStatus.OK));
|
|
||||||
}
|
|
||||||
|
|
||||||
return new ResponseEntity<>(taskEventResource, HttpStatus.OK);
|
return new ResponseEntity<>(taskEventResource, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax</groupId>
|
<groupId>javax</groupId>
|
||||||
<artifactId>javaee-api</artifactId>
|
<artifactId>javaee-api</artifactId>
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax</groupId>
|
<groupId>javax</groupId>
|
||||||
<artifactId>javaee-api</artifactId>
|
<artifactId>javaee-api</artifactId>
|
||||||
|
|
|
@ -49,7 +49,9 @@ public class TaskanaProducers {
|
||||||
dataSource = (DataSource) ctx.lookup(properties.getProperty("datasource.jndi"));
|
dataSource = (DataSource) ctx.lookup(properties.getProperty("datasource.jndi"));
|
||||||
try (Connection connection = dataSource.getConnection()) {
|
try (Connection connection = dataSource.getConnection()) {
|
||||||
DatabaseMetaData metaData = connection.getMetaData();
|
DatabaseMetaData metaData = connection.getMetaData();
|
||||||
LOGGER.debug("---------------> {}", metaData);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("---------------> {}", metaData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.taskanaEngineConfiguration =
|
this.taskanaEngineConfiguration =
|
||||||
new TaskanaEngineConfiguration(dataSource, true, false, "TASKANA");
|
new TaskanaEngineConfiguration(dataSource, true, false, "TASKANA");
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-common</artifactId>
|
<artifactId>taskana-common</artifactId>
|
||||||
|
|
|
@ -147,8 +147,10 @@ public class TaskanaEngineConfiguration {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initTaskanaProperties(String propertiesFile, String separator) {
|
public void initTaskanaProperties(String propertiesFile, String separator) {
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Reading taskana configuration from {} with separator {}", propertiesFile, separator);
|
LOGGER.debug(
|
||||||
|
"Reading taskana configuration from {} with separator {}", propertiesFile, separator);
|
||||||
|
}
|
||||||
Properties props = readPropertiesFromFile(propertiesFile);
|
Properties props = readPropertiesFromFile(propertiesFile);
|
||||||
initTaskanaRoles(props, separator);
|
initTaskanaRoles(props, separator);
|
||||||
initJobParameters(props);
|
initJobParameters(props);
|
||||||
|
@ -409,18 +411,20 @@ public class TaskanaEngineConfiguration {
|
||||||
Boolean::parseBoolean)
|
Boolean::parseBoolean)
|
||||||
.ifPresent(this::setTaskCleanupJobAllCompletedSameParentBusiness);
|
.ifPresent(this::setTaskCleanupJobAllCompletedSameParentBusiness);
|
||||||
|
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Configured number of task and workbasket updates per transaction: {}", jobBatchSize);
|
LOGGER.debug(
|
||||||
LOGGER.debug("Number of retries of failed task updates: {}", maxNumberOfJobRetries);
|
"Configured number of task and workbasket updates per transaction: {}", jobBatchSize);
|
||||||
LOGGER.debug("CleanupJob configuration: first run at {}", cleanupJobFirstRun);
|
LOGGER.debug("Number of retries of failed task updates: {}", maxNumberOfJobRetries);
|
||||||
LOGGER.debug("CleanupJob configuration: runs every {}", cleanupJobRunEvery);
|
LOGGER.debug("CleanupJob configuration: first run at {}", cleanupJobFirstRun);
|
||||||
LOGGER.debug(
|
LOGGER.debug("CleanupJob configuration: runs every {}", cleanupJobRunEvery);
|
||||||
"CleanupJob configuration: minimum age of tasks to be cleanup up is {}",
|
LOGGER.debug(
|
||||||
cleanupJobMinimumAge);
|
"CleanupJob configuration: minimum age of tasks to be cleanup up is {}",
|
||||||
LOGGER.debug(
|
cleanupJobMinimumAge);
|
||||||
"TaskCleanupJob configuration: all completed task with the "
|
LOGGER.debug(
|
||||||
+ "same parent business property id {}",
|
"TaskCleanupJob configuration: all completed task with the "
|
||||||
taskCleanupJobAllCompletedSameParentBusiness);
|
+ "same parent business property id {}",
|
||||||
|
taskCleanupJobAllCompletedSameParentBusiness);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initDomains(Properties props) {
|
private void initDomains(Properties props) {
|
||||||
|
@ -428,7 +432,9 @@ public class TaskanaEngineConfiguration {
|
||||||
p -> splitStringAndTrimElements(p, ",", String::toUpperCase);
|
p -> splitStringAndTrimElements(p, ",", String::toUpperCase);
|
||||||
parseProperty(props, TASKANA_DOMAINS_PROPERTY, parseFunction).ifPresent(this::setDomains);
|
parseProperty(props, TASKANA_DOMAINS_PROPERTY, parseFunction).ifPresent(this::setDomains);
|
||||||
|
|
||||||
LOGGER.debug("Configured domains: {}", domains);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Configured domains: {}", domains);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initClassificationTypes(Properties props) {
|
private void initClassificationTypes(Properties props) {
|
||||||
|
@ -437,7 +443,9 @@ public class TaskanaEngineConfiguration {
|
||||||
parseProperty(props, TASKANA_CLASSIFICATION_TYPES_PROPERTY, parseFunction)
|
parseProperty(props, TASKANA_CLASSIFICATION_TYPES_PROPERTY, parseFunction)
|
||||||
.ifPresent(this::setClassificationTypes);
|
.ifPresent(this::setClassificationTypes);
|
||||||
|
|
||||||
LOGGER.debug("Configured classificationTypes: {}", classificationTypes);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Configured classificationTypes: {}", classificationTypes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initClassificationCategories(Properties props) {
|
private void initClassificationCategories(Properties props) {
|
||||||
|
@ -457,7 +465,9 @@ public class TaskanaEngineConfiguration {
|
||||||
.map(type -> Pair.of(type, getClassificationCategoriesForType.apply(type)))
|
.map(type -> Pair.of(type, getClassificationCategoriesForType.apply(type)))
|
||||||
.collect(Collectors.toMap(Pair::getLeft, Pair::getRight));
|
.collect(Collectors.toMap(Pair::getLeft, Pair::getRight));
|
||||||
|
|
||||||
LOGGER.debug("Configured classification categories : {}", classificationCategoriesByTypeMap);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Configured classification categories : {}", classificationCategoriesByTypeMap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initBooleanProperty(
|
private void initBooleanProperty(
|
||||||
|
@ -484,7 +494,9 @@ public class TaskanaEngineConfiguration {
|
||||||
LOGGER.error("Caught exception when attempting to initialize the schema name", ex);
|
LOGGER.error("Caught exception when attempting to initialize the schema name", ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug("Using schema name {}", this.getSchemaName());
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Using schema name {}", this.getSchemaName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initTaskanaRoles(Properties props, String rolesSeparator) {
|
private void initTaskanaRoles(Properties props, String rolesSeparator) {
|
||||||
|
@ -527,7 +539,9 @@ public class TaskanaEngineConfiguration {
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
parseProperty(props, TASKANA_CUSTOM_HOLIDAY, parseFunction).ifPresent(this::addCustomHolidays);
|
parseProperty(props, TASKANA_CUSTOM_HOLIDAY, parseFunction).ifPresent(this::addCustomHolidays);
|
||||||
|
|
||||||
LOGGER.debug("Configured custom Holidays : {}", customHolidays);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Configured custom Holidays : {}", customHolidays);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CustomHoliday createCustomHolidayFromPropsEntry(String customHolidayEntry)
|
private CustomHoliday createCustomHolidayFromPropsEntry(String customHolidayEntry)
|
||||||
|
@ -559,11 +573,9 @@ public class TaskanaEngineConfiguration {
|
||||||
|
|
||||||
private Properties readPropertiesFromFile(String propertiesFile) {
|
private Properties readPropertiesFromFile(String propertiesFile) {
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
try {
|
try (InputStream stream =
|
||||||
try (InputStream stream =
|
FileLoaderUtil.openFileFromClasspathOrSystem(propertiesFile, getClass())) {
|
||||||
FileLoaderUtil.openFileFromClasspathOrSystem(propertiesFile, getClass())) {
|
props.load(stream);
|
||||||
props.load(stream);
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOGGER.error("caught IOException when processing properties file {}.", propertiesFile);
|
LOGGER.error("caught IOException when processing properties file {}.", propertiesFile);
|
||||||
throw new SystemException(
|
throw new SystemException(
|
||||||
|
|
|
@ -66,7 +66,7 @@ public interface ClassificationService {
|
||||||
throws ClassificationInUseException, ClassificationNotFoundException, NotAuthorizedException;
|
throws ClassificationInUseException, ClassificationNotFoundException, NotAuthorizedException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inserts a new Classification after adding default values. <br>
|
* Inserts a new Classification after adding default values. <br>
|
||||||
* The Classification will be added to master-domain, too - if not already existing. <br>
|
* The Classification will be added to master-domain, too - if not already existing. <br>
|
||||||
* The default values are:
|
* The default values are:
|
||||||
*
|
*
|
||||||
|
|
|
@ -5,8 +5,6 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.ibatis.exceptions.PersistenceException;
|
import org.apache.ibatis.exceptions.PersistenceException;
|
||||||
import org.apache.ibatis.session.RowBounds;
|
import org.apache.ibatis.session.RowBounds;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.classification.api.ClassificationCustomField;
|
import pro.taskana.classification.api.ClassificationCustomField;
|
||||||
import pro.taskana.classification.api.ClassificationQuery;
|
import pro.taskana.classification.api.ClassificationQuery;
|
||||||
|
@ -28,7 +26,7 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
||||||
private static final String LINK_TO_VALUEMAPPER =
|
private static final String LINK_TO_VALUEMAPPER =
|
||||||
"pro.taskana.classification.internal.ClassificationQueryMapper."
|
"pro.taskana.classification.internal.ClassificationQueryMapper."
|
||||||
+ "queryClassificationColumnValues";
|
+ "queryClassificationColumnValues";
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ClassificationQueryImpl.class);
|
|
||||||
private final InternalTaskanaEngine taskanaEngine;
|
private final InternalTaskanaEngine taskanaEngine;
|
||||||
private final List<String> orderBy;
|
private final List<String> orderBy;
|
||||||
private final List<String> orderColumns;
|
private final List<String> orderColumns;
|
||||||
|
@ -325,7 +323,6 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ClassificationSummary> list() {
|
public List<ClassificationSummary> list() {
|
||||||
LOGGER.debug("entry to list(), this = {}", this);
|
|
||||||
List<ClassificationSummary> result = new ArrayList<>();
|
List<ClassificationSummary> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -333,16 +330,11 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(). Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ClassificationSummary> list(int offset, int limit) {
|
public List<ClassificationSummary> list(int offset, int limit) {
|
||||||
LOGGER.debug("entry to list(offset = {}, limit = {}), this = {}", offset, limit, this);
|
|
||||||
List<ClassificationSummary> result = new ArrayList<>();
|
List<ClassificationSummary> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -360,19 +352,12 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(offset,limit). Returning {} resulting Objects: {} ",
|
|
||||||
result.size(),
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> listValues(
|
public List<String> listValues(
|
||||||
ClassificationQueryColumnName columnName, SortDirection sortDirection) {
|
ClassificationQueryColumnName columnName, SortDirection sortDirection) {
|
||||||
LOGGER.debug("Entry to listValues(dbColumnName={}) this = {}", columnName, this);
|
|
||||||
List<String> result = new ArrayList<>();
|
List<String> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -383,16 +368,11 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"Exit from listValues. Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ClassificationSummary single() {
|
public ClassificationSummary single() {
|
||||||
LOGGER.debug("entry to single(), this = {}", this);
|
|
||||||
ClassificationSummary result = null;
|
ClassificationSummary result = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -400,13 +380,11 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from single(). Returning result {} ", result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long count() {
|
public long count() {
|
||||||
LOGGER.debug("entry to count(), this = {}", this);
|
|
||||||
Long rowCount = null;
|
Long rowCount = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -414,7 +392,6 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
||||||
return (rowCount == null) ? 0L : rowCount;
|
return (rowCount == null) ? 0L : rowCount;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from count(). Returning result {} ", rowCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,6 @@ public class ClassificationServiceImpl implements ClassificationService {
|
||||||
@Override
|
@Override
|
||||||
public Classification getClassification(String key, String domain)
|
public Classification getClassification(String key, String domain)
|
||||||
throws ClassificationNotFoundException {
|
throws ClassificationNotFoundException {
|
||||||
LOGGER.debug("entry to getClassification(key = {}, domain = {})", key, domain);
|
|
||||||
if (key == null) {
|
if (key == null) {
|
||||||
throw new ClassificationNotFoundException(
|
throw new ClassificationNotFoundException(
|
||||||
null, domain, "Classification for null key and domain " + domain + " was not found.");
|
null, domain, "Classification for null key and domain " + domain + " was not found.");
|
||||||
|
@ -81,7 +80,6 @@ public class ClassificationServiceImpl implements ClassificationService {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from getClassification(). Returning result {} ", result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +88,6 @@ public class ClassificationServiceImpl implements ClassificationService {
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
throw new ClassificationNotFoundException(null, "Classification for null id is invalid.");
|
throw new ClassificationNotFoundException(null, "Classification for null id is invalid.");
|
||||||
}
|
}
|
||||||
LOGGER.debug("entry to getClassification(id = {})", id);
|
|
||||||
Classification result = null;
|
Classification result = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -102,14 +99,12 @@ public class ClassificationServiceImpl implements ClassificationService {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from getClassification(). Returning result {} ", result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteClassification(String classificationId)
|
public void deleteClassification(String classificationId)
|
||||||
throws ClassificationInUseException, ClassificationNotFoundException, NotAuthorizedException {
|
throws ClassificationInUseException, ClassificationNotFoundException, NotAuthorizedException {
|
||||||
LOGGER.debug("entry to deleteClassification(id = {})", classificationId);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -166,14 +161,12 @@ public class ClassificationServiceImpl implements ClassificationService {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from deleteClassification()");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteClassification(String classificationKey, String domain)
|
public void deleteClassification(String classificationKey, String domain)
|
||||||
throws ClassificationInUseException, ClassificationNotFoundException, NotAuthorizedException {
|
throws ClassificationInUseException, ClassificationNotFoundException, NotAuthorizedException {
|
||||||
LOGGER.debug("entry to deleteClassification(key = {}, domain = {})", classificationKey, domain);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -191,7 +184,6 @@ public class ClassificationServiceImpl implements ClassificationService {
|
||||||
deleteClassification(classification.getId());
|
deleteClassification(classification.getId());
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from deleteClassification(key,domain)");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +191,6 @@ public class ClassificationServiceImpl implements ClassificationService {
|
||||||
public Classification createClassification(Classification classification)
|
public Classification createClassification(Classification classification)
|
||||||
throws ClassificationAlreadyExistException, NotAuthorizedException, DomainNotFoundException,
|
throws ClassificationAlreadyExistException, NotAuthorizedException, DomainNotFoundException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
LOGGER.debug("entry to createClassification(classification = {})", classification);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
if (!taskanaEngine.domainExists(classification.getDomain())
|
if (!taskanaEngine.domainExists(classification.getDomain())
|
||||||
&& !"".equals(classification.getDomain())) {
|
&& !"".equals(classification.getDomain())) {
|
||||||
|
@ -239,14 +230,15 @@ public class ClassificationServiceImpl implements ClassificationService {
|
||||||
details));
|
details));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug("Method createClassification created classification {}.", classificationImpl);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Method createClassification created classification {}.", classificationImpl);
|
||||||
|
}
|
||||||
|
|
||||||
if (!classification.getDomain().isEmpty()) {
|
if (!classification.getDomain().isEmpty()) {
|
||||||
addClassificationToMasterDomain(classificationImpl);
|
addClassificationToMasterDomain(classificationImpl);
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from createClassification()");
|
|
||||||
}
|
}
|
||||||
return classificationImpl;
|
return classificationImpl;
|
||||||
}
|
}
|
||||||
|
@ -255,7 +247,6 @@ public class ClassificationServiceImpl implements ClassificationService {
|
||||||
public Classification updateClassification(Classification classification)
|
public Classification updateClassification(Classification classification)
|
||||||
throws NotAuthorizedException, ConcurrencyException, ClassificationNotFoundException,
|
throws NotAuthorizedException, ConcurrencyException, ClassificationNotFoundException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
LOGGER.debug("entry to updateClassification(Classification = {})", classification);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
ClassificationImpl classificationImpl;
|
ClassificationImpl classificationImpl;
|
||||||
try {
|
try {
|
||||||
|
@ -291,12 +282,13 @@ public class ClassificationServiceImpl implements ClassificationService {
|
||||||
taskanaEngine.getEngine().getCurrentUserContext().getUserid(),
|
taskanaEngine.getEngine().getCurrentUserContext().getUserid(),
|
||||||
details));
|
details));
|
||||||
}
|
}
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Method updateClassification() updated the classification {}.", classificationImpl);
|
LOGGER.debug(
|
||||||
|
"Method updateClassification() updated the classification {}.", classificationImpl);
|
||||||
|
}
|
||||||
return classification;
|
return classification;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from updateClassification().");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,10 +394,12 @@ public class ClassificationServiceImpl implements ClassificationService {
|
||||||
throw new ClassificationAlreadyExistException(masterClassification);
|
throw new ClassificationAlreadyExistException(masterClassification);
|
||||||
} catch (ClassificationNotFoundException e) {
|
} catch (ClassificationNotFoundException e) {
|
||||||
doesExist = false;
|
doesExist = false;
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Method createClassification: Classification does not "
|
LOGGER.debug(
|
||||||
+ "exist in master domain. Classification {}.",
|
"Method createClassification: Classification does not "
|
||||||
masterClassification);
|
+ "exist in master domain. Classification {}.",
|
||||||
|
masterClassification);
|
||||||
|
}
|
||||||
} catch (ClassificationAlreadyExistException ex) {
|
} catch (ClassificationAlreadyExistException ex) {
|
||||||
LOGGER.warn(
|
LOGGER.warn(
|
||||||
"Method createClassification: Classification does already exist "
|
"Method createClassification: Classification does already exist "
|
||||||
|
@ -414,10 +408,12 @@ public class ClassificationServiceImpl implements ClassificationService {
|
||||||
} finally {
|
} finally {
|
||||||
if (!doesExist) {
|
if (!doesExist) {
|
||||||
classificationMapper.insert(masterClassification);
|
classificationMapper.insert(masterClassification);
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Method createClassification: Classification created in "
|
LOGGER.debug(
|
||||||
+ "master-domain, too. Classification {}.",
|
"Method createClassification: Classification created in "
|
||||||
masterClassification);
|
+ "master-domain, too. Classification {}.",
|
||||||
|
masterClassification);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,12 +53,14 @@ public class ClassificationChangedJob extends AbstractTaskanaJob {
|
||||||
private void scheduleTaskRefreshJobs(List<String> affectedTaskIds) {
|
private void scheduleTaskRefreshJobs(List<String> affectedTaskIds) {
|
||||||
int batchSize = taskanaEngineImpl.getConfiguration().getMaxNumberOfUpdatesPerTransaction();
|
int batchSize = taskanaEngineImpl.getConfiguration().getMaxNumberOfUpdatesPerTransaction();
|
||||||
List<List<String>> affectedTaskBatches = partition(affectedTaskIds, batchSize);
|
List<List<String>> affectedTaskBatches = partition(affectedTaskIds, batchSize);
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Creating {} TaskRefreshJobs out of {} affected tasks "
|
LOGGER.debug(
|
||||||
+ "with a maximum number of {} tasks each. ",
|
"Creating {} TaskRefreshJobs out of {} affected tasks "
|
||||||
affectedTaskBatches.size(),
|
+ "with a maximum number of {} tasks each. ",
|
||||||
affectedTaskIds.size(),
|
affectedTaskBatches.size(),
|
||||||
batchSize);
|
affectedTaskIds.size(),
|
||||||
|
batchSize);
|
||||||
|
}
|
||||||
for (List<String> taskIdBatch : affectedTaskBatches) {
|
for (List<String> taskIdBatch : affectedTaskBatches) {
|
||||||
Map<String, String> args = new HashMap<>();
|
Map<String, String> args = new HashMap<>();
|
||||||
if (!taskIdBatch.isEmpty()) {
|
if (!taskIdBatch.isEmpty()) {
|
||||||
|
|
|
@ -26,76 +26,75 @@ public class JobServiceImpl implements JobService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ScheduledJob createJob(ScheduledJob job) {
|
public ScheduledJob createJob(ScheduledJob job) {
|
||||||
LOGGER.debug("Entry to createJob({})", job);
|
|
||||||
try {
|
try {
|
||||||
taskanaEngineImpl.openConnection();
|
taskanaEngineImpl.openConnection();
|
||||||
job = initializeJobDefault(job);
|
job = initializeJobDefault(job);
|
||||||
Integer jobId = jobMapper.insertJob(job);
|
Integer jobId = jobMapper.insertJob(job);
|
||||||
job.setJobId(jobId);
|
job.setJobId(jobId);
|
||||||
LOGGER.debug("Created job {}", job);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Created job {}", job);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngineImpl.returnConnection();
|
taskanaEngineImpl.returnConnection();
|
||||||
}
|
}
|
||||||
LOGGER.debug("Exit from createJob");
|
|
||||||
return job;
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteJobs(Type jobType) {
|
public void deleteJobs(Type jobType) {
|
||||||
LOGGER.debug("entry to deleteJobs(jobType = {})", jobType);
|
|
||||||
try {
|
try {
|
||||||
taskanaEngineImpl.openConnection();
|
taskanaEngineImpl.openConnection();
|
||||||
jobMapper.deleteMultiple(jobType);
|
jobMapper.deleteMultiple(jobType);
|
||||||
LOGGER.debug("Deleted jobs of type: {}", jobType);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Deleted jobs of type: {}", jobType);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngineImpl.returnConnection();
|
taskanaEngineImpl.returnConnection();
|
||||||
LOGGER.debug("exit from deleteJobs()");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScheduledJob lockJob(ScheduledJob job, String owner) {
|
public ScheduledJob lockJob(ScheduledJob job, String owner) {
|
||||||
LOGGER.debug("entry to lockJob(jobId = {}, owner = {})", job.getJobId(), owner);
|
|
||||||
try {
|
try {
|
||||||
taskanaEngineImpl.openConnection();
|
taskanaEngineImpl.openConnection();
|
||||||
job.setLockedBy(owner);
|
job.setLockedBy(owner);
|
||||||
job.setLockExpires(Instant.now().plusMillis(DEFAULT_LOCK_EXPIRATION_PERIOD));
|
job.setLockExpires(Instant.now().plusMillis(DEFAULT_LOCK_EXPIRATION_PERIOD));
|
||||||
job.setRetryCount(job.getRetryCount() - 1);
|
job.setRetryCount(job.getRetryCount() - 1);
|
||||||
jobMapper.update(job);
|
jobMapper.update(job);
|
||||||
LOGGER.debug("Job {} locked. Remaining retries: {}", job.getJobId(), job.getRetryCount());
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Job {} locked. Remaining retries: {}", job.getJobId(), job.getRetryCount());
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngineImpl.returnConnection();
|
taskanaEngineImpl.returnConnection();
|
||||||
LOGGER.debug("exit from lockJob()");
|
|
||||||
}
|
}
|
||||||
return job;
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ScheduledJob> findJobsToRun() {
|
public List<ScheduledJob> findJobsToRun() {
|
||||||
LOGGER.debug("entry to findJobsToRun");
|
|
||||||
List<ScheduledJob> availableJobs;
|
List<ScheduledJob> availableJobs;
|
||||||
try {
|
try {
|
||||||
taskanaEngineImpl.openConnection();
|
taskanaEngineImpl.openConnection();
|
||||||
availableJobs = jobMapper.findJobsToRun(Instant.now());
|
availableJobs = jobMapper.findJobsToRun(Instant.now());
|
||||||
LOGGER.debug("Found available jobs: {}", availableJobs);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Found available jobs: {}", availableJobs);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngineImpl.returnConnection();
|
taskanaEngineImpl.returnConnection();
|
||||||
LOGGER.debug("exit from findJobsToRun()");
|
|
||||||
}
|
}
|
||||||
return availableJobs;
|
return availableJobs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteJob(ScheduledJob job) {
|
public void deleteJob(ScheduledJob job) {
|
||||||
LOGGER.debug("entry to deleteJob(jobId = {})", job.getJobId());
|
|
||||||
try {
|
try {
|
||||||
taskanaEngineImpl.openConnection();
|
taskanaEngineImpl.openConnection();
|
||||||
jobMapper.delete(job);
|
jobMapper.delete(job);
|
||||||
LOGGER.debug("Deleted job: {}", job);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Deleted job: {}", job);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngineImpl.returnConnection();
|
taskanaEngineImpl.returnConnection();
|
||||||
LOGGER.debug("exit from deleteJob()");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ScheduledJob initializeJobDefault(ScheduledJob job) {
|
private ScheduledJob initializeJobDefault(ScheduledJob job) {
|
||||||
LOGGER.debug("entry to initializeJobDefault(job = {})", job);
|
|
||||||
job.setCreated(Instant.now());
|
job.setCreated(Instant.now());
|
||||||
job.setState(ScheduledJob.State.READY);
|
job.setState(ScheduledJob.State.READY);
|
||||||
job.setPriority(JOB_DEFAULT_PRIORITY);
|
job.setPriority(JOB_DEFAULT_PRIORITY);
|
||||||
|
@ -103,7 +102,9 @@ public class JobServiceImpl implements JobService {
|
||||||
job.setDue(Instant.now());
|
job.setDue(Instant.now());
|
||||||
}
|
}
|
||||||
job.setRetryCount(taskanaEngineImpl.getEngine().getConfiguration().getMaxNumberOfJobRetries());
|
job.setRetryCount(taskanaEngineImpl.getEngine().getConfiguration().getMaxNumberOfJobRetries());
|
||||||
LOGGER.debug("Job after initialization: {}", job);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Job after initialization: {}", job);
|
||||||
|
}
|
||||||
return job;
|
return job;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@ public class JobRunner {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void runJobs() {
|
public void runJobs() {
|
||||||
LOGGER.info("entry to runJobs()");
|
|
||||||
try {
|
try {
|
||||||
List<ScheduledJob> jobsToRun = findAndLockJobsToRun();
|
List<ScheduledJob> jobsToRun = findAndLockJobsToRun();
|
||||||
for (ScheduledJob scheduledJob : jobsToRun) {
|
for (ScheduledJob scheduledJob : jobsToRun) {
|
||||||
|
@ -45,8 +44,6 @@ public class JobRunner {
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOGGER.error("Error occurred while running jobs: ", e);
|
LOGGER.error("Error occurred while running jobs: ", e);
|
||||||
} finally {
|
|
||||||
LOGGER.info("exit from runJobs().");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +63,9 @@ public class JobRunner {
|
||||||
} else {
|
} else {
|
||||||
lockedJob = lockJob(job);
|
lockedJob = lockJob(job);
|
||||||
}
|
}
|
||||||
LOGGER.debug("Locked job: {}", lockedJob);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Locked job: {}", lockedJob);
|
||||||
|
}
|
||||||
return lockedJob;
|
return lockedJob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +102,6 @@ public class JobRunner {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void runScheduledJob(ScheduledJob scheduledJob) {
|
private void runScheduledJob(ScheduledJob scheduledJob) {
|
||||||
LOGGER.debug("entry to runScheduledJob(job = {})", scheduledJob);
|
|
||||||
|
|
||||||
if (taskanaEngine.isUserInRole(TaskanaRole.ADMIN)) {
|
if (taskanaEngine.isUserInRole(TaskanaRole.ADMIN)) {
|
||||||
// we run already as admin
|
// we run already as admin
|
||||||
|
@ -125,7 +123,6 @@ public class JobRunner {
|
||||||
LOGGER.warn("Attempt to run job {} failed.", scheduledJob, e);
|
LOGGER.warn("Attempt to run job {} failed.", scheduledJob, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from runScheduledJob");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void runScheduledJobImpl(ScheduledJob scheduledJob) {
|
private void runScheduledJobImpl(ScheduledJob scheduledJob) {
|
||||||
|
|
|
@ -2,8 +2,6 @@ package pro.taskana.monitor.internal.reports;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.common.api.TaskanaRole;
|
import pro.taskana.common.api.TaskanaRole;
|
||||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||||
|
@ -22,9 +20,6 @@ public class ClassificationCategoryReportBuilderImpl
|
||||||
extends TimeIntervalReportBuilderImpl<Builder, MonitorQueryItem, TimeIntervalColumnHeader>
|
extends TimeIntervalReportBuilderImpl<Builder, MonitorQueryItem, TimeIntervalColumnHeader>
|
||||||
implements ClassificationCategoryReport.Builder {
|
implements ClassificationCategoryReport.Builder {
|
||||||
|
|
||||||
private static final Logger LOGGER =
|
|
||||||
LoggerFactory.getLogger(ClassificationCategoryReportBuilderImpl.class);
|
|
||||||
|
|
||||||
public ClassificationCategoryReportBuilderImpl(
|
public ClassificationCategoryReportBuilderImpl(
|
||||||
InternalTaskanaEngine taskanaEngine, MonitorMapper monitorMapper) {
|
InternalTaskanaEngine taskanaEngine, MonitorMapper monitorMapper) {
|
||||||
super(taskanaEngine, monitorMapper);
|
super(taskanaEngine, monitorMapper);
|
||||||
|
@ -39,7 +34,6 @@ public class ClassificationCategoryReportBuilderImpl
|
||||||
@Override
|
@Override
|
||||||
public ClassificationCategoryReport buildReport(TaskTimestamp timestamp)
|
public ClassificationCategoryReport buildReport(TaskTimestamp timestamp)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
LOGGER.debug("entry to buildReport(), this = {}", this);
|
|
||||||
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR);
|
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR);
|
||||||
try {
|
try {
|
||||||
this.taskanaEngine.openConnection();
|
this.taskanaEngine.openConnection();
|
||||||
|
@ -62,7 +56,6 @@ public class ClassificationCategoryReportBuilderImpl
|
||||||
return report;
|
return report;
|
||||||
} finally {
|
} finally {
|
||||||
this.taskanaEngine.returnConnection();
|
this.taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from buildReport().");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,6 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.classification.api.ClassificationService;
|
import pro.taskana.classification.api.ClassificationService;
|
||||||
import pro.taskana.classification.api.models.ClassificationSummary;
|
import pro.taskana.classification.api.models.ClassificationSummary;
|
||||||
|
@ -30,8 +28,6 @@ public class ClassificationReportBuilderImpl
|
||||||
extends TimeIntervalReportBuilderImpl<Builder, MonitorQueryItem, TimeIntervalColumnHeader>
|
extends TimeIntervalReportBuilderImpl<Builder, MonitorQueryItem, TimeIntervalColumnHeader>
|
||||||
implements ClassificationReport.Builder {
|
implements ClassificationReport.Builder {
|
||||||
|
|
||||||
private static final Logger LOGGER =
|
|
||||||
LoggerFactory.getLogger(ClassificationReportBuilderImpl.class);
|
|
||||||
private final ClassificationService classificationService;
|
private final ClassificationService classificationService;
|
||||||
|
|
||||||
public ClassificationReportBuilderImpl(
|
public ClassificationReportBuilderImpl(
|
||||||
|
@ -49,7 +45,6 @@ public class ClassificationReportBuilderImpl
|
||||||
@Override
|
@Override
|
||||||
public ClassificationReport buildReport(TaskTimestamp timestamp)
|
public ClassificationReport buildReport(TaskTimestamp timestamp)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
LOGGER.debug("entry to buildReport(), this = {}", this);
|
|
||||||
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR, TaskanaRole.ADMIN);
|
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
this.taskanaEngine.openConnection();
|
this.taskanaEngine.openConnection();
|
||||||
|
@ -86,7 +81,6 @@ public class ClassificationReportBuilderImpl
|
||||||
return report;
|
return report;
|
||||||
} finally {
|
} finally {
|
||||||
this.taskanaEngine.returnConnection();
|
this.taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from buildReport().");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +93,6 @@ public class ClassificationReportBuilderImpl
|
||||||
@Override
|
@Override
|
||||||
public DetailedClassificationReport buildDetailedReport(TaskTimestamp timestamp)
|
public DetailedClassificationReport buildDetailedReport(TaskTimestamp timestamp)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
LOGGER.debug("entry to buildDetailedReport(), this = {}", this);
|
|
||||||
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR, TaskanaRole.ADMIN);
|
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
this.taskanaEngine.openConnection();
|
this.taskanaEngine.openConnection();
|
||||||
|
@ -141,7 +134,6 @@ public class ClassificationReportBuilderImpl
|
||||||
return report;
|
return report;
|
||||||
} finally {
|
} finally {
|
||||||
this.taskanaEngine.returnConnection();
|
this.taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from buildDetailedReport().");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,6 @@ package pro.taskana.monitor.internal.reports;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.common.api.TaskanaRole;
|
import pro.taskana.common.api.TaskanaRole;
|
||||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||||
|
@ -23,9 +21,6 @@ public class TaskCustomFieldValueReportBuilderImpl
|
||||||
extends TimeIntervalReportBuilderImpl<Builder, MonitorQueryItem, TimeIntervalColumnHeader>
|
extends TimeIntervalReportBuilderImpl<Builder, MonitorQueryItem, TimeIntervalColumnHeader>
|
||||||
implements TaskCustomFieldValueReport.Builder {
|
implements TaskCustomFieldValueReport.Builder {
|
||||||
|
|
||||||
private static final Logger LOGGER =
|
|
||||||
LoggerFactory.getLogger(TaskCustomFieldValueReportBuilderImpl.class);
|
|
||||||
|
|
||||||
private final TaskCustomField taskCustomField;
|
private final TaskCustomField taskCustomField;
|
||||||
|
|
||||||
public TaskCustomFieldValueReportBuilderImpl(
|
public TaskCustomFieldValueReportBuilderImpl(
|
||||||
|
@ -45,7 +40,6 @@ public class TaskCustomFieldValueReportBuilderImpl
|
||||||
@Override
|
@Override
|
||||||
public TaskCustomFieldValueReport buildReport(TaskTimestamp timestamp)
|
public TaskCustomFieldValueReport buildReport(TaskTimestamp timestamp)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
LOGGER.debug("entry to buildReport(taskCustomField = {}), this = {}", taskCustomField, this);
|
|
||||||
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR);
|
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR);
|
||||||
try {
|
try {
|
||||||
this.taskanaEngine.openConnection();
|
this.taskanaEngine.openConnection();
|
||||||
|
@ -70,7 +64,6 @@ public class TaskCustomFieldValueReportBuilderImpl
|
||||||
return report;
|
return report;
|
||||||
} finally {
|
} finally {
|
||||||
this.taskanaEngine.returnConnection();
|
this.taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from buildReport().");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@ package pro.taskana.monitor.internal.reports;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.common.api.TaskanaRole;
|
import pro.taskana.common.api.TaskanaRole;
|
||||||
import pro.taskana.common.api.exceptions.NotAuthorizedException;
|
import pro.taskana.common.api.exceptions.NotAuthorizedException;
|
||||||
|
@ -20,7 +18,6 @@ import pro.taskana.workbasket.api.models.WorkbasketSummary;
|
||||||
/** The implementation of TaskStatusReportBuilder. */
|
/** The implementation of TaskStatusReportBuilder. */
|
||||||
public class TaskStatusReportBuilderImpl implements TaskStatusReport.Builder {
|
public class TaskStatusReportBuilderImpl implements TaskStatusReport.Builder {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TaskStatusReportBuilderImpl.class);
|
|
||||||
private final InternalTaskanaEngine taskanaEngine;
|
private final InternalTaskanaEngine taskanaEngine;
|
||||||
private final MonitorMapper monitorMapper;
|
private final MonitorMapper monitorMapper;
|
||||||
private final WorkbasketService workbasketService;
|
private final WorkbasketService workbasketService;
|
||||||
|
@ -38,7 +35,6 @@ public class TaskStatusReportBuilderImpl implements TaskStatusReport.Builder {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TaskStatusReport buildReport() throws NotAuthorizedException {
|
public TaskStatusReport buildReport() throws NotAuthorizedException {
|
||||||
LOGGER.debug("entry to buildReport(), this = {}", this);
|
|
||||||
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR, TaskanaRole.ADMIN);
|
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
this.taskanaEngine.openConnection();
|
this.taskanaEngine.openConnection();
|
||||||
|
@ -48,20 +44,25 @@ public class TaskStatusReportBuilderImpl implements TaskStatusReport.Builder {
|
||||||
TaskStatusReport report = new TaskStatusReport(this.states);
|
TaskStatusReport report = new TaskStatusReport(this.states);
|
||||||
report.addItems(tasks);
|
report.addItems(tasks);
|
||||||
Map<String, String> displayMap =
|
Map<String, String> displayMap =
|
||||||
taskanaEngine.getEngine().runAsAdmin(
|
taskanaEngine
|
||||||
() ->
|
.getEngine()
|
||||||
workbasketService.createWorkbasketQuery()
|
.runAsAdmin(
|
||||||
.keyIn(report.getRows().keySet().toArray(new String[0]))
|
() ->
|
||||||
.domainIn(domains != null ? domains.toArray(new String[0]) : null).list()
|
workbasketService
|
||||||
.stream()
|
.createWorkbasketQuery()
|
||||||
.collect(
|
.keyIn(report.getRows().keySet().toArray(new String[0]))
|
||||||
Collectors.toMap(
|
.domainIn(domains != null ? domains.toArray(new String[0]) : null)
|
||||||
WorkbasketSummary::getKey, WorkbasketSummary::getName, (a, b) -> a)));
|
.list()
|
||||||
|
.stream()
|
||||||
|
.collect(
|
||||||
|
Collectors.toMap(
|
||||||
|
WorkbasketSummary::getKey,
|
||||||
|
WorkbasketSummary::getName,
|
||||||
|
(a, b) -> a)));
|
||||||
report.augmentDisplayNames(displayMap);
|
report.augmentDisplayNames(displayMap);
|
||||||
return report;
|
return report;
|
||||||
} finally {
|
} finally {
|
||||||
this.taskanaEngine.returnConnection();
|
this.taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from buildReport().");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.common.api.TaskanaRole;
|
import pro.taskana.common.api.TaskanaRole;
|
||||||
import pro.taskana.common.api.WorkingDaysToDaysConverter;
|
import pro.taskana.common.api.WorkingDaysToDaysConverter;
|
||||||
|
@ -40,8 +38,6 @@ abstract class TimeIntervalReportBuilderImpl<
|
||||||
H extends TimeIntervalColumnHeader>
|
H extends TimeIntervalColumnHeader>
|
||||||
implements TimeIntervalReportBuilder<B, I, H> {
|
implements TimeIntervalReportBuilder<B, I, H> {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TimeIntervalReportBuilder.class);
|
|
||||||
|
|
||||||
protected InternalTaskanaEngine taskanaEngine;
|
protected InternalTaskanaEngine taskanaEngine;
|
||||||
protected MonitorMapper monitorMapper;
|
protected MonitorMapper monitorMapper;
|
||||||
protected List<H> columnHeaders;
|
protected List<H> columnHeaders;
|
||||||
|
@ -120,12 +116,6 @@ abstract class TimeIntervalReportBuilderImpl<
|
||||||
public List<String> listTaskIdsForSelectedItems(
|
public List<String> listTaskIdsForSelectedItems(
|
||||||
List<SelectedItem> selectedItems, TaskTimestamp timestamp)
|
List<SelectedItem> selectedItems, TaskTimestamp timestamp)
|
||||||
throws NotAuthorizedException, InvalidArgumentException {
|
throws NotAuthorizedException, InvalidArgumentException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to listTaskIdsForSelectedItems(selectedItems = {}), this = {}",
|
|
||||||
selectedItems,
|
|
||||||
this);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR);
|
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR);
|
||||||
try {
|
try {
|
||||||
|
@ -162,17 +152,12 @@ abstract class TimeIntervalReportBuilderImpl<
|
||||||
joinWithAttachments);
|
joinWithAttachments);
|
||||||
} finally {
|
} finally {
|
||||||
this.taskanaEngine.returnConnection();
|
this.taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from listTaskIdsForSelectedItems().");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> listCustomAttributeValuesForCustomAttributeName(
|
public List<String> listCustomAttributeValuesForCustomAttributeName(
|
||||||
TaskCustomField taskCustomField) throws NotAuthorizedException {
|
TaskCustomField taskCustomField) throws NotAuthorizedException {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to listCustomAttributeValuesForCustomAttributeName(customField = {}), this = {}",
|
|
||||||
taskCustomField,
|
|
||||||
this);
|
|
||||||
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR);
|
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR);
|
||||||
try {
|
try {
|
||||||
this.taskanaEngine.openConnection();
|
this.taskanaEngine.openConnection();
|
||||||
|
@ -188,7 +173,6 @@ abstract class TimeIntervalReportBuilderImpl<
|
||||||
taskCustomField);
|
taskCustomField);
|
||||||
} finally {
|
} finally {
|
||||||
this.taskanaEngine.returnConnection();
|
this.taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from listCustomAttributeValuesForCustomAttributeName().");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,6 @@ import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.common.api.TaskanaRole;
|
import pro.taskana.common.api.TaskanaRole;
|
||||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||||
|
@ -29,7 +27,6 @@ public class TimestampReportBuilderImpl
|
||||||
extends TimeIntervalReportBuilderImpl<Builder, TimestampQueryItem, TimeIntervalColumnHeader>
|
extends TimeIntervalReportBuilderImpl<Builder, TimestampQueryItem, TimeIntervalColumnHeader>
|
||||||
implements TimestampReport.Builder {
|
implements TimestampReport.Builder {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TimestampReportBuilderImpl.class);
|
|
||||||
private List<TaskTimestamp> status =
|
private List<TaskTimestamp> status =
|
||||||
Arrays.asList(TaskTimestamp.CREATED, TaskTimestamp.COMPLETED);
|
Arrays.asList(TaskTimestamp.CREATED, TaskTimestamp.COMPLETED);
|
||||||
|
|
||||||
|
@ -64,7 +61,6 @@ public class TimestampReportBuilderImpl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TimestampReport buildReport() throws NotAuthorizedException, InvalidArgumentException {
|
public TimestampReport buildReport() throws NotAuthorizedException, InvalidArgumentException {
|
||||||
LOGGER.debug("entry to buildDetailedReport(), this = {}", this);
|
|
||||||
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR, TaskanaRole.ADMIN);
|
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
this.taskanaEngine.openConnection();
|
this.taskanaEngine.openConnection();
|
||||||
|
@ -84,7 +80,6 @@ public class TimestampReportBuilderImpl
|
||||||
return report;
|
return report;
|
||||||
} finally {
|
} finally {
|
||||||
this.taskanaEngine.returnConnection();
|
this.taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from buildDetailedReport().");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,6 @@ import java.time.Instant;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.common.api.TaskanaRole;
|
import pro.taskana.common.api.TaskanaRole;
|
||||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||||
|
@ -27,7 +25,6 @@ public class WorkbasketReportBuilderImpl
|
||||||
extends TimeIntervalReportBuilderImpl<Builder, MonitorQueryItem, TimeIntervalColumnHeader>
|
extends TimeIntervalReportBuilderImpl<Builder, MonitorQueryItem, TimeIntervalColumnHeader>
|
||||||
implements WorkbasketReport.Builder {
|
implements WorkbasketReport.Builder {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(WorkbasketReportBuilderImpl.class);
|
|
||||||
private final WorkbasketService workbasketService;
|
private final WorkbasketService workbasketService;
|
||||||
private List<CombinedClassificationFilter> combinedClassificationFilter;
|
private List<CombinedClassificationFilter> combinedClassificationFilter;
|
||||||
|
|
||||||
|
@ -45,7 +42,6 @@ public class WorkbasketReportBuilderImpl
|
||||||
@Override
|
@Override
|
||||||
public WorkbasketReport buildReport(TaskTimestamp timestamp)
|
public WorkbasketReport buildReport(TaskTimestamp timestamp)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
LOGGER.debug("entry to buildReport(), this = {}", this);
|
|
||||||
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR, TaskanaRole.ADMIN);
|
this.taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.MONITOR, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
this.taskanaEngine.openConnection();
|
this.taskanaEngine.openConnection();
|
||||||
|
@ -68,22 +64,25 @@ public class WorkbasketReportBuilderImpl
|
||||||
this.columnHeaders, converter, this.inWorkingDays));
|
this.columnHeaders, converter, this.inWorkingDays));
|
||||||
|
|
||||||
Map<String, String> displayMap =
|
Map<String, String> displayMap =
|
||||||
taskanaEngine.getEngine().runAsAdmin(
|
taskanaEngine
|
||||||
() ->
|
.getEngine()
|
||||||
workbasketService
|
.runAsAdmin(
|
||||||
.createWorkbasketQuery()
|
() ->
|
||||||
.keyIn(report.getRows().keySet().toArray(new String[0]))
|
workbasketService
|
||||||
.domainIn(domains != null ? domains.toArray(new String[0]) : null)
|
.createWorkbasketQuery()
|
||||||
.list()
|
.keyIn(report.getRows().keySet().toArray(new String[0]))
|
||||||
.stream()
|
.domainIn(domains != null ? domains.toArray(new String[0]) : null)
|
||||||
.collect(
|
.list()
|
||||||
Collectors.toMap(
|
.stream()
|
||||||
WorkbasketSummary::getKey, WorkbasketSummary::getName, (a, b) -> a)));
|
.collect(
|
||||||
|
Collectors.toMap(
|
||||||
|
WorkbasketSummary::getKey,
|
||||||
|
WorkbasketSummary::getName,
|
||||||
|
(a, b) -> a)));
|
||||||
report.augmentDisplayNames(displayMap);
|
report.augmentDisplayNames(displayMap);
|
||||||
return report;
|
return report;
|
||||||
} finally {
|
} finally {
|
||||||
this.taskanaEngine.returnConnection();
|
this.taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from buildReport().");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,9 @@ public final class HistoryEventManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createEvent(TaskHistoryEvent event) {
|
public void createEvent(TaskHistoryEvent event) {
|
||||||
LOGGER.debug("Sending event to history service providers: {}", event);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Sending event to history service providers: {}", event);
|
||||||
|
}
|
||||||
serviceLoader.forEach(
|
serviceLoader.forEach(
|
||||||
historyProvider -> {
|
historyProvider -> {
|
||||||
try {
|
try {
|
||||||
|
@ -62,7 +64,9 @@ public final class HistoryEventManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createEvent(WorkbasketHistoryEvent event) {
|
public void createEvent(WorkbasketHistoryEvent event) {
|
||||||
LOGGER.debug("Sending event to history service providers: {}", event);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Sending event to history service providers: {}", event);
|
||||||
|
}
|
||||||
serviceLoader.forEach(
|
serviceLoader.forEach(
|
||||||
historyProvider -> {
|
historyProvider -> {
|
||||||
try {
|
try {
|
||||||
|
@ -79,7 +83,9 @@ public final class HistoryEventManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createEvent(ClassificationHistoryEvent event) {
|
public void createEvent(ClassificationHistoryEvent event) {
|
||||||
LOGGER.debug("Sending event to history service providers: {}", event);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Sending event to history service providers: {}", event);
|
||||||
|
}
|
||||||
serviceLoader.forEach(
|
serviceLoader.forEach(
|
||||||
historyProvider -> {
|
historyProvider -> {
|
||||||
try {
|
try {
|
||||||
|
@ -97,7 +103,9 @@ public final class HistoryEventManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteEvents(List<String> taskIds) {
|
public void deleteEvents(List<String> taskIds) {
|
||||||
LOGGER.debug("Sending taskIds to history service providers: {}", taskIds);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Sending taskIds to history service providers: {}", taskIds);
|
||||||
|
}
|
||||||
serviceLoader.forEach(
|
serviceLoader.forEach(
|
||||||
historyProvider -> {
|
historyProvider -> {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -63,10 +63,6 @@ public final class TaskRoutingManager {
|
||||||
* @return the id of the workbasket in which the task is to be created.
|
* @return the id of the workbasket in which the task is to be created.
|
||||||
*/
|
*/
|
||||||
public String determineWorkbasketId(Task task) {
|
public String determineWorkbasketId(Task task) {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to routeToWorkbasket. TaskRouterr is enabled {}, task = {}",
|
|
||||||
isTaskRoutingEnabled(),
|
|
||||||
task);
|
|
||||||
String workbasketId = null;
|
String workbasketId = null;
|
||||||
if (isTaskRoutingEnabled()) {
|
if (isTaskRoutingEnabled()) {
|
||||||
// route to all TaskRoutingProviders
|
// route to all TaskRoutingProviders
|
||||||
|
@ -104,7 +100,6 @@ public final class TaskRoutingManager {
|
||||||
workbasketId = workbasketIds.stream().findFirst().orElse(null);
|
workbasketId = workbasketIds.stream().findFirst().orElse(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from routeToWorkbasketId. Destination WorkbasketId = {}", workbasketId);
|
|
||||||
return workbasketId;
|
return workbasketId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,9 @@ public class CreateTaskPreprocessorManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task processTaskBeforeCreation(Task taskToProcess) {
|
public Task processTaskBeforeCreation(Task taskToProcess) {
|
||||||
LOGGER.debug("Sending task to CreateTaskPreprocessor providers: {}", taskToProcess);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Sending task to CreateTaskPreprocessor providers: {}", taskToProcess);
|
||||||
|
}
|
||||||
serviceLoader.forEach(
|
serviceLoader.forEach(
|
||||||
createTaskPreprocessorProvider -> {
|
createTaskPreprocessorProvider -> {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,14 +1,11 @@
|
||||||
package pro.taskana.task.api.models;
|
package pro.taskana.task.api.models;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
import pro.taskana.common.api.exceptions.InvalidArgumentException;
|
||||||
|
|
||||||
/** ObjectReference entity. */
|
/** ObjectReference entity. */
|
||||||
public class ObjectReference {
|
public class ObjectReference {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ObjectReference.class);
|
|
||||||
private String id;
|
private String id;
|
||||||
private String company;
|
private String company;
|
||||||
private String system;
|
private String system;
|
||||||
|
@ -28,7 +25,6 @@ public class ObjectReference {
|
||||||
|
|
||||||
public static void validate(ObjectReference objectReference, String objRefType, String objName)
|
public static void validate(ObjectReference objectReference, String objRefType, String objName)
|
||||||
throws InvalidArgumentException {
|
throws InvalidArgumentException {
|
||||||
LOGGER.debug("entry to validateObjectReference()");
|
|
||||||
// check that all values in the ObjectReference are set correctly
|
// check that all values in the ObjectReference are set correctly
|
||||||
if (objectReference == null) {
|
if (objectReference == null) {
|
||||||
throw new InvalidArgumentException(
|
throw new InvalidArgumentException(
|
||||||
|
@ -43,7 +39,6 @@ public class ObjectReference {
|
||||||
throw new InvalidArgumentException(
|
throw new InvalidArgumentException(
|
||||||
String.format("Value of %s of %s must not be empty", objRefType, objName));
|
String.format("Value of %s of %s must not be empty", objRefType, objName));
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from validateObjectReference()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
|
|
|
@ -37,7 +37,6 @@ public class AttachmentHandler {
|
||||||
|
|
||||||
List<Attachment> augmentAttachmentsByClassification(
|
List<Attachment> augmentAttachmentsByClassification(
|
||||||
List<AttachmentImpl> attachmentImpls, BulkOperationResults<String, Exception> bulkLog) {
|
List<AttachmentImpl> attachmentImpls, BulkOperationResults<String, Exception> bulkLog) {
|
||||||
LOGGER.debug("entry to augmentAttachmentsByClassification()");
|
|
||||||
List<Attachment> result = new ArrayList<>();
|
List<Attachment> result = new ArrayList<>();
|
||||||
if (attachmentImpls == null || attachmentImpls.isEmpty()) {
|
if (attachmentImpls == null || attachmentImpls.isEmpty()) {
|
||||||
return result;
|
return result;
|
||||||
|
@ -73,18 +72,12 @@ public class AttachmentHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug("exit from augmentAttachmentsByClassification()");
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void insertAndDeleteAttachmentsOnTaskUpdate(TaskImpl newTaskImpl, TaskImpl oldTaskImpl)
|
void insertAndDeleteAttachmentsOnTaskUpdate(TaskImpl newTaskImpl, TaskImpl oldTaskImpl)
|
||||||
throws AttachmentPersistenceException {
|
throws AttachmentPersistenceException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to insertAndDeleteAttachmentsOnTaskUpdate(oldTaskImpl = {}, newTaskImpl = {})",
|
|
||||||
oldTaskImpl,
|
|
||||||
newTaskImpl);
|
|
||||||
}
|
|
||||||
List<Attachment> newAttachments =
|
List<Attachment> newAttachments =
|
||||||
newTaskImpl.getAttachments().stream().filter(Objects::nonNull).collect(Collectors.toList());
|
newTaskImpl.getAttachments().stream().filter(Objects::nonNull).collect(Collectors.toList());
|
||||||
newTaskImpl.setAttachments(newAttachments);
|
newTaskImpl.setAttachments(newAttachments);
|
||||||
|
@ -92,12 +85,6 @@ public class AttachmentHandler {
|
||||||
deleteRemovedAttachmentsOnTaskUpdate(newTaskImpl, oldTaskImpl);
|
deleteRemovedAttachmentsOnTaskUpdate(newTaskImpl, oldTaskImpl);
|
||||||
insertNewAttachmentsOnTaskUpdate(newTaskImpl, oldTaskImpl);
|
insertNewAttachmentsOnTaskUpdate(newTaskImpl, oldTaskImpl);
|
||||||
updateModifiedAttachmentsOnTaskUpdate(newTaskImpl, oldTaskImpl);
|
updateModifiedAttachmentsOnTaskUpdate(newTaskImpl, oldTaskImpl);
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from insertAndDeleteAttachmentsOnTaskUpdate(oldTaskImpl = {}, newTaskImpl = {})",
|
|
||||||
oldTaskImpl,
|
|
||||||
newTaskImpl);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateModifiedAttachmentsOnTaskUpdate(TaskImpl newTaskImpl, TaskImpl oldTaskImpl) {
|
void updateModifiedAttachmentsOnTaskUpdate(TaskImpl newTaskImpl, TaskImpl oldTaskImpl) {
|
||||||
|
@ -157,12 +144,6 @@ public class AttachmentHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
void deleteRemovedAttachmentsOnTaskUpdate(TaskImpl newTaskImpl, TaskImpl oldTaskImpl) {
|
void deleteRemovedAttachmentsOnTaskUpdate(TaskImpl newTaskImpl, TaskImpl oldTaskImpl) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to deleteRemovedAttachmentsOnTaskUpdate(oldTaskImpl = {}, newTaskImpl = {})",
|
|
||||||
oldTaskImpl,
|
|
||||||
newTaskImpl);
|
|
||||||
}
|
|
||||||
|
|
||||||
final List<Attachment> newAttachments = newTaskImpl.getAttachments();
|
final List<Attachment> newAttachments = newTaskImpl.getAttachments();
|
||||||
List<String> newAttachmentIds = new ArrayList<>();
|
List<String> newAttachmentIds = new ArrayList<>();
|
||||||
|
@ -177,28 +158,30 @@ public class AttachmentHandler {
|
||||||
a -> {
|
a -> {
|
||||||
if (!newAttIds.contains(a.getId())) {
|
if (!newAttIds.contains(a.getId())) {
|
||||||
attachmentMapper.delete(a.getId());
|
attachmentMapper.delete(a.getId());
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"TaskService.updateTask() for TaskId={} DELETED an Attachment={}.",
|
LOGGER.debug(
|
||||||
newTaskImpl.getId(),
|
"TaskService.updateTask() for TaskId={} DELETED an Attachment={}.",
|
||||||
a);
|
newTaskImpl.getId(),
|
||||||
|
a);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from deleteRemovedAttachmentsOnTaskUpdate()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void insertNewAttachmentOnTaskUpdate(TaskImpl newTaskImpl, Attachment attachment)
|
void insertNewAttachmentOnTaskUpdate(TaskImpl newTaskImpl, Attachment attachment)
|
||||||
throws AttachmentPersistenceException {
|
throws AttachmentPersistenceException {
|
||||||
LOGGER.debug("entry to insertNewAttachmentOnTaskUpdate()");
|
|
||||||
AttachmentImpl attachmentImpl = (AttachmentImpl) attachment;
|
AttachmentImpl attachmentImpl = (AttachmentImpl) attachment;
|
||||||
initAttachment(attachmentImpl, newTaskImpl);
|
initAttachment(attachmentImpl, newTaskImpl);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
attachmentMapper.insert(attachmentImpl);
|
attachmentMapper.insert(attachmentImpl);
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"TaskService.updateTask() for TaskId={} INSERTED an Attachment={}.",
|
LOGGER.debug(
|
||||||
newTaskImpl.getId(),
|
"TaskService.updateTask() for TaskId={} INSERTED an Attachment={}.",
|
||||||
attachmentImpl);
|
newTaskImpl.getId(),
|
||||||
|
attachmentImpl);
|
||||||
|
}
|
||||||
} catch (PersistenceException e) {
|
} catch (PersistenceException e) {
|
||||||
throw new AttachmentPersistenceException(
|
throw new AttachmentPersistenceException(
|
||||||
String.format(
|
String.format(
|
||||||
|
@ -206,11 +189,9 @@ public class AttachmentHandler {
|
||||||
attachmentImpl.getId(), newTaskImpl.getId()),
|
attachmentImpl.getId(), newTaskImpl.getId()),
|
||||||
e.getCause());
|
e.getCause());
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from insertNewAttachmentOnTaskUpdate(), returning");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void initAttachment(AttachmentImpl attachment, Task newTask) {
|
void initAttachment(AttachmentImpl attachment, Task newTask) {
|
||||||
LOGGER.debug("entry to initAttachment()");
|
|
||||||
if (attachment.getId() == null) {
|
if (attachment.getId() == null) {
|
||||||
attachment.setId(IdGenerator.generateWithPrefix(IdGenerator.ID_PREFIX_ATTACHMENT));
|
attachment.setId(IdGenerator.generateWithPrefix(IdGenerator.ID_PREFIX_ATTACHMENT));
|
||||||
}
|
}
|
||||||
|
@ -223,21 +204,21 @@ public class AttachmentHandler {
|
||||||
if (attachment.getTaskId() == null) {
|
if (attachment.getTaskId() == null) {
|
||||||
attachment.setTaskId(newTask.getId());
|
attachment.setTaskId(newTask.getId());
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from initAttachment()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeAndInsertAttachment(TaskImpl task, AttachmentImpl attachmentImpl)
|
private void initializeAndInsertAttachment(TaskImpl task, AttachmentImpl attachmentImpl)
|
||||||
throws AttachmentPersistenceException, InvalidArgumentException {
|
throws AttachmentPersistenceException, InvalidArgumentException {
|
||||||
LOGGER.debug("entry to initializeAndInsertAttachment()");
|
|
||||||
initAttachment(attachmentImpl, task);
|
initAttachment(attachmentImpl, task);
|
||||||
ObjectReference objRef = attachmentImpl.getObjectReference();
|
ObjectReference objRef = attachmentImpl.getObjectReference();
|
||||||
ObjectReference.validate(objRef, "ObjectReference", "Attachment");
|
ObjectReference.validate(objRef, "ObjectReference", "Attachment");
|
||||||
try {
|
try {
|
||||||
attachmentMapper.insert(attachmentImpl);
|
attachmentMapper.insert(attachmentImpl);
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"TaskService.updateTask() for TaskId={} INSERTED an Attachment={}.",
|
LOGGER.debug(
|
||||||
task.getId(),
|
"TaskService.updateTask() for TaskId={} INSERTED an Attachment={}.",
|
||||||
attachmentImpl);
|
task.getId(),
|
||||||
|
attachmentImpl);
|
||||||
|
}
|
||||||
} catch (PersistenceException e) {
|
} catch (PersistenceException e) {
|
||||||
throw new AttachmentPersistenceException(
|
throw new AttachmentPersistenceException(
|
||||||
String.format(
|
String.format(
|
||||||
|
@ -245,6 +226,5 @@ public class AttachmentHandler {
|
||||||
attachmentImpl.getId(), task.getId()),
|
attachmentImpl.getId(), task.getId()),
|
||||||
e.getCause());
|
e.getCause());
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from initializeAndInsertAttachment()");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,6 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.ibatis.exceptions.PersistenceException;
|
import org.apache.ibatis.exceptions.PersistenceException;
|
||||||
import org.apache.ibatis.session.RowBounds;
|
import org.apache.ibatis.session.RowBounds;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.common.api.exceptions.TaskanaRuntimeException;
|
import pro.taskana.common.api.exceptions.TaskanaRuntimeException;
|
||||||
import pro.taskana.common.internal.InternalTaskanaEngine;
|
import pro.taskana.common.internal.InternalTaskanaEngine;
|
||||||
|
@ -23,7 +21,6 @@ public class ObjectReferenceQueryImpl implements ObjectReferenceQuery {
|
||||||
"pro.taskana.task.internal.TaskQueryMapper.countQueryObjectReferences";
|
"pro.taskana.task.internal.TaskQueryMapper.countQueryObjectReferences";
|
||||||
private static final String LINK_TO_VALUEMAPPER =
|
private static final String LINK_TO_VALUEMAPPER =
|
||||||
"pro.taskana.task.internal.TaskQueryMapper.queryObjectReferenceColumnValues";
|
"pro.taskana.task.internal.TaskQueryMapper.queryObjectReferenceColumnValues";
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ObjectReferenceQueryImpl.class);
|
|
||||||
private final InternalTaskanaEngine taskanaEngine;
|
private final InternalTaskanaEngine taskanaEngine;
|
||||||
private final List<String> orderBy;
|
private final List<String> orderBy;
|
||||||
private ObjectReferenceQueryColumnName columnName;
|
private ObjectReferenceQueryColumnName columnName;
|
||||||
|
@ -70,7 +67,6 @@ public class ObjectReferenceQueryImpl implements ObjectReferenceQuery {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ObjectReference> list() {
|
public List<ObjectReference> list() {
|
||||||
LOGGER.debug("entry to list(), this = {}", this);
|
|
||||||
List<ObjectReference> result = new ArrayList<>();
|
List<ObjectReference> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -78,16 +74,11 @@ public class ObjectReferenceQueryImpl implements ObjectReferenceQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(). Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ObjectReference> list(int offset, int limit) {
|
public List<ObjectReference> list(int offset, int limit) {
|
||||||
LOGGER.debug("entry to list(offset = {}, limit = {}), this = {}", offset, limit, this);
|
|
||||||
List<ObjectReference> result = new ArrayList<>();
|
List<ObjectReference> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -105,19 +96,12 @@ public class ObjectReferenceQueryImpl implements ObjectReferenceQuery {
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(offset,limit). Returning {} resulting Objects: {} ",
|
|
||||||
result.size(),
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> listValues(
|
public List<String> listValues(
|
||||||
ObjectReferenceQueryColumnName columnName, SortDirection sortDirection) {
|
ObjectReferenceQueryColumnName columnName, SortDirection sortDirection) {
|
||||||
LOGGER.debug("Entry to listValues(dbColumnName={}) this = {}", columnName, this);
|
|
||||||
List<String> result = new ArrayList<>();
|
List<String> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -128,16 +112,11 @@ public class ObjectReferenceQueryImpl implements ObjectReferenceQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"Exit from listValues. Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ObjectReference single() {
|
public ObjectReference single() {
|
||||||
LOGGER.debug("entry to single(), this = {}", this);
|
|
||||||
ObjectReference result = null;
|
ObjectReference result = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -145,13 +124,11 @@ public class ObjectReferenceQueryImpl implements ObjectReferenceQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from single(). Returning result {} ", result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long count() {
|
public long count() {
|
||||||
LOGGER.debug("entry to count(), this = {}", this);
|
|
||||||
Long rowCount = null;
|
Long rowCount = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -159,7 +136,6 @@ public class ObjectReferenceQueryImpl implements ObjectReferenceQuery {
|
||||||
return (rowCount == null) ? 0L : rowCount;
|
return (rowCount == null) ? 0L : rowCount;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from count(). Returning result {} ", rowCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,13 +37,9 @@ class TaskCommentServiceImpl {
|
||||||
|
|
||||||
TaskComment newTaskComment(String taskId) {
|
TaskComment newTaskComment(String taskId) {
|
||||||
|
|
||||||
LOGGER.debug("entry to newTaskComment (taskId = {})", taskId);
|
|
||||||
|
|
||||||
TaskCommentImpl taskComment = new TaskCommentImpl();
|
TaskCommentImpl taskComment = new TaskCommentImpl();
|
||||||
taskComment.setTaskId(taskId);
|
taskComment.setTaskId(taskId);
|
||||||
|
|
||||||
LOGGER.debug("exit from newTaskComment(), returning {}", taskComment);
|
|
||||||
|
|
||||||
return taskComment;
|
return taskComment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,8 +47,6 @@ class TaskCommentServiceImpl {
|
||||||
throws NotAuthorizedException, ConcurrencyException, TaskCommentNotFoundException,
|
throws NotAuthorizedException, ConcurrencyException, TaskCommentNotFoundException,
|
||||||
TaskNotFoundException, InvalidArgumentException {
|
TaskNotFoundException, InvalidArgumentException {
|
||||||
|
|
||||||
LOGGER.debug("entry to updateTaskComment (taskComment = {})", taskCommentToUpdate);
|
|
||||||
|
|
||||||
String userId = taskanaEngine.getEngine().getCurrentUserContext().getUserid();
|
String userId = taskanaEngine.getEngine().getCurrentUserContext().getUserid();
|
||||||
|
|
||||||
TaskCommentImpl taskCommentImplToUpdate = (TaskCommentImpl) taskCommentToUpdate;
|
TaskCommentImpl taskCommentImplToUpdate = (TaskCommentImpl) taskCommentToUpdate;
|
||||||
|
@ -73,10 +67,12 @@ class TaskCommentServiceImpl {
|
||||||
|
|
||||||
taskCommentMapper.update(taskCommentImplToUpdate);
|
taskCommentMapper.update(taskCommentImplToUpdate);
|
||||||
|
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Method updateTaskComment() updated taskComment '{}' for user '{}'.",
|
LOGGER.debug(
|
||||||
taskCommentImplToUpdate.getId(),
|
"Method updateTaskComment() updated taskComment '{}' for user '{}'.",
|
||||||
userId);
|
taskCommentImplToUpdate.getId(),
|
||||||
|
userId);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new NotAuthorizedException(
|
throw new NotAuthorizedException(
|
||||||
|
@ -88,7 +84,6 @@ class TaskCommentServiceImpl {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from updateTaskComment()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return taskCommentImplToUpdate;
|
return taskCommentImplToUpdate;
|
||||||
|
@ -97,8 +92,6 @@ class TaskCommentServiceImpl {
|
||||||
TaskComment createTaskComment(TaskComment taskCommentToCreate)
|
TaskComment createTaskComment(TaskComment taskCommentToCreate)
|
||||||
throws NotAuthorizedException, TaskNotFoundException, InvalidArgumentException {
|
throws NotAuthorizedException, TaskNotFoundException, InvalidArgumentException {
|
||||||
|
|
||||||
LOGGER.debug("entry to setTaskComment (taskCommentToCreate = {})", taskCommentToCreate);
|
|
||||||
|
|
||||||
TaskCommentImpl taskCommentImplToCreate = (TaskCommentImpl) taskCommentToCreate;
|
TaskCommentImpl taskCommentImplToCreate = (TaskCommentImpl) taskCommentToCreate;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -114,10 +107,7 @@ class TaskCommentServiceImpl {
|
||||||
taskCommentMapper.insert(taskCommentImplToCreate);
|
taskCommentMapper.insert(taskCommentImplToCreate);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
|
|
||||||
LOGGER.debug("exit from setTaskComment()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return taskCommentImplToCreate;
|
return taskCommentImplToCreate;
|
||||||
|
@ -127,8 +117,6 @@ class TaskCommentServiceImpl {
|
||||||
throws NotAuthorizedException, TaskCommentNotFoundException, TaskNotFoundException,
|
throws NotAuthorizedException, TaskCommentNotFoundException, TaskNotFoundException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
|
|
||||||
LOGGER.debug("entry to deleteTaskComment (taskComment = {}", taskCommentId);
|
|
||||||
|
|
||||||
String userId = taskanaEngine.getEngine().getCurrentUserContext().getUserid();
|
String userId = taskanaEngine.getEngine().getCurrentUserContext().getUserid();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -143,7 +131,9 @@ class TaskCommentServiceImpl {
|
||||||
|
|
||||||
taskCommentMapper.delete(taskCommentId);
|
taskCommentMapper.delete(taskCommentId);
|
||||||
|
|
||||||
LOGGER.debug("taskComment {} deleted", taskCommentToDelete.getId());
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("taskComment {} deleted", taskCommentToDelete.getId());
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new NotAuthorizedException(
|
throw new NotAuthorizedException(
|
||||||
|
@ -156,15 +146,12 @@ class TaskCommentServiceImpl {
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from deleteTaskComment()");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<TaskComment> getTaskComments(String taskId)
|
List<TaskComment> getTaskComments(String taskId)
|
||||||
throws NotAuthorizedException, TaskNotFoundException {
|
throws NotAuthorizedException, TaskNotFoundException {
|
||||||
|
|
||||||
LOGGER.debug("entry to getTaskComments (taskId = {})", taskId);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -173,17 +160,14 @@ class TaskCommentServiceImpl {
|
||||||
|
|
||||||
List<TaskComment> taskComments = new ArrayList<>(taskCommentMapper.findByTaskId(taskId));
|
List<TaskComment> taskComments = new ArrayList<>(taskCommentMapper.findByTaskId(taskId));
|
||||||
|
|
||||||
if (taskComments.isEmpty()) {
|
if (taskComments.isEmpty() && LOGGER.isDebugEnabled()) {
|
||||||
LOGGER.debug("getTaskComments() found no comments for the provided taskId");
|
LOGGER.debug("getTaskComments() found no comments for the provided taskId");
|
||||||
}
|
}
|
||||||
|
|
||||||
return taskComments;
|
return taskComments;
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
|
|
||||||
LOGGER.debug("exit from getTaskComments()");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,8 +175,6 @@ class TaskCommentServiceImpl {
|
||||||
throws TaskCommentNotFoundException, NotAuthorizedException, TaskNotFoundException,
|
throws TaskCommentNotFoundException, NotAuthorizedException, TaskNotFoundException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
|
|
||||||
LOGGER.debug("entry to getTaskComment (taskCommentId = {})", taskCommentId);
|
|
||||||
|
|
||||||
TaskCommentImpl result;
|
TaskCommentImpl result;
|
||||||
|
|
||||||
verifyTaskCommentIdIsNotNullOrEmpty(taskCommentId);
|
verifyTaskCommentIdIsNotNullOrEmpty(taskCommentId);
|
||||||
|
@ -214,10 +196,7 @@ class TaskCommentServiceImpl {
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
|
|
||||||
LOGGER.debug("exit from getTaskComment()");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -919,7 +919,6 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
public List<TaskSummary> list() {
|
public List<TaskSummary> list() {
|
||||||
List<TaskSummary> result = new ArrayList<>();
|
List<TaskSummary> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
LOGGER.debug("entry to list(), this = {}", this);
|
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
checkForIllegalParamCombinations();
|
checkForIllegalParamCombinations();
|
||||||
checkOpenAndReadPermissionForSpecifiedWorkbaskets();
|
checkOpenAndReadPermissionForSpecifiedWorkbaskets();
|
||||||
|
@ -927,23 +926,16 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
setupAccessIds();
|
setupAccessIds();
|
||||||
List<TaskSummaryImpl> tasks =
|
List<TaskSummaryImpl> tasks =
|
||||||
taskanaEngine.getSqlSession().selectList(getLinkToMapperScript(), this);
|
taskanaEngine.getSqlSession().selectList(getLinkToMapperScript(), this);
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("mapper returned {} resulting Objects: {} ", tasks.size(), tasks);
|
|
||||||
}
|
|
||||||
result = taskService.augmentTaskSummariesByContainedSummariesWithPartitioning(tasks);
|
result = taskService.augmentTaskSummariesByContainedSummariesWithPartitioning(tasks);
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(). Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TaskSummary> list(int offset, int limit) {
|
public List<TaskSummary> list(int offset, int limit) {
|
||||||
LOGGER.debug("entry to list(offset = {}, limit = {}), this = {}", offset, limit, this);
|
|
||||||
List<TaskSummary> result = new ArrayList<>();
|
List<TaskSummary> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -967,18 +959,11 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(offset,limit). Returning {} resulting Objects: {} ",
|
|
||||||
result.size(),
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> listValues(TaskQueryColumnName columnName, SortDirection sortDirection) {
|
public List<String> listValues(TaskQueryColumnName columnName, SortDirection sortDirection) {
|
||||||
LOGGER.debug("Entry to listValues(dbColumnName={}) this = {}", columnName, this);
|
|
||||||
List<String> result = new ArrayList<>();
|
List<String> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -1006,16 +991,11 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"Exit from listValues. Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TaskSummary single() {
|
public TaskSummary single() {
|
||||||
LOGGER.debug("entry to single(), this = {}", this);
|
|
||||||
TaskSummary result = null;
|
TaskSummary result = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -1036,13 +1016,11 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from single(). Returning result {} ", result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long count() {
|
public long count() {
|
||||||
LOGGER.debug("entry to count(), this = {}", this);
|
|
||||||
Long rowCount = null;
|
Long rowCount = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -1053,7 +1031,6 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
return (rowCount == null) ? 0L : rowCount;
|
return (rowCount == null) ? 0L : rowCount;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from count(). Returning result {} ", rowCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1627,7 +1604,9 @@ public class TaskQueryImpl implements TaskQuery {
|
||||||
|
|
||||||
private void checkOpenAndReadPermissionForSpecifiedWorkbaskets() {
|
private void checkOpenAndReadPermissionForSpecifiedWorkbaskets() {
|
||||||
if (taskanaEngine.getEngine().isUserInRole(TaskanaRole.ADMIN, TaskanaRole.TASK_ADMIN)) {
|
if (taskanaEngine.getEngine().isUserInRole(TaskanaRole.ADMIN, TaskanaRole.TASK_ADMIN)) {
|
||||||
LOGGER.debug("Skipping permissions check since user is in role ADMIN or TASK_ADMIN.");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Skipping permissions check since user is in role ADMIN or TASK_ADMIN.");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -159,7 +159,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
public Task createTask(Task taskToCreate)
|
public Task createTask(Task taskToCreate)
|
||||||
throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException,
|
throws NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException,
|
||||||
TaskAlreadyExistException, InvalidArgumentException {
|
TaskAlreadyExistException, InvalidArgumentException {
|
||||||
LOGGER.debug("entry to createTask(task = {})", taskToCreate);
|
|
||||||
|
|
||||||
if (CreateTaskPreprocessorManager.isCreateTaskPreprocessorEnabled()) {
|
if (CreateTaskPreprocessorManager.isCreateTaskPreprocessorEnabled()) {
|
||||||
taskToCreate = createTaskPreprocessorManager.processTaskBeforeCreation(taskToCreate);
|
taskToCreate = createTaskPreprocessorManager.processTaskBeforeCreation(taskToCreate);
|
||||||
|
@ -174,7 +173,9 @@ public class TaskServiceImpl implements TaskService {
|
||||||
throw new InvalidArgumentException("taskId must be empty when creating a task");
|
throw new InvalidArgumentException("taskId must be empty when creating a task");
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug("Task {} cannot be found, so it can be created.", task.getId());
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Task {} cannot be found, so it can be created.", task.getId());
|
||||||
|
}
|
||||||
Workbasket workbasket;
|
Workbasket workbasket;
|
||||||
|
|
||||||
if (task.getWorkbasketSummary().getId() != null) {
|
if (task.getWorkbasketSummary().getId() != null) {
|
||||||
|
@ -219,7 +220,9 @@ public class TaskServiceImpl implements TaskService {
|
||||||
setCallbackStateOnTaskCreation(task);
|
setCallbackStateOnTaskCreation(task);
|
||||||
try {
|
try {
|
||||||
this.taskMapper.insert(task);
|
this.taskMapper.insert(task);
|
||||||
LOGGER.debug("Method createTask() created Task '{}'.", task.getId());
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Method createTask() created Task '{}'.", task.getId());
|
||||||
|
}
|
||||||
if (HistoryEventManager.isHistoryEnabled()) {
|
if (HistoryEventManager.isHistoryEnabled()) {
|
||||||
|
|
||||||
String details =
|
String details =
|
||||||
|
@ -266,13 +269,11 @@ public class TaskServiceImpl implements TaskService {
|
||||||
return task;
|
return task;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from createTask(task = {})", task);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Task getTask(String id) throws NotAuthorizedException, TaskNotFoundException {
|
public Task getTask(String id) throws NotAuthorizedException, TaskNotFoundException {
|
||||||
LOGGER.debug("entry to getTaskById(id = {})", id);
|
|
||||||
TaskImpl resultTask = null;
|
TaskImpl resultTask = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -325,7 +326,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from getTaskById(). Returning result {} ", resultTask);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,7 +346,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
@Override
|
@Override
|
||||||
public Task setTaskRead(String taskId, boolean isRead)
|
public Task setTaskRead(String taskId, boolean isRead)
|
||||||
throws TaskNotFoundException, NotAuthorizedException {
|
throws TaskNotFoundException, NotAuthorizedException {
|
||||||
LOGGER.debug("entry to setTaskRead(taskId = {}, isRead = {})", taskId, isRead);
|
|
||||||
TaskImpl task = null;
|
TaskImpl task = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -354,11 +353,12 @@ public class TaskServiceImpl implements TaskService {
|
||||||
task.setRead(isRead);
|
task.setRead(isRead);
|
||||||
task.setModified(Instant.now());
|
task.setModified(Instant.now());
|
||||||
taskMapper.update(task);
|
taskMapper.update(task);
|
||||||
LOGGER.debug("Method setTaskRead() set read property of Task '{}' to {} ", task, isRead);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Method setTaskRead() set read property of Task '{}' to {} ", task, isRead);
|
||||||
|
}
|
||||||
return task;
|
return task;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from setTaskRead(taskId, isRead). Returning result {} ", task);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,13 +384,11 @@ public class TaskServiceImpl implements TaskService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Task newTask(String workbasketKey, String domain) {
|
public Task newTask(String workbasketKey, String domain) {
|
||||||
LOGGER.debug("entry to newTask(workbasketKey = {}, domain = {})", workbasketKey, domain);
|
|
||||||
TaskImpl task = new TaskImpl();
|
TaskImpl task = new TaskImpl();
|
||||||
WorkbasketSummaryImpl wb = new WorkbasketSummaryImpl();
|
WorkbasketSummaryImpl wb = new WorkbasketSummaryImpl();
|
||||||
wb.setKey(workbasketKey);
|
wb.setKey(workbasketKey);
|
||||||
wb.setDomain(domain);
|
wb.setDomain(domain);
|
||||||
task.setWorkbasketSummary(wb);
|
task.setWorkbasketSummary(wb);
|
||||||
LOGGER.debug("exit from newTask(), returning {}", task);
|
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,7 +408,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
NotAuthorizedException, AttachmentPersistenceException, InvalidStateException,
|
NotAuthorizedException, AttachmentPersistenceException, InvalidStateException,
|
||||||
ClassificationNotFoundException {
|
ClassificationNotFoundException {
|
||||||
String userId = taskanaEngine.getEngine().getCurrentUserContext().getUserid();
|
String userId = taskanaEngine.getEngine().getCurrentUserContext().getUserid();
|
||||||
LOGGER.debug("entry to updateTask(task = {}, userId = {})", task, userId);
|
|
||||||
TaskImpl newTaskImpl = (TaskImpl) task;
|
TaskImpl newTaskImpl = (TaskImpl) task;
|
||||||
TaskImpl oldTaskImpl;
|
TaskImpl oldTaskImpl;
|
||||||
try {
|
try {
|
||||||
|
@ -426,7 +423,9 @@ public class TaskServiceImpl implements TaskService {
|
||||||
|
|
||||||
taskMapper.update(newTaskImpl);
|
taskMapper.update(newTaskImpl);
|
||||||
|
|
||||||
LOGGER.debug("Method updateTask() updated task '{}' for user '{}'.", task.getId(), userId);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Method updateTask() updated task '{}' for user '{}'.", task.getId(), userId);
|
||||||
|
}
|
||||||
|
|
||||||
if (HistoryEventManager.isHistoryEnabled()) {
|
if (HistoryEventManager.isHistoryEnabled()) {
|
||||||
|
|
||||||
|
@ -443,7 +442,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from claim()");
|
|
||||||
}
|
}
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
@ -482,10 +480,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
public Task selectAndClaim(TaskQuery taskQuery)
|
public Task selectAndClaim(TaskQuery taskQuery)
|
||||||
throws NotAuthorizedException, InvalidOwnerException {
|
throws NotAuthorizedException, InvalidOwnerException {
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("entry to selectAndClaim(taskQuery = {})", taskQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -505,7 +499,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
} catch (InvalidStateException | TaskNotFoundException e) {
|
} catch (InvalidStateException | TaskNotFoundException e) {
|
||||||
throw new SystemException("Caught exception ", e);
|
throw new SystemException("Caught exception ", e);
|
||||||
} finally {
|
} finally {
|
||||||
LOGGER.debug("exit from selectAndClaim()");
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -513,9 +506,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
@Override
|
@Override
|
||||||
public BulkOperationResults<String, TaskanaException> deleteTasks(List<String> taskIds)
|
public BulkOperationResults<String, TaskanaException> deleteTasks(List<String> taskIds)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("entry to deleteTasks(tasks = {})", taskIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.ADMIN);
|
||||||
|
|
||||||
|
@ -553,7 +543,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
return bulkLog;
|
return bulkLog;
|
||||||
} finally {
|
} finally {
|
||||||
LOGGER.debug("exit from deleteTasks()");
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -574,12 +563,7 @@ public class TaskServiceImpl implements TaskService {
|
||||||
public List<String> updateTasks(
|
public List<String> updateTasks(
|
||||||
ObjectReference selectionCriteria, Map<TaskCustomField, String> customFieldsToUpdate)
|
ObjectReference selectionCriteria, Map<TaskCustomField, String> customFieldsToUpdate)
|
||||||
throws InvalidArgumentException {
|
throws InvalidArgumentException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to updateTasks(selectionCriteria = {}, customFieldsToUpdate = {})",
|
|
||||||
selectionCriteria,
|
|
||||||
customFieldsToUpdate);
|
|
||||||
}
|
|
||||||
ObjectReference.validate(selectionCriteria, "ObjectReference", "updateTasks call");
|
ObjectReference.validate(selectionCriteria, "ObjectReference", "updateTasks call");
|
||||||
validateCustomFields(customFieldsToUpdate);
|
validateCustomFields(customFieldsToUpdate);
|
||||||
TaskCustomPropertySelector fieldSelector = new TaskCustomPropertySelector();
|
TaskCustomPropertySelector fieldSelector = new TaskCustomPropertySelector();
|
||||||
|
@ -600,11 +584,12 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
LOGGER.debug("updateTasks() found no tasks for update ");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("updateTasks() found no tasks for update ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return changedTasks;
|
return changedTasks;
|
||||||
} finally {
|
} finally {
|
||||||
LOGGER.debug("exit from updateTasks().");
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -613,12 +598,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
public List<String> updateTasks(
|
public List<String> updateTasks(
|
||||||
List<String> taskIds, Map<TaskCustomField, String> customFieldsToUpdate)
|
List<String> taskIds, Map<TaskCustomField, String> customFieldsToUpdate)
|
||||||
throws InvalidArgumentException {
|
throws InvalidArgumentException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to updateTasks(taskIds = {}, customFieldsToUpdate = {})",
|
|
||||||
taskIds,
|
|
||||||
customFieldsToUpdate);
|
|
||||||
}
|
|
||||||
|
|
||||||
validateCustomFields(customFieldsToUpdate);
|
validateCustomFields(customFieldsToUpdate);
|
||||||
TaskCustomPropertySelector fieldSelector = new TaskCustomPropertySelector();
|
TaskCustomPropertySelector fieldSelector = new TaskCustomPropertySelector();
|
||||||
|
@ -639,11 +618,12 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
LOGGER.debug("updateTasks() found no tasks for update ");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("updateTasks() found no tasks for update ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return changedTasks;
|
return changedTasks;
|
||||||
} finally {
|
} finally {
|
||||||
LOGGER.debug("exit from updateTasks().");
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -685,9 +665,7 @@ public class TaskServiceImpl implements TaskService {
|
||||||
@Override
|
@Override
|
||||||
public BulkOperationResults<String, TaskanaException> setCallbackStateForTasks(
|
public BulkOperationResults<String, TaskanaException> setCallbackStateForTasks(
|
||||||
List<String> externalIds, CallbackState state) {
|
List<String> externalIds, CallbackState state) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("entry to setCallbackStateForTasks(externalIds = {})", externalIds);
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
|
||||||
|
@ -708,7 +686,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
return bulkLog;
|
return bulkLog;
|
||||||
} finally {
|
} finally {
|
||||||
LOGGER.debug("exit from setCallbckStateForTasks()");
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -716,9 +693,7 @@ public class TaskServiceImpl implements TaskService {
|
||||||
@Override
|
@Override
|
||||||
public BulkOperationResults<String, TaskanaException> setOwnerOfTasks(
|
public BulkOperationResults<String, TaskanaException> setOwnerOfTasks(
|
||||||
String owner, List<String> argTaskIds) {
|
String owner, List<String> argTaskIds) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("entry to setOwnerOfTasks(owner = {}, tasks = {})", owner, argTaskIds);
|
|
||||||
}
|
|
||||||
BulkOperationResults<String, TaskanaException> bulkLog = new BulkOperationResults<>();
|
BulkOperationResults<String, TaskanaException> bulkLog = new BulkOperationResults<>();
|
||||||
if (argTaskIds == null || argTaskIds.isEmpty()) {
|
if (argTaskIds == null || argTaskIds.isEmpty()) {
|
||||||
return bulkLog;
|
return bulkLog;
|
||||||
|
@ -756,7 +731,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
return bulkLog;
|
return bulkLog;
|
||||||
} finally {
|
} finally {
|
||||||
LOGGER.debug("exit from setOwnerOfTasks()");
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -764,10 +738,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
@Override
|
@Override
|
||||||
public BulkOperationResults<String, TaskanaException> setPlannedPropertyOfTasks(
|
public BulkOperationResults<String, TaskanaException> setPlannedPropertyOfTasks(
|
||||||
Instant planned, List<String> argTaskIds) {
|
Instant planned, List<String> argTaskIds) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to setPlannedPropertyOfTasks(planned = {}, tasks = {})", planned, argTaskIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
BulkLog bulkLog = new BulkLog();
|
BulkLog bulkLog = new BulkLog();
|
||||||
if (argTaskIds == null || argTaskIds.isEmpty()) {
|
if (argTaskIds == null || argTaskIds.isEmpty()) {
|
||||||
|
@ -783,7 +753,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
bulkLog.addAllErrors(errorsFromProcessing);
|
bulkLog.addAllErrors(errorsFromProcessing);
|
||||||
return bulkLog;
|
return bulkLog;
|
||||||
} finally {
|
} finally {
|
||||||
LOGGER.debug("exit from setPlannedPropertyOfTasks");
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -791,7 +760,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
@Override
|
@Override
|
||||||
public Task cancelTask(String taskId)
|
public Task cancelTask(String taskId)
|
||||||
throws TaskNotFoundException, InvalidStateException, NotAuthorizedException {
|
throws TaskNotFoundException, InvalidStateException, NotAuthorizedException {
|
||||||
LOGGER.debug("entry to cancelTask(task = {})", taskId);
|
|
||||||
|
|
||||||
Task cancelledTask;
|
Task cancelledTask;
|
||||||
|
|
||||||
|
@ -808,7 +776,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from cancelTask()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return cancelledTask;
|
return cancelledTask;
|
||||||
|
@ -817,7 +784,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
@Override
|
@Override
|
||||||
public Task terminateTask(String taskId)
|
public Task terminateTask(String taskId)
|
||||||
throws TaskNotFoundException, InvalidStateException, NotAuthorizedException {
|
throws TaskNotFoundException, InvalidStateException, NotAuthorizedException {
|
||||||
LOGGER.debug("entry to terminateTask(task = {})", taskId);
|
|
||||||
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.ADMIN, TaskanaRole.TASK_ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.ADMIN, TaskanaRole.TASK_ADMIN);
|
||||||
|
|
||||||
|
@ -837,15 +803,11 @@ public class TaskServiceImpl implements TaskService {
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from terminateTask()");
|
|
||||||
}
|
}
|
||||||
return terminatedTask;
|
return terminatedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> findTasksIdsAffectedByClassificationChange(String classificationId) {
|
public List<String> findTasksIdsAffectedByClassificationChange(String classificationId) {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to findTasksIdsAffectedByClassificationChange(classificationId = {})",
|
|
||||||
classificationId);
|
|
||||||
// tasks directly affected
|
// tasks directly affected
|
||||||
List<TaskSummary> tasksAffectedDirectly =
|
List<TaskSummary> tasksAffectedDirectly =
|
||||||
createTaskQuery()
|
createTaskQuery()
|
||||||
|
@ -883,15 +845,11 @@ public class TaskServiceImpl implements TaskService {
|
||||||
classificationId,
|
classificationId,
|
||||||
affectedTaskIds);
|
affectedTaskIds);
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from findTasksIdsAffectedByClassificationChange(). ");
|
|
||||||
return affectedTaskIds;
|
return affectedTaskIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshPriorityAndDueDatesOfTasksOnClassificationUpdate(
|
public void refreshPriorityAndDueDatesOfTasksOnClassificationUpdate(
|
||||||
List<String> taskIds, boolean serviceLevelChanged, boolean priorityChanged) {
|
List<String> taskIds, boolean serviceLevelChanged, boolean priorityChanged) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("entry to refreshPriorityAndDueDateOfTasks(tasks = {})", taskIds);
|
|
||||||
}
|
|
||||||
Pair<List<MinimalTaskSummary>, BulkLog> resultsPair = getMinimalTaskSummaries(taskIds);
|
Pair<List<MinimalTaskSummary>, BulkLog> resultsPair = getMinimalTaskSummaries(taskIds);
|
||||||
List<MinimalTaskSummary> tasks = resultsPair.getLeft();
|
List<MinimalTaskSummary> tasks = resultsPair.getLeft();
|
||||||
try {
|
try {
|
||||||
|
@ -912,7 +870,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
LOGGER.debug("exit from refreshPriorityAndDueDateOfTasks");
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -975,12 +932,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
|
|
||||||
void removeNonExistingTasksFromTaskIdList(
|
void removeNonExistingTasksFromTaskIdList(
|
||||||
List<String> taskIds, BulkOperationResults<String, TaskanaException> bulkLog) {
|
List<String> taskIds, BulkOperationResults<String, TaskanaException> bulkLog) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to removeNonExistingTasksFromTaskIdList(targetWbId = {}, taskIds = {})",
|
|
||||||
taskIds,
|
|
||||||
bulkLog);
|
|
||||||
}
|
|
||||||
|
|
||||||
Iterator<String> taskIdIterator = taskIds.iterator();
|
Iterator<String> taskIdIterator = taskIds.iterator();
|
||||||
while (taskIdIterator.hasNext()) {
|
while (taskIdIterator.hasNext()) {
|
||||||
|
@ -991,16 +942,11 @@ public class TaskServiceImpl implements TaskService {
|
||||||
taskIdIterator.remove();
|
taskIdIterator.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from removeNonExistingTasksFromTaskIdList()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<TaskSummary> augmentTaskSummariesByContainedSummariesWithPartitioning(
|
List<TaskSummary> augmentTaskSummariesByContainedSummariesWithPartitioning(
|
||||||
List<TaskSummaryImpl> taskSummaries) {
|
List<TaskSummaryImpl> taskSummaries) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to augmentTaskSummariesByContainedSummariesWithPartitioning(taskSummaries= {})",
|
|
||||||
taskSummaries);
|
|
||||||
}
|
|
||||||
// splitting Augmentation into steps of maximal 32000 tasks
|
// splitting Augmentation into steps of maximal 32000 tasks
|
||||||
// reason: DB2 has a maximum for parameters in a query
|
// reason: DB2 has a maximum for parameters in a query
|
||||||
List<TaskSummary> result =
|
List<TaskSummary> result =
|
||||||
|
@ -1009,7 +955,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
.flatMap(Collection::stream)
|
.flatMap(Collection::stream)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
LOGGER.debug("exit from to augmentTaskSummariesByContainedSummariesWithPartitioning()");
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1044,7 +989,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
private BulkOperationResults<String, TaskanaException> completeTasks(
|
private BulkOperationResults<String, TaskanaException> completeTasks(
|
||||||
List<String> taskIds, boolean forced) throws InvalidArgumentException {
|
List<String> taskIds, boolean forced) throws InvalidArgumentException {
|
||||||
try {
|
try {
|
||||||
LOGGER.debug("entry to completeTasks(taskIds = {})", taskIds);
|
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
if (taskIds == null) {
|
if (taskIds == null) {
|
||||||
throw new InvalidArgumentException("TaskIds can't be used as NULL-Parameter.");
|
throw new InvalidArgumentException("TaskIds can't be used as NULL-Parameter.");
|
||||||
|
@ -1080,7 +1024,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
return bulkLog;
|
return bulkLog;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from to completeTasks(taskIds = {})", taskIds);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1154,10 +1097,12 @@ public class TaskServiceImpl implements TaskService {
|
||||||
task.setCompleted(now);
|
task.setCompleted(now);
|
||||||
task.setState(targetState);
|
task.setState(targetState);
|
||||||
taskMapper.update(task);
|
taskMapper.update(task);
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Task '{}' cancelled by user '{}'.",
|
LOGGER.debug(
|
||||||
taskId,
|
"Task '{}' cancelled by user '{}'.",
|
||||||
taskanaEngine.getEngine().getCurrentUserContext().getUserid());
|
taskId,
|
||||||
|
taskanaEngine.getEngine().getCurrentUserContext().getUserid());
|
||||||
|
}
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1189,8 +1134,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException,
|
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException,
|
||||||
NotAuthorizedException {
|
NotAuthorizedException {
|
||||||
String userId = taskanaEngine.getEngine().getCurrentUserContext().getUserid();
|
String userId = taskanaEngine.getEngine().getCurrentUserContext().getUserid();
|
||||||
LOGGER.debug(
|
|
||||||
"entry to claim(id = {}, userId = {}, forceClaim = {})", taskId, userId, forceClaim);
|
|
||||||
TaskImpl task;
|
TaskImpl task;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -1200,7 +1143,9 @@ public class TaskServiceImpl implements TaskService {
|
||||||
checkPreconditionsForClaimTask(task, forceClaim);
|
checkPreconditionsForClaimTask(task, forceClaim);
|
||||||
claimActionsOnTask(task, userId, now);
|
claimActionsOnTask(task, userId, now);
|
||||||
taskMapper.update(task);
|
taskMapper.update(task);
|
||||||
LOGGER.debug("Task '{}' claimed by user '{}'.", taskId, userId);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Task '{}' claimed by user '{}'.", taskId, userId);
|
||||||
|
}
|
||||||
if (HistoryEventManager.isHistoryEnabled()) {
|
if (HistoryEventManager.isHistoryEnabled()) {
|
||||||
historyEventManager.createEvent(
|
historyEventManager.createEvent(
|
||||||
new TaskClaimedEvent(
|
new TaskClaimedEvent(
|
||||||
|
@ -1210,7 +1155,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from claim()");
|
|
||||||
}
|
}
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
@ -1283,11 +1227,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException,
|
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException,
|
||||||
NotAuthorizedException {
|
NotAuthorizedException {
|
||||||
String userId = taskanaEngine.getEngine().getCurrentUserContext().getUserid();
|
String userId = taskanaEngine.getEngine().getCurrentUserContext().getUserid();
|
||||||
LOGGER.debug(
|
|
||||||
"entry to cancelClaim(taskId = {}), userId = {}, forceUnclaim = {})",
|
|
||||||
taskId,
|
|
||||||
userId,
|
|
||||||
forceUnclaim);
|
|
||||||
TaskImpl task;
|
TaskImpl task;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -1308,7 +1247,9 @@ public class TaskServiceImpl implements TaskService {
|
||||||
task.setRead(true);
|
task.setRead(true);
|
||||||
task.setState(TaskState.READY);
|
task.setState(TaskState.READY);
|
||||||
taskMapper.update(task);
|
taskMapper.update(task);
|
||||||
LOGGER.debug("Task '{}' unclaimed by user '{}'.", taskId, userId);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Task '{}' unclaimed by user '{}'.", taskId, userId);
|
||||||
|
}
|
||||||
if (HistoryEventManager.isHistoryEnabled()) {
|
if (HistoryEventManager.isHistoryEnabled()) {
|
||||||
historyEventManager.createEvent(
|
historyEventManager.createEvent(
|
||||||
new TaskClaimCancelledEvent(
|
new TaskClaimCancelledEvent(
|
||||||
|
@ -1318,7 +1259,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from cancelClaim()");
|
|
||||||
}
|
}
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
@ -1327,8 +1267,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
throws TaskNotFoundException, InvalidOwnerException, InvalidStateException,
|
throws TaskNotFoundException, InvalidOwnerException, InvalidStateException,
|
||||||
NotAuthorizedException {
|
NotAuthorizedException {
|
||||||
String userId = taskanaEngine.getEngine().getCurrentUserContext().getUserid();
|
String userId = taskanaEngine.getEngine().getCurrentUserContext().getUserid();
|
||||||
LOGGER.debug(
|
|
||||||
"entry to completeTask(id = {}, userId = {}, isForced = {})", taskId, userId, isForced);
|
|
||||||
TaskImpl task;
|
TaskImpl task;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -1349,7 +1287,9 @@ public class TaskServiceImpl implements TaskService {
|
||||||
Instant now = Instant.now();
|
Instant now = Instant.now();
|
||||||
completeActionsOnTask(task, userId, now);
|
completeActionsOnTask(task, userId, now);
|
||||||
taskMapper.update(task);
|
taskMapper.update(task);
|
||||||
LOGGER.debug("Task '{}' completed by user '{}'.", taskId, userId);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Task '{}' completed by user '{}'.", taskId, userId);
|
||||||
|
}
|
||||||
if (HistoryEventManager.isHistoryEnabled()) {
|
if (HistoryEventManager.isHistoryEnabled()) {
|
||||||
historyEventManager.createEvent(
|
historyEventManager.createEvent(
|
||||||
new TaskCompletedEvent(
|
new TaskCompletedEvent(
|
||||||
|
@ -1359,14 +1299,12 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from completeTask()");
|
|
||||||
}
|
}
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteTask(String taskId, boolean forceDelete)
|
private void deleteTask(String taskId, boolean forceDelete)
|
||||||
throws TaskNotFoundException, InvalidStateException, NotAuthorizedException {
|
throws TaskNotFoundException, InvalidStateException, NotAuthorizedException {
|
||||||
LOGGER.debug("entry to deleteTask(taskId = {} , forceDelete = {})", taskId, forceDelete);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.ADMIN);
|
||||||
TaskImpl task;
|
TaskImpl task;
|
||||||
try {
|
try {
|
||||||
|
@ -1393,10 +1331,11 @@ public class TaskServiceImpl implements TaskService {
|
||||||
historyEventManager.deleteEvents(Collections.singletonList(taskId));
|
historyEventManager.deleteEvents(Collections.singletonList(taskId));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug("Task {} deleted.", taskId);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Task {} deleted.", taskId);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from deleteTask().");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1404,7 +1343,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
BulkOperationResults<String, TaskanaException> bulkLog,
|
BulkOperationResults<String, TaskanaException> bulkLog,
|
||||||
List<MinimalTaskSummary> taskSummaries,
|
List<MinimalTaskSummary> taskSummaries,
|
||||||
Iterator<String> taskIdIterator) {
|
Iterator<String> taskIdIterator) {
|
||||||
LOGGER.debug("entry to removeSingleTask()");
|
|
||||||
String currentTaskId = taskIdIterator.next();
|
String currentTaskId = taskIdIterator.next();
|
||||||
if (currentTaskId == null || currentTaskId.equals("")) {
|
if (currentTaskId == null || currentTaskId.equals("")) {
|
||||||
bulkLog.addError(
|
bulkLog.addError(
|
||||||
|
@ -1438,7 +1376,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from removeSingleTask()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeSingleTaskForCallbackStateByExternalId(
|
private void removeSingleTaskForCallbackStateByExternalId(
|
||||||
|
@ -1446,7 +1383,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
List<MinimalTaskSummary> taskSummaries,
|
List<MinimalTaskSummary> taskSummaries,
|
||||||
Iterator<String> externalIdIterator,
|
Iterator<String> externalIdIterator,
|
||||||
CallbackState desiredCallbackState) {
|
CallbackState desiredCallbackState) {
|
||||||
LOGGER.debug("entry to removeSingleTask()");
|
|
||||||
String currentExternalId = externalIdIterator.next();
|
String currentExternalId = externalIdIterator.next();
|
||||||
if (currentExternalId == null || currentExternalId.equals("")) {
|
if (currentExternalId == null || currentExternalId.equals("")) {
|
||||||
bulkLog.addError(
|
bulkLog.addError(
|
||||||
|
@ -1472,7 +1408,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
externalIdIterator.remove();
|
externalIdIterator.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from removeSingleTask()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean desiredCallbackStateCanBeSetForFoundSummary(
|
private boolean desiredCallbackStateCanBeSetForFoundSummary(
|
||||||
|
@ -1503,7 +1438,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
private void standardSettings(TaskImpl task, Classification classification)
|
private void standardSettings(TaskImpl task, Classification classification)
|
||||||
throws InvalidArgumentException {
|
throws InvalidArgumentException {
|
||||||
TaskImpl task1 = task;
|
TaskImpl task1 = task;
|
||||||
LOGGER.debug("entry to standardSettings()");
|
|
||||||
final Instant now = Instant.now();
|
final Instant now = Instant.now();
|
||||||
task1.setId(IdGenerator.generateWithPrefix(IdGenerator.ID_PREFIX_TASK));
|
task1.setId(IdGenerator.generateWithPrefix(IdGenerator.ID_PREFIX_TASK));
|
||||||
if (task1.getExternalId() == null) {
|
if (task1.getExternalId() == null) {
|
||||||
|
@ -1549,7 +1483,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
throw new SystemException(
|
throw new SystemException(
|
||||||
"Internal error when trying to insert new Attachments on Task Creation.", e);
|
"Internal error when trying to insert new Attachments on Task Creation.", e);
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from standardSettings()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setCallbackStateOnTaskCreation(TaskImpl task) throws InvalidArgumentException {
|
private void setCallbackStateOnTaskCreation(TaskImpl task) throws InvalidArgumentException {
|
||||||
|
@ -1571,9 +1504,7 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateTasksToBeCompleted(Stream<TaskSummaryImpl> taskSummaries, Instant now) {
|
private void updateTasksToBeCompleted(Stream<TaskSummaryImpl> taskSummaries, Instant now) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("entry to updateTasksToBeCompleted()");
|
|
||||||
}
|
|
||||||
List<String> taskIds = new ArrayList<>();
|
List<String> taskIds = new ArrayList<>();
|
||||||
List<String> updateClaimedTaskIds = new ArrayList<>();
|
List<String> updateClaimedTaskIds = new ArrayList<>();
|
||||||
List<TaskSummary> taskSummaryList =
|
List<TaskSummary> taskSummaryList =
|
||||||
|
@ -1607,20 +1538,12 @@ public class TaskServiceImpl implements TaskService {
|
||||||
createTasksCompletedEvents(taskSummaryList);
|
createTasksCompletedEvents(taskSummaryList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from updateTasksToBeCompleted()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addClassificationSummariesToTaskSummaries(
|
private void addClassificationSummariesToTaskSummaries(
|
||||||
List<TaskSummaryImpl> tasks, List<ClassificationSummary> classifications) {
|
List<TaskSummaryImpl> tasks, List<ClassificationSummary> classifications) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to addClassificationSummariesToTaskSummaries(tasks = {}, classifications = {})",
|
|
||||||
tasks,
|
|
||||||
classifications);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tasks == null || tasks.isEmpty()) {
|
if (tasks == null || tasks.isEmpty()) {
|
||||||
LOGGER.debug("exit from addClassificationSummariesToTaskSummaries()");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// assign query results to appropriate tasks.
|
// assign query results to appropriate tasks.
|
||||||
|
@ -1642,12 +1565,10 @@ public class TaskServiceImpl implements TaskService {
|
||||||
// set the classification on the task object
|
// set the classification on the task object
|
||||||
task.setClassificationSummary(classificationSummary);
|
task.setClassificationSummary(classificationSummary);
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from addClassificationSummariesToTaskSummaries()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ClassificationSummary> findClassificationsForTasksAndAttachments(
|
private List<ClassificationSummary> findClassificationsForTasksAndAttachments(
|
||||||
List<TaskSummaryImpl> taskSummaries, List<AttachmentSummaryImpl> attachmentSummaries) {
|
List<TaskSummaryImpl> taskSummaries, List<AttachmentSummaryImpl> attachmentSummaries) {
|
||||||
LOGGER.debug("entry to findClassificationsForTasksAndAttachments()");
|
|
||||||
if (taskSummaries == null || taskSummaries.isEmpty()) {
|
if (taskSummaries == null || taskSummaries.isEmpty()) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
@ -1662,13 +1583,11 @@ public class TaskServiceImpl implements TaskService {
|
||||||
classificationIdSet.add(att.getClassificationSummary().getId());
|
classificationIdSet.add(att.getClassificationSummary().getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from findClassificationsForTasksAndAttachments()");
|
|
||||||
return queryClassificationsForTasksAndAttachments(classificationIdSet);
|
return queryClassificationsForTasksAndAttachments(classificationIdSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<ClassificationSummary> findClassificationForTaskImplAndAttachments(
|
private List<ClassificationSummary> findClassificationForTaskImplAndAttachments(
|
||||||
TaskImpl task, List<AttachmentImpl> attachmentImpls) {
|
TaskImpl task, List<AttachmentImpl> attachmentImpls) {
|
||||||
LOGGER.debug("entry to transferBulk()");
|
|
||||||
Set<String> classificationIdSet =
|
Set<String> classificationIdSet =
|
||||||
new HashSet<>(Collections.singletonList(task.getClassificationSummary().getId()));
|
new HashSet<>(Collections.singletonList(task.getClassificationSummary().getId()));
|
||||||
if (attachmentImpls != null && !attachmentImpls.isEmpty()) {
|
if (attachmentImpls != null && !attachmentImpls.isEmpty()) {
|
||||||
|
@ -1676,7 +1595,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
classificationIdSet.add(att.getClassificationSummary().getId());
|
classificationIdSet.add(att.getClassificationSummary().getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from findClassificationForTaskImplAndAttachments()");
|
|
||||||
return queryClassificationsForTasksAndAttachments(classificationIdSet);
|
return queryClassificationsForTasksAndAttachments(classificationIdSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1685,8 +1603,10 @@ public class TaskServiceImpl implements TaskService {
|
||||||
|
|
||||||
String[] classificationIdArray = classificationIdSet.toArray(new String[0]);
|
String[] classificationIdArray = classificationIdSet.toArray(new String[0]);
|
||||||
|
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"getClassificationsForTasksAndAttachments() about to query classifications and exit");
|
LOGGER.debug(
|
||||||
|
"getClassificationsForTasksAndAttachments() about to query classifications and exit");
|
||||||
|
}
|
||||||
// perform classification query
|
// perform classification query
|
||||||
return this.classificationService
|
return this.classificationService
|
||||||
.createClassificationQuery()
|
.createClassificationQuery()
|
||||||
|
@ -1695,7 +1615,6 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addWorkbasketSummariesToTaskSummaries(List<TaskSummaryImpl> taskSummaries) {
|
private void addWorkbasketSummariesToTaskSummaries(List<TaskSummaryImpl> taskSummaries) {
|
||||||
LOGGER.debug("entry to addWorkbasketSummariesToTaskSummaries()");
|
|
||||||
if (taskSummaries == null || taskSummaries.isEmpty()) {
|
if (taskSummaries == null || taskSummaries.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1705,7 +1624,9 @@ public class TaskServiceImpl implements TaskService {
|
||||||
.map(t -> t.getWorkbasketSummary().getId())
|
.map(t -> t.getWorkbasketSummary().getId())
|
||||||
.distinct()
|
.distinct()
|
||||||
.toArray(String[]::new);
|
.toArray(String[]::new);
|
||||||
LOGGER.debug("addWorkbasketSummariesToTaskSummaries() about to query workbaskets");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("addWorkbasketSummariesToTaskSummaries() about to query workbaskets");
|
||||||
|
}
|
||||||
WorkbasketQueryImpl query = (WorkbasketQueryImpl) workbasketService.createWorkbasketQuery();
|
WorkbasketQueryImpl query = (WorkbasketQueryImpl) workbasketService.createWorkbasketQuery();
|
||||||
query.setUsedToAugmentTasks(true);
|
query.setUsedToAugmentTasks(true);
|
||||||
|
|
||||||
|
@ -1728,21 +1649,12 @@ public class TaskServiceImpl implements TaskService {
|
||||||
|
|
||||||
task.setWorkbasketSummary(workbasketSummary);
|
task.setWorkbasketSummary(workbasketSummary);
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from addWorkbasketSummariesToTaskSummaries()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addAttachmentSummariesToTaskSummaries(
|
private void addAttachmentSummariesToTaskSummaries(
|
||||||
List<TaskSummaryImpl> taskSummaries,
|
List<TaskSummaryImpl> taskSummaries,
|
||||||
List<AttachmentSummaryImpl> attachmentSummaries,
|
List<AttachmentSummaryImpl> attachmentSummaries,
|
||||||
List<ClassificationSummary> classifications) {
|
List<ClassificationSummary> classifications) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to addAttachmentSummariesToTaskSummaries(taskSummaries = {}, "
|
|
||||||
+ "attachmentSummaries = {}, classifications = {})",
|
|
||||||
taskSummaries,
|
|
||||||
attachmentSummaries,
|
|
||||||
classifications);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (taskSummaries == null || taskSummaries.isEmpty()) {
|
if (taskSummaries == null || taskSummaries.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
|
@ -1762,21 +1674,17 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug("exit from addAttachmentSummariesToTaskSummaries()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addClassificationSummariesToAttachmentSummaries(
|
private void addClassificationSummariesToAttachmentSummaries(
|
||||||
List<AttachmentSummaryImpl> attachmentSummaries,
|
List<AttachmentSummaryImpl> attachmentSummaries,
|
||||||
List<TaskSummaryImpl> taskSummaries,
|
List<TaskSummaryImpl> taskSummaries,
|
||||||
List<ClassificationSummary> classifications) {
|
List<ClassificationSummary> classifications) {
|
||||||
LOGGER.debug("entry to addClassificationSummariesToAttachmentSummaries()");
|
|
||||||
// prereq: in each attachmentSummary, the classificationSummary.key property is set.
|
// prereq: in each attachmentSummary, the classificationSummary.key property is set.
|
||||||
if (attachmentSummaries == null
|
if (attachmentSummaries == null
|
||||||
|| attachmentSummaries.isEmpty()
|
|| attachmentSummaries.isEmpty()
|
||||||
|| taskSummaries == null
|
|| taskSummaries == null
|
||||||
|| taskSummaries.isEmpty()) {
|
|| taskSummaries.isEmpty()) {
|
||||||
LOGGER.debug("exit from addClassificationSummariesToAttachmentSummaries()");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// iterate over all attachment summaries an add the appropriate classification summary to each
|
// iterate over all attachment summaries an add the appropriate classification summary to each
|
||||||
|
@ -1792,20 +1700,12 @@ public class TaskServiceImpl implements TaskService {
|
||||||
}
|
}
|
||||||
att.setClassificationSummary(classificationSummary);
|
att.setClassificationSummary(classificationSummary);
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from addClassificationSummariesToAttachmentSummaries()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Attachment> addClassificationSummariesToAttachments(
|
private List<Attachment> addClassificationSummariesToAttachments(
|
||||||
List<AttachmentImpl> attachmentImpls, List<ClassificationSummary> classifications) {
|
List<AttachmentImpl> attachmentImpls, List<ClassificationSummary> classifications) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to addClassificationSummariesToAttachments(targetWbId = {}, taskIds = {})",
|
|
||||||
attachmentImpls,
|
|
||||||
classifications);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attachmentImpls == null || attachmentImpls.isEmpty()) {
|
if (attachmentImpls == null || attachmentImpls.isEmpty()) {
|
||||||
LOGGER.debug("exit from addClassificationSummariesToAttachments()");
|
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1824,21 +1724,12 @@ public class TaskServiceImpl implements TaskService {
|
||||||
att.setClassificationSummary(classificationSummary);
|
att.setClassificationSummary(classificationSummary);
|
||||||
result.add(att);
|
result.add(att);
|
||||||
}
|
}
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("exit from addClassificationSummariesToAttachments(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private TaskImpl initUpdatedTask(
|
private TaskImpl initUpdatedTask(
|
||||||
Map<TaskCustomField, String> customFieldsToUpdate, TaskCustomPropertySelector fieldSelector) {
|
Map<TaskCustomField, String> customFieldsToUpdate, TaskCustomPropertySelector fieldSelector) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to initUpdatedTask(customFieldsToUpdate = {}, fieldSelector = {})",
|
|
||||||
customFieldsToUpdate,
|
|
||||||
fieldSelector);
|
|
||||||
}
|
|
||||||
|
|
||||||
TaskImpl newTask = new TaskImpl();
|
TaskImpl newTask = new TaskImpl();
|
||||||
newTask.setModified(Instant.now());
|
newTask.setModified(Instant.now());
|
||||||
|
@ -1848,25 +1739,16 @@ public class TaskServiceImpl implements TaskService {
|
||||||
fieldSelector.setCustomProperty(key, true);
|
fieldSelector.setCustomProperty(key, true);
|
||||||
newTask.setCustomAttribute(key, entry.getValue());
|
newTask.setCustomAttribute(key, entry.getValue());
|
||||||
}
|
}
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("exit from initUpdatedTask(), returning {}", newTask);
|
|
||||||
}
|
|
||||||
|
|
||||||
return newTask;
|
return newTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateCustomFields(Map<TaskCustomField, String> customFieldsToUpdate)
|
private void validateCustomFields(Map<TaskCustomField, String> customFieldsToUpdate)
|
||||||
throws InvalidArgumentException {
|
throws InvalidArgumentException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to validateCustomFields(customFieldsToUpdate = {})", customFieldsToUpdate);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (customFieldsToUpdate == null || customFieldsToUpdate.isEmpty()) {
|
if (customFieldsToUpdate == null || customFieldsToUpdate.isEmpty()) {
|
||||||
throw new InvalidArgumentException(
|
throw new InvalidArgumentException(
|
||||||
"The customFieldsToUpdate argument to updateTasks must not be empty.");
|
"The customFieldsToUpdate argument to updateTasks must not be empty.");
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from validateCustomFields()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TaskSummary> getTasksToChange(List<String> taskIds) {
|
private List<TaskSummary> getTasksToChange(List<String> taskIds) {
|
||||||
|
|
|
@ -61,11 +61,6 @@ class TaskTransferrer {
|
||||||
String taskId, String destinationWorkbasketKey, String domain, boolean setTransferFlag)
|
String taskId, String destinationWorkbasketKey, String domain, boolean setTransferFlag)
|
||||||
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException,
|
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException,
|
||||||
InvalidStateException {
|
InvalidStateException {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to transfer(taskId = {}, destinationWorkbasketKey = {}, domain = {})",
|
|
||||||
taskId,
|
|
||||||
destinationWorkbasketKey,
|
|
||||||
domain);
|
|
||||||
TaskImpl task = null;
|
TaskImpl task = null;
|
||||||
WorkbasketSummary oldWorkbasketSummary = null;
|
WorkbasketSummary oldWorkbasketSummary = null;
|
||||||
try {
|
try {
|
||||||
|
@ -105,10 +100,12 @@ class TaskTransferrer {
|
||||||
task.setState(TaskState.READY);
|
task.setState(TaskState.READY);
|
||||||
task.setOwner(null);
|
task.setOwner(null);
|
||||||
taskMapper.update(task);
|
taskMapper.update(task);
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Method transfer() transferred Task '{}' to destination workbasket {}",
|
LOGGER.debug(
|
||||||
taskId,
|
"Method transfer() transferred Task '{}' to destination workbasket {}",
|
||||||
destinationWorkbasket.getId());
|
taskId,
|
||||||
|
destinationWorkbasket.getId());
|
||||||
|
}
|
||||||
if (HistoryEventManager.isHistoryEnabled()) {
|
if (HistoryEventManager.isHistoryEnabled()) {
|
||||||
createTaskTransferredEvent(
|
createTaskTransferredEvent(
|
||||||
task, oldWorkbasketSummary.getId(), destinationWorkbasket.asSummary().getId());
|
task, oldWorkbasketSummary.getId(), destinationWorkbasket.asSummary().getId());
|
||||||
|
@ -116,17 +113,13 @@ class TaskTransferrer {
|
||||||
return task;
|
return task;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from transfer(). Returning result {} ", task);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Task transfer(String taskId, String destinationWorkbasketId, boolean setTransferFlag)
|
Task transfer(String taskId, String destinationWorkbasketId, boolean setTransferFlag)
|
||||||
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException,
|
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException,
|
||||||
InvalidStateException {
|
InvalidStateException {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to transfer(taskId = {}, destinationWorkbasketId = {})",
|
|
||||||
taskId,
|
|
||||||
destinationWorkbasketId);
|
|
||||||
TaskImpl task = null;
|
TaskImpl task = null;
|
||||||
WorkbasketSummary oldWorkbasketSummary = null;
|
WorkbasketSummary oldWorkbasketSummary = null;
|
||||||
try {
|
try {
|
||||||
|
@ -162,17 +155,18 @@ class TaskTransferrer {
|
||||||
task.setState(TaskState.READY);
|
task.setState(TaskState.READY);
|
||||||
task.setOwner(null);
|
task.setOwner(null);
|
||||||
taskMapper.update(task);
|
taskMapper.update(task);
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Method transfer() transferred Task '{}' to destination workbasket {}",
|
LOGGER.debug(
|
||||||
taskId,
|
"Method transfer() transferred Task '{}' to destination workbasket {}",
|
||||||
destinationWorkbasketId);
|
taskId,
|
||||||
|
destinationWorkbasketId);
|
||||||
|
}
|
||||||
if (HistoryEventManager.isHistoryEnabled()) {
|
if (HistoryEventManager.isHistoryEnabled()) {
|
||||||
createTaskTransferredEvent(task, oldWorkbasketSummary.getId(), destinationWorkbasketId);
|
createTaskTransferredEvent(task, oldWorkbasketSummary.getId(), destinationWorkbasketId);
|
||||||
}
|
}
|
||||||
return task;
|
return task;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from transfer(). Returning result {} ", task);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,13 +178,6 @@ class TaskTransferrer {
|
||||||
throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException {
|
throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException {
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to transferTasks(targetWbKey = {}, domain = {}, taskIds = {})",
|
|
||||||
destinationWorkbasketKey,
|
|
||||||
destinationWorkbasketDomain,
|
|
||||||
taskIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check pre-conditions with trowing Exceptions
|
// Check pre-conditions with trowing Exceptions
|
||||||
if (destinationWorkbasketKey == null || destinationWorkbasketDomain == null) {
|
if (destinationWorkbasketKey == null || destinationWorkbasketDomain == null) {
|
||||||
|
@ -202,15 +189,6 @@ class TaskTransferrer {
|
||||||
|
|
||||||
return transferTasks(taskIds, destinationWorkbasket, setTransferFlag);
|
return transferTasks(taskIds, destinationWorkbasket, setTransferFlag);
|
||||||
} finally {
|
} finally {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from transferTasks(targetWbKey = {}, targetWbDomain = {}, "
|
|
||||||
+ "destination taskIds = {})",
|
|
||||||
destinationWorkbasketKey,
|
|
||||||
destinationWorkbasketDomain,
|
|
||||||
taskIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -220,12 +198,6 @@ class TaskTransferrer {
|
||||||
throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException {
|
throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException {
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to transferTasks(targetWbId = {}, taskIds = {})",
|
|
||||||
destinationWorkbasketId,
|
|
||||||
taskIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check pre-conditions with trowing Exceptions
|
// Check pre-conditions with trowing Exceptions
|
||||||
if (destinationWorkbasketId == null || destinationWorkbasketId.isEmpty()) {
|
if (destinationWorkbasketId == null || destinationWorkbasketId.isEmpty()) {
|
||||||
|
@ -235,13 +207,6 @@ class TaskTransferrer {
|
||||||
|
|
||||||
return transferTasks(taskIds, destinationWorkbasket, setTransferFlag);
|
return transferTasks(taskIds, destinationWorkbasket, setTransferFlag);
|
||||||
} finally {
|
} finally {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from transferTasks(targetWbKey = {}, taskIds = {})",
|
|
||||||
destinationWorkbasketId,
|
|
||||||
taskIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,12 +216,6 @@ class TaskTransferrer {
|
||||||
Workbasket destinationWorkbasket,
|
Workbasket destinationWorkbasket,
|
||||||
boolean setTransferFlag)
|
boolean setTransferFlag)
|
||||||
throws InvalidArgumentException, WorkbasketNotFoundException, NotAuthorizedException {
|
throws InvalidArgumentException, WorkbasketNotFoundException, NotAuthorizedException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to transferTasks(taskIdsToBeTransferred = {}, destinationWorkbasket = {})",
|
|
||||||
taskIdsToBeTransferred,
|
|
||||||
destinationWorkbasket);
|
|
||||||
}
|
|
||||||
|
|
||||||
workbasketService.checkAuthorization(
|
workbasketService.checkAuthorization(
|
||||||
destinationWorkbasket.getId(), WorkbasketPermission.APPEND);
|
destinationWorkbasket.getId(), WorkbasketPermission.APPEND);
|
||||||
|
@ -276,10 +235,6 @@ class TaskTransferrer {
|
||||||
taskSummaries = taskMapper.findExistingTasks(taskIds, null);
|
taskSummaries = taskMapper.findExistingTasks(taskIds, null);
|
||||||
checkIfTransferConditionsAreFulfilled(taskIds, taskSummaries, bulkLog);
|
checkIfTransferConditionsAreFulfilled(taskIds, taskSummaries, bulkLog);
|
||||||
updateTasksToBeTransferred(taskIds, taskSummaries, destinationWorkbasket, setTransferFlag);
|
updateTasksToBeTransferred(taskIds, taskSummaries, destinationWorkbasket, setTransferFlag);
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("exit from transferTasks(), returning {}", bulkLog);
|
|
||||||
}
|
|
||||||
|
|
||||||
return bulkLog;
|
return bulkLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,14 +242,6 @@ class TaskTransferrer {
|
||||||
List<String> taskIds,
|
List<String> taskIds,
|
||||||
List<MinimalTaskSummary> taskSummaries,
|
List<MinimalTaskSummary> taskSummaries,
|
||||||
BulkOperationResults<String, TaskanaException> bulkLog) {
|
BulkOperationResults<String, TaskanaException> bulkLog) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to checkIfTransferConditionsAreFulfilled(taskIds = {}, "
|
|
||||||
+ "taskSummaries = {}, bulkLog = {})",
|
|
||||||
taskIds,
|
|
||||||
taskSummaries,
|
|
||||||
bulkLog);
|
|
||||||
}
|
|
||||||
|
|
||||||
Set<String> workbasketIds = new HashSet<>();
|
Set<String> workbasketIds = new HashSet<>();
|
||||||
taskSummaries.forEach(t -> workbasketIds.add(t.getWorkbasketId()));
|
taskSummaries.forEach(t -> workbasketIds.add(t.getWorkbasketId()));
|
||||||
|
@ -311,7 +258,6 @@ class TaskTransferrer {
|
||||||
.list();
|
.list();
|
||||||
}
|
}
|
||||||
checkIfTasksMatchTransferCriteria(taskIds, taskSummaries, sourceWorkbaskets, bulkLog);
|
checkIfTasksMatchTransferCriteria(taskIds, taskSummaries, sourceWorkbaskets, bulkLog);
|
||||||
LOGGER.debug("exit from checkIfTransferConditionsAreFulfilled()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkIfTasksMatchTransferCriteria(
|
private void checkIfTasksMatchTransferCriteria(
|
||||||
|
@ -319,15 +265,6 @@ class TaskTransferrer {
|
||||||
List<MinimalTaskSummary> taskSummaries,
|
List<MinimalTaskSummary> taskSummaries,
|
||||||
List<WorkbasketSummary> sourceWorkbaskets,
|
List<WorkbasketSummary> sourceWorkbaskets,
|
||||||
BulkOperationResults<String, TaskanaException> bulkLog) {
|
BulkOperationResults<String, TaskanaException> bulkLog) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to checkIfTasksMatchTransferCriteria(taskIds = {}, taskSummaries = {}, "
|
|
||||||
+ "sourceWorkbaskets = {}, bulkLog = {})",
|
|
||||||
taskIds,
|
|
||||||
taskSummaries,
|
|
||||||
sourceWorkbaskets,
|
|
||||||
bulkLog);
|
|
||||||
}
|
|
||||||
|
|
||||||
Iterator<String> taskIdIterator = taskIds.iterator();
|
Iterator<String> taskIdIterator = taskIds.iterator();
|
||||||
while (taskIdIterator.hasNext()) {
|
while (taskIdIterator.hasNext()) {
|
||||||
|
@ -359,7 +296,6 @@ class TaskTransferrer {
|
||||||
taskIdIterator.remove();
|
taskIdIterator.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from checkIfTasksMatchTransferCriteria()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createTaskTransferredEvent(
|
private void createTaskTransferredEvent(
|
||||||
|
@ -378,14 +314,6 @@ class TaskTransferrer {
|
||||||
List<MinimalTaskSummary> taskSummaries,
|
List<MinimalTaskSummary> taskSummaries,
|
||||||
Workbasket destinationWorkbasket,
|
Workbasket destinationWorkbasket,
|
||||||
boolean setTransferFlag) {
|
boolean setTransferFlag) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to updateTasksToBeTransferred(taskIds = {}, taskSummaries = {}, "
|
|
||||||
+ "destinationWorkbasket = {})",
|
|
||||||
taskIds,
|
|
||||||
taskSummaries,
|
|
||||||
destinationWorkbasket.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
taskSummaries =
|
taskSummaries =
|
||||||
taskSummaries.stream()
|
taskSummaries.stream()
|
||||||
|
@ -406,7 +334,6 @@ class TaskTransferrer {
|
||||||
createTasksTransferredEvents(taskSummaries, updateObject);
|
createTasksTransferredEvents(taskSummaries, updateObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from updateTasksToBeTransferred()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createTasksTransferredEvents(
|
private void createTasksTransferredEvents(
|
||||||
|
|
|
@ -82,7 +82,6 @@ public class TaskCleanupJob extends AbstractTaskanaJob {
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TaskSummary> getTasksCompletedBefore(Instant untilDate) {
|
private List<TaskSummary> getTasksCompletedBefore(Instant untilDate) {
|
||||||
LOGGER.debug("entry to getTasksCompletedBefore(untilDate = {})", untilDate);
|
|
||||||
|
|
||||||
List<TaskSummary> tasksToDelete =
|
List<TaskSummary> tasksToDelete =
|
||||||
taskanaEngineImpl
|
taskanaEngineImpl
|
||||||
|
@ -127,17 +126,10 @@ public class TaskCleanupJob extends AbstractTaskanaJob {
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("exit from getTasksCompletedBefore(), returning {}", tasksToDelete);
|
|
||||||
}
|
|
||||||
|
|
||||||
return tasksToDelete;
|
return tasksToDelete;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int deleteTasksTransactionally(List<TaskSummary> tasksToBeDeleted) {
|
private int deleteTasksTransactionally(List<TaskSummary> tasksToBeDeleted) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("entry to deleteTasksTransactionally(tasksToBeDeleted = {})", tasksToBeDeleted);
|
|
||||||
}
|
|
||||||
|
|
||||||
int deletedTaskCount = 0;
|
int deletedTaskCount = 0;
|
||||||
if (txProvider != null) {
|
if (txProvider != null) {
|
||||||
|
@ -152,7 +144,6 @@ public class TaskCleanupJob extends AbstractTaskanaJob {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
LOGGER.debug("exit from deleteTasksTransactionally(), returning {}", count);
|
|
||||||
return count;
|
return count;
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
@ -161,21 +152,19 @@ public class TaskCleanupJob extends AbstractTaskanaJob {
|
||||||
LOGGER.warn("Could not delete tasks.", e);
|
LOGGER.warn("Could not delete tasks.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from deleteTasksTransactionally(), returning {}", deletedTaskCount);
|
|
||||||
return deletedTaskCount;
|
return deletedTaskCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int deleteTasks(List<TaskSummary> tasksToBeDeleted)
|
private int deleteTasks(List<TaskSummary> tasksToBeDeleted)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("entry to deleteTasks(tasksToBeDeleted = {})", tasksToBeDeleted);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<String> tasksIdsToBeDeleted =
|
List<String> tasksIdsToBeDeleted =
|
||||||
tasksToBeDeleted.stream().map(TaskSummary::getId).collect(Collectors.toList());
|
tasksToBeDeleted.stream().map(TaskSummary::getId).collect(Collectors.toList());
|
||||||
BulkOperationResults<String, TaskanaException> results =
|
BulkOperationResults<String, TaskanaException> results =
|
||||||
taskanaEngineImpl.getTaskService().deleteTasks(tasksIdsToBeDeleted);
|
taskanaEngineImpl.getTaskService().deleteTasks(tasksIdsToBeDeleted);
|
||||||
LOGGER.debug("{} tasks deleted.", tasksIdsToBeDeleted.size() - results.getFailedIds().size());
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("{} tasks deleted.", tasksIdsToBeDeleted.size() - results.getFailedIds().size());
|
||||||
|
}
|
||||||
for (String failedId : results.getFailedIds()) {
|
for (String failedId : results.getFailedIds()) {
|
||||||
if (LOGGER.isWarnEnabled()) {
|
if (LOGGER.isWarnEnabled()) {
|
||||||
LOGGER.warn(
|
LOGGER.warn(
|
||||||
|
@ -184,18 +173,13 @@ public class TaskCleanupJob extends AbstractTaskanaJob {
|
||||||
LogSanitizer.stripLineBreakingChars(results.getErrorForId(failedId)));
|
LogSanitizer.stripLineBreakingChars(results.getErrorForId(failedId)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug(
|
|
||||||
"exit from deleteTasks(), returning {}",
|
|
||||||
tasksIdsToBeDeleted.size() - results.getFailedIds().size());
|
|
||||||
return tasksIdsToBeDeleted.size() - results.getFailedIds().size();
|
return tasksIdsToBeDeleted.size() - results.getFailedIds().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void scheduleNextCleanupJob() {
|
private void scheduleNextCleanupJob() {
|
||||||
LOGGER.debug("Entry to scheduleNextCleanupJob.");
|
|
||||||
ScheduledJob job = new ScheduledJob();
|
ScheduledJob job = new ScheduledJob();
|
||||||
job.setType(ScheduledJob.Type.TASKCLEANUPJOB);
|
job.setType(ScheduledJob.Type.TASKCLEANUPJOB);
|
||||||
job.setDue(getNextDueForCleanupJob());
|
job.setDue(getNextDueForCleanupJob());
|
||||||
taskanaEngineImpl.getJobService().createJob(job);
|
taskanaEngineImpl.getJobService().createJob(job);
|
||||||
LOGGER.debug("Exit from scheduleNextCleanupJob.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,6 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.ibatis.exceptions.PersistenceException;
|
import org.apache.ibatis.exceptions.PersistenceException;
|
||||||
import org.apache.ibatis.session.RowBounds;
|
import org.apache.ibatis.session.RowBounds;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.common.api.exceptions.TaskanaRuntimeException;
|
import pro.taskana.common.api.exceptions.TaskanaRuntimeException;
|
||||||
import pro.taskana.common.internal.InternalTaskanaEngine;
|
import pro.taskana.common.internal.InternalTaskanaEngine;
|
||||||
|
@ -27,8 +25,6 @@ abstract class AbstractWorkbasketAccessItemQueryImpl<
|
||||||
private static final String LINK_TO_COUNTER =
|
private static final String LINK_TO_COUNTER =
|
||||||
"pro.taskana.workbasket.internal.WorkbasketQueryMapper.countQueryWorkbasketAccessItems";
|
"pro.taskana.workbasket.internal.WorkbasketQueryMapper.countQueryWorkbasketAccessItems";
|
||||||
|
|
||||||
private static final Logger LOGGER =
|
|
||||||
LoggerFactory.getLogger(AbstractWorkbasketAccessItemQueryImpl.class);
|
|
||||||
private AccessItemQueryColumnName columnName;
|
private AccessItemQueryColumnName columnName;
|
||||||
private String[] accessIdIn;
|
private String[] accessIdIn;
|
||||||
private String[] workbasketIdIn;
|
private String[] workbasketIdIn;
|
||||||
|
@ -80,7 +76,6 @@ abstract class AbstractWorkbasketAccessItemQueryImpl<
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<T> list() {
|
public List<T> list() {
|
||||||
LOGGER.debug("entry to list(), this = {}", _this());
|
|
||||||
List<T> result = new ArrayList<>();
|
List<T> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -90,16 +85,11 @@ abstract class AbstractWorkbasketAccessItemQueryImpl<
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(). Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<T> list(int offset, int limit) {
|
public List<T> list(int offset, int limit) {
|
||||||
LOGGER.debug("entry to list(offset = {}, limit = {}), this = {}", offset, limit, _this());
|
|
||||||
List<T> result = new ArrayList<>();
|
List<T> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -119,19 +109,12 @@ abstract class AbstractWorkbasketAccessItemQueryImpl<
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(offset,limit). Returning {} resulting Objects: {} ",
|
|
||||||
result.size(),
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> listValues(
|
public List<String> listValues(
|
||||||
AccessItemQueryColumnName columnName, SortDirection sortDirection) {
|
AccessItemQueryColumnName columnName, SortDirection sortDirection) {
|
||||||
LOGGER.debug("Entry to listValues(dbColumnName={}) this = {}", columnName, _this());
|
|
||||||
List<String> result = null;
|
List<String> result = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -142,19 +125,11 @@ abstract class AbstractWorkbasketAccessItemQueryImpl<
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
int numberOfResultObjects = result == null ? 0 : result.size();
|
|
||||||
LOGGER.debug(
|
|
||||||
"Exit from listValues. Returning {} resulting Objects: {} ",
|
|
||||||
numberOfResultObjects,
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public T single() {
|
public T single() {
|
||||||
LOGGER.debug("entry to single(), this = {}", _this());
|
|
||||||
T accessItem = null;
|
T accessItem = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -162,13 +137,11 @@ abstract class AbstractWorkbasketAccessItemQueryImpl<
|
||||||
return accessItem;
|
return accessItem;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from single(). Returning result {} ", accessItem);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long count() {
|
public long count() {
|
||||||
LOGGER.debug("entry to count(), this = {}", _this());
|
|
||||||
Long rowCount = null;
|
Long rowCount = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -176,7 +149,6 @@ abstract class AbstractWorkbasketAccessItemQueryImpl<
|
||||||
return (rowCount == null) ? 0L : rowCount;
|
return (rowCount == null) ? 0L : rowCount;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from count(). Returning result {} ", rowCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,6 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.ibatis.exceptions.PersistenceException;
|
import org.apache.ibatis.exceptions.PersistenceException;
|
||||||
import org.apache.ibatis.session.RowBounds;
|
import org.apache.ibatis.session.RowBounds;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.common.api.exceptions.TaskanaRuntimeException;
|
import pro.taskana.common.api.exceptions.TaskanaRuntimeException;
|
||||||
import pro.taskana.common.internal.InternalTaskanaEngine;
|
import pro.taskana.common.internal.InternalTaskanaEngine;
|
||||||
|
@ -24,7 +22,6 @@ public class WorkbasketAccessItemQueryImpl implements WorkbasketAccessItemQuery
|
||||||
"pro.taskana.workbasket.internal.WorkbasketQueryMapper.countQueryWorkbasketAccessItems";
|
"pro.taskana.workbasket.internal.WorkbasketQueryMapper.countQueryWorkbasketAccessItems";
|
||||||
private static final String LINK_TO_VALUEMAPPER =
|
private static final String LINK_TO_VALUEMAPPER =
|
||||||
"pro.taskana.workbasket.internal.WorkbasketQueryMapper.queryWorkbasketAccessItemColumnValues";
|
"pro.taskana.workbasket.internal.WorkbasketQueryMapper.queryWorkbasketAccessItemColumnValues";
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(WorkbasketQueryImpl.class);
|
|
||||||
private AccessItemQueryColumnName columnName;
|
private AccessItemQueryColumnName columnName;
|
||||||
private String[] accessIdIn;
|
private String[] accessIdIn;
|
||||||
private String[] accessIdLike;
|
private String[] accessIdLike;
|
||||||
|
@ -102,19 +99,14 @@ public class WorkbasketAccessItemQueryImpl implements WorkbasketAccessItemQuery
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WorkbasketAccessItem> list() {
|
public List<WorkbasketAccessItem> list() {
|
||||||
LOGGER.debug("entry to list(), this = {}", this);
|
|
||||||
List<WorkbasketAccessItem> result =
|
List<WorkbasketAccessItem> result =
|
||||||
taskanaEngine.openAndReturnConnection(
|
taskanaEngine.openAndReturnConnection(
|
||||||
() -> new ArrayList<>(taskanaEngine.getSqlSession().selectList(LINK_TO_MAPPER, this)));
|
() -> new ArrayList<>(taskanaEngine.getSqlSession().selectList(LINK_TO_MAPPER, this)));
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("exit from list(). Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WorkbasketAccessItem> list(int offset, int limit) {
|
public List<WorkbasketAccessItem> list(int offset, int limit) {
|
||||||
LOGGER.debug("entry to list(offset = {}, limit = {}), this = {}", offset, limit, this);
|
|
||||||
List<WorkbasketAccessItem> result = new ArrayList<>();
|
List<WorkbasketAccessItem> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -134,19 +126,12 @@ public class WorkbasketAccessItemQueryImpl implements WorkbasketAccessItemQuery
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(offset,limit). Returning {} resulting Objects: {} ",
|
|
||||||
result.size(),
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> listValues(
|
public List<String> listValues(
|
||||||
AccessItemQueryColumnName columnName, SortDirection sortDirection) {
|
AccessItemQueryColumnName columnName, SortDirection sortDirection) {
|
||||||
LOGGER.debug("Entry to listValues(dbColumnName={}) this = {}", columnName, this);
|
|
||||||
List<String> result = null;
|
List<String> result = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -157,19 +142,11 @@ public class WorkbasketAccessItemQueryImpl implements WorkbasketAccessItemQuery
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
int numberOfResultObjects = result == null ? 0 : result.size();
|
|
||||||
LOGGER.debug(
|
|
||||||
"Exit from listValues. Returning {} resulting Objects: {} ",
|
|
||||||
numberOfResultObjects,
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorkbasketAccessItem single() {
|
public WorkbasketAccessItem single() {
|
||||||
LOGGER.debug("entry to single(), this = {}", this);
|
|
||||||
WorkbasketAccessItem accessItm = null;
|
WorkbasketAccessItem accessItm = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -177,13 +154,11 @@ public class WorkbasketAccessItemQueryImpl implements WorkbasketAccessItemQuery
|
||||||
return accessItm;
|
return accessItm;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from single(). Returning result {} ", accessItm);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long count() {
|
public long count() {
|
||||||
LOGGER.debug("entry to count(), this = {}", this);
|
|
||||||
Long rowCount = null;
|
Long rowCount = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -191,7 +166,6 @@ public class WorkbasketAccessItemQueryImpl implements WorkbasketAccessItemQuery
|
||||||
return (rowCount == null) ? 0L : rowCount;
|
return (rowCount == null) ? 0L : rowCount;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from count(). Returning result {} ", rowCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,6 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.ibatis.exceptions.PersistenceException;
|
import org.apache.ibatis.exceptions.PersistenceException;
|
||||||
import org.apache.ibatis.session.RowBounds;
|
import org.apache.ibatis.session.RowBounds;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import pro.taskana.TaskanaEngineConfiguration;
|
import pro.taskana.TaskanaEngineConfiguration;
|
||||||
import pro.taskana.common.api.TaskanaRole;
|
import pro.taskana.common.api.TaskanaRole;
|
||||||
|
@ -32,7 +30,6 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
||||||
"pro.taskana.workbasket.internal.WorkbasketQueryMapper.countQueryWorkbaskets";
|
"pro.taskana.workbasket.internal.WorkbasketQueryMapper.countQueryWorkbaskets";
|
||||||
private static final String LINK_TO_VALUEMAPPER =
|
private static final String LINK_TO_VALUEMAPPER =
|
||||||
"pro.taskana.workbasket.internal.WorkbasketQueryMapper.queryWorkbasketColumnValues";
|
"pro.taskana.workbasket.internal.WorkbasketQueryMapper.queryWorkbasketColumnValues";
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(WorkbasketQueryImpl.class);
|
|
||||||
private WorkbasketQueryColumnName columnName;
|
private WorkbasketQueryColumnName columnName;
|
||||||
private String[] accessId;
|
private String[] accessId;
|
||||||
private String[] idIn;
|
private String[] idIn;
|
||||||
|
@ -362,7 +359,6 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WorkbasketSummary> list() {
|
public List<WorkbasketSummary> list() {
|
||||||
LOGGER.debug("entry to list(), this = {}", this);
|
|
||||||
List<WorkbasketSummary> workbaskets = new ArrayList<>();
|
List<WorkbasketSummary> workbaskets = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -371,19 +367,11 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
||||||
return workbaskets;
|
return workbaskets;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
int numberOfResultObjects = workbaskets == null ? 0 : workbaskets.size();
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(). Returning {} resulting Objects: {} ",
|
|
||||||
numberOfResultObjects,
|
|
||||||
workbaskets);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WorkbasketSummary> list(int offset, int limit) {
|
public List<WorkbasketSummary> list(int offset, int limit) {
|
||||||
LOGGER.debug("entry to list(offset = {}, limit = {}), this = {}", offset, limit, this);
|
|
||||||
List<WorkbasketSummary> workbaskets = new ArrayList<>();
|
List<WorkbasketSummary> workbaskets = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -402,18 +390,11 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from list(offset,limit). Returning {} resulting Objects: {} ",
|
|
||||||
workbaskets.size(),
|
|
||||||
workbaskets);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> listValues(
|
public List<String> listValues(
|
||||||
WorkbasketQueryColumnName columnName, SortDirection sortDirection) {
|
WorkbasketQueryColumnName columnName, SortDirection sortDirection) {
|
||||||
LOGGER.debug("Entry to listValues(dbColumnName={}) this = {}", columnName, this);
|
|
||||||
List<String> result = new ArrayList<>();
|
List<String> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -424,16 +405,11 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"Exit from listValues. Returning {} resulting Objects: {} ", result.size(), result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorkbasketSummary single() {
|
public WorkbasketSummary single() {
|
||||||
LOGGER.debug("entry to single(), this = {}", this);
|
|
||||||
WorkbasketSummary workbasket = null;
|
WorkbasketSummary workbasket = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -442,13 +418,11 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
||||||
return workbasket;
|
return workbasket;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from single(). Returning result {} ", workbasket);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long count() {
|
public long count() {
|
||||||
LOGGER.debug("entry to count(), this = {}", this);
|
|
||||||
Long rowCount = null;
|
Long rowCount = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -457,7 +431,6 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
||||||
return (rowCount == null) ? 0L : rowCount;
|
return (rowCount == null) ? 0L : rowCount;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from count(). Returning result {} ", rowCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -669,7 +642,6 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
||||||
lowercaseAccessIds(this.accessId);
|
lowercaseAccessIds(this.accessId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug("exit from handleCallerRolesAndAccessIds, now this is {}", this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private WorkbasketQuery addOrderCriteria(String colName, SortDirection sortDirection) {
|
private WorkbasketQuery addOrderCriteria(String colName, SortDirection sortDirection) {
|
||||||
|
|
|
@ -78,7 +78,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
@Override
|
@Override
|
||||||
public Workbasket getWorkbasket(String workbasketId)
|
public Workbasket getWorkbasket(String workbasketId)
|
||||||
throws WorkbasketNotFoundException, NotAuthorizedException {
|
throws WorkbasketNotFoundException, NotAuthorizedException {
|
||||||
LOGGER.debug("entry to getWorkbasket(workbasketId = {})", workbasketId);
|
|
||||||
Workbasket result = null;
|
Workbasket result = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -95,14 +94,12 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from getWorkbasket(workbasketId). Returning result {} ", result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Workbasket getWorkbasket(String workbasketKey, String domain)
|
public Workbasket getWorkbasket(String workbasketKey, String domain)
|
||||||
throws WorkbasketNotFoundException, NotAuthorizedException {
|
throws WorkbasketNotFoundException, NotAuthorizedException {
|
||||||
LOGGER.debug("entry to getWorkbasketByKey(workbasketKey = {})", workbasketKey);
|
|
||||||
Workbasket result = null;
|
Workbasket result = null;
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -121,7 +118,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from getWorkbasket(workbasketId). Returning result {} ", result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +125,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
public Workbasket createWorkbasket(Workbasket newWorkbasket)
|
public Workbasket createWorkbasket(Workbasket newWorkbasket)
|
||||||
throws InvalidWorkbasketException, NotAuthorizedException, WorkbasketAlreadyExistException,
|
throws InvalidWorkbasketException, NotAuthorizedException, WorkbasketAlreadyExistException,
|
||||||
DomainNotFoundException {
|
DomainNotFoundException {
|
||||||
LOGGER.debug("entry to createWorkbasket(workbasket) with Workbasket {}", newWorkbasket);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
|
|
||||||
WorkbasketImpl workbasket = (WorkbasketImpl) newWorkbasket;
|
WorkbasketImpl workbasket = (WorkbasketImpl) newWorkbasket;
|
||||||
|
@ -163,11 +158,12 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
taskanaEngine.getEngine().getCurrentUserContext().getUserid(),
|
taskanaEngine.getEngine().getCurrentUserContext().getUserid(),
|
||||||
details));
|
details));
|
||||||
}
|
}
|
||||||
LOGGER.debug("Method createWorkbasket() created Workbasket '{}'", workbasket);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Method createWorkbasket() created Workbasket '{}'", workbasket);
|
||||||
|
}
|
||||||
return workbasket;
|
return workbasket;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from createWorkbasket(workbasket). Returning result {} ", workbasket);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,8 +172,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
throws NotAuthorizedException, WorkbasketNotFoundException, ConcurrencyException,
|
throws NotAuthorizedException, WorkbasketNotFoundException, ConcurrencyException,
|
||||||
InvalidWorkbasketException {
|
InvalidWorkbasketException {
|
||||||
|
|
||||||
LOGGER.debug("entry to updateWorkbasket(Workbasket = {})", workbasketToUpdate);
|
|
||||||
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
WorkbasketImpl workbasketImplToUpdate = (WorkbasketImpl) workbasketToUpdate;
|
WorkbasketImpl workbasketImplToUpdate = (WorkbasketImpl) workbasketToUpdate;
|
||||||
validateNameAndType(workbasketToUpdate);
|
validateNameAndType(workbasketToUpdate);
|
||||||
|
@ -209,13 +203,14 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
details));
|
details));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Method updateWorkbasket() updated workbasket '{}'", workbasketImplToUpdate.getId());
|
LOGGER.debug(
|
||||||
|
"Method updateWorkbasket() updated workbasket '{}'", workbasketImplToUpdate.getId());
|
||||||
|
}
|
||||||
|
|
||||||
return workbasketImplToUpdate;
|
return workbasketImplToUpdate;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from updateWorkbasket(). Returning result {} ", workbasketImplToUpdate);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,8 +230,7 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
public WorkbasketAccessItem createWorkbasketAccessItem(WorkbasketAccessItem workbasketAccessItem)
|
public WorkbasketAccessItem createWorkbasketAccessItem(WorkbasketAccessItem workbasketAccessItem)
|
||||||
throws InvalidArgumentException, NotAuthorizedException, WorkbasketNotFoundException,
|
throws InvalidArgumentException, NotAuthorizedException, WorkbasketNotFoundException,
|
||||||
WorkbasketAccessItemAlreadyExistException {
|
WorkbasketAccessItemAlreadyExistException {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to createWorkbasketAccessItemn(workbasketAccessItem = {})", workbasketAccessItem);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
WorkbasketAccessItemImpl accessItem = (WorkbasketAccessItemImpl) workbasketAccessItem;
|
WorkbasketAccessItemImpl accessItem = (WorkbasketAccessItemImpl) workbasketAccessItem;
|
||||||
try {
|
try {
|
||||||
|
@ -276,11 +270,15 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
taskanaEngine.getEngine().getCurrentUserContext().getUserid(),
|
taskanaEngine.getEngine().getCurrentUserContext().getUserid(),
|
||||||
details));
|
details));
|
||||||
}
|
}
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Method createWorkbasketAccessItem() created workbaskteAccessItem {}", accessItem);
|
LOGGER.debug(
|
||||||
|
"Method createWorkbasketAccessItem() created workbaskteAccessItem {}", accessItem);
|
||||||
|
}
|
||||||
} catch (PersistenceException e) {
|
} catch (PersistenceException e) {
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"when trying to insert WorkbasketAccessItem {} caught exception", accessItem, e);
|
LOGGER.debug(
|
||||||
|
"when trying to insert WorkbasketAccessItem {} caught exception", accessItem, e);
|
||||||
|
}
|
||||||
Stream<String> accessItemExistsIdentifier =
|
Stream<String> accessItemExistsIdentifier =
|
||||||
Stream.of(
|
Stream.of(
|
||||||
"SQLCODE=-803", // DB2
|
"SQLCODE=-803", // DB2
|
||||||
|
@ -295,17 +293,13 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
return accessItem;
|
return accessItem;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug(
|
|
||||||
"exit from createWorkbasketAccessItem(workbasketAccessItem). Returning result {}",
|
|
||||||
accessItem);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorkbasketAccessItem updateWorkbasketAccessItem(WorkbasketAccessItem workbasketAccessItem)
|
public WorkbasketAccessItem updateWorkbasketAccessItem(WorkbasketAccessItem workbasketAccessItem)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to updateWorkbasketAccessItem(workbasketAccessItem = {}", workbasketAccessItem);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
WorkbasketAccessItemImpl accessItem = (WorkbasketAccessItemImpl) workbasketAccessItem;
|
WorkbasketAccessItemImpl accessItem = (WorkbasketAccessItemImpl) workbasketAccessItem;
|
||||||
try {
|
try {
|
||||||
|
@ -337,19 +331,18 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
details));
|
details));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Method updateWorkbasketAccessItem() updated workbasketAccessItem {}", accessItem);
|
LOGGER.debug(
|
||||||
|
"Method updateWorkbasketAccessItem() updated workbasketAccessItem {}", accessItem);
|
||||||
|
}
|
||||||
return accessItem;
|
return accessItem;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug(
|
|
||||||
"exit from updateWorkbasketAccessItem(workbasketAccessItem). Returning {}", accessItem);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteWorkbasketAccessItem(String accessItemId) throws NotAuthorizedException {
|
public void deleteWorkbasketAccessItem(String accessItemId) throws NotAuthorizedException {
|
||||||
LOGGER.debug("entry to deleteWorkbasketAccessItem(id = {})", accessItemId);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -376,12 +369,13 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
details));
|
details));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Method deleteWorkbasketAccessItem() deleted workbasketAccessItem wit Id {}",
|
LOGGER.debug(
|
||||||
accessItemId);
|
"Method deleteWorkbasketAccessItem() deleted workbasketAccessItem wit Id {}",
|
||||||
|
accessItemId);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from deleteWorkbasketAccessItem(id).");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -431,7 +425,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from checkAuthorization(). User is authorized = {}.", isAuthorized);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -486,14 +479,12 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from checkAuthorization(). User is authorized = {}.", isAuthorized);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WorkbasketAccessItem> getWorkbasketAccessItems(String workbasketId)
|
public List<WorkbasketAccessItem> getWorkbasketAccessItems(String workbasketId)
|
||||||
throws NotAuthorizedException {
|
throws NotAuthorizedException {
|
||||||
LOGGER.debug("entry to getWorkbasketAccessItems(workbasketId = {})", workbasketId);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
List<WorkbasketAccessItem> result = new ArrayList<>();
|
List<WorkbasketAccessItem> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
|
@ -504,12 +495,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from getWorkbasketAccessItems(workbasketId). Returning {} resulting Objects: {} ",
|
|
||||||
result.size(),
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -518,7 +503,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
String workbasketId, List<WorkbasketAccessItem> wbAccessItems)
|
String workbasketId, List<WorkbasketAccessItem> wbAccessItems)
|
||||||
throws NotAuthorizedException, WorkbasketAccessItemAlreadyExistException,
|
throws NotAuthorizedException, WorkbasketAccessItemAlreadyExistException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
LOGGER.debug("entry to setWorkbasketAccessItems(workbasketAccessItems = {})", wbAccessItems);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
|
|
||||||
Set<String> ids = new HashSet<>();
|
Set<String> ids = new HashSet<>();
|
||||||
|
@ -554,7 +538,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from setWorkbasketAccessItems(workbasketAccessItems = {})", wbAccessItems);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -588,7 +571,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
@Override
|
@Override
|
||||||
public List<WorkbasketSummary> getDistributionTargets(String workbasketId)
|
public List<WorkbasketSummary> getDistributionTargets(String workbasketId)
|
||||||
throws NotAuthorizedException, WorkbasketNotFoundException {
|
throws NotAuthorizedException, WorkbasketNotFoundException {
|
||||||
LOGGER.debug("entry to getDistributionTargets(workbasketId = {})", workbasketId);
|
|
||||||
List<WorkbasketSummary> result = new ArrayList<>();
|
List<WorkbasketSummary> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -605,21 +587,13 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
int numberOfResultObjects = result.size();
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from getDistributionTargets(workbasketId). Returning {} resulting Objects: {} ",
|
|
||||||
numberOfResultObjects,
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WorkbasketSummary> getDistributionTargets(String workbasketKey, String domain)
|
public List<WorkbasketSummary> getDistributionTargets(String workbasketKey, String domain)
|
||||||
throws NotAuthorizedException, WorkbasketNotFoundException {
|
throws NotAuthorizedException, WorkbasketNotFoundException {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to getDistributionTargets(workbasketKey = {}, domain = {})", workbasketKey, domain);
|
|
||||||
List<WorkbasketSummary> result = new ArrayList<>();
|
List<WorkbasketSummary> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -636,25 +610,13 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
int numberOfResultObjects = result.size();
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from getDistributionTargets(workbasketId). Returning {} resulting Objects: {} ",
|
|
||||||
numberOfResultObjects,
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDistributionTargets(String sourceWorkbasketId, List<String> targetWorkbasketIds)
|
public void setDistributionTargets(String sourceWorkbasketId, List<String> targetWorkbasketIds)
|
||||||
throws WorkbasketNotFoundException, NotAuthorizedException {
|
throws WorkbasketNotFoundException, NotAuthorizedException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"entry to setDistributionTargets(sourceWorkbasketId = {}, targetWorkazketIds = {})",
|
|
||||||
sourceWorkbasketId,
|
|
||||||
targetWorkbasketIds);
|
|
||||||
}
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -677,11 +639,13 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
// check for existence of target workbasket
|
// check for existence of target workbasket
|
||||||
getWorkbasket(targetId);
|
getWorkbasket(targetId);
|
||||||
distributionTargetMapper.insert(sourceWorkbasketId, targetId);
|
distributionTargetMapper.insert(sourceWorkbasketId, targetId);
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Method setDistributionTargets() created distribution target "
|
LOGGER.debug(
|
||||||
+ "for source '{}' and target {}",
|
"Method setDistributionTargets() created distribution target "
|
||||||
sourceWorkbasketId,
|
+ "for source '{}' and target {}",
|
||||||
targetId);
|
sourceWorkbasketId,
|
||||||
|
targetId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HistoryEventManager.isHistoryEnabled() && !targetWorkbasketIds.isEmpty()) {
|
if (HistoryEventManager.isHistoryEnabled() && !targetWorkbasketIds.isEmpty()) {
|
||||||
|
@ -713,10 +677,7 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
@Override
|
@Override
|
||||||
public void addDistributionTarget(String sourceWorkbasketId, String targetWorkbasketId)
|
public void addDistributionTarget(String sourceWorkbasketId, String targetWorkbasketId)
|
||||||
throws NotAuthorizedException, WorkbasketNotFoundException {
|
throws NotAuthorizedException, WorkbasketNotFoundException {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to addDistributionTarget(sourceWorkbasketId = {}, targetWorkbasketId = {})",
|
|
||||||
sourceWorkbasketId,
|
|
||||||
targetWorkbasketId);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -729,9 +690,11 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
distributionTargetMapper.getNumberOfDistributionTargets(
|
distributionTargetMapper.getNumberOfDistributionTargets(
|
||||||
sourceWorkbasketId, targetWorkbasketId);
|
sourceWorkbasketId, targetWorkbasketId);
|
||||||
if (numOfDistTargets > 0) {
|
if (numOfDistTargets > 0) {
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"addDistributionTarget detected that the specified "
|
LOGGER.debug(
|
||||||
+ "distribution target exists already. Doing nothing.");
|
"addDistributionTarget detected that the specified "
|
||||||
|
+ "distribution target exists already. Doing nothing.");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
distributionTargetMapper.insert(sourceWorkbasketId, targetWorkbasketId);
|
distributionTargetMapper.insert(sourceWorkbasketId, targetWorkbasketId);
|
||||||
|
|
||||||
|
@ -747,27 +710,25 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
taskanaEngine.getEngine().getCurrentUserContext().getUserid(),
|
taskanaEngine.getEngine().getCurrentUserContext().getUserid(),
|
||||||
details));
|
details));
|
||||||
}
|
}
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"addDistributionTarget inserted distribution target sourceId = {}, targetId = {}",
|
LOGGER.debug(
|
||||||
sourceWorkbasketId,
|
"addDistributionTarget inserted distribution target sourceId = {}, targetId = {}",
|
||||||
targetWorkbasketId);
|
sourceWorkbasketId,
|
||||||
|
targetWorkbasketId);
|
||||||
|
}
|
||||||
sourceWorkbasket.setModified(Instant.now());
|
sourceWorkbasket.setModified(Instant.now());
|
||||||
workbasketMapper.update(sourceWorkbasket);
|
workbasketMapper.update(sourceWorkbasket);
|
||||||
}
|
}
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from addDistributionTarget");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeDistributionTarget(String sourceWorkbasketId, String targetWorkbasketId)
|
public void removeDistributionTarget(String sourceWorkbasketId, String targetWorkbasketId)
|
||||||
throws NotAuthorizedException {
|
throws NotAuthorizedException {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to removeDistributionTarget(sourceWorkbasketId = {}, targetWorkbasketId = {})",
|
|
||||||
sourceWorkbasketId,
|
|
||||||
targetWorkbasketId);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -797,30 +758,35 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
details));
|
details));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"removeDistributionTarget deleted distribution target sourceId = {}, targetId = {}",
|
LOGGER.debug(
|
||||||
sourceWorkbasketId,
|
"removeDistributionTarget deleted distribution target sourceId = {}, targetId = {}",
|
||||||
targetWorkbasketId);
|
sourceWorkbasketId,
|
||||||
|
targetWorkbasketId);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
WorkbasketImpl sourceWorkbasket = (WorkbasketImpl) getWorkbasket(sourceWorkbasketId);
|
WorkbasketImpl sourceWorkbasket = (WorkbasketImpl) getWorkbasket(sourceWorkbasketId);
|
||||||
sourceWorkbasket.setModified(Instant.now());
|
sourceWorkbasket.setModified(Instant.now());
|
||||||
workbasketMapper.update(sourceWorkbasket);
|
workbasketMapper.update(sourceWorkbasket);
|
||||||
} catch (WorkbasketNotFoundException e) {
|
} catch (WorkbasketNotFoundException e) {
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"removeDistributionTarget found that the source workbasket {} "
|
LOGGER.debug(
|
||||||
+ "doesn't exist. Ignoring the request... ",
|
"removeDistributionTarget found that the source workbasket {} "
|
||||||
sourceWorkbasketId);
|
+ "doesn't exist. Ignoring the request... ",
|
||||||
|
sourceWorkbasketId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"removeDistributionTarget detected that the specified distribution "
|
LOGGER.debug(
|
||||||
+ "target doesn't exist. Doing nothing...");
|
"removeDistributionTarget detected that the specified distribution "
|
||||||
|
+ "target doesn't exist. Doing nothing...");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from addDistributionTarget");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -828,7 +794,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
public boolean deleteWorkbasket(String workbasketId)
|
public boolean deleteWorkbasket(String workbasketId)
|
||||||
throws NotAuthorizedException, WorkbasketNotFoundException, WorkbasketInUseException,
|
throws NotAuthorizedException, WorkbasketNotFoundException, WorkbasketInUseException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
LOGGER.debug("entry to deleteWorkbasket(workbasketId = {})", workbasketId);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
|
|
||||||
validateId(workbasketId);
|
validateId(workbasketId);
|
||||||
|
@ -840,7 +805,9 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
try {
|
try {
|
||||||
workbasketToDelete = this.getWorkbasket(workbasketId);
|
workbasketToDelete = this.getWorkbasket(workbasketId);
|
||||||
} catch (WorkbasketNotFoundException ex) {
|
} catch (WorkbasketNotFoundException ex) {
|
||||||
LOGGER.debug("Workbasket with workbasketId = {} is already deleted?", workbasketId);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Workbasket with workbasketId = {} is already deleted?", workbasketId);
|
||||||
|
}
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -886,15 +853,11 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
return canBeDeletedNow;
|
return canBeDeletedNow;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from deleteWorkbasket(workbasketId = {})", workbasketId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public BulkOperationResults<String, TaskanaException> deleteWorkbaskets(
|
public BulkOperationResults<String, TaskanaException> deleteWorkbaskets(
|
||||||
List<String> workbasketsIds) throws NotAuthorizedException, InvalidArgumentException {
|
List<String> workbasketsIds) throws NotAuthorizedException, InvalidArgumentException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("entry to deleteWorkbaskets(workbasketId = {})", workbasketsIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
|
|
||||||
|
@ -936,7 +899,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
}
|
}
|
||||||
return bulkLog;
|
return bulkLog;
|
||||||
} finally {
|
} finally {
|
||||||
LOGGER.debug("exit from deleteWorkbaskets()");
|
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -944,7 +906,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
@Override
|
@Override
|
||||||
public List<WorkbasketSummary> getDistributionSources(String workbasketId)
|
public List<WorkbasketSummary> getDistributionSources(String workbasketId)
|
||||||
throws NotAuthorizedException, WorkbasketNotFoundException {
|
throws NotAuthorizedException, WorkbasketNotFoundException {
|
||||||
LOGGER.debug("entry to getDistributionSources(workbasketId = {})", workbasketId);
|
|
||||||
List<WorkbasketSummary> result = new ArrayList<>();
|
List<WorkbasketSummary> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -959,21 +920,13 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
int numberOfResultObjects = result.size();
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from getDistributionSources(workbasketId). Returning {} resulting Objects: {} ",
|
|
||||||
numberOfResultObjects,
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<WorkbasketSummary> getDistributionSources(String workbasketKey, String domain)
|
public List<WorkbasketSummary> getDistributionSources(String workbasketKey, String domain)
|
||||||
throws NotAuthorizedException, WorkbasketNotFoundException {
|
throws NotAuthorizedException, WorkbasketNotFoundException {
|
||||||
LOGGER.debug(
|
|
||||||
"entry to getDistributionSources(workbasketKey = {}, domain = {})", workbasketKey, domain);
|
|
||||||
List<WorkbasketSummary> result = new ArrayList<>();
|
List<WorkbasketSummary> result = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -988,20 +941,12 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
return result;
|
return result;
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
int numberOfResultObjects = result.size();
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from getDistributionSources(workbasketId). Returning {} resulting Objects: {} ",
|
|
||||||
numberOfResultObjects,
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteWorkbasketAccessItemsForAccessId(String accessId)
|
public void deleteWorkbasketAccessItemsForAccessId(String accessId)
|
||||||
throws NotAuthorizedException {
|
throws NotAuthorizedException {
|
||||||
LOGGER.debug("entry to deleteWorkbasketAccessItemsForAccessId(accessId = {})", accessId);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -1035,7 +980,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from deleteWorkbasketAccessItemsForAccessId(accessId={}).", accessId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1119,18 +1063,24 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
|
|
||||||
// Skip permission check if security is not enabled
|
// Skip permission check if security is not enabled
|
||||||
if (!taskanaEngine.getEngine().getConfiguration().isSecurityEnabled()) {
|
if (!taskanaEngine.getEngine().getConfiguration().isSecurityEnabled()) {
|
||||||
LOGGER.debug("Skipping permissions check since security is disabled.");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Skipping permissions check since security is disabled.");
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Arrays.asList(requestedPermissions).contains(WorkbasketPermission.READ)) {
|
if (Arrays.asList(requestedPermissions).contains(WorkbasketPermission.READ)) {
|
||||||
|
|
||||||
if (taskanaEngine.getEngine().isUserInRole(TaskanaRole.ADMIN)) {
|
if (taskanaEngine.getEngine().isUserInRole(TaskanaRole.ADMIN)) {
|
||||||
LOGGER.debug("Skipping read permissions check since user is in role ADMIN");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Skipping read permissions check since user is in role ADMIN");
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (taskanaEngine.getEngine().isUserInRole(TaskanaRole.ADMIN, TaskanaRole.TASK_ADMIN)) {
|
} else if (taskanaEngine.getEngine().isUserInRole(TaskanaRole.ADMIN, TaskanaRole.TASK_ADMIN)) {
|
||||||
LOGGER.debug("Skipping permissions check since user is in role ADMIN or TASK_ADMIN.");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Skipping permissions check since user is in role ADMIN or TASK_ADMIN.");
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1195,7 +1145,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
|
|
||||||
private void markWorkbasketForDeletion(String workbasketId)
|
private void markWorkbasketForDeletion(String workbasketId)
|
||||||
throws NotAuthorizedException, InvalidArgumentException {
|
throws NotAuthorizedException, InvalidArgumentException {
|
||||||
LOGGER.debug("entry to markWorkbasketForDeletion(workbasketId = {})", workbasketId);
|
|
||||||
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
taskanaEngine.getEngine().checkRoleMembership(TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
try {
|
try {
|
||||||
taskanaEngine.openConnection();
|
taskanaEngine.openConnection();
|
||||||
|
@ -1214,7 +1163,6 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
taskanaEngine.returnConnection();
|
taskanaEngine.returnConnection();
|
||||||
LOGGER.debug("exit from markWorkbasketForDeletion(workbasketId = {}).", workbasketId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,8 +105,10 @@ public class WorkbasketCleanupJob extends AbstractTaskanaJob {
|
||||||
|
|
||||||
BulkOperationResults<String, TaskanaException> results =
|
BulkOperationResults<String, TaskanaException> results =
|
||||||
taskanaEngineImpl.getWorkbasketService().deleteWorkbaskets(workbasketsToBeDeleted);
|
taskanaEngineImpl.getWorkbasketService().deleteWorkbaskets(workbasketsToBeDeleted);
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"{} workbasket deleted.", workbasketsToBeDeleted.size() - results.getFailedIds().size());
|
LOGGER.debug(
|
||||||
|
"{} workbasket deleted.", workbasketsToBeDeleted.size() - results.getFailedIds().size());
|
||||||
|
}
|
||||||
for (String failedId : results.getFailedIds()) {
|
for (String failedId : results.getFailedIds()) {
|
||||||
LOGGER.warn(
|
LOGGER.warn(
|
||||||
"Workbasket with id {} could not be deleted. Reason:",
|
"Workbasket with id {} could not be deleted. Reason:",
|
||||||
|
@ -117,11 +119,9 @@ public class WorkbasketCleanupJob extends AbstractTaskanaJob {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void scheduleNextCleanupJob() {
|
private void scheduleNextCleanupJob() {
|
||||||
LOGGER.debug("Entry to scheduleNextCleanupJob.");
|
|
||||||
ScheduledJob job = new ScheduledJob();
|
ScheduledJob job = new ScheduledJob();
|
||||||
job.setType(ScheduledJob.Type.WORKBASKETCLEANUPJOB);
|
job.setType(ScheduledJob.Type.WORKBASKETCLEANUPJOB);
|
||||||
job.setDue(getNextDueForCleanupJob());
|
job.setDue(getNextDueForCleanupJob());
|
||||||
taskanaEngineImpl.getJobService().createJob(job);
|
taskanaEngineImpl.getJobService().createJob(job);
|
||||||
LOGGER.debug("Exit from scheduleNextCleanupJob.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import com.tngtech.archunit.base.Optional;
|
import com.tngtech.archunit.base.Optional;
|
||||||
import com.tngtech.archunit.core.domain.JavaClass;
|
import com.tngtech.archunit.core.domain.JavaClass;
|
||||||
|
import com.tngtech.archunit.core.domain.JavaClass.Predicates;
|
||||||
import com.tngtech.archunit.core.domain.JavaClasses;
|
import com.tngtech.archunit.core.domain.JavaClasses;
|
||||||
import com.tngtech.archunit.core.domain.JavaMethod;
|
import com.tngtech.archunit.core.domain.JavaMethod;
|
||||||
import com.tngtech.archunit.core.importer.ClassFileImporter;
|
import com.tngtech.archunit.core.importer.ClassFileImporter;
|
||||||
|
@ -33,6 +34,8 @@ import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.TestFactory;
|
import org.junit.jupiter.api.TestFactory;
|
||||||
import org.junit.jupiter.api.function.ThrowingConsumer;
|
import org.junit.jupiter.api.function.ThrowingConsumer;
|
||||||
|
|
||||||
|
import pro.taskana.common.internal.logging.LoggingAspect;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test architecture of classes in taskana. For more info and examples see
|
* Test architecture of classes in taskana. For more info and examples see
|
||||||
* https://www.archunit.org/userguide/html/000_Index.html.
|
* https://www.archunit.org/userguide/html/000_Index.html.
|
||||||
|
@ -75,8 +78,9 @@ class ArchitectureTest {
|
||||||
.and()
|
.and()
|
||||||
.resideInAPackage("..api..")
|
.resideInAPackage("..api..")
|
||||||
.should()
|
.should()
|
||||||
.onlyDependOnClassesThat()
|
.onlyDependOnClassesThat(
|
||||||
.resideOutsideOfPackage("..internal..");
|
Predicates.resideOutsideOfPackage("..pro.taskana..internal..")
|
||||||
|
.or(Predicates.assignableTo(LoggingAspect.class)));
|
||||||
myRule.check(importedClasses);
|
myRule.check(importedClasses);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import nl.jqno.equalsverifier.EqualsVerifier;
|
import nl.jqno.equalsverifier.EqualsVerifier;
|
||||||
import nl.jqno.equalsverifier.Warning;
|
import nl.jqno.equalsverifier.Warning;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
|
||||||
import org.junit.jupiter.api.Disabled;
|
import org.junit.jupiter.api.Disabled;
|
||||||
import org.junit.jupiter.api.DynamicTest;
|
import org.junit.jupiter.api.DynamicTest;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
@ -28,21 +27,16 @@ import org.junit.jupiter.api.TestFactory;
|
||||||
/** check classes with a custom equals and hashcode implementation for correctness. */
|
/** check classes with a custom equals and hashcode implementation for correctness. */
|
||||||
class PojoTest {
|
class PojoTest {
|
||||||
|
|
||||||
private static List<Class<?>> pojoClasses;
|
private static final List<Class<?>> POJO_CLASSES = getPojoClasses();
|
||||||
|
|
||||||
@BeforeAll
|
|
||||||
static void setup() {
|
|
||||||
pojoClasses = getPojoClasses();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testsThatPojoClassesAreFound() {
|
void testsThatPojoClassesAreFound() {
|
||||||
assertThat(pojoClasses).isNotEmpty();
|
assertThat(POJO_CLASSES).isNotEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestFactory
|
@TestFactory
|
||||||
Stream<DynamicTest> equalsContract() {
|
Stream<DynamicTest> equalsContract() {
|
||||||
return pojoClasses.stream()
|
return POJO_CLASSES.stream()
|
||||||
.map(
|
.map(
|
||||||
cl ->
|
cl ->
|
||||||
DynamicTest.dynamicTest(
|
DynamicTest.dynamicTest(
|
||||||
|
@ -52,7 +46,7 @@ class PojoTest {
|
||||||
|
|
||||||
@TestFactory
|
@TestFactory
|
||||||
Stream<DynamicTest> validateGetters() {
|
Stream<DynamicTest> validateGetters() {
|
||||||
return pojoClasses.stream()
|
return POJO_CLASSES.stream()
|
||||||
.map(
|
.map(
|
||||||
cl ->
|
cl ->
|
||||||
DynamicTest.dynamicTest(
|
DynamicTest.dynamicTest(
|
||||||
|
@ -62,7 +56,7 @@ class PojoTest {
|
||||||
|
|
||||||
@TestFactory
|
@TestFactory
|
||||||
Stream<DynamicTest> validateSetters() {
|
Stream<DynamicTest> validateSetters() {
|
||||||
return pojoClasses.stream()
|
return POJO_CLASSES.stream()
|
||||||
.map(
|
.map(
|
||||||
cl ->
|
cl ->
|
||||||
DynamicTest.dynamicTest(
|
DynamicTest.dynamicTest(
|
||||||
|
@ -73,7 +67,7 @@ class PojoTest {
|
||||||
@TestFactory
|
@TestFactory
|
||||||
@Disabled("because of the truncation of all Instant member variables")
|
@Disabled("because of the truncation of all Instant member variables")
|
||||||
Stream<DynamicTest> validateGetAndSet() {
|
Stream<DynamicTest> validateGetAndSet() {
|
||||||
return pojoClasses.stream()
|
return POJO_CLASSES.stream()
|
||||||
.map(
|
.map(
|
||||||
cl ->
|
cl ->
|
||||||
DynamicTest.dynamicTest(
|
DynamicTest.dynamicTest(
|
||||||
|
@ -83,7 +77,7 @@ class PojoTest {
|
||||||
|
|
||||||
@TestFactory
|
@TestFactory
|
||||||
Stream<DynamicTest> validateNoStaticExceptFinalFields() {
|
Stream<DynamicTest> validateNoStaticExceptFinalFields() {
|
||||||
return pojoClasses.stream()
|
return POJO_CLASSES.stream()
|
||||||
.map(
|
.map(
|
||||||
cl ->
|
cl ->
|
||||||
DynamicTest.dynamicTest(
|
DynamicTest.dynamicTest(
|
||||||
|
@ -93,7 +87,7 @@ class PojoTest {
|
||||||
|
|
||||||
@TestFactory
|
@TestFactory
|
||||||
Stream<DynamicTest> validateNoPublicFields() {
|
Stream<DynamicTest> validateNoPublicFields() {
|
||||||
return pojoClasses.stream()
|
return POJO_CLASSES.stream()
|
||||||
.map(
|
.map(
|
||||||
cl ->
|
cl ->
|
||||||
DynamicTest.dynamicTest(
|
DynamicTest.dynamicTest(
|
||||||
|
|
|
@ -41,7 +41,7 @@ class SelectAndClaimTaskAccTest extends AbstractAccTest {
|
||||||
|
|
||||||
Runnable test = getRunnableTest(selectedAndClaimedTasks, accessIds);
|
Runnable test = getRunnableTest(selectedAndClaimedTasks, accessIds);
|
||||||
|
|
||||||
Thread[] threads = new Thread[4];
|
Thread[] threads = new Thread[accessIds.size()];
|
||||||
for (int i = 0; i < threads.length; i++) {
|
for (int i = 0; i < threads.length; i++) {
|
||||||
threads[i] = new Thread(test);
|
threads[i] = new Thread(test);
|
||||||
threads[i].start();
|
threads[i].start();
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-core</artifactId>
|
<artifactId>taskana-core</artifactId>
|
||||||
|
|
50
pom.xml
50
pom.xml
|
@ -89,6 +89,10 @@
|
||||||
<version.slf4j-test>1.2.0</version.slf4j-test>
|
<version.slf4j-test>1.2.0</version.slf4j-test>
|
||||||
<version.auto-restdocs>2.0.11</version.auto-restdocs>
|
<version.auto-restdocs>2.0.11</version.auto-restdocs>
|
||||||
|
|
||||||
|
<!-- AspectJ dependencies -->
|
||||||
|
<version.aspectj-maven-plugin>1.12.6</version.aspectj-maven-plugin>
|
||||||
|
<version.aspectj>1.9.6</version.aspectj>
|
||||||
|
|
||||||
<!-- database driver versions -->
|
<!-- database driver versions -->
|
||||||
<version.db2>11.1.1.1</version.db2>
|
<version.db2>11.1.1.1</version.db2>
|
||||||
|
|
||||||
|
@ -135,6 +139,51 @@
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>aspectj-logging</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>!skipAspectJ</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.nickwongdev</groupId>
|
||||||
|
<artifactId>aspectj-maven-plugin</artifactId>
|
||||||
|
<version>${version.aspectj-maven-plugin}</version>
|
||||||
|
<configuration>
|
||||||
|
<complianceLevel>${java.version}</complianceLevel>
|
||||||
|
<source>11</source>
|
||||||
|
<target>8</target>
|
||||||
|
<showWeaveInfo>false</showWeaveInfo>
|
||||||
|
<verbose>true</verbose>
|
||||||
|
<aspectLibraries>
|
||||||
|
<aspectLibrary>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
</aspectLibrary>
|
||||||
|
</aspectLibraries>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>compile</goal>
|
||||||
|
<goal>test-compile</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.aspectj</groupId>
|
||||||
|
<artifactId>aspectjtools</artifactId>
|
||||||
|
<version>${version.aspectj}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>jdk8-compatibility</id>
|
<id>jdk8-compatibility</id>
|
||||||
<activation>
|
<activation>
|
||||||
|
@ -261,6 +310,7 @@
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!-- This plugin appends version information into the jar, so
|
<!-- This plugin appends version information into the jar, so
|
||||||
that it can be extracted from the jar. See TSK-837 for more information -->
|
that it can be extracted from the jar. See TSK-837 for more information -->
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
|
@ -16,6 +16,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database</groupId>
|
<groupId>com.h2database</groupId>
|
||||||
<artifactId>h2</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
|
@ -41,9 +46,6 @@
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
<id>history.plugin</id>
|
<id>history.plugin</id>
|
||||||
<activation>
|
|
||||||
<activeByDefault>false</activeByDefault>
|
|
||||||
</activation>
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana.history</groupId>
|
<groupId>pro.taskana.history</groupId>
|
||||||
|
@ -84,9 +86,6 @@
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>historyLogging.plugin</id>
|
<id>historyLogging.plugin</id>
|
||||||
<activation>
|
|
||||||
<activeByDefault>false</activeByDefault>
|
|
||||||
</activation>
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana.history</groupId>
|
<groupId>pro.taskana.history</groupId>
|
||||||
|
|
|
@ -20,6 +20,11 @@
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-rest-spring</artifactId>
|
<artifactId>taskana-rest-spring</artifactId>
|
||||||
|
|
|
@ -42,7 +42,6 @@ public class JobScheduler {
|
||||||
public void scheduleCleanupJob()
|
public void scheduleCleanupJob()
|
||||||
throws NoSuchMethodException, InvocationTargetException, IllegalAccessException,
|
throws NoSuchMethodException, InvocationTargetException, IllegalAccessException,
|
||||||
ClassNotFoundException {
|
ClassNotFoundException {
|
||||||
LOGGER.debug("Entry to scheduleCleanupJob.");
|
|
||||||
TaskCleanupJob.initializeSchedule(taskanaEngine);
|
TaskCleanupJob.initializeSchedule(taskanaEngine);
|
||||||
WorkbasketCleanupJob.initializeSchedule(taskanaEngine);
|
WorkbasketCleanupJob.initializeSchedule(taskanaEngine);
|
||||||
|
|
||||||
|
@ -53,7 +52,6 @@ public class JobScheduler {
|
||||||
.getDeclaredMethod("initializeSchedule", TaskanaEngine.class)
|
.getDeclaredMethod("initializeSchedule", TaskanaEngine.class)
|
||||||
.invoke(null, taskanaEngine);
|
.invoke(null, taskanaEngine);
|
||||||
}
|
}
|
||||||
LOGGER.debug("Exit from scheduleCleanupJob.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Scheduled(cron = "${taskana.jobscheduler.async.cron}")
|
@Scheduled(cron = "${taskana.jobscheduler.async.cron}")
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package pro.taskana.example.rest.controllers;
|
package pro.taskana.example.rest.controllers;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.core.Ordered;
|
import org.springframework.core.Ordered;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||||
|
@ -10,13 +8,10 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
/** The login controller. */
|
/** The login controller. */
|
||||||
@Controller
|
@Controller
|
||||||
public class LoginController implements WebMvcConfigurer {
|
public class LoginController implements WebMvcConfigurer {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(LoginController.class);
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addViewControllers(ViewControllerRegistry registry) {
|
public void addViewControllers(ViewControllerRegistry registry) {
|
||||||
LOGGER.debug("Entry to addViewControllers()");
|
|
||||||
registry.addViewController("/login").setViewName("login");
|
registry.addViewController("/login").setViewName("login");
|
||||||
registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
|
registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
|
||||||
LOGGER.debug("Exit from addViewControllers()");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,11 @@
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-spring</artifactId>
|
<artifactId>taskana-spring</artifactId>
|
||||||
|
|
|
@ -4,8 +4,6 @@ import java.beans.ConstructorProperties;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.hateoas.MediaTypes;
|
import org.springframework.hateoas.MediaTypes;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||||
|
@ -48,8 +46,6 @@ import pro.taskana.common.rest.util.QueryParamsValidator;
|
||||||
@EnableHypermediaSupport(type = HypermediaType.HAL)
|
@EnableHypermediaSupport(type = HypermediaType.HAL)
|
||||||
public class ClassificationController {
|
public class ClassificationController {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ClassificationController.class);
|
|
||||||
|
|
||||||
private final ClassificationService classificationService;
|
private final ClassificationService classificationService;
|
||||||
private final ClassificationRepresentationModelAssembler modelAssembler;
|
private final ClassificationRepresentationModelAssembler modelAssembler;
|
||||||
private final ClassificationSummaryRepresentationModelAssembler summaryModelAssembler;
|
private final ClassificationSummaryRepresentationModelAssembler summaryModelAssembler;
|
||||||
|
@ -97,10 +93,6 @@ public class ClassificationController {
|
||||||
ResponseEntity.ok(
|
ResponseEntity.ok(
|
||||||
summaryModelAssembler.toPagedModel(
|
summaryModelAssembler.toPagedModel(
|
||||||
classificationSummaries, pagingParameter.getPageMetadata()));
|
classificationSummaries, pagingParameter.getPageMetadata()));
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getClassifications(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,17 +108,9 @@ public class ClassificationController {
|
||||||
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
||||||
public ResponseEntity<ClassificationRepresentationModel> getClassification(
|
public ResponseEntity<ClassificationRepresentationModel> getClassification(
|
||||||
@PathVariable String classificationId) throws ClassificationNotFoundException {
|
@PathVariable String classificationId) throws ClassificationNotFoundException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Entry to getClassification(classificationId= {})", classificationId);
|
|
||||||
}
|
|
||||||
|
|
||||||
Classification classification = classificationService.getClassification(classificationId);
|
Classification classification = classificationService.getClassification(classificationId);
|
||||||
ResponseEntity<ClassificationRepresentationModel> response =
|
ResponseEntity<ClassificationRepresentationModel> response =
|
||||||
ResponseEntity.ok(modelAssembler.toModel(classification));
|
ResponseEntity.ok(modelAssembler.toModel(classification));
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getClassification(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,17 +133,11 @@ public class ClassificationController {
|
||||||
@RequestBody ClassificationRepresentationModel repModel)
|
@RequestBody ClassificationRepresentationModel repModel)
|
||||||
throws NotAuthorizedException, ClassificationAlreadyExistException, DomainNotFoundException,
|
throws NotAuthorizedException, ClassificationAlreadyExistException, DomainNotFoundException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Entry to createClassification(repModel= {})", repModel);
|
|
||||||
}
|
|
||||||
Classification classification = modelAssembler.toEntityModel(repModel);
|
Classification classification = modelAssembler.toEntityModel(repModel);
|
||||||
classification = classificationService.createClassification(classification);
|
classification = classificationService.createClassification(classification);
|
||||||
|
|
||||||
ResponseEntity<ClassificationRepresentationModel> response =
|
ResponseEntity<ClassificationRepresentationModel> response =
|
||||||
ResponseEntity.status(HttpStatus.CREATED).body(modelAssembler.toModel(classification));
|
ResponseEntity.status(HttpStatus.CREATED).body(modelAssembler.toModel(classification));
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from createClassification(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
@ -184,12 +162,6 @@ public class ClassificationController {
|
||||||
@RequestBody ClassificationRepresentationModel resource)
|
@RequestBody ClassificationRepresentationModel resource)
|
||||||
throws NotAuthorizedException, ClassificationNotFoundException, ConcurrencyException,
|
throws NotAuthorizedException, ClassificationNotFoundException, ConcurrencyException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"Entry to updateClassification(classificationId= {}, resource= {})",
|
|
||||||
classificationId,
|
|
||||||
resource);
|
|
||||||
}
|
|
||||||
if (!classificationId.equals(resource.getClassificationId())) {
|
if (!classificationId.equals(resource.getClassificationId())) {
|
||||||
throw new InvalidArgumentException(
|
throw new InvalidArgumentException(
|
||||||
String.format(
|
String.format(
|
||||||
|
@ -202,10 +174,6 @@ public class ClassificationController {
|
||||||
ResponseEntity<ClassificationRepresentationModel> result =
|
ResponseEntity<ClassificationRepresentationModel> result =
|
||||||
ResponseEntity.ok(modelAssembler.toModel(classification));
|
ResponseEntity.ok(modelAssembler.toModel(classification));
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from updateClassification(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,10 +193,8 @@ public class ClassificationController {
|
||||||
public ResponseEntity<ClassificationRepresentationModel> deleteClassification(
|
public ResponseEntity<ClassificationRepresentationModel> deleteClassification(
|
||||||
@PathVariable String classificationId)
|
@PathVariable String classificationId)
|
||||||
throws ClassificationNotFoundException, ClassificationInUseException, NotAuthorizedException {
|
throws ClassificationNotFoundException, ClassificationInUseException, NotAuthorizedException {
|
||||||
LOGGER.debug("Entry to deleteClassification(classificationId= {})", classificationId);
|
|
||||||
classificationService.deleteClassification(classificationId);
|
classificationService.deleteClassification(classificationId);
|
||||||
ResponseEntity<ClassificationRepresentationModel> response = ResponseEntity.noContent().build();
|
ResponseEntity<ClassificationRepresentationModel> response = ResponseEntity.noContent().build();
|
||||||
LOGGER.debug("Exit from deleteClassification(), returning {}", response);
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ import static pro.taskana.common.internal.util.CheckedFunction.wrap;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -13,8 +12,6 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.dao.DuplicateKeyException;
|
import org.springframework.dao.DuplicateKeyException;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||||
|
@ -48,9 +45,6 @@ import pro.taskana.common.rest.RestEndpoints;
|
||||||
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
|
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
|
||||||
public class ClassificationDefinitionController {
|
public class ClassificationDefinitionController {
|
||||||
|
|
||||||
private static final Logger LOGGER =
|
|
||||||
LoggerFactory.getLogger(ClassificationDefinitionController.class);
|
|
||||||
|
|
||||||
private final ObjectMapper mapper;
|
private final ObjectMapper mapper;
|
||||||
private final ClassificationService classificationService;
|
private final ClassificationService classificationService;
|
||||||
private final ClassificationDefinitionRepresentationModelAssembler assembler;
|
private final ClassificationDefinitionRepresentationModelAssembler assembler;
|
||||||
|
@ -76,9 +70,6 @@ public class ClassificationDefinitionController {
|
||||||
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
||||||
public ResponseEntity<ClassificationDefinitionCollectionRepresentationModel>
|
public ResponseEntity<ClassificationDefinitionCollectionRepresentationModel>
|
||||||
exportClassifications(@RequestParam(required = false) String[] domain) {
|
exportClassifications(@RequestParam(required = false) String[] domain) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Entry to exportClassifications(domain= {})", Arrays.toString(domain));
|
|
||||||
}
|
|
||||||
ClassificationQuery query = classificationService.createClassificationQuery();
|
ClassificationQuery query = classificationService.createClassificationQuery();
|
||||||
|
|
||||||
List<ClassificationSummary> summaries =
|
List<ClassificationSummary> summaries =
|
||||||
|
@ -94,9 +85,6 @@ public class ClassificationDefinitionController {
|
||||||
|
|
||||||
ResponseEntity<ClassificationDefinitionCollectionRepresentationModel> response =
|
ResponseEntity<ClassificationDefinitionCollectionRepresentationModel> response =
|
||||||
ResponseEntity.ok(collectionModel);
|
ResponseEntity.ok(collectionModel);
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from exportClassifications(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
@ -122,7 +110,6 @@ public class ClassificationDefinitionController {
|
||||||
throws InvalidArgumentException, NotAuthorizedException, ConcurrencyException,
|
throws InvalidArgumentException, NotAuthorizedException, ConcurrencyException,
|
||||||
ClassificationNotFoundException, ClassificationAlreadyExistException,
|
ClassificationNotFoundException, ClassificationAlreadyExistException,
|
||||||
DomainNotFoundException, IOException {
|
DomainNotFoundException, IOException {
|
||||||
LOGGER.debug("Entry to importClassifications()");
|
|
||||||
Map<String, String> systemIds = getSystemIds();
|
Map<String, String> systemIds = getSystemIds();
|
||||||
ClassificationDefinitionCollectionRepresentationModel collection =
|
ClassificationDefinitionCollectionRepresentationModel collection =
|
||||||
extractClassificationResourcesFromFile(file);
|
extractClassificationResourcesFromFile(file);
|
||||||
|
@ -133,7 +120,6 @@ public class ClassificationDefinitionController {
|
||||||
insertOrUpdateClassificationsWithoutParent(collection.getContent(), systemIds);
|
insertOrUpdateClassificationsWithoutParent(collection.getContent(), systemIds);
|
||||||
updateParentChildrenRelations(childrenInFile);
|
updateParentChildrenRelations(childrenInFile);
|
||||||
ResponseEntity<Void> response = ResponseEntity.noContent().build();
|
ResponseEntity<Void> response = ResponseEntity.noContent().build();
|
||||||
LOGGER.debug("Exit from importClassifications(), returning {}", response);
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +157,6 @@ public class ClassificationDefinitionController {
|
||||||
private Map<Classification, String> mapChildrenToParentKeys(
|
private Map<Classification, String> mapChildrenToParentKeys(
|
||||||
Collection<ClassificationDefinitionRepresentationModel> definitionList,
|
Collection<ClassificationDefinitionRepresentationModel> definitionList,
|
||||||
Map<String, String> systemIds) {
|
Map<String, String> systemIds) {
|
||||||
LOGGER.debug("Entry to mapChildrenToParentKeys()");
|
|
||||||
Map<Classification, String> childrenInFile = new HashMap<>();
|
Map<Classification, String> childrenInFile = new HashMap<>();
|
||||||
Set<String> newKeysWithDomain = new HashSet<>();
|
Set<String> newKeysWithDomain = new HashSet<>();
|
||||||
definitionList.stream()
|
definitionList.stream()
|
||||||
|
@ -200,10 +185,6 @@ public class ClassificationDefinitionController {
|
||||||
childrenInFile.put(assembler.toEntityModel(def), cl.getParentKey());
|
childrenInFile.put(assembler.toEntityModel(def), cl.getParentKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from mapChildrenToParentKeys(), returning {}", childrenInFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
return childrenInFile;
|
return childrenInFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,8 +193,6 @@ public class ClassificationDefinitionController {
|
||||||
Map<String, String> systemIds)
|
Map<String, String> systemIds)
|
||||||
throws ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException,
|
throws ClassificationNotFoundException, NotAuthorizedException, InvalidArgumentException,
|
||||||
ClassificationAlreadyExistException, DomainNotFoundException, ConcurrencyException {
|
ClassificationAlreadyExistException, DomainNotFoundException, ConcurrencyException {
|
||||||
LOGGER.debug("Entry to insertOrUpdateClassificationsWithoutParent()");
|
|
||||||
|
|
||||||
for (ClassificationDefinitionRepresentationModel definition : definitionList) {
|
for (ClassificationDefinitionRepresentationModel definition : definitionList) {
|
||||||
ClassificationRepresentationModel classificationRepModel = definition.getClassification();
|
ClassificationRepresentationModel classificationRepModel = definition.getClassification();
|
||||||
classificationRepModel.setParentKey(null);
|
classificationRepModel.setParentKey(null);
|
||||||
|
@ -230,14 +209,11 @@ public class ClassificationDefinitionController {
|
||||||
classificationService.createClassification(newClassification);
|
classificationService.createClassification(newClassification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGGER.debug("Exit from insertOrUpdateClassificationsWithoutParent()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateParentChildrenRelations(Map<Classification, String> childrenInFile)
|
private void updateParentChildrenRelations(Map<Classification, String> childrenInFile)
|
||||||
throws ClassificationNotFoundException, NotAuthorizedException, ConcurrencyException,
|
throws ClassificationNotFoundException, NotAuthorizedException, ConcurrencyException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
LOGGER.debug("Entry to updateParentChildrenRelations()");
|
|
||||||
|
|
||||||
for (Map.Entry<Classification, String> entry : childrenInFile.entrySet()) {
|
for (Map.Entry<Classification, String> entry : childrenInFile.entrySet()) {
|
||||||
Classification childRes = entry.getKey();
|
Classification childRes = entry.getKey();
|
||||||
String parentKey = entry.getValue();
|
String parentKey = entry.getValue();
|
||||||
|
@ -256,13 +232,11 @@ public class ClassificationDefinitionController {
|
||||||
|
|
||||||
classificationService.updateClassification(child);
|
classificationService.updateClassification(child);
|
||||||
}
|
}
|
||||||
LOGGER.debug("Exit from updateParentChildrenRelations()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateExistingClassification(Classification newClassification, String systemId)
|
private void updateExistingClassification(Classification newClassification, String systemId)
|
||||||
throws ClassificationNotFoundException, NotAuthorizedException, ConcurrencyException,
|
throws ClassificationNotFoundException, NotAuthorizedException, ConcurrencyException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
LOGGER.debug("Entry to updateExistingClassification()");
|
|
||||||
Classification currentClassification = classificationService.getClassification(systemId);
|
Classification currentClassification = classificationService.getClassification(systemId);
|
||||||
if (newClassification.getType() != null
|
if (newClassification.getType() != null
|
||||||
&& !newClassification.getType().equals(currentClassification.getType())) {
|
&& !newClassification.getType().equals(currentClassification.getType())) {
|
||||||
|
@ -302,6 +276,5 @@ public class ClassificationDefinitionController {
|
||||||
ClassificationCustomField.CUSTOM_8,
|
ClassificationCustomField.CUSTOM_8,
|
||||||
newClassification.getCustomAttribute(ClassificationCustomField.CUSTOM_8));
|
newClassification.getCustomAttribute(ClassificationCustomField.CUSTOM_8));
|
||||||
classificationService.updateClassification(currentClassification);
|
classificationService.updateClassification(currentClassification);
|
||||||
LOGGER.debug("Exit from updateExistingClassification()");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package pro.taskana.common.rest;
|
package pro.taskana.common.rest;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType;
|
import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType;
|
||||||
|
@ -23,8 +21,6 @@ import pro.taskana.common.rest.models.AccessIdRepresentationModel;
|
||||||
@EnableHypermediaSupport(type = HypermediaType.HAL)
|
@EnableHypermediaSupport(type = HypermediaType.HAL)
|
||||||
public class AccessIdController {
|
public class AccessIdController {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(AccessIdController.class);
|
|
||||||
|
|
||||||
private final LdapClient ldapClient;
|
private final LdapClient ldapClient;
|
||||||
private final TaskanaEngine taskanaEngine;
|
private final TaskanaEngine taskanaEngine;
|
||||||
|
|
||||||
|
@ -48,18 +44,10 @@ public class AccessIdController {
|
||||||
public ResponseEntity<List<AccessIdRepresentationModel>> searchUsersAndGroups(
|
public ResponseEntity<List<AccessIdRepresentationModel>> searchUsersAndGroups(
|
||||||
@RequestParam("search-for") String searchFor)
|
@RequestParam("search-for") String searchFor)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
|
|
||||||
LOGGER.debug("Entry to validateAccessIds(search-for= {})", searchFor);
|
|
||||||
|
|
||||||
taskanaEngine.checkRoleMembership(TaskanaRole.ADMIN, TaskanaRole.BUSINESS_ADMIN);
|
taskanaEngine.checkRoleMembership(TaskanaRole.ADMIN, TaskanaRole.BUSINESS_ADMIN);
|
||||||
|
|
||||||
List<AccessIdRepresentationModel> accessIdUsers = ldapClient.searchUsersAndGroups(searchFor);
|
List<AccessIdRepresentationModel> accessIdUsers = ldapClient.searchUsersAndGroups(searchFor);
|
||||||
ResponseEntity<List<AccessIdRepresentationModel>> response = ResponseEntity.ok(accessIdUsers);
|
return ResponseEntity.ok(accessIdUsers);
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from validateAccessIds(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,30 +69,17 @@ public class AccessIdController {
|
||||||
public ResponseEntity<List<AccessIdRepresentationModel>> searchUsersByNameOrAccessIdForRole(
|
public ResponseEntity<List<AccessIdRepresentationModel>> searchUsersByNameOrAccessIdForRole(
|
||||||
@RequestParam("search-for") String nameOrAccessId, @RequestParam("role") String role)
|
@RequestParam("search-for") String nameOrAccessId, @RequestParam("role") String role)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
|
|
||||||
LOGGER.debug(
|
|
||||||
"Entry to searchUsersByNameOrAccessIdForRole(search-for= {}, role= {})",
|
|
||||||
nameOrAccessId,
|
|
||||||
role);
|
|
||||||
|
|
||||||
taskanaEngine.checkRoleMembership(
|
taskanaEngine.checkRoleMembership(
|
||||||
TaskanaRole.USER, TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
TaskanaRole.USER, TaskanaRole.BUSINESS_ADMIN, TaskanaRole.ADMIN);
|
||||||
|
|
||||||
if (role.equals("user")) {
|
if (!role.equals("user")) {
|
||||||
List<AccessIdRepresentationModel> accessIdUsers =
|
|
||||||
ldapClient.searchUsersByNameOrAccessIdInUserRole(nameOrAccessId);
|
|
||||||
ResponseEntity<List<AccessIdRepresentationModel>> response = ResponseEntity.ok(accessIdUsers);
|
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from searchUsersByNameOrAccessIdForRole(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
} else {
|
|
||||||
throw new InvalidArgumentException(
|
throw new InvalidArgumentException(
|
||||||
String.format(
|
String.format(
|
||||||
"Requested users for not supported role %s. Only role 'user' is supported'", role));
|
"Requested users for not supported role %s. Only role 'user' is supported'", role));
|
||||||
}
|
}
|
||||||
|
List<AccessIdRepresentationModel> accessIdUsers =
|
||||||
|
ldapClient.searchUsersByNameOrAccessIdInUserRole(nameOrAccessId);
|
||||||
|
return ResponseEntity.ok(accessIdUsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -120,9 +95,6 @@ public class AccessIdController {
|
||||||
public ResponseEntity<List<AccessIdRepresentationModel>> getGroupsByAccessId(
|
public ResponseEntity<List<AccessIdRepresentationModel>> getGroupsByAccessId(
|
||||||
@RequestParam("access-id") String accessId)
|
@RequestParam("access-id") String accessId)
|
||||||
throws InvalidArgumentException, NotAuthorizedException {
|
throws InvalidArgumentException, NotAuthorizedException {
|
||||||
|
|
||||||
LOGGER.debug("Entry to getGroupsByAccessId(access-id= {})", accessId);
|
|
||||||
|
|
||||||
taskanaEngine.checkRoleMembership(TaskanaRole.ADMIN, TaskanaRole.BUSINESS_ADMIN);
|
taskanaEngine.checkRoleMembership(TaskanaRole.ADMIN, TaskanaRole.BUSINESS_ADMIN);
|
||||||
|
|
||||||
if (!ldapClient.validateAccessId(accessId)) {
|
if (!ldapClient.validateAccessId(accessId)) {
|
||||||
|
@ -131,11 +103,7 @@ public class AccessIdController {
|
||||||
|
|
||||||
List<AccessIdRepresentationModel> accessIds =
|
List<AccessIdRepresentationModel> accessIds =
|
||||||
ldapClient.searchGroupsAccessIdIsMemberOf(accessId);
|
ldapClient.searchGroupsAccessIdIsMemberOf(accessId);
|
||||||
ResponseEntity<List<AccessIdRepresentationModel>> response = ResponseEntity.ok(accessIds);
|
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
return ResponseEntity.ok(accessIds);
|
||||||
LOGGER.debug("Exit from getGroupsByAccessId(), returning {}", response);
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,9 @@ public class SpringSecurityToJaasFilter extends GenericFilterBean {
|
||||||
throws IOException, ServletException {
|
throws IOException, ServletException {
|
||||||
Optional<Authentication> authentication = getCurrentAuthentication();
|
Optional<Authentication> authentication = getCurrentAuthentication();
|
||||||
if (authentication.isPresent()) {
|
if (authentication.isPresent()) {
|
||||||
LOGGER.debug("Authentication found in Spring security context: {}", authentication);
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Authentication found in Spring security context: {}", authentication);
|
||||||
|
}
|
||||||
obtainSubject()
|
obtainSubject()
|
||||||
.ifPresent(
|
.ifPresent(
|
||||||
subject -> {
|
subject -> {
|
||||||
|
@ -37,8 +39,10 @@ public class SpringSecurityToJaasFilter extends GenericFilterBean {
|
||||||
initializeGroupPrincipalsFromAuthentication(authentication.get(), subject);
|
initializeGroupPrincipalsFromAuthentication(authentication.get(), subject);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"No authentication found in Spring security context. Continuing unauthenticatic.");
|
LOGGER.debug(
|
||||||
|
"No authentication found in Spring security context. Continuing unauthenticatic.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
chain.doFilter(request, response);
|
chain.doFilter(request, response);
|
||||||
|
@ -74,12 +78,17 @@ public class SpringSecurityToJaasFilter extends GenericFilterBean {
|
||||||
private void initializeUserPrincipalFromAuthentication(
|
private void initializeUserPrincipalFromAuthentication(
|
||||||
Authentication authentication, Subject subject) {
|
Authentication authentication, Subject subject) {
|
||||||
if (subject.getPrincipals().isEmpty()) {
|
if (subject.getPrincipals().isEmpty()) {
|
||||||
LOGGER.debug("Setting the principal of the subject with {}.", authentication.getPrincipal());
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug(
|
||||||
|
"Setting the principal of the subject with {}.", authentication.getPrincipal());
|
||||||
|
}
|
||||||
subject
|
subject
|
||||||
.getPrincipals()
|
.getPrincipals()
|
||||||
.add(new UserPrincipal(((UserDetails) authentication.getPrincipal()).getUsername()));
|
.add(new UserPrincipal(((UserDetails) authentication.getPrincipal()).getUsername()));
|
||||||
} else {
|
} else {
|
||||||
LOGGER.debug("Principal of the subject is already set to {}.", subject.getPrincipals());
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Principal of the subject is already set to {}.", subject.getPrincipals());
|
||||||
|
}
|
||||||
throw new SystemException("Finding an existing principal is unexpected. Please investigate.");
|
throw new SystemException("Finding an existing principal is unexpected. Please investigate.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +96,9 @@ public class SpringSecurityToJaasFilter extends GenericFilterBean {
|
||||||
private void initializeGroupPrincipalsFromAuthentication(
|
private void initializeGroupPrincipalsFromAuthentication(
|
||||||
Authentication authentication, Subject subject) {
|
Authentication authentication, Subject subject) {
|
||||||
|
|
||||||
LOGGER.debug("Adding roles {} to subject.", authentication.getAuthorities());
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Adding roles {} to subject.", authentication.getAuthorities());
|
||||||
|
}
|
||||||
|
|
||||||
authentication
|
authentication
|
||||||
.getAuthorities()
|
.getAuthorities()
|
||||||
|
@ -95,6 +106,8 @@ public class SpringSecurityToJaasFilter extends GenericFilterBean {
|
||||||
grantedAuthority ->
|
grantedAuthority ->
|
||||||
subject.getPrincipals().add(new GroupPrincipal(grantedAuthority.getAuthority())));
|
subject.getPrincipals().add(new GroupPrincipal(grantedAuthority.getAuthority())));
|
||||||
|
|
||||||
LOGGER.debug("{}", subject.getPublicCredentials(GroupPrincipal.class));
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("{}", subject.getPublicCredentials(GroupPrincipal.class));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@ package pro.taskana.common.rest;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
@ -21,8 +19,6 @@ import pro.taskana.common.rest.models.VersionRepresentationModel;
|
||||||
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
|
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
|
||||||
public class TaskanaEngineController {
|
public class TaskanaEngineController {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TaskanaEngineController.class);
|
|
||||||
|
|
||||||
private final TaskanaEngineConfiguration taskanaEngineConfiguration;
|
private final TaskanaEngineConfiguration taskanaEngineConfiguration;
|
||||||
|
|
||||||
private final TaskanaEngine taskanaEngine;
|
private final TaskanaEngine taskanaEngine;
|
||||||
|
@ -40,12 +36,7 @@ public class TaskanaEngineController {
|
||||||
*/
|
*/
|
||||||
@GetMapping(path = RestEndpoints.URL_DOMAIN)
|
@GetMapping(path = RestEndpoints.URL_DOMAIN)
|
||||||
public ResponseEntity<List<String>> getDomains() {
|
public ResponseEntity<List<String>> getDomains() {
|
||||||
ResponseEntity<List<String>> response =
|
return ResponseEntity.ok(taskanaEngineConfiguration.getDomains());
|
||||||
ResponseEntity.ok(taskanaEngineConfiguration.getDomains());
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getDomains(), returning {}", response);
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,21 +50,11 @@ public class TaskanaEngineController {
|
||||||
@GetMapping(path = RestEndpoints.URL_CLASSIFICATION_CATEGORIES)
|
@GetMapping(path = RestEndpoints.URL_CLASSIFICATION_CATEGORIES)
|
||||||
public ResponseEntity<List<String>> getClassificationCategories(
|
public ResponseEntity<List<String>> getClassificationCategories(
|
||||||
@RequestParam(required = false) String type) {
|
@RequestParam(required = false) String type) {
|
||||||
LOGGER.debug("Entry to getClassificationCategories(type = {})", type);
|
|
||||||
ResponseEntity<List<String>> response;
|
ResponseEntity<List<String>> response;
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
response =
|
return ResponseEntity.ok(taskanaEngineConfiguration.getClassificationCategoriesByType(type));
|
||||||
ResponseEntity.ok(taskanaEngineConfiguration.getClassificationCategoriesByType(type));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getClassificationCategories(), returning {}", response);
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
response = ResponseEntity.ok(taskanaEngineConfiguration.getAllClassificationCategories());
|
return ResponseEntity.ok(taskanaEngineConfiguration.getAllClassificationCategories());
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getClassificationCategories(), returning {}", response);
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -83,12 +64,7 @@ public class TaskanaEngineController {
|
||||||
*/
|
*/
|
||||||
@GetMapping(path = RestEndpoints.URL_CLASSIFICATION_TYPES)
|
@GetMapping(path = RestEndpoints.URL_CLASSIFICATION_TYPES)
|
||||||
public ResponseEntity<List<String>> getClassificationTypes() {
|
public ResponseEntity<List<String>> getClassificationTypes() {
|
||||||
ResponseEntity<List<String>> response =
|
return ResponseEntity.ok(taskanaEngineConfiguration.getClassificationTypes());
|
||||||
ResponseEntity.ok(taskanaEngineConfiguration.getClassificationTypes());
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getClassificationTypes(), returning {}", response);
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,12 +75,7 @@ public class TaskanaEngineController {
|
||||||
*/
|
*/
|
||||||
@GetMapping(path = RestEndpoints.URL_CLASSIFICATION_CATEGORIES_BY_TYPES)
|
@GetMapping(path = RestEndpoints.URL_CLASSIFICATION_CATEGORIES_BY_TYPES)
|
||||||
public ResponseEntity<Map<String, List<String>>> getClassificationCategoriesByTypeMap() {
|
public ResponseEntity<Map<String, List<String>>> getClassificationCategoriesByTypeMap() {
|
||||||
ResponseEntity<Map<String, List<String>>> response =
|
return ResponseEntity.ok(taskanaEngineConfiguration.getClassificationCategoriesByTypeMap());
|
||||||
ResponseEntity.ok(taskanaEngineConfiguration.getClassificationCategoriesByTypeMap());
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getClassificationCategoriesByTypeMap(), returning {}", response);
|
|
||||||
}
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -114,7 +85,6 @@ public class TaskanaEngineController {
|
||||||
*/
|
*/
|
||||||
@GetMapping(path = RestEndpoints.URL_CURRENT_USER)
|
@GetMapping(path = RestEndpoints.URL_CURRENT_USER)
|
||||||
public ResponseEntity<TaskanaUserInfoRepresentationModel> getCurrentUserInfo() {
|
public ResponseEntity<TaskanaUserInfoRepresentationModel> getCurrentUserInfo() {
|
||||||
LOGGER.debug("Entry to getCurrentUserInfo()");
|
|
||||||
TaskanaUserInfoRepresentationModel resource = new TaskanaUserInfoRepresentationModel();
|
TaskanaUserInfoRepresentationModel resource = new TaskanaUserInfoRepresentationModel();
|
||||||
resource.setUserId(taskanaEngine.getCurrentUserContext().getUserid());
|
resource.setUserId(taskanaEngine.getCurrentUserContext().getUserid());
|
||||||
resource.setGroupIds(taskanaEngine.getCurrentUserContext().getGroupIds());
|
resource.setGroupIds(taskanaEngine.getCurrentUserContext().getGroupIds());
|
||||||
|
@ -123,12 +93,7 @@ public class TaskanaEngineController {
|
||||||
resource.getRoles().add(role);
|
resource.getRoles().add(role);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ResponseEntity<TaskanaUserInfoRepresentationModel> response = ResponseEntity.ok(resource);
|
return ResponseEntity.ok(resource);
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getCurrentUserInfo(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -138,9 +103,7 @@ public class TaskanaEngineController {
|
||||||
*/
|
*/
|
||||||
@GetMapping(path = RestEndpoints.URL_HISTORY_ENABLED)
|
@GetMapping(path = RestEndpoints.URL_HISTORY_ENABLED)
|
||||||
public ResponseEntity<Boolean> getIsHistoryProviderEnabled() {
|
public ResponseEntity<Boolean> getIsHistoryProviderEnabled() {
|
||||||
ResponseEntity<Boolean> response = ResponseEntity.ok(taskanaEngine.isHistoryEnabled());
|
return ResponseEntity.ok(taskanaEngine.isHistoryEnabled());
|
||||||
LOGGER.debug("Exit from getIsHistoryProviderEnabled(), returning {}", response);
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -150,11 +113,8 @@ public class TaskanaEngineController {
|
||||||
*/
|
*/
|
||||||
@GetMapping(path = RestEndpoints.URL_VERSION)
|
@GetMapping(path = RestEndpoints.URL_VERSION)
|
||||||
public ResponseEntity<VersionRepresentationModel> currentVersion() {
|
public ResponseEntity<VersionRepresentationModel> currentVersion() {
|
||||||
LOGGER.debug("Entry to currentVersion()");
|
|
||||||
VersionRepresentationModel resource = new VersionRepresentationModel();
|
VersionRepresentationModel resource = new VersionRepresentationModel();
|
||||||
resource.setVersion(TaskanaEngineConfiguration.class.getPackage().getImplementationVersion());
|
resource.setVersion(TaskanaEngineConfiguration.class.getPackage().getImplementationVersion());
|
||||||
ResponseEntity<VersionRepresentationModel> response = ResponseEntity.ok(resource);
|
return ResponseEntity.ok(resource);
|
||||||
LOGGER.debug("Exit from currentVersion(), returning {}", response);
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,6 @@ public class LdapClient {
|
||||||
*/
|
*/
|
||||||
public List<AccessIdRepresentationModel> searchUsersAndGroups(final String name)
|
public List<AccessIdRepresentationModel> searchUsersAndGroups(final String name)
|
||||||
throws InvalidArgumentException {
|
throws InvalidArgumentException {
|
||||||
LOGGER.debug("entry to searchUsersAndGroups(name = {})", name);
|
|
||||||
isInitOrFail();
|
isInitOrFail();
|
||||||
testMinSearchForLength(name);
|
testMinSearchForLength(name);
|
||||||
|
|
||||||
|
@ -80,15 +79,7 @@ public class LdapClient {
|
||||||
accessIds.addAll(searchGroupsByName(name));
|
accessIds.addAll(searchGroupsByName(name));
|
||||||
}
|
}
|
||||||
sortListOfAccessIdResources(accessIds);
|
sortListOfAccessIdResources(accessIds);
|
||||||
List<AccessIdRepresentationModel> result = getFirstPageOfaResultList(accessIds);
|
return getFirstPageOfaResultList(accessIds);
|
||||||
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from searchUsersAndGroups(name = {}). Returning {} users and groups: {}",
|
|
||||||
name,
|
|
||||||
accessIds.size(),
|
|
||||||
result);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<AccessIdRepresentationModel> searchUsersByNameOrAccessIdInUserRole(
|
public List<AccessIdRepresentationModel> searchUsersByNameOrAccessIdInUserRole(
|
||||||
|
@ -137,7 +128,6 @@ public class LdapClient {
|
||||||
|
|
||||||
public List<AccessIdRepresentationModel> searchUsersByNameOrAccessId(final String name)
|
public List<AccessIdRepresentationModel> searchUsersByNameOrAccessId(final String name)
|
||||||
throws InvalidArgumentException {
|
throws InvalidArgumentException {
|
||||||
LOGGER.debug("entry to searchUsersByNameOrAccessId(name = {}).", name);
|
|
||||||
isInitOrFail();
|
isInitOrFail();
|
||||||
testMinSearchForLength(name);
|
testMinSearchForLength(name);
|
||||||
|
|
||||||
|
@ -151,20 +141,15 @@ public class LdapClient {
|
||||||
orFilter.or(new WhitespaceWildcardsFilter(getUserIdAttribute(), name));
|
orFilter.or(new WhitespaceWildcardsFilter(getUserIdAttribute(), name));
|
||||||
andFilter.and(orFilter);
|
andFilter.and(orFilter);
|
||||||
|
|
||||||
final List<AccessIdRepresentationModel> accessIds =
|
return ldapTemplate.search(
|
||||||
ldapTemplate.search(
|
getUserSearchBase(),
|
||||||
getUserSearchBase(),
|
andFilter.encode(),
|
||||||
andFilter.encode(),
|
SearchControls.SUBTREE_SCOPE,
|
||||||
SearchControls.SUBTREE_SCOPE,
|
getLookUpUserAttributesToReturn(),
|
||||||
getLookUpUserAttributesToReturn(),
|
new UserContextMapper());
|
||||||
new UserContextMapper());
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from searchUsersByNameOrAccessId. Retrieved the following users: {}.", accessIds);
|
|
||||||
return accessIds;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<AccessIdRepresentationModel> getUsersByAccessId(final String accessId) {
|
public List<AccessIdRepresentationModel> getUsersByAccessId(final String accessId) {
|
||||||
LOGGER.debug("entry to searchUsersByAccessId(name = {}).", accessId);
|
|
||||||
isInitOrFail();
|
isInitOrFail();
|
||||||
|
|
||||||
final AndFilter andFilter = new AndFilter();
|
final AndFilter andFilter = new AndFilter();
|
||||||
|
@ -175,20 +160,16 @@ public class LdapClient {
|
||||||
getUserFirstnameAttribute(), getUserLastnameAttribute(), getUserIdAttribute()
|
getUserFirstnameAttribute(), getUserLastnameAttribute(), getUserIdAttribute()
|
||||||
};
|
};
|
||||||
|
|
||||||
final List<AccessIdRepresentationModel> accessIds =
|
return ldapTemplate.search(
|
||||||
ldapTemplate.search(
|
getUserSearchBase(),
|
||||||
getUserSearchBase(),
|
andFilter.encode(),
|
||||||
andFilter.encode(),
|
SearchControls.SUBTREE_SCOPE,
|
||||||
SearchControls.SUBTREE_SCOPE,
|
userAttributesToReturn,
|
||||||
userAttributesToReturn,
|
new UserContextMapper());
|
||||||
new UserContextMapper());
|
|
||||||
LOGGER.debug("exit from searchUsersByAccessId. Retrieved the following users: {}.", accessIds);
|
|
||||||
return accessIds;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<AccessIdRepresentationModel> searchGroupsByName(final String name)
|
public List<AccessIdRepresentationModel> searchGroupsByName(final String name)
|
||||||
throws InvalidArgumentException {
|
throws InvalidArgumentException {
|
||||||
LOGGER.debug("entry to searchGroupsByName(name = {}).", name);
|
|
||||||
isInitOrFail();
|
isInitOrFail();
|
||||||
testMinSearchForLength(name);
|
testMinSearchForLength(name);
|
||||||
|
|
||||||
|
@ -201,37 +182,31 @@ public class LdapClient {
|
||||||
}
|
}
|
||||||
andFilter.and(orFilter);
|
andFilter.and(orFilter);
|
||||||
|
|
||||||
final List<AccessIdRepresentationModel> accessIds =
|
return ldapTemplate.search(
|
||||||
ldapTemplate.search(
|
getGroupSearchBase(),
|
||||||
getGroupSearchBase(),
|
andFilter.encode(),
|
||||||
andFilter.encode(),
|
SearchControls.SUBTREE_SCOPE,
|
||||||
SearchControls.SUBTREE_SCOPE,
|
getLookUpGroupAttributesToReturn(),
|
||||||
getLookUpGroupAttributesToReturn(),
|
new GroupContextMapper());
|
||||||
new GroupContextMapper());
|
|
||||||
LOGGER.debug("Exit from searchGroupsByName. Retrieved the following groups: {}", accessIds);
|
|
||||||
return accessIds;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public AccessIdRepresentationModel searchAccessIdByDn(final String dn) {
|
public AccessIdRepresentationModel searchAccessIdByDn(final String dn) {
|
||||||
LOGGER.debug("entry to searchGroupByDn(name = {}).", dn);
|
|
||||||
isInitOrFail();
|
isInitOrFail();
|
||||||
// Obviously Spring LdapTemplate does have a inconsistency and always adds the base name to the
|
// Obviously Spring LdapTemplate does have a inconsistency and always adds the base name to the
|
||||||
// given DN.
|
// given DN.
|
||||||
// https://stackoverflow.com/questions/55285743/spring-ldaptemplate-how-to-lookup-fully-qualified-dn-with-configured-base-dn
|
// https://stackoverflow.com/questions/55285743/spring-ldaptemplate-how-to-lookup-fully-qualified-dn-with-configured-base-dn
|
||||||
// Therefore we have to remove the base name from the dn before performing the lookup
|
// Therefore we have to remove the base name from the dn before performing the lookup
|
||||||
String nameWithoutBaseDn = getNameWithoutBaseDn(dn);
|
String nameWithoutBaseDn = getNameWithoutBaseDn(dn);
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Removed baseDN {} from given DN. New DN to be used: {}", getBaseDn(), nameWithoutBaseDn);
|
LOGGER.debug(
|
||||||
final AccessIdRepresentationModel accessId =
|
"Removed baseDN {} from given DN. New DN to be used: {}", getBaseDn(), nameWithoutBaseDn);
|
||||||
ldapTemplate.lookup(
|
}
|
||||||
nameWithoutBaseDn, getLookUpUserAndGroupAttributesToReturn(), new DnContextMapper());
|
return ldapTemplate.lookup(
|
||||||
LOGGER.debug("Exit from searchGroupByDn. Retrieved the following group: {}", accessId);
|
nameWithoutBaseDn, getLookUpUserAndGroupAttributesToReturn(), new DnContextMapper());
|
||||||
return accessId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<AccessIdRepresentationModel> searchGroupsAccessIdIsMemberOf(final String accessId)
|
public List<AccessIdRepresentationModel> searchGroupsAccessIdIsMemberOf(final String accessId)
|
||||||
throws InvalidArgumentException {
|
throws InvalidArgumentException {
|
||||||
LOGGER.debug("entry to searchGroupsAccessIdIsMemberOf(name = {}).", accessId);
|
|
||||||
isInitOrFail();
|
isInitOrFail();
|
||||||
testMinSearchForLength(accessId);
|
testMinSearchForLength(accessId);
|
||||||
|
|
||||||
|
@ -252,18 +227,12 @@ public class LdapClient {
|
||||||
|
|
||||||
String[] userAttributesToReturn = {getUserIdAttribute(), getGroupNameAttribute()};
|
String[] userAttributesToReturn = {getUserIdAttribute(), getGroupNameAttribute()};
|
||||||
|
|
||||||
final List<AccessIdRepresentationModel> accessIds =
|
return ldapTemplate.search(
|
||||||
ldapTemplate.search(
|
getGroupSearchBase(),
|
||||||
getGroupSearchBase(),
|
andFilter.encode(),
|
||||||
andFilter.encode(),
|
SearchControls.SUBTREE_SCOPE,
|
||||||
SearchControls.SUBTREE_SCOPE,
|
userAttributesToReturn,
|
||||||
userAttributesToReturn,
|
new GroupContextMapper());
|
||||||
new GroupContextMapper());
|
|
||||||
|
|
||||||
LOGGER.debug(
|
|
||||||
"exit from searchGroupsAccessIdIsMemberOf. Retrieved the following accessIds: {}.",
|
|
||||||
accessIds);
|
|
||||||
return accessIds;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -273,9 +242,6 @@ public class LdapClient {
|
||||||
* @return whether the given name is valid or not
|
* @return whether the given name is valid or not
|
||||||
*/
|
*/
|
||||||
public boolean validateAccessId(final String name) {
|
public boolean validateAccessId(final String name) {
|
||||||
|
|
||||||
LOGGER.debug("entry to validateAccessId(name = {})", name);
|
|
||||||
|
|
||||||
isInitOrFail();
|
isInitOrFail();
|
||||||
|
|
||||||
if (nameIsDn(name)) {
|
if (nameIsDn(name)) {
|
||||||
|
@ -446,7 +412,6 @@ public class LdapClient {
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
void init() {
|
void init() {
|
||||||
LOGGER.debug("Entry to init()");
|
|
||||||
minSearchForLength = calcMinSearchForLength(3);
|
minSearchForLength = calcMinSearchForLength(3);
|
||||||
maxNumberOfReturnedAccessIds = calcMaxNumberOfReturnedAccessIds(50);
|
maxNumberOfReturnedAccessIds = calcMaxNumberOfReturnedAccessIds(50);
|
||||||
|
|
||||||
|
@ -459,8 +424,6 @@ public class LdapClient {
|
||||||
throw new SystemException(message);
|
throw new SystemException(message);
|
||||||
}
|
}
|
||||||
active = true;
|
active = true;
|
||||||
|
|
||||||
LOGGER.debug("Exit from init()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<LdapSettings> checkForMissingConfigurations() {
|
List<LdapSettings> checkForMissingConfigurations() {
|
||||||
|
|
|
@ -5,8 +5,6 @@ import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
@ -31,8 +29,6 @@ import pro.taskana.task.api.TaskState;
|
||||||
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
|
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
|
||||||
public class MonitorController {
|
public class MonitorController {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(MonitorController.class);
|
|
||||||
|
|
||||||
private final MonitorService monitorService;
|
private final MonitorService monitorService;
|
||||||
|
|
||||||
private final ReportRepresentationModelAssembler reportRepresentationModelAssembler;
|
private final ReportRepresentationModelAssembler reportRepresentationModelAssembler;
|
||||||
|
@ -56,7 +52,6 @@ public class MonitorController {
|
||||||
* @param states Filter the report values by Task states.
|
* @param states Filter the report values by Task states.
|
||||||
* @param workbasketIds Filter the report values by Workbasket Ids.
|
* @param workbasketIds Filter the report values by Workbasket Ids.
|
||||||
* @param priorityMinimum Filter the report values by a minimum priority.
|
* @param priorityMinimum Filter the report values by a minimum priority.
|
||||||
*
|
|
||||||
* @return the computed TaskStatusReport
|
* @return the computed TaskStatusReport
|
||||||
* @throws NotAuthorizedException if the current user is not authorized to compute the report
|
* @throws NotAuthorizedException if the current user is not authorized to compute the report
|
||||||
* @title Get a Task Status Report
|
* @title Get a Task Status Report
|
||||||
|
@ -69,26 +64,20 @@ public class MonitorController {
|
||||||
@RequestParam(name = "workbasket-ids", required = false) List<String> workbasketIds,
|
@RequestParam(name = "workbasket-ids", required = false) List<String> workbasketIds,
|
||||||
@RequestParam(name = "priority-minimum", required = false) Integer priorityMinimum)
|
@RequestParam(name = "priority-minimum", required = false) Integer priorityMinimum)
|
||||||
throws NotAuthorizedException {
|
throws NotAuthorizedException {
|
||||||
LOGGER.debug("Entry to getTasksStatusReport(), states to include {}", states);
|
|
||||||
ResponseEntity<ReportRepresentationModel> response =
|
|
||||||
ResponseEntity.ok(
|
|
||||||
reportRepresentationModelAssembler.toModel(
|
|
||||||
monitorService
|
|
||||||
.createTaskStatusReportBuilder()
|
|
||||||
.stateIn(states)
|
|
||||||
.domainIn(domains)
|
|
||||||
.workbasketIdsIn(workbasketIds)
|
|
||||||
.priorityMinimum(priorityMinimum)
|
|
||||||
.buildReport(),
|
|
||||||
domains,
|
|
||||||
states,
|
|
||||||
workbasketIds,
|
|
||||||
priorityMinimum));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getTasksStatusReport(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
return ResponseEntity.ok(
|
||||||
|
reportRepresentationModelAssembler.toModel(
|
||||||
|
monitorService
|
||||||
|
.createTaskStatusReportBuilder()
|
||||||
|
.stateIn(states)
|
||||||
|
.domainIn(domains)
|
||||||
|
.workbasketIdsIn(workbasketIds)
|
||||||
|
.priorityMinimum(priorityMinimum)
|
||||||
|
.buildReport(),
|
||||||
|
domains,
|
||||||
|
states,
|
||||||
|
workbasketIds,
|
||||||
|
priorityMinimum));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -111,7 +100,6 @@ public class MonitorController {
|
||||||
@RequestParam List<TaskState> states,
|
@RequestParam List<TaskState> states,
|
||||||
@RequestParam(required = false) TaskTimestamp taskTimestamp)
|
@RequestParam(required = false) TaskTimestamp taskTimestamp)
|
||||||
throws NotAuthorizedException, InvalidArgumentException {
|
throws NotAuthorizedException, InvalidArgumentException {
|
||||||
LOGGER.debug("Entry to getTasksWorkbasketReport(), states to include {}", states);
|
|
||||||
if (taskTimestamp == null) {
|
if (taskTimestamp == null) {
|
||||||
taskTimestamp = TaskTimestamp.DUE;
|
taskTimestamp = TaskTimestamp.DUE;
|
||||||
}
|
}
|
||||||
|
@ -126,10 +114,6 @@ public class MonitorController {
|
||||||
states,
|
states,
|
||||||
taskTimestamp);
|
taskTimestamp);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getTasksWorkbasketReport(), returning {}", report);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(report);
|
return ResponseEntity.status(HttpStatus.OK).body(report);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,12 +124,6 @@ public class MonitorController {
|
||||||
@RequestParam(value = "daysInPast") int daysInPast,
|
@RequestParam(value = "daysInPast") int daysInPast,
|
||||||
@RequestParam(value = "states") List<TaskState> states)
|
@RequestParam(value = "states") List<TaskState> states)
|
||||||
throws NotAuthorizedException, InvalidArgumentException {
|
throws NotAuthorizedException, InvalidArgumentException {
|
||||||
LOGGER.debug(
|
|
||||||
"Entry to getTasksWorkbasketPlannedDateReport(), "
|
|
||||||
+ "upto {} days in the past, states to include {}",
|
|
||||||
daysInPast,
|
|
||||||
states);
|
|
||||||
|
|
||||||
ReportRepresentationModel report =
|
ReportRepresentationModel report =
|
||||||
reportRepresentationModelAssembler.toModel(
|
reportRepresentationModelAssembler.toModel(
|
||||||
monitorService
|
monitorService
|
||||||
|
@ -155,9 +133,6 @@ public class MonitorController {
|
||||||
.buildReport(TaskTimestamp.PLANNED),
|
.buildReport(TaskTimestamp.PLANNED),
|
||||||
daysInPast,
|
daysInPast,
|
||||||
states);
|
states);
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getTasksWorkbasketPlannedDateReport(), returning {}", report);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(report);
|
return ResponseEntity.status(HttpStatus.OK).body(report);
|
||||||
}
|
}
|
||||||
|
@ -180,7 +155,6 @@ public class MonitorController {
|
||||||
public ResponseEntity<ReportRepresentationModel> getClassificationReport(
|
public ResponseEntity<ReportRepresentationModel> getClassificationReport(
|
||||||
@RequestParam(required = false) TaskTimestamp taskTimestamp)
|
@RequestParam(required = false) TaskTimestamp taskTimestamp)
|
||||||
throws NotAuthorizedException, InvalidArgumentException {
|
throws NotAuthorizedException, InvalidArgumentException {
|
||||||
LOGGER.debug("Entry to getClassificationReport()");
|
|
||||||
if (taskTimestamp == null) {
|
if (taskTimestamp == null) {
|
||||||
taskTimestamp = TaskTimestamp.DUE;
|
taskTimestamp = TaskTimestamp.DUE;
|
||||||
}
|
}
|
||||||
|
@ -193,10 +167,6 @@ public class MonitorController {
|
||||||
.buildReport(taskTimestamp),
|
.buildReport(taskTimestamp),
|
||||||
taskTimestamp);
|
taskTimestamp);
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getClassificationReport(), returning {}", report);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(report);
|
return ResponseEntity.status(HttpStatus.OK).body(report);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@ package pro.taskana.task.rest;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType;
|
import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType;
|
||||||
|
@ -39,8 +37,6 @@ import pro.taskana.task.rest.models.TaskCommentRepresentationModel;
|
||||||
@EnableHypermediaSupport(type = HypermediaType.HAL)
|
@EnableHypermediaSupport(type = HypermediaType.HAL)
|
||||||
public class TaskCommentController {
|
public class TaskCommentController {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TaskCommentController.class);
|
|
||||||
|
|
||||||
private final TaskService taskService;
|
private final TaskService taskService;
|
||||||
private final TaskCommentRepresentationModelAssembler taskCommentRepresentationModelAssembler;
|
private final TaskCommentRepresentationModelAssembler taskCommentRepresentationModelAssembler;
|
||||||
|
|
||||||
|
@ -69,23 +65,12 @@ public class TaskCommentController {
|
||||||
@PathVariable String taskCommentId)
|
@PathVariable String taskCommentId)
|
||||||
throws NotAuthorizedException, TaskNotFoundException, TaskCommentNotFoundException,
|
throws NotAuthorizedException, TaskNotFoundException, TaskCommentNotFoundException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Entry to getTaskComment(taskCommentId= {})", taskCommentId);
|
|
||||||
}
|
|
||||||
|
|
||||||
TaskComment taskComment = taskService.getTaskComment(taskCommentId);
|
TaskComment taskComment = taskService.getTaskComment(taskCommentId);
|
||||||
|
|
||||||
TaskCommentRepresentationModel taskCommentRepresentationModel =
|
TaskCommentRepresentationModel taskCommentRepresentationModel =
|
||||||
taskCommentRepresentationModelAssembler.toModel(taskComment);
|
taskCommentRepresentationModelAssembler.toModel(taskComment);
|
||||||
|
|
||||||
ResponseEntity<TaskCommentRepresentationModel> response =
|
return ResponseEntity.ok(taskCommentRepresentationModel);
|
||||||
ResponseEntity.ok(taskCommentRepresentationModel);
|
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getTaskComment(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -113,11 +98,6 @@ public class TaskCommentController {
|
||||||
@RequestParam(name = "sort-by", required = false) List<TaskCommentsSortBy> sortBy,
|
@RequestParam(name = "sort-by", required = false) List<TaskCommentsSortBy> sortBy,
|
||||||
@RequestParam(required = false) List<SortDirection> order)
|
@RequestParam(required = false) List<SortDirection> order)
|
||||||
throws NotAuthorizedException, TaskNotFoundException, InvalidArgumentException {
|
throws NotAuthorizedException, TaskNotFoundException, InvalidArgumentException {
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Entry to getTaskComments(taskId= {})", taskId);
|
|
||||||
}
|
|
||||||
|
|
||||||
Optional<Comparator<TaskComment>> comparator = getTaskCommentComparator(sortBy, order);
|
Optional<Comparator<TaskComment>> comparator = getTaskCommentComparator(sortBy, order);
|
||||||
List<TaskComment> taskComments = taskService.getTaskComments(taskId);
|
List<TaskComment> taskComments = taskService.getTaskComments(taskId);
|
||||||
comparator.ifPresent(taskComments::sort);
|
comparator.ifPresent(taskComments::sort);
|
||||||
|
@ -125,14 +105,7 @@ public class TaskCommentController {
|
||||||
TaskCommentCollectionRepresentationModel taskCommentListResource =
|
TaskCommentCollectionRepresentationModel taskCommentListResource =
|
||||||
taskCommentRepresentationModelAssembler.toTaskanaCollectionModel(taskComments);
|
taskCommentRepresentationModelAssembler.toTaskanaCollectionModel(taskComments);
|
||||||
|
|
||||||
ResponseEntity<TaskCommentCollectionRepresentationModel> response =
|
return ResponseEntity.ok(taskCommentListResource);
|
||||||
ResponseEntity.ok(taskCommentListResource);
|
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getTaskComments(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -153,19 +126,9 @@ public class TaskCommentController {
|
||||||
@PathVariable String taskCommentId)
|
@PathVariable String taskCommentId)
|
||||||
throws NotAuthorizedException, TaskNotFoundException, TaskCommentNotFoundException,
|
throws NotAuthorizedException, TaskNotFoundException, TaskCommentNotFoundException,
|
||||||
InvalidArgumentException {
|
InvalidArgumentException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Entry to deleteTaskComment(taskCommentId= {})", taskCommentId);
|
|
||||||
}
|
|
||||||
|
|
||||||
taskService.deleteTaskComment(taskCommentId);
|
taskService.deleteTaskComment(taskCommentId);
|
||||||
|
|
||||||
ResponseEntity<TaskCommentRepresentationModel> result = ResponseEntity.noContent().build();
|
return ResponseEntity.noContent().build();
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from deleteTaskComment(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -189,12 +152,6 @@ public class TaskCommentController {
|
||||||
@RequestBody TaskCommentRepresentationModel taskCommentRepresentationModel)
|
@RequestBody TaskCommentRepresentationModel taskCommentRepresentationModel)
|
||||||
throws NotAuthorizedException, TaskNotFoundException, TaskCommentNotFoundException,
|
throws NotAuthorizedException, TaskNotFoundException, TaskCommentNotFoundException,
|
||||||
InvalidArgumentException, ConcurrencyException {
|
InvalidArgumentException, ConcurrencyException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"Entry to updateTaskComment(taskCommentId= {}, taskCommentResource= {})",
|
|
||||||
taskCommentId,
|
|
||||||
taskCommentRepresentationModel);
|
|
||||||
}
|
|
||||||
if (!taskCommentId.equals(taskCommentRepresentationModel.getTaskCommentId())) {
|
if (!taskCommentId.equals(taskCommentRepresentationModel.getTaskCommentId())) {
|
||||||
throw new InvalidArgumentException(
|
throw new InvalidArgumentException(
|
||||||
String.format(
|
String.format(
|
||||||
|
@ -207,14 +164,8 @@ public class TaskCommentController {
|
||||||
taskCommentRepresentationModelAssembler.toEntityModel(taskCommentRepresentationModel);
|
taskCommentRepresentationModelAssembler.toEntityModel(taskCommentRepresentationModel);
|
||||||
|
|
||||||
taskComment = taskService.updateTaskComment(taskComment);
|
taskComment = taskService.updateTaskComment(taskComment);
|
||||||
ResponseEntity<TaskCommentRepresentationModel> result =
|
|
||||||
ResponseEntity.ok(taskCommentRepresentationModelAssembler.toModel(taskComment));
|
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
return ResponseEntity.ok(taskCommentRepresentationModelAssembler.toModel(taskComment));
|
||||||
LOGGER.debug("Exit from updateTaskComment(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -234,31 +185,14 @@ public class TaskCommentController {
|
||||||
@PathVariable String taskId,
|
@PathVariable String taskId,
|
||||||
@RequestBody TaskCommentRepresentationModel taskCommentRepresentationModel)
|
@RequestBody TaskCommentRepresentationModel taskCommentRepresentationModel)
|
||||||
throws NotAuthorizedException, InvalidArgumentException, TaskNotFoundException {
|
throws NotAuthorizedException, InvalidArgumentException, TaskNotFoundException {
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"Entry to createTaskComment(taskId= {}, taskCommentResource= {})",
|
|
||||||
taskId,
|
|
||||||
taskCommentRepresentationModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
taskCommentRepresentationModel.setTaskId(taskId);
|
taskCommentRepresentationModel.setTaskId(taskId);
|
||||||
|
|
||||||
TaskComment taskCommentFromResource =
|
TaskComment taskCommentFromResource =
|
||||||
taskCommentRepresentationModelAssembler.toEntityModel(taskCommentRepresentationModel);
|
taskCommentRepresentationModelAssembler.toEntityModel(taskCommentRepresentationModel);
|
||||||
TaskComment createdTaskComment = taskService.createTaskComment(taskCommentFromResource);
|
TaskComment createdTaskComment = taskService.createTaskComment(taskCommentFromResource);
|
||||||
|
|
||||||
ResponseEntity<TaskCommentRepresentationModel> result;
|
return ResponseEntity.status(HttpStatus.CREATED)
|
||||||
|
.body(taskCommentRepresentationModelAssembler.toModel(createdTaskComment));
|
||||||
result =
|
|
||||||
ResponseEntity.status(HttpStatus.CREATED)
|
|
||||||
.body(taskCommentRepresentationModelAssembler.toModel(createdTaskComment));
|
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from createTaskComment(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Optional<Comparator<TaskComment>> getTaskCommentComparator(
|
private Optional<Comparator<TaskComment>> getTaskCommentComparator(
|
||||||
|
|
|
@ -5,8 +5,6 @@ import java.util.List;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType;
|
import org.springframework.hateoas.config.EnableHypermediaSupport.HypermediaType;
|
||||||
|
@ -54,8 +52,6 @@ import pro.taskana.workbasket.api.exceptions.WorkbasketNotFoundException;
|
||||||
@EnableHypermediaSupport(type = HypermediaType.HAL)
|
@EnableHypermediaSupport(type = HypermediaType.HAL)
|
||||||
public class TaskController {
|
public class TaskController {
|
||||||
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(TaskController.class);
|
|
||||||
|
|
||||||
private final TaskService taskService;
|
private final TaskService taskService;
|
||||||
private final TaskRepresentationModelAssembler taskRepresentationModelAssembler;
|
private final TaskRepresentationModelAssembler taskRepresentationModelAssembler;
|
||||||
private final TaskSummaryRepresentationModelAssembler taskSummaryRepresentationModelAssembler;
|
private final TaskSummaryRepresentationModelAssembler taskSummaryRepresentationModelAssembler;
|
||||||
|
@ -104,12 +100,7 @@ public class TaskController {
|
||||||
TaskSummaryPagedRepresentationModel pagedModels =
|
TaskSummaryPagedRepresentationModel pagedModels =
|
||||||
taskSummaryRepresentationModelAssembler.toPagedModel(
|
taskSummaryRepresentationModelAssembler.toPagedModel(
|
||||||
taskSummaries, pagingParameter.getPageMetadata());
|
taskSummaries, pagingParameter.getPageMetadata());
|
||||||
ResponseEntity<TaskSummaryPagedRepresentationModel> response = ResponseEntity.ok(pagedModels);
|
return ResponseEntity.ok(pagedModels);
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getTasks(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -144,14 +135,9 @@ public class TaskController {
|
||||||
.filter(summary -> !result.getFailedIds().contains(summary.getId()))
|
.filter(summary -> !result.getFailedIds().contains(summary.getId()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
ResponseEntity<TaskSummaryCollectionRepresentationModel> response =
|
return ResponseEntity.ok(
|
||||||
ResponseEntity.ok(
|
taskSummaryRepresentationModelAssembler.toTaskanaCollectionModel(
|
||||||
taskSummaryRepresentationModelAssembler.toTaskanaCollectionModel(
|
successfullyDeletedTaskSummaries));
|
||||||
successfullyDeletedTaskSummaries));
|
|
||||||
|
|
||||||
LOGGER.debug("Exit from deleteTasks(), returning {}", response);
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -167,15 +153,9 @@ public class TaskController {
|
||||||
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
||||||
public ResponseEntity<TaskRepresentationModel> getTask(@PathVariable String taskId)
|
public ResponseEntity<TaskRepresentationModel> getTask(@PathVariable String taskId)
|
||||||
throws TaskNotFoundException, NotAuthorizedException {
|
throws TaskNotFoundException, NotAuthorizedException {
|
||||||
LOGGER.debug("Entry to getTask(taskId= {})", taskId);
|
|
||||||
Task task = taskService.getTask(taskId);
|
Task task = taskService.getTask(taskId);
|
||||||
ResponseEntity<TaskRepresentationModel> result =
|
|
||||||
ResponseEntity.ok(taskRepresentationModelAssembler.toModel(task));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getTask(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return ResponseEntity.ok(taskRepresentationModelAssembler.toModel(task));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -197,17 +177,10 @@ public class TaskController {
|
||||||
@PathVariable String taskId, @RequestBody(required = false) String userName)
|
@PathVariable String taskId, @RequestBody(required = false) String userName)
|
||||||
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException,
|
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException,
|
||||||
NotAuthorizedException {
|
NotAuthorizedException {
|
||||||
LOGGER.debug("Entry to claimTask(taskId= {}, userName= {})", taskId, userName);
|
|
||||||
// TODO verify user
|
// TODO verify user
|
||||||
taskService.claim(taskId);
|
taskService.claim(taskId);
|
||||||
Task updatedTask = taskService.getTask(taskId);
|
Task updatedTask = taskService.getTask(taskId);
|
||||||
ResponseEntity<TaskRepresentationModel> result =
|
return ResponseEntity.ok(taskRepresentationModelAssembler.toModel(updatedTask));
|
||||||
ResponseEntity.ok(taskRepresentationModelAssembler.toModel(updatedTask));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from claimTask(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -226,8 +199,6 @@ public class TaskController {
|
||||||
public ResponseEntity<TaskRepresentationModel> selectAndClaimTask(
|
public ResponseEntity<TaskRepresentationModel> selectAndClaimTask(
|
||||||
TaskQueryFilterParameter filterParameter, TaskQuerySortParameter sortParameter)
|
TaskQueryFilterParameter filterParameter, TaskQuerySortParameter sortParameter)
|
||||||
throws InvalidOwnerException, NotAuthorizedException {
|
throws InvalidOwnerException, NotAuthorizedException {
|
||||||
LOGGER.debug("Entry to selectAndClaimTask");
|
|
||||||
|
|
||||||
TaskQuery query = taskService.createTaskQuery();
|
TaskQuery query = taskService.createTaskQuery();
|
||||||
|
|
||||||
filterParameter.applyToQuery(query);
|
filterParameter.applyToQuery(query);
|
||||||
|
@ -235,13 +206,7 @@ public class TaskController {
|
||||||
|
|
||||||
Task selectedAndClaimedTask = taskService.selectAndClaim(query);
|
Task selectedAndClaimedTask = taskService.selectAndClaim(query);
|
||||||
|
|
||||||
ResponseEntity<TaskRepresentationModel> result =
|
return ResponseEntity.ok(taskRepresentationModelAssembler.toModel(selectedAndClaimedTask));
|
||||||
ResponseEntity.ok(taskRepresentationModelAssembler.toModel(selectedAndClaimedTask));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from selectAndClaimTask(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -262,17 +227,9 @@ public class TaskController {
|
||||||
public ResponseEntity<TaskRepresentationModel> cancelClaimTask(@PathVariable String taskId)
|
public ResponseEntity<TaskRepresentationModel> cancelClaimTask(@PathVariable String taskId)
|
||||||
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException,
|
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException,
|
||||||
NotAuthorizedException {
|
NotAuthorizedException {
|
||||||
|
|
||||||
LOGGER.debug("Entry to cancelClaimTask(taskId= {}", taskId);
|
|
||||||
|
|
||||||
Task updatedTask = taskService.cancelClaim(taskId);
|
Task updatedTask = taskService.cancelClaim(taskId);
|
||||||
|
|
||||||
ResponseEntity<TaskRepresentationModel> result =
|
return ResponseEntity.ok(taskRepresentationModelAssembler.toModel(updatedTask));
|
||||||
ResponseEntity.ok(taskRepresentationModelAssembler.toModel(updatedTask));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from cancelClaimTask(), returning {}", result);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -292,17 +249,8 @@ public class TaskController {
|
||||||
public ResponseEntity<TaskRepresentationModel> forceCancelClaimTask(@PathVariable String taskId)
|
public ResponseEntity<TaskRepresentationModel> forceCancelClaimTask(@PathVariable String taskId)
|
||||||
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException,
|
throws TaskNotFoundException, InvalidStateException, InvalidOwnerException,
|
||||||
NotAuthorizedException {
|
NotAuthorizedException {
|
||||||
|
|
||||||
LOGGER.debug("Entry to forceCancelClaimTask(taskId= {}", taskId);
|
|
||||||
|
|
||||||
Task updatedTask = taskService.forceCancelClaim(taskId);
|
Task updatedTask = taskService.forceCancelClaim(taskId);
|
||||||
|
return ResponseEntity.ok(taskRepresentationModelAssembler.toModel(updatedTask));
|
||||||
ResponseEntity<TaskRepresentationModel> result =
|
|
||||||
ResponseEntity.ok(taskRepresentationModelAssembler.toModel(updatedTask));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from forceCancelClaimTask(), returning {}", result);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -322,16 +270,10 @@ public class TaskController {
|
||||||
public ResponseEntity<TaskRepresentationModel> completeTask(@PathVariable String taskId)
|
public ResponseEntity<TaskRepresentationModel> completeTask(@PathVariable String taskId)
|
||||||
throws TaskNotFoundException, InvalidOwnerException, InvalidStateException,
|
throws TaskNotFoundException, InvalidOwnerException, InvalidStateException,
|
||||||
NotAuthorizedException {
|
NotAuthorizedException {
|
||||||
LOGGER.debug("Entry to completeTask(taskId= {})", taskId);
|
|
||||||
|
|
||||||
Task updatedTask = taskService.forceCompleteTask(taskId);
|
Task updatedTask = taskService.forceCompleteTask(taskId);
|
||||||
ResponseEntity<TaskRepresentationModel> result =
|
|
||||||
ResponseEntity.ok(taskRepresentationModelAssembler.toModel(updatedTask));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from completeTask(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return ResponseEntity.ok(taskRepresentationModelAssembler.toModel(updatedTask));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -349,11 +291,9 @@ public class TaskController {
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public ResponseEntity<TaskRepresentationModel> deleteTask(@PathVariable String taskId)
|
public ResponseEntity<TaskRepresentationModel> deleteTask(@PathVariable String taskId)
|
||||||
throws TaskNotFoundException, InvalidStateException, NotAuthorizedException {
|
throws TaskNotFoundException, InvalidStateException, NotAuthorizedException {
|
||||||
LOGGER.debug("Entry to deleteTask(taskId= {})", taskId);
|
|
||||||
taskService.forceDeleteTask(taskId);
|
taskService.forceDeleteTask(taskId);
|
||||||
ResponseEntity<TaskRepresentationModel> result = ResponseEntity.noContent().build();
|
|
||||||
LOGGER.debug("Exit from deleteTask(), returning {}", result);
|
return ResponseEntity.noContent().build();
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -372,16 +312,10 @@ public class TaskController {
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public ResponseEntity<TaskRepresentationModel> cancelTask(@PathVariable String taskId)
|
public ResponseEntity<TaskRepresentationModel> cancelTask(@PathVariable String taskId)
|
||||||
throws TaskNotFoundException, NotAuthorizedException, InvalidStateException {
|
throws TaskNotFoundException, NotAuthorizedException, InvalidStateException {
|
||||||
LOGGER.debug("Entry to cancelTask(taskId= {})", taskId);
|
|
||||||
|
|
||||||
Task cancelledTask = taskService.cancelTask(taskId);
|
Task cancelledTask = taskService.cancelTask(taskId);
|
||||||
ResponseEntity<TaskRepresentationModel> result =
|
|
||||||
ResponseEntity.ok(taskRepresentationModelAssembler.toModel(cancelledTask));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from cancelTask(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return ResponseEntity.ok(taskRepresentationModelAssembler.toModel(cancelledTask));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -403,21 +337,11 @@ public class TaskController {
|
||||||
@RequestBody TaskRepresentationModel taskRepresentationModel)
|
@RequestBody TaskRepresentationModel taskRepresentationModel)
|
||||||
throws WorkbasketNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
|
throws WorkbasketNotFoundException, ClassificationNotFoundException, NotAuthorizedException,
|
||||||
TaskAlreadyExistException, InvalidArgumentException {
|
TaskAlreadyExistException, InvalidArgumentException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Entry to createTask(params= {})", taskRepresentationModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
Task fromResource = taskRepresentationModelAssembler.toEntityModel(taskRepresentationModel);
|
Task fromResource = taskRepresentationModelAssembler.toEntityModel(taskRepresentationModel);
|
||||||
Task createdTask = taskService.createTask(fromResource);
|
Task createdTask = taskService.createTask(fromResource);
|
||||||
|
|
||||||
ResponseEntity<TaskRepresentationModel> result =
|
return ResponseEntity.status(HttpStatus.CREATED)
|
||||||
ResponseEntity.status(HttpStatus.CREATED)
|
.body(taskRepresentationModelAssembler.toModel(createdTask));
|
||||||
.body(taskRepresentationModelAssembler.toModel(createdTask));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from createTask(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -441,17 +365,10 @@ public class TaskController {
|
||||||
@RequestBody(required = false) Boolean setTransferFlag)
|
@RequestBody(required = false) Boolean setTransferFlag)
|
||||||
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException,
|
throws TaskNotFoundException, WorkbasketNotFoundException, NotAuthorizedException,
|
||||||
InvalidStateException {
|
InvalidStateException {
|
||||||
LOGGER.debug("Entry to transferTask(taskId= {}, workbasketId= {})", taskId, workbasketId);
|
|
||||||
|
|
||||||
Task updatedTask =
|
Task updatedTask =
|
||||||
taskService.transfer(taskId, workbasketId, setTransferFlag == null || setTransferFlag);
|
taskService.transfer(taskId, workbasketId, setTransferFlag == null || setTransferFlag);
|
||||||
ResponseEntity<TaskRepresentationModel> result =
|
|
||||||
ResponseEntity.ok(taskRepresentationModelAssembler.toModel(updatedTask));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from transferTask(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return ResponseEntity.ok(taskRepresentationModelAssembler.toModel(updatedTask));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -480,26 +397,16 @@ public class TaskController {
|
||||||
throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException,
|
throws TaskNotFoundException, ClassificationNotFoundException, InvalidArgumentException,
|
||||||
ConcurrencyException, NotAuthorizedException, AttachmentPersistenceException,
|
ConcurrencyException, NotAuthorizedException, AttachmentPersistenceException,
|
||||||
InvalidStateException {
|
InvalidStateException {
|
||||||
LOGGER.debug(
|
if (!taskId.equals(taskRepresentationModel.getTaskId())) {
|
||||||
"Entry to updateTask(taskId= {}, taskResource= {})", taskId, taskRepresentationModel);
|
|
||||||
ResponseEntity<TaskRepresentationModel> result;
|
|
||||||
if (taskId.equals(taskRepresentationModel.getTaskId())) {
|
|
||||||
Task task = taskRepresentationModelAssembler.toEntityModel(taskRepresentationModel);
|
|
||||||
task = taskService.updateTask(task);
|
|
||||||
result = ResponseEntity.ok(taskRepresentationModelAssembler.toModel(task));
|
|
||||||
} else {
|
|
||||||
throw new InvalidArgumentException(
|
throw new InvalidArgumentException(
|
||||||
String.format(
|
String.format(
|
||||||
"TaskId ('%s') is not identical with the taskId of to "
|
"TaskId ('%s') is not identical with the taskId of to "
|
||||||
+ "object in the payload which should be updated. ID=('%s')",
|
+ "object in the payload which should be updated. ID=('%s')",
|
||||||
taskId, taskRepresentationModel.getTaskId()));
|
taskId, taskRepresentationModel.getTaskId()));
|
||||||
}
|
}
|
||||||
|
Task task = taskRepresentationModelAssembler.toEntityModel(taskRepresentationModel);
|
||||||
if (LOGGER.isDebugEnabled()) {
|
task = taskService.updateTask(task);
|
||||||
LOGGER.debug("Exit from updateTask(), returning {}", result);
|
return ResponseEntity.ok(taskRepresentationModelAssembler.toModel(task));
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum TaskQuerySortBy implements QuerySortBy<TaskQuery> {
|
public enum TaskQuerySortBy implements QuerySortBy<TaskQuery> {
|
||||||
|
|
|
@ -4,8 +4,6 @@ import java.beans.ConstructorProperties;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
@ -34,9 +32,6 @@ import pro.taskana.workbasket.rest.models.WorkbasketAccessItemPagedRepresentatio
|
||||||
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
|
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
|
||||||
public class WorkbasketAccessItemController {
|
public class WorkbasketAccessItemController {
|
||||||
|
|
||||||
private static final Logger LOGGER =
|
|
||||||
LoggerFactory.getLogger(WorkbasketAccessItemController.class);
|
|
||||||
|
|
||||||
private final LdapClient ldapClient;
|
private final LdapClient ldapClient;
|
||||||
private final WorkbasketService workbasketService;
|
private final WorkbasketService workbasketService;
|
||||||
private final WorkbasketAccessItemRepresentationModelAssembler modelAssembler;
|
private final WorkbasketAccessItemRepresentationModelAssembler modelAssembler;
|
||||||
|
@ -85,13 +80,7 @@ public class WorkbasketAccessItemController {
|
||||||
WorkbasketAccessItemPagedRepresentationModel pagedResources =
|
WorkbasketAccessItemPagedRepresentationModel pagedResources =
|
||||||
modelAssembler.toPagedModel(workbasketAccessItems, pagingParameter.getPageMetadata());
|
modelAssembler.toPagedModel(workbasketAccessItems, pagingParameter.getPageMetadata());
|
||||||
|
|
||||||
ResponseEntity<WorkbasketAccessItemPagedRepresentationModel> response =
|
return ResponseEntity.ok(pagedResources);
|
||||||
ResponseEntity.ok(pagedResources);
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getWorkbasketAccessItems(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -107,7 +96,6 @@ public class WorkbasketAccessItemController {
|
||||||
public ResponseEntity<Void> removeWorkbasketAccessItems(
|
public ResponseEntity<Void> removeWorkbasketAccessItems(
|
||||||
@RequestParam("access-id") String accessId)
|
@RequestParam("access-id") String accessId)
|
||||||
throws NotAuthorizedException, InvalidArgumentException {
|
throws NotAuthorizedException, InvalidArgumentException {
|
||||||
LOGGER.debug("Entry to removeWorkbasketAccessItems(access-id= {})", accessId);
|
|
||||||
if (ldapClient.isUser(accessId)) {
|
if (ldapClient.isUser(accessId)) {
|
||||||
List<WorkbasketAccessItem> workbasketAccessItemList =
|
List<WorkbasketAccessItem> workbasketAccessItemList =
|
||||||
workbasketService.createWorkbasketAccessItemQuery().accessIdIn(accessId).list();
|
workbasketService.createWorkbasketAccessItemQuery().accessIdIn(accessId).list();
|
||||||
|
@ -122,9 +110,7 @@ public class WorkbasketAccessItemController {
|
||||||
accessId));
|
accessId));
|
||||||
}
|
}
|
||||||
|
|
||||||
ResponseEntity<Void> response = ResponseEntity.noContent().build();
|
return ResponseEntity.noContent().build();
|
||||||
LOGGER.debug("Exit from removeWorkbasketAccessItems(), returning {}", response);
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum WorkbasketAccessItemSortBy implements QuerySortBy<WorkbasketAccessItemQuery> {
|
public enum WorkbasketAccessItemSortBy implements QuerySortBy<WorkbasketAccessItemQuery> {
|
||||||
|
|
|
@ -113,13 +113,7 @@ public class WorkbasketController {
|
||||||
workbasketSummaryRepresentationModelAssembler.toPagedModel(
|
workbasketSummaryRepresentationModelAssembler.toPagedModel(
|
||||||
workbasketSummaries, pagingParameter.getPageMetadata());
|
workbasketSummaries, pagingParameter.getPageMetadata());
|
||||||
|
|
||||||
ResponseEntity<WorkbasketSummaryPagedRepresentationModel> response =
|
return ResponseEntity.ok(pagedModels);
|
||||||
ResponseEntity.ok(pagedModels);
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getWorkbaskets(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -137,15 +131,9 @@ public class WorkbasketController {
|
||||||
public ResponseEntity<WorkbasketRepresentationModel> getWorkbasket(
|
public ResponseEntity<WorkbasketRepresentationModel> getWorkbasket(
|
||||||
@PathVariable(value = "workbasketId") String workbasketId)
|
@PathVariable(value = "workbasketId") String workbasketId)
|
||||||
throws WorkbasketNotFoundException, NotAuthorizedException {
|
throws WorkbasketNotFoundException, NotAuthorizedException {
|
||||||
LOGGER.debug("Entry to getWorkbasket(workbasketId= {})", workbasketId);
|
|
||||||
ResponseEntity<WorkbasketRepresentationModel> result;
|
|
||||||
Workbasket workbasket = workbasketService.getWorkbasket(workbasketId);
|
Workbasket workbasket = workbasketService.getWorkbasket(workbasketId);
|
||||||
result = ResponseEntity.ok(workbasketRepresentationModelAssembler.toModel(workbasket));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getWorkbasket(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return ResponseEntity.ok(workbasketRepresentationModelAssembler.toModel(workbasket));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -174,22 +162,21 @@ public class WorkbasketController {
|
||||||
@PathVariable(value = "workbasketId") String workbasketId)
|
@PathVariable(value = "workbasketId") String workbasketId)
|
||||||
throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
|
throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
|
||||||
WorkbasketInUseException {
|
WorkbasketInUseException {
|
||||||
LOGGER.debug("Entry to markWorkbasketForDeletion(workbasketId= {})", workbasketId);
|
|
||||||
ResponseEntity<WorkbasketRepresentationModel> response;
|
|
||||||
|
|
||||||
boolean workbasketDeleted = workbasketService.deleteWorkbasket(workbasketId);
|
boolean workbasketDeleted = workbasketService.deleteWorkbasket(workbasketId);
|
||||||
|
|
||||||
if (workbasketDeleted) {
|
if (workbasketDeleted) {
|
||||||
LOGGER.debug("Workbasket successfully deleted.");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
response = ResponseEntity.noContent().build();
|
LOGGER.debug("Workbasket successfully deleted.");
|
||||||
|
}
|
||||||
|
return ResponseEntity.noContent().build();
|
||||||
} else {
|
} else {
|
||||||
LOGGER.debug(
|
if (LOGGER.isDebugEnabled()) {
|
||||||
"Workbasket was only marked for deletion and will be physically deleted later on.");
|
LOGGER.debug(
|
||||||
response = ResponseEntity.accepted().build();
|
"Workbasket was only marked for deletion and will be physically deleted later on.");
|
||||||
|
}
|
||||||
|
return ResponseEntity.accepted().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.debug("Exit from markWorkbasketForDeletion(), returning {}", response);
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -210,22 +197,12 @@ public class WorkbasketController {
|
||||||
@RequestBody WorkbasketRepresentationModel workbasketRepresentationModel)
|
@RequestBody WorkbasketRepresentationModel workbasketRepresentationModel)
|
||||||
throws InvalidWorkbasketException, NotAuthorizedException, WorkbasketAlreadyExistException,
|
throws InvalidWorkbasketException, NotAuthorizedException, WorkbasketAlreadyExistException,
|
||||||
DomainNotFoundException {
|
DomainNotFoundException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"Entry to createWorkbasket(workbasketResource= {})", workbasketRepresentationModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
Workbasket workbasket =
|
Workbasket workbasket =
|
||||||
workbasketRepresentationModelAssembler.toEntityModel(workbasketRepresentationModel);
|
workbasketRepresentationModelAssembler.toEntityModel(workbasketRepresentationModel);
|
||||||
workbasket = workbasketService.createWorkbasket(workbasket);
|
workbasket = workbasketService.createWorkbasket(workbasket);
|
||||||
ResponseEntity<WorkbasketRepresentationModel> response =
|
|
||||||
ResponseEntity.status(HttpStatus.CREATED)
|
|
||||||
.body(workbasketRepresentationModelAssembler.toModel(workbasket));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from createWorkbasket(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
return ResponseEntity.status(HttpStatus.CREATED)
|
||||||
|
.body(workbasketRepresentationModelAssembler.toModel(workbasket));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -249,7 +226,6 @@ public class WorkbasketController {
|
||||||
@RequestBody WorkbasketRepresentationModel workbasketRepresentationModel)
|
@RequestBody WorkbasketRepresentationModel workbasketRepresentationModel)
|
||||||
throws InvalidWorkbasketException, WorkbasketNotFoundException, NotAuthorizedException,
|
throws InvalidWorkbasketException, WorkbasketNotFoundException, NotAuthorizedException,
|
||||||
ConcurrencyException {
|
ConcurrencyException {
|
||||||
LOGGER.debug("Entry to updateWorkbasket(workbasketId= {})", workbasketId);
|
|
||||||
if (!workbasketId.equals(workbasketRepresentationModel.getWorkbasketId())) {
|
if (!workbasketId.equals(workbasketRepresentationModel.getWorkbasketId())) {
|
||||||
throw new InvalidWorkbasketException(
|
throw new InvalidWorkbasketException(
|
||||||
"Target-WB-ID('"
|
"Target-WB-ID('"
|
||||||
|
@ -261,14 +237,8 @@ public class WorkbasketController {
|
||||||
Workbasket workbasket =
|
Workbasket workbasket =
|
||||||
workbasketRepresentationModelAssembler.toEntityModel(workbasketRepresentationModel);
|
workbasketRepresentationModelAssembler.toEntityModel(workbasketRepresentationModel);
|
||||||
workbasket = workbasketService.updateWorkbasket(workbasket);
|
workbasket = workbasketService.updateWorkbasket(workbasket);
|
||||||
ResponseEntity<WorkbasketRepresentationModel> result =
|
|
||||||
ResponseEntity.ok(workbasketRepresentationModelAssembler.toModel(workbasket));
|
|
||||||
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
return ResponseEntity.ok(workbasketRepresentationModelAssembler.toModel(workbasket));
|
||||||
LOGGER.debug("Exit from updateWorkbasket(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -288,19 +258,12 @@ public class WorkbasketController {
|
||||||
public ResponseEntity<WorkbasketAccessItemCollectionRepresentationModel> getWorkbasketAccessItems(
|
public ResponseEntity<WorkbasketAccessItemCollectionRepresentationModel> getWorkbasketAccessItems(
|
||||||
@PathVariable(value = "workbasketId") String workbasketId)
|
@PathVariable(value = "workbasketId") String workbasketId)
|
||||||
throws NotAuthorizedException, WorkbasketNotFoundException {
|
throws NotAuthorizedException, WorkbasketNotFoundException {
|
||||||
LOGGER.debug("Entry to getWorkbasketAccessItems(workbasketId= {})", workbasketId);
|
|
||||||
|
|
||||||
List<WorkbasketAccessItem> accessItems =
|
List<WorkbasketAccessItem> accessItems =
|
||||||
workbasketService.getWorkbasketAccessItems(workbasketId);
|
workbasketService.getWorkbasketAccessItems(workbasketId);
|
||||||
final ResponseEntity<WorkbasketAccessItemCollectionRepresentationModel> result =
|
|
||||||
ResponseEntity.ok(
|
|
||||||
workbasketAccessItemRepresentationModelAssembler
|
|
||||||
.toTaskanaCollectionModelForSingleWorkbasket(workbasketId, accessItems));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getWorkbasketAccessItems(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return ResponseEntity.ok(
|
||||||
|
workbasketAccessItemRepresentationModelAssembler
|
||||||
|
.toTaskanaCollectionModelForSingleWorkbasket(workbasketId, accessItems));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -325,7 +288,6 @@ public class WorkbasketController {
|
||||||
@RequestBody WorkbasketAccessItemCollectionRepresentationModel workbasketAccessItemRepModels)
|
@RequestBody WorkbasketAccessItemCollectionRepresentationModel workbasketAccessItemRepModels)
|
||||||
throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
|
throws NotAuthorizedException, InvalidArgumentException, WorkbasketNotFoundException,
|
||||||
WorkbasketAccessItemAlreadyExistException {
|
WorkbasketAccessItemAlreadyExistException {
|
||||||
LOGGER.debug("Entry to setWorkbasketAccessItems(workbasketId= {})", workbasketId);
|
|
||||||
if (workbasketAccessItemRepModels == null) {
|
if (workbasketAccessItemRepModels == null) {
|
||||||
throw new InvalidArgumentException("Can´t create something with NULL body-value.");
|
throw new InvalidArgumentException("Can´t create something with NULL body-value.");
|
||||||
}
|
}
|
||||||
|
@ -338,15 +300,9 @@ public class WorkbasketController {
|
||||||
List<WorkbasketAccessItem> updatedWbAccessItems =
|
List<WorkbasketAccessItem> updatedWbAccessItems =
|
||||||
workbasketService.getWorkbasketAccessItems(workbasketId);
|
workbasketService.getWorkbasketAccessItems(workbasketId);
|
||||||
|
|
||||||
ResponseEntity<WorkbasketAccessItemCollectionRepresentationModel> response =
|
return ResponseEntity.ok(
|
||||||
ResponseEntity.ok(
|
workbasketAccessItemRepresentationModelAssembler
|
||||||
workbasketAccessItemRepresentationModelAssembler
|
.toTaskanaCollectionModelForSingleWorkbasket(workbasketId, updatedWbAccessItems));
|
||||||
.toTaskanaCollectionModelForSingleWorkbasket(workbasketId, updatedWbAccessItems));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from setWorkbasketAccessItems(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -366,19 +322,12 @@ public class WorkbasketController {
|
||||||
public ResponseEntity<DistributionTargetsCollectionRepresentationModel> getDistributionTargets(
|
public ResponseEntity<DistributionTargetsCollectionRepresentationModel> getDistributionTargets(
|
||||||
@PathVariable(value = "workbasketId") String workbasketId)
|
@PathVariable(value = "workbasketId") String workbasketId)
|
||||||
throws WorkbasketNotFoundException, NotAuthorizedException {
|
throws WorkbasketNotFoundException, NotAuthorizedException {
|
||||||
|
|
||||||
LOGGER.debug("Entry to getDistributionTargets(workbasketId= {})", workbasketId);
|
|
||||||
List<WorkbasketSummary> distributionTargets =
|
List<WorkbasketSummary> distributionTargets =
|
||||||
workbasketService.getDistributionTargets(workbasketId);
|
workbasketService.getDistributionTargets(workbasketId);
|
||||||
DistributionTargetsCollectionRepresentationModel distributionTargetRepModels =
|
DistributionTargetsCollectionRepresentationModel distributionTargetRepModels =
|
||||||
workbasketSummaryRepresentationModelAssembler.toTaskanaCollectionModel(distributionTargets);
|
workbasketSummaryRepresentationModelAssembler.toTaskanaCollectionModel(distributionTargets);
|
||||||
ResponseEntity<DistributionTargetsCollectionRepresentationModel> result =
|
|
||||||
ResponseEntity.ok(distributionTargetRepModels);
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getDistributionTargets(), returning {}", result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return ResponseEntity.ok(distributionTargetRepModels);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -399,26 +348,14 @@ public class WorkbasketController {
|
||||||
@PathVariable(value = "workbasketId") String sourceWorkbasketId,
|
@PathVariable(value = "workbasketId") String sourceWorkbasketId,
|
||||||
@RequestBody List<String> targetWorkbasketIds)
|
@RequestBody List<String> targetWorkbasketIds)
|
||||||
throws WorkbasketNotFoundException, NotAuthorizedException {
|
throws WorkbasketNotFoundException, NotAuthorizedException {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug(
|
|
||||||
"Entry to getTasksStatusReport(workbasketId= {}, targetWorkbasketIds´= {})",
|
|
||||||
sourceWorkbasketId,
|
|
||||||
targetWorkbasketIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
workbasketService.setDistributionTargets(sourceWorkbasketId, targetWorkbasketIds);
|
workbasketService.setDistributionTargets(sourceWorkbasketId, targetWorkbasketIds);
|
||||||
|
|
||||||
List<WorkbasketSummary> distributionTargets =
|
List<WorkbasketSummary> distributionTargets =
|
||||||
workbasketService.getDistributionTargets(sourceWorkbasketId);
|
workbasketService.getDistributionTargets(sourceWorkbasketId);
|
||||||
ResponseEntity<DistributionTargetsCollectionRepresentationModel> response =
|
|
||||||
ResponseEntity.ok(
|
|
||||||
workbasketSummaryRepresentationModelAssembler.toTaskanaCollectionModel(
|
|
||||||
distributionTargets));
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from getTasksStatusReport(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
return ResponseEntity.ok(
|
||||||
|
workbasketSummaryRepresentationModelAssembler.toTaskanaCollectionModel(
|
||||||
|
distributionTargets));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -435,18 +372,13 @@ public class WorkbasketController {
|
||||||
public ResponseEntity<Void> removeDistributionTargetForWorkbasketId(
|
public ResponseEntity<Void> removeDistributionTargetForWorkbasketId(
|
||||||
@PathVariable(value = "workbasketId") String targetWorkbasketId)
|
@PathVariable(value = "workbasketId") String targetWorkbasketId)
|
||||||
throws WorkbasketNotFoundException, NotAuthorizedException {
|
throws WorkbasketNotFoundException, NotAuthorizedException {
|
||||||
LOGGER.debug(
|
|
||||||
"Entry to removeDistributionTargetForWorkbasketId(workbasketId= {})", targetWorkbasketId);
|
|
||||||
|
|
||||||
List<WorkbasketSummary> sourceWorkbaskets =
|
List<WorkbasketSummary> sourceWorkbaskets =
|
||||||
workbasketService.getDistributionSources(targetWorkbasketId);
|
workbasketService.getDistributionSources(targetWorkbasketId);
|
||||||
for (WorkbasketSummary source : sourceWorkbaskets) {
|
for (WorkbasketSummary source : sourceWorkbaskets) {
|
||||||
workbasketService.removeDistributionTarget(source.getId(), targetWorkbasketId);
|
workbasketService.removeDistributionTarget(source.getId(), targetWorkbasketId);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResponseEntity<Void> response = ResponseEntity.noContent().build();
|
return ResponseEntity.noContent().build();
|
||||||
LOGGER.debug("Exit from removeDistributionTargetForWorkbasketId(), returning {}", response);
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum WorkbasketQuerySortBy implements QuerySortBy<WorkbasketQuery> {
|
public enum WorkbasketQuerySortBy implements QuerySortBy<WorkbasketQuery> {
|
||||||
|
|
|
@ -6,7 +6,6 @@ import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -15,8 +14,6 @@ import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.dao.DuplicateKeyException;
|
import org.springframework.dao.DuplicateKeyException;
|
||||||
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
import org.springframework.hateoas.config.EnableHypermediaSupport;
|
||||||
|
@ -56,9 +53,6 @@ import pro.taskana.workbasket.rest.models.WorkbasketRepresentationModel;
|
||||||
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
|
@EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL)
|
||||||
public class WorkbasketDefinitionController {
|
public class WorkbasketDefinitionController {
|
||||||
|
|
||||||
private static final Logger LOGGER =
|
|
||||||
LoggerFactory.getLogger(WorkbasketDefinitionController.class);
|
|
||||||
|
|
||||||
private final WorkbasketService workbasketService;
|
private final WorkbasketService workbasketService;
|
||||||
private final WorkbasketDefinitionRepresentationModelAssembler workbasketDefinitionAssembler;
|
private final WorkbasketDefinitionRepresentationModelAssembler workbasketDefinitionAssembler;
|
||||||
private final WorkbasketRepresentationModelAssembler workbasketAssembler;
|
private final WorkbasketRepresentationModelAssembler workbasketAssembler;
|
||||||
|
@ -91,9 +85,6 @@ public class WorkbasketDefinitionController {
|
||||||
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
@Transactional(readOnly = true, rollbackFor = Exception.class)
|
||||||
public ResponseEntity<WorkbasketDefinitionCollectionRepresentationModel> exportWorkbaskets(
|
public ResponseEntity<WorkbasketDefinitionCollectionRepresentationModel> exportWorkbaskets(
|
||||||
@RequestParam(required = false) String[] domain) {
|
@RequestParam(required = false) String[] domain) {
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Entry to exportWorkbaskets(domain= {})", Arrays.toString(domain));
|
|
||||||
}
|
|
||||||
WorkbasketQuery query = workbasketService.createWorkbasketQuery();
|
WorkbasketQuery query = workbasketService.createWorkbasketQuery();
|
||||||
Optional.ofNullable(domain).ifPresent(query::domainIn);
|
Optional.ofNullable(domain).ifPresent(query::domainIn);
|
||||||
|
|
||||||
|
@ -107,13 +98,7 @@ public class WorkbasketDefinitionController {
|
||||||
Collectors.collectingAndThen(
|
Collectors.collectingAndThen(
|
||||||
Collectors.toList(), workbasketDefinitionAssembler::toTaskanaCollectionModel));
|
Collectors.toList(), workbasketDefinitionAssembler::toTaskanaCollectionModel));
|
||||||
|
|
||||||
ResponseEntity<WorkbasketDefinitionCollectionRepresentationModel> response =
|
return ResponseEntity.ok(pageModel);
|
||||||
ResponseEntity.ok(pageModel);
|
|
||||||
if (LOGGER.isDebugEnabled()) {
|
|
||||||
LOGGER.debug("Exit from exportWorkbaskets(), returning {}", response);
|
|
||||||
}
|
|
||||||
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -147,7 +132,6 @@ public class WorkbasketDefinitionController {
|
||||||
InvalidWorkbasketException, WorkbasketAlreadyExistException, WorkbasketNotFoundException,
|
InvalidWorkbasketException, WorkbasketAlreadyExistException, WorkbasketNotFoundException,
|
||||||
InvalidArgumentException, WorkbasketAccessItemAlreadyExistException,
|
InvalidArgumentException, WorkbasketAccessItemAlreadyExistException,
|
||||||
ConcurrencyException {
|
ConcurrencyException {
|
||||||
LOGGER.debug("Entry to importWorkbaskets()");
|
|
||||||
WorkbasketDefinitionCollectionRepresentationModel definitions =
|
WorkbasketDefinitionCollectionRepresentationModel definitions =
|
||||||
mapper.readValue(
|
mapper.readValue(
|
||||||
file.getInputStream(),
|
file.getInputStream(),
|
||||||
|
@ -228,9 +212,7 @@ public class WorkbasketDefinitionController {
|
||||||
// no verification necessary since the workbasket was already imported in step 1.
|
// no verification necessary since the workbasket was already imported in step 1.
|
||||||
idConversion.get(definition.getWorkbasket().getWorkbasketId()), distributionTargets);
|
idConversion.get(definition.getWorkbasket().getWorkbasketId()), distributionTargets);
|
||||||
}
|
}
|
||||||
ResponseEntity<Void> response = ResponseEntity.noContent().build();
|
return ResponseEntity.noContent().build();
|
||||||
LOGGER.debug("Exit from importWorkbaskets(), returning {}", response);
|
|
||||||
return response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Workbasket removeId(Workbasket importedWb) {
|
private Workbasket removeId(Workbasket importedWb) {
|
||||||
|
|
|
@ -383,7 +383,9 @@ class ClassificationDefinitionControllerIntTest {
|
||||||
ResponseEntity<Void> response = importRequest(clList);
|
ResponseEntity<Void> response = importRequest(clList);
|
||||||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.NO_CONTENT);
|
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.NO_CONTENT);
|
||||||
Thread.sleep(10);
|
Thread.sleep(10);
|
||||||
LOGGER.debug("Wait 10 ms to give the system a chance to update");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Wait 10 ms to give the system a chance to update");
|
||||||
|
}
|
||||||
|
|
||||||
ClassificationRepresentationModel childWithNewParent =
|
ClassificationRepresentationModel childWithNewParent =
|
||||||
this.getClassificationWithKeyAndDomain("L110105", "DOMAIN_A");
|
this.getClassificationWithKeyAndDomain("L110105", "DOMAIN_A");
|
||||||
|
@ -415,7 +417,9 @@ class ClassificationDefinitionControllerIntTest {
|
||||||
|
|
||||||
private ResponseEntity<Void> importRequest(ClassificationCollectionRepresentationModel clList)
|
private ResponseEntity<Void> importRequest(ClassificationCollectionRepresentationModel clList)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
LOGGER.debug("Start Import");
|
if (LOGGER.isDebugEnabled()) {
|
||||||
|
LOGGER.debug("Start Import");
|
||||||
|
}
|
||||||
File tmpFile = File.createTempFile("test", ".tmp");
|
File tmpFile = File.createTempFile("test", ".tmp");
|
||||||
try (FileOutputStream out = new FileOutputStream(tmpFile);
|
try (FileOutputStream out = new FileOutputStream(tmpFile);
|
||||||
OutputStreamWriter writer = new OutputStreamWriter(out, StandardCharsets.UTF_8)) {
|
OutputStreamWriter writer = new OutputStreamWriter(out, StandardCharsets.UTF_8)) {
|
||||||
|
|
|
@ -16,6 +16,11 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>pro.taskana</groupId>
|
<groupId>pro.taskana</groupId>
|
||||||
<artifactId>taskana-core</artifactId>
|
<artifactId>taskana-core</artifactId>
|
||||||
|
|
|
@ -18,6 +18,14 @@
|
||||||
<sonar.skip>true</sonar.skip>
|
<sonar.skip>true</sonar.skip>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>pro.taskana</groupId>
|
||||||
|
<artifactId>taskana-common-logging</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
Loading…
Reference in New Issue