com.transferwise.tasks.dao.PostgresTaskTables Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tw-tasks-core Show documentation
Show all versions of tw-tasks-core Show documentation
Transferwise Tasks Executor - Fire and forget until Alert.
The newest version!
package com.transferwise.tasks.dao;
import com.transferwise.tasks.TasksProperties;
import org.apache.commons.lang3.StringUtils;
public class PostgresTaskTables implements ITwTaskTables {
private final String taskTableIdentifier;
private final String uniqueTaskKeyIdentifier;
private final String taskDataTableIdentifier;
public PostgresTaskTables(TasksProperties tasksProperties) {
if (StringUtils.isNotEmpty(tasksProperties.getTaskTablesSchemaName())) {
taskTableIdentifier = tasksProperties.getTaskTablesSchemaName() + "." + tasksProperties.getTaskTableName();
uniqueTaskKeyIdentifier = tasksProperties.getTaskTablesSchemaName() + "." + tasksProperties.getUniqueTaskKeyTableName();
taskDataTableIdentifier = tasksProperties.getTaskTablesSchemaName() + "." + tasksProperties.getTaskDataTableName();
} else {
taskTableIdentifier = tasksProperties.getTaskTableName();
uniqueTaskKeyIdentifier = tasksProperties.getUniqueTaskKeyTableName();
taskDataTableIdentifier = tasksProperties.getTaskDataTableName();
}
}
@Override
public String getTaskTableIdentifier() {
return taskTableIdentifier;
}
@Override
public String getUniqueTaskKeyTableIdentifier() {
return uniqueTaskKeyIdentifier;
}
@Override
public String getTaskDataTableIdentifier() {
return taskDataTableIdentifier;
}
}