use of com.emc.storageos.security.geo.GeoServiceClient in project coprhd-controller by CoprHD.
the class VdcConfigHelper method sendVdcNodeCheckRequest.
/**
* @param sendToVdc
* @param virtualDataCenters
* @return
*/
private VdcNodeCheckResponse sendVdcNodeCheckRequest(VirtualDataCenter sendToVdc, List<VdcConfig> virtualDataCenters) {
log.info("sending {} vdcs to {} to be checked", virtualDataCenters.size(), sendToVdc.getShortId());
VdcNodeCheckParam param = new VdcNodeCheckParam();
param.setVirtualDataCenters(virtualDataCenters);
try {
GeoServiceClient client = resetGeoClientCacheTimeout(sendToVdc.getShortId(), null, NODE_CHECK_TIMEOUT);
return client.vdcNodeCheck(param);
} finally {
// clear the client cache to reset timeouts that were altered above
geoClientCache.clearCache();
}
}
use of com.emc.storageos.security.geo.GeoServiceClient in project coprhd-controller by CoprHD.
the class BlockVirtualPoolService method queryBulkResourceReps.
@Override
public BlockVirtualPoolBulkRep queryBulkResourceReps(List<URI> ids) {
if (!ids.iterator().hasNext()) {
return new BlockVirtualPoolBulkRep();
}
// get vdc id from the first id; assume all id's are from the same vdc
String shortVdcId = VdcUtil.getVdcId(getResourceClass(), ids.iterator().next()).toString();
Iterator<VirtualPool> dbIterator;
if (shortVdcId.equals(VdcUtil.getLocalShortVdcId())) {
dbIterator = _dbClient.queryIterativeObjects(getResourceClass(), ids);
} else {
GeoServiceClient geoClient = _geoHelper.getClient(shortVdcId);
try {
dbIterator = geoClient.queryObjects(getResourceClass(), ids);
} catch (Exception ex) {
// TODO: revisit this exception
_log.error("error retrieving bulk virtual pools from vdc " + shortVdcId, ex);
throw APIException.internalServerErrors.genericApisvcError("error retrieving remote virtual pool", ex);
}
}
return new BlockVirtualPoolBulkRep(BulkList.wrapping(dbIterator, BLOCK_VPOOL_MAPPER, new BulkList.VirtualPoolFilter(Type.block)));
}
Aggregations