use of com.emc.storageos.vasa.data.internal.CoS.CoSElement in project coprhd-controller by CoprHD.
the class SyncManager method fetchFileCosIdList.
/**
* Returns list of file Cos Ids
*
* @return list of file CoS ids
* @throws SOSFailure
*/
private List<String> fetchFileCosIdList() throws SOSFailure {
final String methodName = "fetchFileCosIdList(): ";
log.trace(methodName + "Entry");
final String FILE_COS_URI = "/file/vpools";
List<String> fileCosIdList = new ArrayList<String>();
try {
CoSList cosElemList = _client.queryObject(FILE_COS_URI, CoSList.class);
if (cosElemList != null && cosElemList.getCosElements() != null) {
for (CoSElement elem : cosElemList.getCosElements()) {
if (elem != null) {
fileCosIdList.add(elem.getId());
}
}
}
log.trace(methodName + "File CoS Ids: " + fileCosIdList);
if (cosElemList != null && fileCosIdList != null) {
log.trace(methodName + "Exit returning cos list of size[" + fileCosIdList.size() + "]");
return fileCosIdList;
}
log.trace(methodName + "Exit returning cos list of size[0]");
return new ArrayList<String>();
} catch (NoSuchAlgorithmException e) {
log.error(methodName + "NoSuchAlgorithmException occured", e);
throw new SOSFailure(e);
} catch (UniformInterfaceException e) {
log.error(methodName + "UniformInterfaceException occured", e);
throw new SOSFailure(e);
}
}
use of com.emc.storageos.vasa.data.internal.CoS.CoSElement in project coprhd-controller by CoprHD.
the class SyncManager method fetchBlockCosIdList.
/**
* Returns list of file Cos Ids
*
* @return list of file Cos Ids
* @throws SOSFailure
*/
private List<String> fetchBlockCosIdList() throws SOSFailure {
final String methodName = "fetchBlockCosIdList(): ";
log.trace(methodName + "Entry");
final String BLOCK_COS_URI = "/block/vpools";
List<String> blockCosIdList = new ArrayList<String>();
try {
CoSList cosElemList = _client.queryObject(BLOCK_COS_URI, CoSList.class);
if (cosElemList != null && cosElemList.getCosElements() != null) {
for (CoSElement elem : cosElemList.getCosElements()) {
if (elem != null) {
blockCosIdList.add(elem.getId());
}
}
}
log.trace(methodName + "Block CoS Ids: " + blockCosIdList);
if (cosElemList != null && blockCosIdList != null) {
log.trace(methodName + "Exit returning cos list of size[" + blockCosIdList.size() + "]");
return blockCosIdList;
}
log.trace(methodName + "Exit returning cos list of size[0]");
return new ArrayList<String>();
} catch (NoSuchAlgorithmException e) {
log.error(methodName + "NoSuchAlgorithmException occured", e);
throw new SOSFailure(e);
} catch (UniformInterfaceException e) {
log.error(methodName + "UniformInterfaceException occured", e);
throw new SOSFailure(e);
}
}
Aggregations