use of com.emc.nas.vnxfile.xmlapi.MoverInterface in project coprhd-controller by CoprHD.
the class VNXStoragePortsProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
final PostMethod result = (PostMethod) resultObj;
_logger.info("processing vnx storageport response" + resultObj);
try {
ResponsePacket responsePacket = (ResponsePacket) _unmarshaller.unmarshal(result.getResponseBodyAsStream());
if (null != responsePacket.getPacketFault()) {
Status status = responsePacket.getPacketFault();
processErrorStatus(status, keyMap);
} else {
List<Object> queryResponse = getQueryResponse(responsePacket);
Iterator<Object> queryRespItr = queryResponse.iterator();
List<VNXDataMoverIntf> dmIntfs = new ArrayList<VNXDataMoverIntf>();
while (queryRespItr.hasNext()) {
Object responseObj = queryRespItr.next();
if (responseObj instanceof MoverInterface) {
MoverInterface mover = (MoverInterface) responseObj;
// Check that the interface is up and not an internal network interface.
String name = mover.getName();
if (mover.isUp() && !name.startsWith("el")) {
VNXDataMoverIntf vnxMover = new VNXDataMoverIntf(mover.getName(), mover.getIpAddress(), mover.getMover());
_logger.debug("Port Information : {}", vnxMover.toString());
dmIntfs.add(vnxMover);
}
}
}
_logger.info("Number of Ports found : {}", dmIntfs.size());
keyMap.put(VNXFileConstants.STORAGE_PORTS, dmIntfs);
// Extract session information from the response header.
Header[] headers = result.getResponseHeaders(VNXFileConstants.CELERRA_SESSION);
if (null != headers && headers.length > 0) {
keyMap.put(VNXFileConstants.CELERRA_SESSION, headers[0].getValue());
_logger.info("Recieved celerra storage ports information from the Server.");
}
}
} catch (final Exception ex) {
_logger.error("Exception occurred while processing the vnx storage ports info response due to ", ex);
} finally {
result.releaseConnection();
}
}
Aggregations