Project

General

Profile

1
package eu.dnetlib.enabling.tools.blackboard;
2

    
3
import java.util.Map;
4

    
5
/**
6
 * High level representation of a blackboard job.
7
 *
8
 * @author marko
9
 */
10
public interface BlackboardJob {
11

    
12
	/**
13
	 * Get the message id.
14
	 *
15
	 * @return id
16
	 */
17
	String getId();
18

    
19
	/**
20
	 * Set message id.
21
	 *
22
	 * @param identifier id
23
	 */
24
	void setId(String identifier);
25

    
26
	/**
27
	 * Get the action name.
28
	 *
29
	 * @return action name
30
	 */
31
	String getAction();
32

    
33
	/**
34
	 * Set the action name.
35
	 *
36
	 * @param action action name
37
	 */
38
	void setAction(String action);
39

    
40
	/**
41
	 * Get the action status.
42
	 *
43
	 * @return action status
44
	 */
45
	ActionStatus getActionStatus();
46

    
47
	/**
48
	 * Set the action status.
49
	 *
50
	 * @param actionStatus action status
51
	 */
52
	void setActionStatus(ActionStatus actionStatus);
53

    
54
	/**
55
	 * Get the message date.
56
	 *
57
	 * @return date
58
	 */
59
	String getDate();
60

    
61
	/**
62
	 * Set the message date.
63
	 *
64
	 * @param date date
65
	 */
66
	void setDate(String date);
67

    
68
	/**
69
	 * obtains a mutable parameter map (key/value).
70
	 *
71
	 * @return mutable parameter map
72
	 */
73
	Map<String, String> getParameters();
74

    
75
	/**
76
	 * Get the error message, if the actionStatus is FAILED. Usually the error message is also present in the parameter map but it's
77
	 * preferred to use this method.
78
	 *
79
	 * @return error message
80
	 */
81
	String getError();
82

    
83
	/**
84
	 * Set the error message, if the actionStatus is FAILED. Usually the error message is also present in the parameter map but it's
85
	 * preferred to use this method.
86
	 *
87
	 * @param error error message
88
	 */
89
	void setError(String error);
90

    
91
	/**
92
	 * Get the setviceId.
93
	 *
94
	 * @return the serviceId
95
	 */
96
	String getServiceId();
97

    
98
	/**
99
	 * True if the action status is one of the termination statuses (e.g. done and failed).
100
	 *
101
	 * @return true if completed
102
	 */
103
	boolean isCompleted();
104

    
105
	/**
106
	 * Get the bb message.
107
	 *
108
	 * @return the bb message
109
	 */
110
	BlackboardMessage getMessage();
111

    
112
}
(8-8/27)