use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class VNXFileSystemMoverInfoProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
final PostMethod result = (PostMethod) resultObj;
try {
ResponsePacket responsePacket = (ResponsePacket) _unmarshaller.unmarshal(result.getResponseBodyAsStream());
// 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("Received celerra session info from the Server.");
}
if (null != responsePacket.getPacketFault()) {
Status status = responsePacket.getPacketFault();
processErrorStatus(status, keyMap);
} else {
List<Object> filesystemList = getQueryResponse(responsePacket);
processFilesystemList(filesystemList, keyMap);
}
} catch (final Exception ex) {
_logger.error("Exception occurred while processing the vnx fileShare response due to {}", ex.getMessage());
} finally {
result.releaseConnection();
}
}
use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class VNXFileSystemStaticLoadProcessor method processResult.
/**
* Process the result got from data sources.
*/
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
// TODO Auto-generated method stub
_logger.info("Processing VNX Mount Query response: {}", resultObj);
final PostMethod result = (PostMethod) resultObj;
try {
ResponsePacket responsePacket = (ResponsePacket) _unmarshaller.unmarshal(result.getResponseBodyAsStream());
// 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("Received celerra session info from the Server.");
}
if (null != responsePacket.getPacketFault()) {
Status status = responsePacket.getPacketFault();
processErrorStatus(status, keyMap);
} else {
List<Object> mountList = getQueryResponse(responsePacket);
// process the mount list
processMountList(mountList, keyMap);
keyMap.put(VNXFileConstants.CMD_RESULT, VNXFileConstants.CMD_SUCCESS);
}
} catch (final Exception ex) {
_logger.error("Exception occurred while processing the vnx fileShare response due to {}", ex.getMessage());
keyMap.put(VNXFileConstants.FAULT_DESC, ex.getMessage());
keyMap.put(VNXFileConstants.CMD_RESULT, VNXFileConstants.CMD_FAILURE);
} finally {
result.releaseConnection();
}
return;
}
use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class VNXFileSystemUnexportProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
_logger.info("Processing VNX File System Unexport response: {}", resultObj);
final PostMethod result = (PostMethod) resultObj;
try {
ResponsePacket responsePacket = (ResponsePacket) _unmarshaller.unmarshal(result.getResponseBodyAsStream());
Status status = null;
if (null != responsePacket.getPacketFault()) {
status = responsePacket.getPacketFault();
processErrorStatus(status, keyMap);
} else {
List<Object> queryResponse = getTaskResponse(responsePacket);
Iterator<Object> queryRespItr = queryResponse.iterator();
while (queryRespItr.hasNext()) {
Object responseObj = queryRespItr.next();
if (responseObj instanceof TaskResponse) {
TaskResponse taskResp = (TaskResponse) responseObj;
status = taskResp.getStatus();
_logger.info("FileSystem Unexport task response status: {}", status.getMaxSeverity().name());
if (status.getMaxSeverity() == Severity.OK) {
keyMap.put(VNXFileConstants.CMD_RESULT, VNXFileConstants.CMD_SUCCESS);
} else {
processErrorStatus(status, keyMap);
}
break;
} else {
_logger.info("Response not TaskResponse: {}", responseObj.getClass().getName());
}
}
// 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("Received celerra session information from the Server.");
}
}
} catch (final Exception ex) {
_logger.error("Exception occurred while processing the vnx create file sys response due to ", ex);
keyMap.put(VNXFileConstants.FAULT_DESC, ex.getMessage());
keyMap.put(VNXFileConstants.CMD_RESULT, VNXFileConstants.CMD_FAILURE);
} finally {
result.releaseConnection();
}
}
use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class VNXFileSystemUnmountProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
_logger.info("Processing VNX File System Unmount response: {}", resultObj);
final PostMethod result = (PostMethod) resultObj;
try {
ResponsePacket responsePacket = (ResponsePacket) _unmarshaller.unmarshal(result.getResponseBodyAsStream());
Status status = null;
if (null != responsePacket.getPacketFault()) {
status = responsePacket.getPacketFault();
processErrorStatus(status, keyMap);
} else {
List<Object> queryResponse = getTaskResponse(responsePacket);
Iterator<Object> queryRespItr = queryResponse.iterator();
while (queryRespItr.hasNext()) {
Object responseObj = queryRespItr.next();
if (responseObj instanceof TaskResponse) {
TaskResponse system = (TaskResponse) responseObj;
status = system.getStatus();
_logger.info("Unmount task response status: {}", status.getMaxSeverity().name());
if (status.getMaxSeverity() == Severity.OK) {
keyMap.put(VNXFileConstants.CMD_RESULT, VNXFileConstants.CMD_SUCCESS);
} else {
processErrorStatus(status, keyMap);
}
break;
} else {
_logger.info("Response not TaskResponse: {}", responseObj.getClass().getName());
}
}
// 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 prov response due to ", ex);
keyMap.put(VNXFileConstants.FAULT_DESC, ex.getMessage());
keyMap.put(VNXFileConstants.CMD_RESULT, VNXFileConstants.CMD_FAILURE);
} finally {
result.releaseConnection();
}
}
use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.
the class VNXFileSystemsProcessor method processResult.
@Override
public void processResult(Operation operation, Object resultObj, Map<String, Object> keyMap) throws BaseCollectionException {
final PostMethod result = (PostMethod) resultObj;
try {
ResponsePacket responsePacket = (ResponsePacket) _unmarshaller.unmarshal(result.getResponseBodyAsStream());
// 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("Received celerra session info from the Server.");
}
Status status = null;
if (null != responsePacket.getPacketFault()) {
status = responsePacket.getPacketFault();
processErrorStatus(status, keyMap);
} else {
List<Object> filesystemList = getQueryResponse(responsePacket);
List<VNXFileSystem> processedFileSystems = processFilesystemList(filesystemList, keyMap);
keyMap.put(VNXFileConstants.FILESYSTEMS, processedFileSystems);
keyMap.put(VNXFileConstants.CMD_RESULT, VNXFileConstants.CMD_SUCCESS);
}
} catch (final Exception ex) {
_logger.error("Exception occurred while processing the vnx fileShare response due to {}", ex.getMessage());
keyMap.put(com.emc.storageos.plugins.metering.vnxfile.VNXFileConstants.FAULT_DESC, ex.getMessage());
keyMap.put(com.emc.storageos.plugins.metering.vnxfile.VNXFileConstants.CMD_RESULT, com.emc.storageos.plugins.metering.vnxfile.VNXFileConstants.CMD_FAILURE);
} finally {
result.releaseConnection();
}
}
Aggregations