use of org.ovirt.engine.core.common.queries.OsQueryParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getNicTypeList.
public void getNicTypeList(final int osId, Version version, AsyncQuery<List<VmInterfaceType>> asyncQuery) {
asyncQuery.converterCallback = returnValue -> {
ArrayList<String> nics = (ArrayList<String>) returnValue;
List<VmInterfaceType> interfaceTypes = new ArrayList<>();
for (String nic : nics) {
try {
interfaceTypes.add(VmInterfaceType.valueOf(nic));
} catch (IllegalArgumentException e) {
// ignore if we can't find the enum value.
}
}
return interfaceTypes;
};
Frontend.getInstance().runQuery(QueryType.OsRepository, new OsQueryParameters(OsRepositoryVerb.GetNetworkDevices, osId, version), asyncQuery);
}
use of org.ovirt.engine.core.common.queries.OsQueryParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method getDiskInterfaceList.
public void getDiskInterfaceList(int osId, Version clusterVersion, AsyncQuery<List<DiskInterface>> asyncQuery) {
asyncQuery.converterCallback = returnValue -> {
ArrayList<String> interfaces = (ArrayList<String>) returnValue;
List<DiskInterface> interfaceTypes = new ArrayList<>();
for (String diskIfs : interfaces) {
try {
interfaceTypes.add(DiskInterface.valueOf(diskIfs));
} catch (IllegalArgumentException e) {
// ignore if we can't find the enum value.
}
}
return interfaceTypes;
};
Frontend.getInstance().runQuery(QueryType.OsRepository, new OsQueryParameters(OsRepositoryVerb.GetDiskInterfaces, osId, clusterVersion), asyncQuery);
}
use of org.ovirt.engine.core.common.queries.OsQueryParameters in project ovirt-engine by oVirt.
the class AsyncDataProvider method isFloppySupported.
public static void isFloppySupported(AsyncQuery<Boolean> aQuery, Integer osId, Version version) {
aQuery.converterCallback = new DefaultValueConverter<>(Boolean.FALSE);
OsQueryParameters params = new OsQueryParameters(OsRepositoryVerb.GetFloppySupport, osId, version);
Frontend.getInstance().runQuery(QueryType.OsRepository, params, aQuery);
}
Aggregations