use of com.emc.storageos.hds.model.StorageArray in project coprhd-controller by CoprHD.
the class HDSStorageDevice method validateStorageProviderConnection.
@Override
public boolean validateStorageProviderConnection(String ipAddress, Integer portNumber) {
boolean isConnectionValid = false;
try {
StringBuffer providerID = new StringBuffer(ipAddress).append(HDSConstants.HYPHEN_OPERATOR).append(portNumber);
URIQueryResultList providerUriList = new URIQueryResultList();
dbClient.queryByConstraint(AlternateIdConstraint.Factory.getStorageProviderByProviderIDConstraint(providerID.toString()), providerUriList);
if (providerUriList.iterator().hasNext()) {
StorageProvider provider = dbClient.queryObject(StorageProvider.class, providerUriList.iterator().next());
HDSApiClient hdsApiClient = hdsApiFactory.getClient(HDSUtils.getHDSServerManagementServerInfo(provider), provider.getUserName(), provider.getPassword());
List<StorageArray> storageArrayList = hdsApiClient.getStorageSystemsInfo();
if (null != storageArrayList && !storageArrayList.isEmpty()) {
isConnectionValid = true;
}
}
} catch (Exception ex) {
log.error("Problem in checking provider live connection for ipaddress: {} due to", ipAddress, ex);
}
return isConnectionValid;
}
Aggregations