Search in sources :

Example 31 with User

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

the class JobMapper method map.

@Mapping(from = org.ovirt.engine.core.common.job.Job.class, to = Job.class)
public static Job map(org.ovirt.engine.core.common.job.Job entity, Job job) {
    Job model = job != null ? job : new Job();
    model.setId(entity.getId().toString());
    model.setDescription(entity.getDescription());
    model.setStatus(mapJobStatus(entity.getStatus()));
    if (entity.getOwnerId() != null) {
        User user = new User();
        user.setId(entity.getOwnerId().toString());
        model.setOwner(user);
    }
    model.setStartTime(DateMapper.map(entity.getStartTime(), null));
    if (entity.getEndTime() != null) {
        model.setEndTime(DateMapper.map(entity.getEndTime(), null));
    }
    if (entity.getLastUpdateTime() != null) {
        model.setLastUpdated(DateMapper.map(entity.getLastUpdateTime(), null));
    }
    model.setExternal(entity.isExternal());
    model.setAutoCleared(entity.isAutoCleared());
    return model;
}
Also used : User(org.ovirt.engine.api.model.User) Job(org.ovirt.engine.api.model.Job)

Aggregations

User (org.ovirt.engine.api.model.User)31 Test (org.junit.Test)12 DbUser (org.ovirt.engine.core.common.businessentities.aaa.DbUser)9 Role (org.ovirt.engine.api.model.Role)7 Permission (org.ovirt.engine.api.model.Permission)6 DirectoryUser (org.ovirt.engine.core.aaa.DirectoryUser)6 Roles (org.ovirt.engine.api.model.Roles)5 Domain (org.ovirt.engine.api.model.Domain)4 WebApplicationException (javax.ws.rs.WebApplicationException)3 Response (javax.ws.rs.core.Response)3 Group (org.ovirt.engine.api.model.Group)3 AbstractBackendCollectionResourceTest (org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResourceTest)3 Groups (org.ovirt.engine.api.model.Groups)2 Session (org.ovirt.engine.api.model.Session)2 Ssh (org.ovirt.engine.api.model.Ssh)2 Users (org.ovirt.engine.api.model.Users)2 DbGroup (org.ovirt.engine.core.common.businessentities.aaa.DbGroup)2 ArrayList (java.util.ArrayList)1 AuthorizedKey (org.ovirt.engine.api.model.AuthorizedKey)1 BaseResource (org.ovirt.engine.api.model.BaseResource)1