Search in sources :

Example 1 with ServerParameters

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);
}
Also used : ServerParameters(org.ovirt.engine.core.common.queries.ServerParameters)

Example 2 with ServerParameters

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;
}
Also used : ServerParameters(org.ovirt.engine.core.common.queries.ServerParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) HashMap(java.util.HashMap)

Example 3 with ServerParameters

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;
}
Also used : ServerParameters(org.ovirt.engine.core.common.queries.ServerParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) HashMap(java.util.HashMap) GlusterServerInfo(org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo)

Aggregations

ServerParameters (org.ovirt.engine.core.common.queries.ServerParameters)3 HashMap (java.util.HashMap)2 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)2 GlusterServerInfo (org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo)1