Search in sources :

Example 1 with V3Users

use of org.ovirt.engine.api.v3.types.V3Users in project ovirt-engine by oVirt.

the class V3UsersInAdapter method adapt.

@Override
public Users adapt(V3Users from) {
    Users to = new Users();
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetActive()) {
        to.setActive(from.getActive());
    }
    if (from.isSetSize()) {
        to.setSize(from.getSize());
    }
    if (from.isSetTotal()) {
        to.setTotal(from.getTotal());
    }
    to.getUsers().addAll(adaptIn(from.getUsers()));
    return to;
}
Also used : Users(org.ovirt.engine.api.model.Users) V3Users(org.ovirt.engine.api.v3.types.V3Users)

Example 2 with V3Users

use of org.ovirt.engine.api.v3.types.V3Users in project ovirt-engine by oVirt.

the class V3UsersOutAdapter method adapt.

@Override
public V3Users adapt(Users from) {
    V3Users to = new V3Users();
    if (from.isSetActions()) {
        to.setActions(adaptOut(from.getActions()));
    }
    if (from.isSetActive()) {
        to.setActive(from.getActive());
    }
    if (from.isSetSize()) {
        to.setSize(from.getSize());
    }
    if (from.isSetTotal()) {
        to.setTotal(from.getTotal());
    }
    to.getUsers().addAll(adaptOut(from.getUsers()));
    return to;
}
Also used : V3Users(org.ovirt.engine.api.v3.types.V3Users)

Example 3 with V3Users

use of org.ovirt.engine.api.v3.types.V3Users in project ovirt-engine by oVirt.

the class V3CloudInitOutAdapter method adapt.

@Override
public V3CloudInit adapt(CloudInit from) {
    V3CloudInit to = new V3CloudInit();
    if (from.isSetAuthorizedKeys()) {
        to.setAuthorizedKeys(new V3AuthorizedKeys());
        to.getAuthorizedKeys().getAuthorizedKeys().addAll(adaptOut(from.getAuthorizedKeys().getAuthorizedKeys()));
    }
    if (from.isSetFiles()) {
        to.setFiles(new V3Files());
        to.getFiles().getFiles().addAll(adaptOut(from.getFiles().getFiles()));
    }
    if (from.isSetHost()) {
        to.setHost(adaptOut(from.getHost()));
    }
    if (from.isSetNetworkConfiguration()) {
        to.setNetworkConfiguration(adaptOut(from.getNetworkConfiguration()));
    }
    if (from.isSetRegenerateSshKeys()) {
        to.setRegenerateSshKeys(from.isRegenerateSshKeys());
    }
    if (from.isSetTimezone()) {
        to.setTimezone(from.getTimezone());
    }
    if (from.isSetUsers()) {
        to.setUsers(new V3Users());
        to.getUsers().getUsers().addAll(adaptOut(from.getUsers().getUsers()));
    }
    return to;
}
Also used : V3Files(org.ovirt.engine.api.v3.types.V3Files) V3CloudInit(org.ovirt.engine.api.v3.types.V3CloudInit) V3Users(org.ovirt.engine.api.v3.types.V3Users) V3AuthorizedKeys(org.ovirt.engine.api.v3.types.V3AuthorizedKeys)

Example 4 with V3Users

use of org.ovirt.engine.api.v3.types.V3Users in project ovirt-engine by oVirt.

the class V3ApiSummaryOutAdapter method adapt.

@Override
public V3ApiSummary adapt(ApiSummary from) {
    V3ApiSummary to = new V3ApiSummary();
    if (from.isSetHosts()) {
        ApiSummaryItem fromHosts = from.getHosts();
        V3Hosts toHosts = new V3Hosts();
        if (fromHosts.isSetTotal()) {
            toHosts.setTotal(fromHosts.getTotal().longValue());
        }
        if (fromHosts.isSetActive()) {
            toHosts.setActive(fromHosts.getActive().longValue());
        }
        to.setHosts(toHosts);
    }
    if (from.isSetStorageDomains()) {
        ApiSummaryItem fromSds = from.getStorageDomains();
        V3StorageDomains toSds = new V3StorageDomains();
        if (fromSds.isSetTotal()) {
            toSds.setTotal(fromSds.getTotal().longValue());
        }
        if (fromSds.isSetActive()) {
            toSds.setActive(fromSds.getActive().longValue());
        }
        to.setStorageDomains(toSds);
    }
    if (from.isSetUsers()) {
        ApiSummaryItem fromUsers = from.getUsers();
        V3Users toUsers = new V3Users();
        if (fromUsers.isSetTotal()) {
            toUsers.setTotal(fromUsers.getTotal().longValue());
        }
        if (fromUsers.isSetActive()) {
            toUsers.setActive(fromUsers.getActive().longValue());
        }
        to.setUsers(toUsers);
    }
    if (from.isSetVms()) {
        ApiSummaryItem fromVms = from.getVms();
        V3VMs toVms = new V3VMs();
        if (fromVms.isSetTotal()) {
            toVms.setTotal(fromVms.getTotal().longValue());
        }
        if (fromVms.isSetActive()) {
            toVms.setActive(fromVms.getActive().longValue());
        }
        to.setVMs(toVms);
    }
    return to;
}
Also used : ApiSummaryItem(org.ovirt.engine.api.model.ApiSummaryItem) V3ApiSummary(org.ovirt.engine.api.v3.types.V3ApiSummary) V3Hosts(org.ovirt.engine.api.v3.types.V3Hosts) V3Users(org.ovirt.engine.api.v3.types.V3Users) V3VMs(org.ovirt.engine.api.v3.types.V3VMs) V3StorageDomains(org.ovirt.engine.api.v3.types.V3StorageDomains)

Example 5 with V3Users

use of org.ovirt.engine.api.v3.types.V3Users in project ovirt-engine by oVirt.

the class V3QuotaOutAdapter method adapt.

@Override
public V3Quota adapt(Quota from) {
    V3Quota to = new V3Quota();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptOut(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptOut(from.getActions()));
    }
    if (from.isSetClusterHardLimitPct()) {
        to.setClusterHardLimitPct(from.getClusterHardLimitPct());
    }
    if (from.isSetClusterSoftLimitPct()) {
        to.setClusterSoftLimitPct(from.getClusterSoftLimitPct());
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetDataCenter()) {
        to.setDataCenter(adaptOut(from.getDataCenter()));
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetDisks()) {
        to.setDisks(new V3Disks());
        to.getDisks().getDisks().addAll(adaptOut(from.getDisks().getDisks()));
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetStorageHardLimitPct()) {
        to.setStorageHardLimitPct(from.getStorageHardLimitPct());
    }
    if (from.isSetStorageSoftLimitPct()) {
        to.setStorageSoftLimitPct(from.getStorageSoftLimitPct());
    }
    if (from.isSetUsers()) {
        to.setUsers(new V3Users());
        to.getUsers().getUsers().addAll(adaptOut(from.getUsers().getUsers()));
    }
    if (from.isSetVms()) {
        to.setVms(new V3VMs());
        to.getVms().getVMs().addAll(adaptOut(from.getVms().getVms()));
    }
    return to;
}
Also used : V3Quota(org.ovirt.engine.api.v3.types.V3Quota) V3Disks(org.ovirt.engine.api.v3.types.V3Disks) V3Users(org.ovirt.engine.api.v3.types.V3Users) V3VMs(org.ovirt.engine.api.v3.types.V3VMs)

Aggregations

V3Users (org.ovirt.engine.api.v3.types.V3Users)5 V3VMs (org.ovirt.engine.api.v3.types.V3VMs)2 ApiSummaryItem (org.ovirt.engine.api.model.ApiSummaryItem)1 Users (org.ovirt.engine.api.model.Users)1 V3ApiSummary (org.ovirt.engine.api.v3.types.V3ApiSummary)1 V3AuthorizedKeys (org.ovirt.engine.api.v3.types.V3AuthorizedKeys)1 V3CloudInit (org.ovirt.engine.api.v3.types.V3CloudInit)1 V3Disks (org.ovirt.engine.api.v3.types.V3Disks)1 V3Files (org.ovirt.engine.api.v3.types.V3Files)1 V3Hosts (org.ovirt.engine.api.v3.types.V3Hosts)1 V3Quota (org.ovirt.engine.api.v3.types.V3Quota)1 V3StorageDomains (org.ovirt.engine.api.v3.types.V3StorageDomains)1