1
|
/**
|
2
|
* Copyright (C) 2017 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.cdm.database.update;
|
10
|
|
11
|
import eu.etaxonomy.cdm.common.IoResultBase;
|
12
|
|
13
|
/**
|
14
|
* @author a.mueller
|
15
|
* @since 04.06.2017
|
16
|
*
|
17
|
*/
|
18
|
public class SchemaUpdateResult extends IoResultBase{
|
19
|
|
20
|
private static final long serialVersionUID = -1154009912578583419L;
|
21
|
|
22
|
/**
|
23
|
* {@inheritDoc}
|
24
|
*/
|
25
|
@Override
|
26
|
protected void setExceptionState() {
|
27
|
// TODO Auto-generated method stub
|
28
|
}
|
29
|
|
30
|
/**
|
31
|
* {@inheritDoc}
|
32
|
*/
|
33
|
@Override
|
34
|
public void setAborted() {
|
35
|
// TODO Auto-generated method stub
|
36
|
}
|
37
|
|
38
|
/**
|
39
|
* @return
|
40
|
*/
|
41
|
public boolean isSuccess() {
|
42
|
return this.getExceptions().isEmpty() && this.getErrors().isEmpty();
|
43
|
}
|
44
|
|
45
|
/**
|
46
|
* @param e
|
47
|
* @param message
|
48
|
* @param classificationRootNodeUpdater
|
49
|
* @param methodName
|
50
|
*/
|
51
|
public void addException(Exception e, String message, SchemaUpdaterStepBase step,
|
52
|
String methodName) {
|
53
|
addException(e, message, step.getStepName() + ", " + step.getClass().getName() + "." + methodName);
|
54
|
}
|
55
|
|
56
|
/**
|
57
|
* @param message
|
58
|
* @param singleTermUpdater
|
59
|
* @param string
|
60
|
*/
|
61
|
public void addError(String message, SchemaUpdaterStepBase step, String string) {
|
62
|
addError(message, step.getStepName() + ", " + step.getClass().getName() +"." + string);
|
63
|
}
|
64
|
|
65
|
/**
|
66
|
* @param message
|
67
|
* @param singleTermUpdater
|
68
|
* @param string
|
69
|
*/
|
70
|
public void addWarning(String message, SchemaUpdaterStepBase step, String string) {
|
71
|
addWarning(message, step.getStepName() + ", " + step.getClass().getName() +"." + string);
|
72
|
}
|
73
|
|
74
|
@Override
|
75
|
public StringBuffer createReport() {
|
76
|
boolean isSuccess = isSuccess();
|
77
|
String strSuccess = "Schema-Update ended " + (isSuccess ? "successful" : "with errors");
|
78
|
StringBuffer superReport = super.createReport();
|
79
|
superReport.insert(0, strSuccess + "\n");
|
80
|
return superReport;
|
81
|
}
|
82
|
|
83
|
}
|