Search in sources :

Example 1 with Users

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

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

the class BackendDomainUsersResource method mapUsers.

private Users mapUsers(List<DirectoryUser> entities) {
    Users collection = new Users();
    for (DirectoryUser entity : entities) {
        User user = map(entity);
        user = populate(user, entity);
        user = addLinks(user, true);
        collection.getUsers().add(user);
    }
    return collection;
}
Also used : DirectoryUser(org.ovirt.engine.core.aaa.DirectoryUser) DirectoryUser(org.ovirt.engine.core.aaa.DirectoryUser) User(org.ovirt.engine.api.model.User) Users(org.ovirt.engine.api.model.Users)

Example 3 with Users

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

the class V3QuotaInAdapter method adapt.

@Override
public Quota adapt(V3Quota from) {
    Quota to = new Quota();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(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(adaptIn(from.getDataCenter()));
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetDisks()) {
        to.setDisks(new Disks());
        to.getDisks().getDisks().addAll(adaptIn(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 Users());
        to.getUsers().getUsers().addAll(adaptIn(from.getUsers().getUsers()));
    }
    if (from.isSetVms()) {
        to.setVms(new Vms());
        to.getVms().getVms().addAll(adaptIn(from.getVms().getVMs()));
    }
    return to;
}
Also used : V3Quota(org.ovirt.engine.api.v3.types.V3Quota) Quota(org.ovirt.engine.api.model.Quota) Disks(org.ovirt.engine.api.model.Disks) Users(org.ovirt.engine.api.model.Users) Vms(org.ovirt.engine.api.model.Vms)

Example 4 with Users

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

the class V3CloudInitInAdapter method adapt.

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

Example 5 with Users

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

the class BackendUsersResource method mapDbUserCollection.

protected Users mapDbUserCollection(List<DbUser> entities) {
    Users collection = new Users();
    for (DbUser entity : entities) {
        User user = map(entity);
        user = populate(user, entity);
        user = addLinks(user, BaseResource.class);
        collection.getUsers().add(user);
    }
    return collection;
}
Also used : User(org.ovirt.engine.api.model.User) DbUser(org.ovirt.engine.core.common.businessentities.aaa.DbUser) DirectoryUser(org.ovirt.engine.core.aaa.DirectoryUser) BaseResource(org.ovirt.engine.api.model.BaseResource) Users(org.ovirt.engine.api.model.Users) DbUser(org.ovirt.engine.core.common.businessentities.aaa.DbUser)

Aggregations

Users (org.ovirt.engine.api.model.Users)5 User (org.ovirt.engine.api.model.User)2 DirectoryUser (org.ovirt.engine.core.aaa.DirectoryUser)2 AuthorizedKeys (org.ovirt.engine.api.model.AuthorizedKeys)1 BaseResource (org.ovirt.engine.api.model.BaseResource)1 CloudInit (org.ovirt.engine.api.model.CloudInit)1 Disks (org.ovirt.engine.api.model.Disks)1 Files (org.ovirt.engine.api.model.Files)1 Quota (org.ovirt.engine.api.model.Quota)1 Vms (org.ovirt.engine.api.model.Vms)1 V3CloudInit (org.ovirt.engine.api.v3.types.V3CloudInit)1 V3Quota (org.ovirt.engine.api.v3.types.V3Quota)1 V3Users (org.ovirt.engine.api.v3.types.V3Users)1 DbUser (org.ovirt.engine.core.common.businessentities.aaa.DbUser)1