use of org.ovirt.engine.core.common.queries.ServerParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getHostFingerprint.
public void getHostFingerprint(AsyncQuery<String> aQuery, String hostAddress, Integer hostPort) {
aQuery.converterCallback = new StringConverter();
Frontend.getInstance().runQuery(QueryType.GetServerSSHKeyFingerprint, new ServerParameters(hostAddress, hostPort), aQuery);
}
use of org.ovirt.engine.core.common.queries.ServerParameters in project ovirt-engine by oVirt.
the class GlusterUtil method getFingerprints.
protected Map<String, String> getFingerprints(Set<String> servers) {
QueryReturnValue returnValue;
Map<String, String> fingerprints = new HashMap<>();
for (String server : servers) {
returnValue = backend.runInternalQuery(QueryType.GetServerSSHKeyFingerprint, new ServerParameters(server), null);
if (returnValue != null && returnValue.getSucceeded() && returnValue.getReturnValue() != null) {
fingerprints.put(server, returnValue.getReturnValue().toString());
} else {
fingerprints.put(server, null);
}
}
return fingerprints;
}
use of org.ovirt.engine.core.common.queries.ServerParameters in project ovirt-engine by oVirt.
the class GetAddedGlusterServersQuery method getAddedGlusterServers.
private Map<String, String> getAddedGlusterServers(List<GlusterServerInfo> glusterServers) {
Map<String, String> serversAndFingerprint = new HashMap<>();
for (GlusterServerInfo server : glusterServers) {
if (server.getStatus() == PeerStatus.CONNECTED && !serverExists(server)) {
String fingerprint = null;
QueryReturnValue returnValue;
if (getParameters().isServerKeyFingerprintRequired()) {
returnValue = runInternalQuery(QueryType.GetServerSSHKeyFingerprint, new ServerParameters(server.getHostnameOrIp()));
if (returnValue != null && returnValue.getSucceeded() && returnValue.getReturnValue() != null) {
fingerprint = returnValue.getReturnValue().toString();
}
}
serversAndFingerprint.put(server.getHostnameOrIp(), fingerprint == null ? "" : fingerprint);
}
}
return serversAndFingerprint;
}
Aggregations