use of org.ovirt.engine.api.model.Domain in project ovirt-engine by oVirt.
the class BackendVmSessionsResource method addLinksIncludingUser.
/**
* Special handling of adding links to the user and domain of the session.
*/
private void addLinksIncludingUser(Session session) {
String domainName = session.getUser().getDomain().getName();
addLinks(session, org.ovirt.engine.api.model.Vm.class);
session.getUser().setDomain(new Domain());
session.getUser().getDomain().setName(domainName);
setSessionUser(session);
}
use of org.ovirt.engine.api.model.Domain in project ovirt-engine by oVirt.
the class GroupMapper method map.
@Mapping(from = Group.class, to = DbGroup.class)
public static DbGroup map(Group model, DbGroup template) {
DbGroup entity = template != null ? template : new DbGroup();
if (model.isSetName()) {
entity.setName(model.getName());
}
if (model.isSetId()) {
String id = model.getId();
entity.setId(GuidUtils.asGuid(id));
}
if (model.isSetDomain()) {
Domain domain = model.getDomain();
if (domain.isSetName()) {
entity.setDomain(domain.getName());
}
}
if (model.isSetDomainEntryId()) {
entity.setExternalId(DirectoryEntryIdUtils.decode(model.getDomainEntryId()));
}
if (model.isSetNamespace()) {
entity.setNamespace(model.getNamespace());
}
return entity;
}
use of org.ovirt.engine.api.model.Domain in project ovirt-engine by oVirt.
the class GroupMapper method map.
@Mapping(from = DirectoryGroup.class, to = Group.class)
public static Group map(DirectoryGroup entity, Group template) {
Group model = template != null ? template : new Group();
model.setName(entity.getName());
if (!StringUtils.isEmpty(entity.getDirectoryName())) {
Domain dom = new Domain();
dom.setName(entity.getDirectoryName());
dom.setId(DirectoryEntryIdUtils.encode(dom.getName()));
model.setDomain(dom);
}
model.setId(DirectoryEntryIdUtils.encode(entity.getId()));
model.setNamespace(entity.getNamespace());
return model;
}
use of org.ovirt.engine.api.model.Domain in project ovirt-engine by oVirt.
the class GroupMapper method map.
@Mapping(from = AuthzGroup.class, to = Group.class)
public static Group map(AuthzGroup authzGroup, Group template) {
Group model = template != null ? template : new Group();
model.setId(DirectoryEntryIdUtils.encode(authzGroup.getId()));
model.setName(authzGroup.getName());
model.setNamespace(authzGroup.getNamespace());
if (!StringUtils.isEmpty(authzGroup.getAuthz())) {
Domain dom = new Domain();
dom.setName(authzGroup.getAuthz());
dom.setId(DirectoryEntryIdUtils.encode(dom.getName()));
model.setDomain(dom);
}
return model;
}
use of org.ovirt.engine.api.model.Domain in project ovirt-engine by oVirt.
the class DirectoryMapper method map.
@Mapping(from = Directory.class, to = Domain.class)
public static Domain map(Directory dir, Domain template) {
Domain directory = template != null ? template : new Domain();
directory.setName(dir.getDomain());
directory.setId(dir.getId());
return directory;
}
Aggregations