Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5535 amar.kumar 1
namespace java in.shop2020.alert
2
namespace py shop2020.thriftpy.alert
3
 
4
include "GenericService.thrift"
5
 
6
/**
7
Exceptions
8
*/
9
exception AlertServiceException {
10
	1:string message,
11
	2:i32 errorCode
12
}
13
 
14
/**
15
Various structures
16
**/
17
enum EntityType {
18
	ORDER = 1,
19
	COURIER = 2,
20
	PRODUCT = 3,
21
	TICKET = 4
22
}
23
 
24
enum EntityProcessedState {
25
	UNEXPIRED = 1,
26
	WARNING_SENT = 2,
27
	CRITICAL_SENT = 3
28
}
29
 
30
enum AlertType {
31
	EMAIL = 1
32
}
33
 
34
struct EntityMonitoringStatus {
35
	1:EntityType entityType,
36
	2:bool isActive
37
	3:string userIds
38
}
39
 
40
struct MonitoredEntity {
41
	1:i64 id,
42
	2:EntityType entityType,
43
	3:i32 eventType,
44
	4:string entityIdentifier,
45
	5:i64 warnExpiryTime,
46
	6:i64 criticalExpiryTime,
47
	7:string description,
48
	8:EntityProcessedState entityProcessedState
49
}
50
 
51
struct AlertMapper {
52
	1:EntityType entityType,
53
	2:i32 eventType,
54
	3:string eventdesciption,
55
	4:AlertType alertType,
56
	5:string userIds
57
} 
58
 
59
struct AlertedEntity {
60
	1:i64 id,
61
	2:EntityType entityType,
62
	3:i32 eventType,
63
	4:string entityIdentifier,
64
	5:string description,
65
	6:EntityProcessedState entityProcessedState,
66
	7:i64 lastAlertedTime
67
}
68
 
69
struct SearchFilter {
70
    1:optional EntityType entityType,
71
    2:i32 eventType,
72
    3:optional string entityIdentifier,
73
    4:optional i64 warnExpiryTime,
74
    5:optional i64 criticalExpiryTime,
75
    6:optional EntityProcessedState entityProcessedState
76
}
77
 
78
 
79
service AlertService extends GenericService.GenericService{
80
 
81
	/**
82
	Create a new tracking object. 
83
	*/
84
	void scheduleAlert(1:MonitoredEntity entity) throws (1:AlertServiceException e),
85
 
86
	/**
87
	Update previously stored tracking object.
88
	*/ 
89
	void updateMonitoredObject(1:MonitoredEntity entity) throws (1:AlertServiceException e),
90
 
91
	/**
92
	Stop tracking the entity 
93
	*/ 
94
	void endMonitoringEntity(1:EntityType entityType, 2:string entityIdentifier) throws (1:AlertServiceException e),
95
 
96
	/**
97
	Get entities with specified conditions in SearchFilter Object
98
	*/
99
	list<MonitoredEntity> getEntities(1:SearchFilter searchFilter) throws (1:AlertServiceException e)
100
 
101
	/**
102
	Get entities with specified conditions in SearchFilter Object
103
	*/
104
	list<AlertedEntity> getAlertedEntities(1:SearchFilter searchFilter) throws (1:AlertServiceException e)
105
 
106
	/**
107
	Get alertMap for entityType and eventType
108
	*/
109
	AlertMapper getAlertMapper(1:EntityType entityType,2:i32 eventType) throws (1:AlertServiceException e)
110
 
111
	/**
112
	Start monitoring entityType or Update monitoring paremeters
113
	*/
114
	void activateEntityMonitoring(1:EntityType entityType,2:string userIds) throws (1:AlertServiceException e)
115
 
116
	/**
117
	Stop monitoring entityType
118
	*/
119
	void deActivateEntityMonitoring(1:EntityType entityType) throws (1:AlertServiceException e)
120
 
121
	/**
122
	Add AlertMap values for particular entity and event
123
	*/
124
	void  registerEventType(1:AlertMapper alertMap) throws (1:AlertServiceException e)
125
 
126
 
127
}