Search in sources :

Example 1 with Versions

use of org.ovirt.engine.api.model.Versions in project ovirt-engine by oVirt.

the class V3DataCenterInAdapter method adapt.

@Override
public DataCenter adapt(V3DataCenter from) {
    DataCenter to = new DataCenter();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetLocal()) {
        to.setLocal(from.isLocal());
    }
    if (from.isSetMacPool()) {
        to.setMacPool(adaptIn(from.getMacPool()));
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetQuotaMode()) {
        to.setQuotaMode(QuotaModeType.fromValue(from.getQuotaMode()));
    }
    if (from.isSetStatus() && from.getStatus().isSetState()) {
        to.setStatus(DataCenterStatus.fromValue(from.getStatus().getState()));
    }
    if (from.isSetStorageFormat()) {
        to.setStorageFormat(StorageFormat.fromValue(from.getStorageFormat()));
    }
    if (from.isSetSupportedVersions()) {
        to.setSupportedVersions(new Versions());
        to.getSupportedVersions().getVersions().addAll(adaptIn(from.getSupportedVersions().getVersions()));
    }
    if (from.isSetVersion()) {
        to.setVersion(adaptIn(from.getVersion()));
    }
    // attribute "local":
    if (from.isSetStorageType() && !to.isSetLocal()) {
        boolean local = "localfs".equalsIgnoreCase(from.getStorageType());
        to.setLocal(local);
    }
    return to;
}
Also used : DataCenter(org.ovirt.engine.api.model.DataCenter) V3DataCenter(org.ovirt.engine.api.v3.types.V3DataCenter) Versions(org.ovirt.engine.api.model.Versions)

Example 2 with Versions

use of org.ovirt.engine.api.model.Versions in project ovirt-engine by oVirt.

the class V3ClusterInAdapter method adapt.

@Override
public Cluster adapt(V3Cluster from) {
    Cluster to = new Cluster();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetBallooningEnabled()) {
        to.setBallooningEnabled(from.isBallooningEnabled());
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetCpu()) {
        to.setCpu(adaptIn(from.getCpu()));
    }
    if (from.isSetDataCenter()) {
        to.setDataCenter(adaptIn(from.getDataCenter()));
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetDisplay()) {
        to.setDisplay(adaptIn(from.getDisplay()));
    }
    if (from.isSetErrorHandling()) {
        to.setErrorHandling(adaptIn(from.getErrorHandling()));
    }
    if (from.isSetFencingPolicy()) {
        to.setFencingPolicy(adaptIn(from.getFencingPolicy()));
    }
    if (from.isSetGlusterService()) {
        to.setGlusterService(from.isGlusterService());
    }
    if (from.isSetHaReservation()) {
        to.setHaReservation(from.isHaReservation());
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetKsm()) {
        to.setKsm(adaptIn(from.getKsm()));
    }
    if (from.isSetMaintenanceReasonRequired()) {
        to.setMaintenanceReasonRequired(from.isMaintenanceReasonRequired());
    }
    if (from.isSetManagementNetwork()) {
        to.setManagementNetwork(adaptIn(from.getManagementNetwork()));
    }
    if (from.isSetMemoryPolicy()) {
        to.setMemoryPolicy(adaptIn(from.getMemoryPolicy()));
    }
    if (from.isSetMigration()) {
        to.setMigration(adaptIn(from.getMigration()));
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetOptionalReason()) {
        to.setOptionalReason(from.isOptionalReason());
    }
    if (from.isSetRequiredRngSources()) {
        to.setRequiredRngSources(new Cluster.RequiredRngSourcesList());
        to.getRequiredRngSources().getRequiredRngSources().addAll(adaptRngSources(from));
    }
    if (from.isSetSchedulingPolicy()) {
        to.setSchedulingPolicy(adaptIn(from.getSchedulingPolicy()));
    }
    if (from.isSetSerialNumber()) {
        to.setSerialNumber(adaptIn(from.getSerialNumber()));
    }
    if (from.isSetSupportedVersions()) {
        to.setSupportedVersions(new Versions());
        to.getSupportedVersions().getVersions().addAll(adaptIn(from.getSupportedVersions().getVersions()));
    }
    if (from.isSetThreadsAsCores()) {
        to.setThreadsAsCores(from.isThreadsAsCores());
    }
    if (from.isSetTrustedService()) {
        to.setTrustedService(from.isTrustedService());
    }
    if (from.isSetTunnelMigration()) {
        to.setTunnelMigration(from.isTunnelMigration());
    }
    if (from.isSetVersion()) {
        to.setVersion(adaptIn(from.getVersion()));
    }
    if (from.isSetVirtService()) {
        to.setVirtService(from.isVirtService());
    }
    return to;
}
Also used : Versions(org.ovirt.engine.api.model.Versions) V3Cluster(org.ovirt.engine.api.v3.types.V3Cluster) Cluster(org.ovirt.engine.api.model.Cluster)

Example 3 with Versions

use of org.ovirt.engine.api.model.Versions in project ovirt-engine by oVirt.

the class VersionMapper method map.

@Mapping(from = List.class, to = Versions.class)
public static Versions map(List<org.ovirt.engine.core.compat.Version> entity, Versions template) {
    Versions model = template != null ? template : new Versions();
    for (org.ovirt.engine.core.compat.Version version : entity) {
        Version v = new Version();
        v.setMajor(version.getMajor());
        v.setMinor(version.getMinor());
        model.getVersions().add(v);
    }
    return model;
}
Also used : Versions(org.ovirt.engine.api.model.Versions) Version(org.ovirt.engine.api.model.Version)

Aggregations

Versions (org.ovirt.engine.api.model.Versions)3 Cluster (org.ovirt.engine.api.model.Cluster)1 DataCenter (org.ovirt.engine.api.model.DataCenter)1 Version (org.ovirt.engine.api.model.Version)1 V3Cluster (org.ovirt.engine.api.v3.types.V3Cluster)1 V3DataCenter (org.ovirt.engine.api.v3.types.V3DataCenter)1