use of com.emc.nas.vnxfile.xmlapi.Mover in project coprhd-controller by CoprHD.
the class VNXDataMoverIdProcessor method processDataMoverList.
private void processDataMoverList(List<Object> dmList, Map<String, Object> keyMap) throws VNXFilePluginException {
Iterator<Object> iterator = dmList.iterator();
Set<String> moverNames = new HashSet<String>();
Set<String> moverIds = new HashSet<String>();
if (iterator.hasNext()) {
Status status = (Status) iterator.next();
if (status.getMaxSeverity() == Severity.OK || status.getMaxSeverity() == Severity.WARNING) {
while (iterator.hasNext()) {
Mover dm = (Mover) iterator.next();
if (dm.getRole() == MoverRole.STANDBY) {
continue;
}
moverIds.add(dm.getMover());
moverNames.add(dm.getName());
}
} else {
throw new VNXFilePluginException("Fault response received from XMLAPI Server.", VNXFilePluginException.ERRORCODE_INVALID_RESPONSE);
}
}
keyMap.put(VNXFileConstants.MOVERLIST, moverIds);
keyMap.put(VNXFileConstants.MOVER_NAME, moverNames);
if (!moverIds.isEmpty()) {
keyMap.put(VNXFileConstants.MOVER_ID, moverIds.toArray(new String[0])[0]);
}
}
use of com.emc.nas.vnxfile.xmlapi.Mover in project coprhd-controller by CoprHD.
the class VNXStoragePortGroupsProcessor 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 datamovers 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<VNXDataMover> movers = new ArrayList<VNXDataMover>();
while (queryRespItr.hasNext()) {
Object responseObj = queryRespItr.next();
if (responseObj instanceof Mover) {
VNXDataMover vnxMover = new VNXDataMover();
Mover mover = (Mover) responseObj;
vnxMover.setId(Integer.valueOf(mover.getMover()));
vnxMover.setName(mover.getName());
vnxMover.setRole(mover.getRole().value());
_logger.debug("Port Group Information : {}", vnxMover.toString());
movers.add(vnxMover);
}
}
_logger.info("Number of Port Groups found : {}", movers.size());
keyMap.put(VNXFileConstants.STORAGE_PORT_GROUPS, movers);
// 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 session information from the Server.");
}
}
} catch (final Exception ex) {
_logger.error("Exception occurred while processing the vnx info response due to ", ex);
} finally {
result.releaseConnection();
}
}
use of com.emc.nas.vnxfile.xmlapi.Mover in project coprhd-controller by CoprHD.
the class VNXDataMoverNameProcessor method processDataMoverList.
private void processDataMoverList(List<Object> dmList, Map<String, Object> keyMap) throws VNXFilePluginException {
Iterator<Object> iterator = dmList.iterator();
String dmId = (String) keyMap.get(VNXFileConstants.DATAMOVER_ID);
if (iterator.hasNext()) {
Status status = (Status) iterator.next();
if (status.getMaxSeverity() == Severity.OK || status.getMaxSeverity() == Severity.WARNING) {
while (iterator.hasNext()) {
Mover dm = (Mover) iterator.next();
if (dm.getRole() == MoverRole.STANDBY) {
continue;
}
if (dmId.equals(dm.getMover())) {
keyMap.put(VNXFileConstants.DATAMOVER_NAME, dm.getName());
break;
}
}
} else {
throw new VNXFilePluginException("Fault response received from XMLAPI Server.", VNXFilePluginException.ERRORCODE_INVALID_RESPONSE);
}
}
}
Aggregations