Search in sources :

Example 11 with Version

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

the class BackendApiResource method addSystemVersion.

private Api addSystemVersion(Api api) {
    String productVersion = getConfigurationValueDefault(ConfigValues.ProductRPMVersion);
    if (productVersion != null) {
        BrandingManager obrand = BrandingManager.getInstance();
        ProductInfo productInfo = new ProductInfo();
        productInfo.setName(obrand.getMessage("obrand.backend.product"));
        productInfo.setVendor(obrand.getMessage("obrand.backend.vendor"));
        Version version = getVersion();
        version.setFullVersion(productVersion);
        productInfo.setVersion(version);
        api.setProductInfo(productInfo);
    }
    return api;
}
Also used : ProductInfo(org.ovirt.engine.api.model.ProductInfo) BrandingManager(org.ovirt.engine.core.branding.BrandingManager) Version(org.ovirt.engine.api.model.Version)

Example 12 with Version

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

the class V3VersionInAdapter method adapt.

@Override
public Version adapt(V3Version from) {
    Version to = new Version();
    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.isSetName()) {
        to.setName(from.getName());
    }
    to.setMajor(from.getMajor());
    to.setMinor(from.getMinor());
    to.setRevision(from.getRevision());
    to.setBuild(from.getBuild());
    to.setFullVersion(from.getFullVersion());
    return to;
}
Also used : V3Version(org.ovirt.engine.api.v3.types.V3Version) Version(org.ovirt.engine.api.model.Version)

Example 13 with Version

use of org.ovirt.engine.api.model.Version 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)

Example 14 with Version

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

the class VersionMapper method map.

public static Version map(org.ovirt.engine.core.compat.Version versionEngine) {
    Version versionApi = new Version();
    versionApi.setMajor(versionEngine.getMajor() >= 0 ? versionEngine.getMajor() : null);
    versionApi.setMinor(versionEngine.getMinor() >= 0 ? versionEngine.getMinor() : null);
    versionApi.setBuild(versionEngine.getBuild() >= 0 ? versionEngine.getBuild() : null);
    versionApi.setRevision(versionEngine.getRevision() >= 0 ? versionEngine.getRevision() : null);
    return versionApi;
}
Also used : Version(org.ovirt.engine.api.model.Version)

Example 15 with Version

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

the class V3ProductInfoOutAdapter method adapt.

@Override
public V3ProductInfo adapt(ProductInfo from) {
    V3ProductInfo to = new V3ProductInfo();
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetVendor()) {
        to.setVendor(from.getVendor());
    }
    Version fromVersion = from.getVersion();
    if (fromVersion != null) {
        V3Version toVersion = new V3Version();
        toVersion.setMajor(fromVersion.getMajor());
        toVersion.setMinor(fromVersion.getMinor());
        toVersion.setBuild(fromVersion.getBuild());
        toVersion.setRevision(fromVersion.getRevision());
        toVersion.setFullVersion(fromVersion.getFullVersion());
        to.setVersion(toVersion);
        to.setFullVersion(fromVersion.getFullVersion());
    }
    return to;
}
Also used : V3ProductInfo(org.ovirt.engine.api.v3.types.V3ProductInfo) V3Version(org.ovirt.engine.api.v3.types.V3Version) Version(org.ovirt.engine.api.model.Version) V3Version(org.ovirt.engine.api.v3.types.V3Version)

Aggregations

Version (org.ovirt.engine.api.model.Version)20 Test (org.junit.Test)5 Response (javax.ws.rs.core.Response)2 V3Version (org.ovirt.engine.api.v3.types.V3Version)2 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)2 BigDecimal (java.math.BigDecimal)1 Matcher (java.util.regex.Matcher)1 Certificate (org.ovirt.engine.api.model.Certificate)1 Cluster (org.ovirt.engine.api.model.Cluster)1 Cpu (org.ovirt.engine.api.model.Cpu)1 CpuTopology (org.ovirt.engine.api.model.CpuTopology)1 Display (org.ovirt.engine.api.model.Display)1 ExternalHostProvider (org.ovirt.engine.api.model.ExternalHostProvider)1 ExternalStatus (org.ovirt.engine.api.model.ExternalStatus)1 HardwareInformation (org.ovirt.engine.api.model.HardwareInformation)1 Host (org.ovirt.engine.api.model.Host)1 HostDevicePassthrough (org.ovirt.engine.api.model.HostDevicePassthrough)1 HostStatus (org.ovirt.engine.api.model.HostStatus)1 HostType (org.ovirt.engine.api.model.HostType)1 IscsiDetails (org.ovirt.engine.api.model.IscsiDetails)1