Search in sources :

Example 16 with GeoServiceClient

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();
    }
}
Also used : VdcNodeCheckParam(com.emc.storageos.geomodel.VdcNodeCheckParam) GeoServiceClient(com.emc.storageos.security.geo.GeoServiceClient)

Example 17 with GeoServiceClient

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)));
}
Also used : BlockVirtualPoolBulkRep(com.emc.storageos.model.vpool.BlockVirtualPoolBulkRep) GeoServiceClient(com.emc.storageos.security.geo.GeoServiceClient) VirtualPoolMapper.toBlockVirtualPool(com.emc.storageos.api.mapper.VirtualPoolMapper.toBlockVirtualPool) VirtualPool(com.emc.storageos.db.client.model.VirtualPool) APIException(com.emc.storageos.svcs.errorhandling.resources.APIException) DatabaseException(com.emc.storageos.db.exceptions.DatabaseException)

Aggregations

GeoServiceClient (com.emc.storageos.security.geo.GeoServiceClient)17 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)12 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)12 VirtualArray (com.emc.storageos.db.client.model.VirtualArray)8 VirtualPool (com.emc.storageos.db.client.model.VirtualPool)8 MapVirtualArray (com.emc.storageos.api.mapper.functions.MapVirtualArray)4 BulkList (com.emc.storageos.api.service.impl.response.BulkList)4 VirtualPoolMapper.toBlockVirtualPool (com.emc.storageos.api.mapper.VirtualPoolMapper.toBlockVirtualPool)2 VirtualPoolMapper.toFileVirtualPool (com.emc.storageos.api.mapper.VirtualPoolMapper.toFileVirtualPool)2 VirtualPoolMapper.toObjectVirtualPool (com.emc.storageos.api.mapper.VirtualPoolMapper.toObjectVirtualPool)2 MapFileVirtualPool (com.emc.storageos.api.mapper.functions.MapFileVirtualPool)2 MapObjectVirtualPool (com.emc.storageos.api.mapper.functions.MapObjectVirtualPool)2 TenantOrg (com.emc.storageos.db.client.model.TenantOrg)2 VdcNodeCheckParam (com.emc.storageos.geomodel.VdcNodeCheckParam)2 VirtualArrayBulkRep (com.emc.storageos.model.varray.VirtualArrayBulkRep)2 BlockVirtualPoolBulkRep (com.emc.storageos.model.vpool.BlockVirtualPoolBulkRep)2 FileVirtualPoolBulkRep (com.emc.storageos.model.vpool.FileVirtualPoolBulkRep)2 ObjectVirtualPoolBulkRep (com.emc.storageos.model.vpool.ObjectVirtualPoolBulkRep)2 StorageOSUser (com.emc.storageos.security.authentication.StorageOSUser)2 URI (java.net.URI)2