use of com.emc.nas.vnxfile.xmlapi.LogicalNetworkDevice in project coprhd-controller by CoprHD.
the class VNXDataMoverInterfaceProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
// TODO Auto-generated method stub
final PostMethod result = (PostMethod) resultObj;
_logger.info("processing PortMetrics 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();
LogicalNetworkDevice logicalNetworkDevice = null;
// this interface to pysical port map.
Map<String, List<String>> interPortMap = null;
// this is mover to interportMap
Map<String, Map<String, List<String>>> moverInterMap = new HashMap<String, Map<String, List<String>>>();
Map<String, String> portSpeedMap = new HashMap<String, String>();
while (queryRespItr.hasNext()) {
Object responseObj = queryRespItr.next();
if (responseObj instanceof LogicalNetworkDevice) {
logicalNetworkDevice = (LogicalNetworkDevice) responseObj;
// get logical device map
interPortMap = moverInterMap.get(logicalNetworkDevice.getMover());
if (interPortMap == null) {
interPortMap = new HashMap<String, List<String>>();
}
// process logical network device
processNetworkDevice(logicalNetworkDevice, interPortMap);
// add to map <movername, Map<interfaceIP, List<physicalport>>
if (!interPortMap.isEmpty()) {
moverInterMap.put(logicalNetworkDevice.getMover(), interPortMap);
}
// process logical network device speed
processPortSpeed(logicalNetworkDevice, portSpeedMap);
}
}
keyMap.put(VNXFileConstants.INTREFACE_PORT_MAP, moverInterMap);
// STORAGE_PORT_SPEED_MAP
keyMap.put(VNXFileConstants.LOGICAL_NETWORK_SPEED_MAP, portSpeedMap);
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 Port Metrics information from the Server.");
}
}
} catch (final Exception ex) {
_logger.error("Exception occurred while processing the Port Metrics response due to {}", ex.getMessage());
} finally {
result.releaseConnection();
}
}
Aggregations