| Line 5... |
Line 5... |
| 5 |
|
5 |
|
| 6 |
import in.shop2020.alert.AlertMapper;
|
6 |
import in.shop2020.alert.AlertMapper;
|
| 7 |
import in.shop2020.alert.AlertServiceException;
|
7 |
import in.shop2020.alert.AlertServiceException;
|
| 8 |
import in.shop2020.alert.AlertType;
|
8 |
import in.shop2020.alert.AlertType;
|
| 9 |
import in.shop2020.alert.AlertedEntity;
|
9 |
import in.shop2020.alert.AlertedEntity;
|
| - |
|
10 |
import in.shop2020.alert.EntityMonitoringStatus;
|
| 10 |
import in.shop2020.alert.EntityProcessedState;
|
11 |
import in.shop2020.alert.EntityProcessedState;
|
| 11 |
import in.shop2020.alert.EntityType;
|
12 |
import in.shop2020.alert.EntityType;
|
| 12 |
import in.shop2020.alert.MonitoredEntity;
|
13 |
import in.shop2020.alert.MonitoredEntity;
|
| 13 |
import in.shop2020.alert.SearchFilter;
|
14 |
import in.shop2020.alert.SearchFilter;
|
| 14 |
import in.shop2020.alert.persistence.EntityMapper;
|
15 |
import in.shop2020.alert.persistence.EntityMapper;
|
| Line 131... |
Line 132... |
| 131 |
public void activateEntityMonitoring(EntityType entityType, String userIds) throws TException {
|
132 |
public void activateEntityMonitoring(EntityType entityType, String userIds) throws TException {
|
| 132 |
if(userIds == null) {
|
133 |
if(userIds == null) {
|
| 133 |
throw new TException("Default Ids for alert cannot be null while " +
|
134 |
throw new TException("Default Ids for alert cannot be null while " +
|
| 134 |
"activating Entity Monitoring");
|
135 |
"activating Entity Monitoring");
|
| 135 |
}
|
136 |
}
|
| - |
|
137 |
if(entityMapper.getEntityMonitoringStatus(entityType.getValue())!=null) {
|
| 136 |
entityMapper.activateEntityMonitoring(entityType, userIds);
|
138 |
entityMapper.activateEntityMonitoring(entityType, userIds);
|
| - |
|
139 |
} else {
|
| - |
|
140 |
in.shop2020.alert.domain.EntityMonitoringStatus entityMonStatus =
|
| - |
|
141 |
new in.shop2020.alert.domain.EntityMonitoringStatus();
|
| - |
|
142 |
entityMonStatus.setEntityType(entityType);
|
| - |
|
143 |
entityMonStatus.setActive(true);
|
| - |
|
144 |
entityMonStatus.setDefaultAlertGroup(userIds);
|
| - |
|
145 |
entityMapper.addEntityType(entityMonStatus);
|
| - |
|
146 |
}
|
| 137 |
}
|
147 |
}
|
| 138 |
|
148 |
|
| 139 |
public void deActivateEntityMonitoring(EntityType entityType) {
|
149 |
public void deActivateEntityMonitoring(EntityType entityType) {
|
| 140 |
entityMapper.deActivateEntityMonitoring(entityType);
|
150 |
entityMapper.deActivateEntityMonitoring(entityType);
|
| 141 |
}
|
151 |
}
|
| - |
|
152 |
|
| - |
|
153 |
public EntityMonitoringStatus getEntityMonitoringStatus(
|
| - |
|
154 |
EntityType entityType) {
|
| - |
|
155 |
in.shop2020.alert.domain.EntityMonitoringStatus entityMonStatus =
|
| - |
|
156 |
entityMapper.getEntityMonitoringStatus(entityType.getValue());
|
| - |
|
157 |
EntityMonitoringStatus tEntityMonitoringStatus = new EntityMonitoringStatus();
|
| - |
|
158 |
tEntityMonitoringStatus.setEntityType(entityMonStatus.getEntityType());
|
| - |
|
159 |
tEntityMonitoringStatus.setIsActive(entityMonStatus.isActive());
|
| - |
|
160 |
tEntityMonitoringStatus.setUserIds(entityMonStatus.getDefaultAlertGroup());
|
| - |
|
161 |
return tEntityMonitoringStatus;
|
| - |
|
162 |
}
|
| 142 |
|
163 |
|
| 143 |
}
|
164 |
}
|