19
19
import com .fasterxml .jackson .databind .ObjectMapper ;
20
20
import com .fasterxml .jackson .databind .node .ArrayNode ;
21
21
import lombok .Getter ;
22
+ import lombok .Setter ;
23
+
22
24
import org .slf4j .Logger ;
23
25
import org .slf4j .LoggerFactory ;
24
26
import org .springframework .beans .factory .annotation .Autowired ;
32
34
/**
33
35
* This class is responsible to take a aggregatedObject and match it with all
34
36
* the Subscription Object, to check ALL Conditions/requirement for
35
- * notification. (AND between conditions in requirements, "OR" between requirements with conditions)
37
+ * notification. (AND between conditions in requirements, "OR" between
38
+ * requirements with conditions)
36
39
*
37
40
* @author xjibbal
38
41
*/
@@ -53,8 +56,9 @@ public class SubscriptionHandler {
53
56
@ Autowired
54
57
private InformSubscription informSubscription ;
55
58
59
+ @ Setter
56
60
@ Autowired
57
- private MongoDBHandler handler ;
61
+ private MongoDBHandler mongoDBHandler ;
58
62
59
63
@ Autowired
60
64
private RunSubscription runSubscription ;
@@ -71,7 +75,8 @@ public class SubscriptionHandler {
71
75
*/
72
76
public void checkSubscriptionForObject (final String aggregatedObject ) {
73
77
Thread subscriptionThread = new Thread (() -> {
74
- List <String > subscriptions = handler .getAllDocuments (subscriptionDataBaseName , subscriptionCollectionName );
78
+ List <String > subscriptions = mongoDBHandler .getAllDocuments (subscriptionDataBaseName ,
79
+ subscriptionCollectionName );
75
80
subscriptions .forEach (subscription -> extractConditions (aggregatedObject , subscription ));
76
81
});
77
82
subscriptionThread .setName ("SubscriptionHandler" );
@@ -113,7 +118,7 @@ private void extractConditions(String aggregatedObject, String subscriptionData)
113
118
public void print () {
114
119
LOGGER .debug ("SubscriptionDataBaseName : " + subscriptionDataBaseName );
115
120
LOGGER .debug ("SubscriptionCollectionName : " + subscriptionCollectionName );
116
- LOGGER .debug ("MongoDBHandler object : " + handler );
121
+ LOGGER .debug ("MongoDBHandler object : " + mongoDBHandler );
117
122
LOGGER .debug ("JmesPathInterface : " + jmespath );
118
123
119
124
}
0 commit comments