use of com.emc.nas.vnxfile.xmlapi.Status.Problem in project coprhd-controller by CoprHD.
the class VNXFileProcessor method processErrorStatus.
/**
* Retrieve the description and diagnostics information from the error status.
*
* @param status status of the response returned by the XML API Server
* @param keyMap map used to returned values to upper layers.
*/
protected void processErrorStatus(Status status, Map<String, Object> keyMap) {
List<Problem> problems = status.getProblem();
// Only retrieve the first problem.
if (null != problems && !problems.isEmpty()) {
Problem problem = problems.get(0);
String desc = problem.getDescription();
String message = problem.getMessage();
String diags = problem.getDiagnostics();
keyMap.put(VNXFileConstants.CMD_RESULT, VNXFileConstants.CMD_FAILURE);
// These fields are optional in the response packet.
if (null != desc) {
keyMap.put(VNXFileConstants.FAULT_DESC, desc);
}
if (null != diags) {
keyMap.put(VNXFileConstants.FAULT_DIAG, diags);
}
if (null != message) {
keyMap.put(VNXFileConstants.FAULT_MSG, message);
}
if ((desc != null) && (!desc.isEmpty())) {
_logger.error("Fault response received due to {} possible cause {}", desc, diags);
} else {
_logger.error("Fault response received due to {} possible cause {}", message, diags);
}
}
}
use of com.emc.nas.vnxfile.xmlapi.Status.Problem in project coprhd-controller by CoprHD.
the class VNXFileProcessor method getTaskResponse.
protected List<Object> getTaskResponse(ResponsePacket responsePacket) {
List<Object> responseList = responsePacket.getResponseOrResponseEx();
Iterator<Object> responseListItr = responseList.iterator();
List<Object> taskResponse = new ArrayList<Object>();
while (responseListItr.hasNext()) {
Response response = (Response) responseListItr.next();
if (null != response.getFault()) {
Status status = response.getFault();
List<Problem> problems = status.getProblem();
Iterator<Problem> problemsItr = problems.iterator();
while (problemsItr.hasNext()) {
Problem prob = problemsItr.next();
_logger.error("Respone fault: {} cause: {}", prob.getDescription(), prob.getDiagnostics());
}
}
taskResponse.add(response.getTaskResponse());
}
return taskResponse;
}
use of com.emc.nas.vnxfile.xmlapi.Status.Problem in project coprhd-controller by CoprHD.
the class VNXFileSystemUsageProcessor method processResult.
@SuppressWarnings("unchecked")
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
_logger.info("processing fileshare usage response" + resultObj);
final PostMethod result = (PostMethod) resultObj;
try {
DbClient dbClient = (DbClient) keyMap.get(Constants.dbClient);
ResponsePacket responsePacket = (ResponsePacket) _unmarshaller.unmarshal(result.getResponseBodyAsStream());
if (null != responsePacket.getPacketFault()) {
Status status = responsePacket.getPacketFault();
List<Problem> problems = status.getProblem();
Iterator<Problem> problemsItr = problems.iterator();
while (problemsItr.hasNext()) {
Problem problem = problemsItr.next();
_logger.error("Fault response received due to {} possible cause {}", problem.getDescription(), problem.getDiagnostics());
}
} else {
List<Object> fsUsageInfo = getQueryStatsResponse(responsePacket);
final List<Stat> statList = (List<Stat>) keyMap.get(Constants._Stats);
processFileShareInfo(fsUsageInfo, keyMap, statList, dbClient);
_zeroRecordGenerator.identifyRecordstobeZeroed(keyMap, statList, FileShare.class);
}
} catch (final IOException ioEx) {
_logger.error("IOException occurred while processing the Fileshare capacity response due to {}", ioEx.getMessage());
throw new VNXFilePluginException("IOException occurred while processing the Fileshare capacity response.", ioEx.getCause());
} catch (final Exception ex) {
_logger.error("Exception occurred while processing the Fileshare capacity response due to {}", ex.getMessage());
throw new VNXFilePluginException("Exception occurred while processing the Fileshare capacity response.", ex.getCause());
} finally {
result.releaseConnection();
}
}
Aggregations