private boolean handleBlsrChangeEvent(AbstractNe ne, Map<String, String> values, CHANGE oper) { try { String workingAid = values.get("AID1"); String protectionAid = values.get("AID2"); NetworkElement omeNe = (NetworkElement) ne; // Set up the data for event HashMap<String, String> eventData = new HashMap<String, String>(); eventData.put("workingAid", workingAid); eventData.put("proctectingAid", protectionAid); eventData.put("operation", oper.asString()); dbchgEvent.addDataElement(eventData); getParameters().put(AbstractCommandlet.RESULT_KEY, dbchgEvent); // String command = values.get("COMMAND"); if (oper == CHANGE.DELETE) { // don't handle any thing, for now log.debug("Got the DLT-BLSRMAP report for " + workingAid + ":" + protectionAid); DbUtility.INSTANCE.updateOrAddFacilityAttr( ne, workingAid, AbstractFacilityXml.APSID_ATTR, "N/A"); DbUtility.INSTANCE.updateOrAddFacilityAttr( ne, protectionAid, AbstractFacilityXml.APSID_ATTR, "N/A"); omeNe.getRingName().remove(workingAid); omeNe.getRingName().remove(protectionAid); omeNe.setApsId(null); eventData.put(AbstractFacilityXml.APSID_ATTR, "N/A"); return true; } log.debug("Got the ENT-BLSRMAP report for " + workingAid + ":" + protectionAid); Map<String, String> paramList = new HashMap<String, String>(); paramList.put(ObjectElement.OPERATION_KEY, Tl1CommandCode.RTRV_BLSRMAP.toString()); paramList.put("WRKGAID", workingAid); paramList.put("PROTAID", protectionAid); List<Map<String, String>> result = omeNe.getTl1Session().sendToNE(paramList); if (result != null) { Iterator<Map<String, String>> ir = result.iterator(); while (ir.hasNext()) { Map<String, String> blsrResult = ir.next(); String ringName = blsrResult.get("LABEL"); omeNe.getRingName().put(workingAid, ringName); omeNe.getRingName().put(protectionAid, ringName); // ringMap is expected to have the following format // "3:3/0:0/1:1/2:2/3:3" try { String ringMap = blsrResult.get("RINGMAP"); log.debug("got ringMap info for " + ringName + " in " + ringMap); String apsIdStr = ringMap.split("/")[0].split(":")[0]; omeNe.setApsId(Integer.valueOf(apsIdStr)); // update the facility in the database with the apsId. DbUtility.INSTANCE.updateOrAddFacilityAttr( ne, workingAid, AbstractFacilityXml.APSID_ATTR, apsIdStr); DbUtility.INSTANCE.updateOrAddFacilityAttr( ne, protectionAid, AbstractFacilityXml.APSID_ATTR, apsIdStr); eventData.put(AbstractFacilityXml.APSID_ATTR, apsIdStr); } catch (Exception ex) { log.error("Fail to obtain the ring information", ex); } } return true; } } catch (Exception e) { log.error("Failed to handle BLSRMAP event", e); } return false; }