| |
|
Line 31
|
Parallel
|
Line 31
|
Parallel
|
| 31 |
import com.dhyan.nms.client.webclient.webbase.struts.WebConstants; |
31 |
import com.dhyan.nms.client.webclient.webbase.struts.WebConstants; |
| 32 |
import com.dhyan.nms.datamodel.StaleDataException; |
32 |
import com.dhyan.nms.datamodel.StaleDataException; |
| 33 |
import com.dhyan.nms.server.fault.alarmmanager.AlarmConstants; |
33 |
import com.dhyan.nms.server.fault.alarmmanager.AlarmConstants; |
|
|
34 |
import com.dhyan.nms.server.fault.alarmmanager.AlarmManager; |
| 34 |
import com.dhyan.nms.server.fault.alarmmanager.datamodel.Alarm; |
35 |
import com.dhyan.nms.server.fault.alarmmanager.datamodel.Alarm; |
| 35 |
import com.dhyan.nms.server.fault.alarmmanager.datamodel.Alarmannotation; |
36 |
import com.dhyan.nms.server.fault.alarmmanager.datamodel.Alarmannotation; |
| 36 |
import com.dhyan.nms.server.fault.alarmmanager.interfaces.AlarmSessionLocal; |
37 |
import com.dhyan.nms.server.fault.alarmmanager.interfaces.AlarmSessionLocal; |
| |
| |
|
Line 160
|
Parallel
|
Line 161
|
Parallel
|
| 160 |
this.optionalfield = optionalfieldArg; |
161 |
this.optionalfield = optionalfieldArg; |
| 161 |
} |
162 |
} |
| 162 |
|
163 |
|
| 163 |
|
|
|
| 164 |
/** |
164 |
/** |
| 165 |
* @param rowsjsonArg the rowsjson to set |
165 |
* @param rowsjsonArg the rowsjson to set |
| 166 |
*/ |
166 |
*/ |
| |
| |
|
Line 883
|
Parallel
|
Line 883
|
Parallel
|
| 883 |
{ |
883 |
{ |
| 884 |
if (response != null) |
884 |
if (response != null) |
| 885 |
{ |
885 |
{ |
|
|
886 |
JSONBuilder.setResponseAttributes(response); |
| 886 |
response.getWriter().write(responseString); |
887 |
response.getWriter().write(responseString); |
| 887 |
} |
888 |
} |
| 888 |
} |
889 |
} |
| |
| |
|
Line 892
|
Parallel
|
Line 893
|
Parallel
|
| 892 |
* @return null |
893 |
* @return null |
| 893 |
* @throws Exception exception |
894 |
* @throws Exception exception |
| 894 |
*/ |
895 |
*/ |
|
|
896 |
public String checkCanClearAlarms() throws Exception |
|
|
897 |
{ |
|
|
898 |
|
|
|
899 |
try |
|
|
900 |
{ |
|
|
901 |
JSONArray jsonArray = new JSONArray(getRowsjson()); |
|
|
902 |
JSONObject responseJSON = new JSONObject(); |
|
|
903 |
if (jsonArray.length() > 0) |
|
|
904 |
{ |
|
|
905 |
for (int i = 0; i < jsonArray.length(); i++) |
|
|
906 |
{ |
|
|
907 |
JSONObject jsonObject = jsonArray.getJSONObject(i); |
|
|
908 |
Alarm alarmObj = getAlarmFromJSON(jsonObject); |
|
|
909 |
if (AlarmManager.getInstance().isDeviceAlarm(alarmObj)) |
|
|
910 |
{ |
|
|
911 |
responseJSON.put("errorMessage", ResourceBundleHandler.getInstance().getResource(AlarmDetailsAction.RESOURCE_BUNDLE, |
|
|
912 |
"AlarmDetailsAction.alert.clearAlarm.validation", "Problem in locating Resource Bundle / Keys")); |
|
|
913 |
break; |
|
|
914 |
} |
|
|
915 |
} |
|
|
916 |
} |
|
|
917 |
this.writeToResponse(responseJSON.toString()); |
|
|
918 |
} |
|
|
919 |
catch (Exception e) |
|
|
920 |
{ |
|
|
921 |
AlarmDetailsAction.LOGGER.error("Problem while Clearing Alarms; Exception caused due to " + e.getMessage()); |
|
|
922 |
} |
|
|
923 |
return null; |
|
|
924 |
} |
|
|
925 |
|
|
|
926 |
/** |
|
|
927 |
* To clear the alarms. |
|
|
928 |
* @return null |
|
|
929 |
* @throws Exception exception |
|
|
930 |
*/ |
| 895 |
public String clearAlarm() throws Exception |
931 |
public String clearAlarm() throws Exception |
| 896 |
{ |
932 |
{ |
| 897 |
try |
933 |
try |
| |
| |
|
Line 913
|
Parallel
|
Line 949
|
Parallel
|
| 913 |
alarm_store_local.addAnnotateAlarm(alarmObj.getAlarmid(), this.getAnnotation(), security_facade_local.getUserID(alarmObj.getOwner())); |
949 |
alarm_store_local.addAnnotateAlarm(alarmObj.getAlarmid(), this.getAnnotation(), security_facade_local.getUserID(alarmObj.getOwner())); |
| 914 |
} |
950 |
} |
| 915 |
} |
951 |
} |
| 916 |
this.writeToResponse(JSONBuilder.OPEN_CURLY_BRACE |
952 |
this.writeToResponse(JSONBuilder.OPEN_CURLY_BRACE + JSONBuilder.prepareKeyValuePair(AlarmDetailsAction.SUCCESS, "success ") |
| 917 |
+ JSONBuilder.prepareKeyValuePair(AlarmDetailsAction.SUCCESS, "success ") + JSONBuilder.CLOSED_CURLY_BRACE); |
953 |
+ JSONBuilder.CLOSED_CURLY_BRACE); |
| 918 |
} |
954 |
} |
| 919 |
catch (StaleDataException se) |
955 |
catch (StaleDataException se) |
| 920 |
{ |
956 |
{ |
| |