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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations