TSK-104 make constructor of impl classes package private
This commit is contained in:
parent
9408142e57
commit
451d2fc63d
|
@ -66,7 +66,7 @@ public class TaskanaEngineConfiguration {
|
|||
* @return the TaskanaEngine
|
||||
*/
|
||||
public TaskanaEngine buildTaskanaEngine() {
|
||||
return new TaskanaEngineImpl(this);
|
||||
return TaskanaEngineImpl.createTaskanaEngine(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,6 +17,10 @@ public class AttachmentSummaryImpl implements AttachmentSummary {
|
|||
private ClassificationSummary classificationSummary;
|
||||
private Instant received;
|
||||
|
||||
AttachmentSummaryImpl() {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see pro.taskana.impl.AttachmentSummary#getId()
|
||||
|
|
|
@ -59,7 +59,7 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
|||
private String[] custom8In;
|
||||
private String[] custom8Like;
|
||||
|
||||
public ClassificationQueryImpl(TaskanaEngine taskanaEngine) {
|
||||
ClassificationQueryImpl(TaskanaEngine taskanaEngine) {
|
||||
this.taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
||||
}
|
||||
|
||||
|
@ -159,7 +159,7 @@ public class ClassificationQueryImpl implements ClassificationQuery {
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public ClassificationQuery custom1Like(String... custom1Like) {
|
||||
this.custom1Like = custom1Like;
|
||||
return this;
|
||||
|
|
|
@ -33,7 +33,7 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
private ClassificationMapper classificationMapper;
|
||||
private TaskanaEngineImpl taskanaEngineImpl;
|
||||
|
||||
public ClassificationServiceImpl(TaskanaEngine taskanaEngine, ClassificationMapper classificationMapper) {
|
||||
ClassificationServiceImpl(TaskanaEngine taskanaEngine, ClassificationMapper classificationMapper) {
|
||||
super();
|
||||
this.taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
||||
this.classificationMapper = classificationMapper;
|
||||
|
@ -295,15 +295,17 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void deleteClassification(String classificationKey, String domain) throws ClassificationInUseException, ClassificationNotFoundException {
|
||||
public void deleteClassification(String classificationKey, String domain)
|
||||
throws ClassificationInUseException, ClassificationNotFoundException {
|
||||
try {
|
||||
taskanaEngineImpl.openConnection();
|
||||
if (this.classificationMapper.findByKeyAndDomain(classificationKey, domain) == null) {
|
||||
throw new ClassificationNotFoundException("The classification " + classificationKey + "wasn't found in the domain " + domain);
|
||||
throw new ClassificationNotFoundException(
|
||||
"The classification " + classificationKey + "wasn't found in the domain " + domain);
|
||||
}
|
||||
|
||||
if (domain.equals("")) {
|
||||
//master mode - delete all associated classifications in every domain.
|
||||
// master mode - delete all associated classifications in every domain.
|
||||
List<String> domains = this.classificationMapper.getDomainsForClassification(classificationKey);
|
||||
domains.remove("");
|
||||
for (String classificationDomain : domains) {
|
||||
|
@ -313,12 +315,17 @@ public class ClassificationServiceImpl implements ClassificationService {
|
|||
|
||||
TaskServiceImpl taskService = (TaskServiceImpl) taskanaEngineImpl.getTaskService();
|
||||
try {
|
||||
List<TaskSummary> classificationTasks = taskService.createTaskQuery().classificationKeyIn(classificationKey).domainIn(domain).list();
|
||||
List<TaskSummary> classificationTasks = taskService.createTaskQuery()
|
||||
.classificationKeyIn(classificationKey)
|
||||
.domainIn(domain)
|
||||
.list();
|
||||
if (!classificationTasks.isEmpty()) {
|
||||
throw new ClassificationInUseException("There are " + classificationTasks.size() + " Tasks which belong to this classification or a child classification. Please complete them and try again.");
|
||||
throw new ClassificationInUseException("There are " + classificationTasks.size()
|
||||
+ " Tasks which belong to this classification or a child classification. Please complete them and try again.");
|
||||
}
|
||||
} catch (NotAuthorizedException e) {
|
||||
LOGGER.error("ClassificationQuery unexpectedly returned NotauthorizedException. Throwing SystemException ");
|
||||
LOGGER.error(
|
||||
"ClassificationQuery unexpectedly returned NotauthorizedException. Throwing SystemException ");
|
||||
throw new SystemException("ClassificationQuery unexpectedly returned NotauthorizedException.");
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,10 @@ public class ClassificationSummaryImpl implements ClassificationSummary {
|
|||
private String domain;
|
||||
private String name;
|
||||
|
||||
ClassificationSummaryImpl() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
|
|
|
@ -11,6 +11,10 @@ public class MinimalTaskSummary {
|
|||
private String workbasketKey;
|
||||
private TaskState taskState;
|
||||
|
||||
MinimalTaskSummary() {
|
||||
|
||||
}
|
||||
|
||||
public String getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public class ObjectReferenceQueryImpl implements ObjectReferenceQuery {
|
|||
private String[] type;
|
||||
private String[] value;
|
||||
|
||||
public ObjectReferenceQueryImpl(TaskanaEngine taskanaEngine) {
|
||||
ObjectReferenceQueryImpl(TaskanaEngine taskanaEngine) {
|
||||
this.taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ public class TaskMonitorServiceImpl implements TaskMonitorService {
|
|||
private TaskanaEngineImpl taskanaEngineImpl;
|
||||
private TaskMonitorMapper taskMonitorMapper;
|
||||
|
||||
public TaskMonitorServiceImpl(TaskanaEngine taskanaEngine, TaskMonitorMapper taskMonitorMapper) {
|
||||
TaskMonitorServiceImpl(TaskanaEngine taskanaEngine, TaskMonitorMapper taskMonitorMapper) {
|
||||
super();
|
||||
this.taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
||||
this.taskMonitorMapper = taskMonitorMapper;
|
||||
|
|
|
@ -54,7 +54,7 @@ public class TaskQueryImpl implements TaskQuery {
|
|||
private String porValueLike;
|
||||
private List<String> orderBy;
|
||||
|
||||
public TaskQueryImpl(TaskanaEngine taskanaEngine) {
|
||||
TaskQueryImpl(TaskanaEngine taskanaEngine) {
|
||||
this.taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
||||
this.taskService = (TaskServiceImpl) taskanaEngineImpl.getTaskService();
|
||||
this.orderBy = new ArrayList<>();
|
||||
|
|
|
@ -64,7 +64,7 @@ public class TaskServiceImpl implements TaskService {
|
|||
private TaskMapper taskMapper;
|
||||
private AttachmentMapper attachmentMapper;
|
||||
|
||||
public TaskServiceImpl(TaskanaEngine taskanaEngine, TaskMapper taskMapper,
|
||||
TaskServiceImpl(TaskanaEngine taskanaEngine, TaskMapper taskMapper,
|
||||
AttachmentMapper attachmentMapper) {
|
||||
super();
|
||||
this.taskanaEngine = taskanaEngine;
|
||||
|
|
|
@ -49,6 +49,10 @@ public class TaskSummaryImpl implements TaskSummary {
|
|||
private String custom9;
|
||||
private String custom10;
|
||||
|
||||
TaskSummaryImpl() {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see pro.taskana.impl.TaskSummary#getId()
|
||||
|
|
|
@ -53,7 +53,11 @@ public class TaskanaEngineImpl implements TaskanaEngine {
|
|||
protected ConnectionManagementMode mode = ConnectionManagementMode.PARTICIPATE;
|
||||
protected java.sql.Connection connection = null;
|
||||
|
||||
public TaskanaEngineImpl(TaskanaEngineConfiguration taskanaEngineConfiguration) {
|
||||
public static TaskanaEngine createTaskanaEngine(TaskanaEngineConfiguration taskanaEngineConfiguration) {
|
||||
return new TaskanaEngineImpl(taskanaEngineConfiguration);
|
||||
}
|
||||
|
||||
protected TaskanaEngineImpl(TaskanaEngineConfiguration taskanaEngineConfiguration) {
|
||||
this.taskanaEngineConfiguration = taskanaEngineConfiguration;
|
||||
createTransactionFactory(taskanaEngineConfiguration.getUseManagedTransactions());
|
||||
this.sessionManager = createSqlSessionManager();
|
||||
|
|
|
@ -32,7 +32,7 @@ public class WorkbasketAccessItemQueryImpl implements WorkbasketAccessItemQuery
|
|||
private TaskanaEngineImpl taskanaEngineImpl;
|
||||
private List<String> orderBy;
|
||||
|
||||
public WorkbasketAccessItemQueryImpl(TaskanaEngine taskanaEngine) {
|
||||
WorkbasketAccessItemQueryImpl(TaskanaEngine taskanaEngine) {
|
||||
this.taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
||||
orderBy = new ArrayList<>();
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class WorkbasketQueryImpl implements WorkbasketQuery {
|
|||
private TaskanaEngineImpl taskanaEngineImpl;
|
||||
private List<String> orderBy;
|
||||
|
||||
public WorkbasketQueryImpl(TaskanaEngine taskanaEngine) {
|
||||
WorkbasketQueryImpl(TaskanaEngine taskanaEngine) {
|
||||
this.taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
|
||||
orderBy = new ArrayList<>();
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class WorkbasketServiceImpl implements WorkbasketService {
|
|||
public WorkbasketServiceImpl() {
|
||||
}
|
||||
|
||||
public WorkbasketServiceImpl(TaskanaEngine taskanaEngine, WorkbasketMapper workbasketMapper,
|
||||
WorkbasketServiceImpl(TaskanaEngine taskanaEngine, WorkbasketMapper workbasketMapper,
|
||||
DistributionTargetMapper distributionTargetMapper, WorkbasketAccessMapper workbasketAccessMapper) {
|
||||
this.taskanaEngine = (TaskanaEngineImpl) taskanaEngine;
|
||||
this.workbasketMapper = workbasketMapper;
|
||||
|
|
|
@ -22,6 +22,10 @@ public class WorkbasketSummaryImpl implements WorkbasketSummary {
|
|||
private String orgLevel3;
|
||||
private String orgLevel4;
|
||||
|
||||
WorkbasketSummaryImpl() {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see pro.taskana.impl.WorkbasketSummary#getId()
|
||||
|
|
|
@ -240,7 +240,8 @@ public class TaskServiceImplIntAutocommitTest {
|
|||
dummyTask = (TaskImpl) taskServiceImpl.createTask(dummyTask);
|
||||
|
||||
List<TaskSummaryImpl> expectedTaskSumamries = new ArrayList<>();
|
||||
TaskSummaryImpl taskSummary = new TaskSummaryImpl();
|
||||
TaskSummaryImpl taskSummary = (TaskSummaryImpl) taskServiceImpl.newTask(dummyTask.getWorkbasketKey())
|
||||
.asSummary();
|
||||
taskSummary.setTaskId(dummyTask.getId());
|
||||
taskSummary.setName(dummyTask.getName());
|
||||
expectedTaskSumamries.add(taskSummary);
|
||||
|
|
Loading…
Reference in New Issue