Search in sources :

Example 6 with VdcObjectType

use of org.ovirt.engine.core.common.VdcObjectType in project ovirt-engine by oVirt.

the class PermissionListModel method syncSearch.

@Override
protected void syncSearch() {
    VdcObjectType objType = getObjectType();
    GetPermissionsForObjectParameters tempVar = new GetPermissionsForObjectParameters();
    tempVar.setObjectId(getEntityGuid());
    tempVar.setVdcObjectType(objType);
    tempVar.setDirectOnly(false);
    tempVar.setRefresh(getIsQueryFirstTime());
    tempVar.setAllUsersWithPermission(getAllUsersWithPermission());
    super.syncSearch(QueryType.GetPermissionsForObject, tempVar);
}
Also used : VdcObjectType(org.ovirt.engine.core.common.VdcObjectType) GetPermissionsForObjectParameters(org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters)

Example 7 with VdcObjectType

use of org.ovirt.engine.core.common.VdcObjectType in project ovirt-engine by oVirt.

the class EditProviderModel method preSave.

@Override
protected void preSave() {
    if (!stringsEqualIgnoreCase(getUrl().getEntity(), oldUrl)) {
        ArrayList<QueryType> queryTypes = new ArrayList<>();
        ArrayList<QueryParametersBase> queryParams = new ArrayList<>();
        final Set<VdcObjectType> providedTypes = provider.getType().getProvidedTypes();
        if (providedTypes.contains(VdcObjectType.Network)) {
            queryTypes.add(QueryType.GetAllNetworksForProvider);
            queryParams.add(new IdQueryParameters(provider.getId()));
        }
        if (!queryTypes.isEmpty()) {
            startProgress();
            Frontend.getInstance().runMultipleQueries(queryTypes, queryParams, result -> {
                stopProgress();
                Iterator<QueryReturnValue> i = result.getReturnValues().iterator();
                if (providedTypes.contains(VdcObjectType.Network)) {
                    providedNetworks = i.next().getReturnValue();
                }
                showConfirmation();
            });
            return;
        }
    }
    actualSave();
}
Also used : QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) ArrayList(java.util.ArrayList) QueryParametersBase(org.ovirt.engine.core.common.queries.QueryParametersBase) VdcObjectType(org.ovirt.engine.core.common.VdcObjectType) QueryType(org.ovirt.engine.core.common.queries.QueryType)

Example 8 with VdcObjectType

use of org.ovirt.engine.core.common.VdcObjectType in project ovirt-engine by oVirt.

the class StepDaoTest method prepareStartedStepsByStepSubjectEntityTest.

private StepSubjectEntity prepareStartedStepsByStepSubjectEntityTest() {
    Guid entityId = Guid.newGuid();
    VdcObjectType entityType = VdcObjectType.EXECUTION_HOST;
    StepSubjectEntity subjectEntity = new StepSubjectEntity(FixturesTool.STEP_ID, entityType, entityId);
    getStepSubjectEntityDao().saveAll(Arrays.asList(subjectEntity));
    Step s = dao.get(FixturesTool.STEP_ID);
    s.setStatus(JobExecutionStatus.STARTED);
    dao.update(s);
    return subjectEntity;
}
Also used : Guid(org.ovirt.engine.core.compat.Guid) Step(org.ovirt.engine.core.common.job.Step) VdcObjectType(org.ovirt.engine.core.common.VdcObjectType) StepSubjectEntity(org.ovirt.engine.core.common.job.StepSubjectEntity)

Example 9 with VdcObjectType

use of org.ovirt.engine.core.common.VdcObjectType in project ovirt-engine by oVirt.

the class StepDaoTest method prepareProgressTest.

private void prepareProgressTest(Guid entityId) {
    VdcObjectType type = VdcObjectType.Disk;
    BaseDisk diskImage = getDiskDao().get(entityId);
    assertProgress(null, diskImage);
    getStepSubjectEntityDao().saveAll(Arrays.asList(new StepSubjectEntity(FixturesTool.STEP_ID, type, entityId, 30), new StepSubjectEntity(FixturesTool.STEP_ID_2, type, entityId, 50)));
}
Also used : BaseDisk(org.ovirt.engine.core.common.businessentities.storage.BaseDisk) VdcObjectType(org.ovirt.engine.core.common.VdcObjectType) StepSubjectEntity(org.ovirt.engine.core.common.job.StepSubjectEntity)

Example 10 with VdcObjectType

use of org.ovirt.engine.core.common.VdcObjectType in project ovirt-engine by oVirt.

the class JobRepositoryImpl method getJobWithSteps.

@Override
public Job getJobWithSteps(final Guid jobId) {
    Job job = jobDao.get(jobId);
    if (job != null) {
        Map<Guid, VdcObjectType> jobSubjectEntity = jobSubjectEntityDao.getJobSubjectEntityByJobId(jobId);
        job.setJobSubjectEntities(jobSubjectEntity);
        loadJobSteps(job);
    }
    return job;
}
Also used : Guid(org.ovirt.engine.core.compat.Guid) Job(org.ovirt.engine.core.common.job.Job) VdcObjectType(org.ovirt.engine.core.common.VdcObjectType)

Aggregations

VdcObjectType (org.ovirt.engine.core.common.VdcObjectType)13 Guid (org.ovirt.engine.core.compat.Guid)7 StepSubjectEntity (org.ovirt.engine.core.common.job.StepSubjectEntity)3 Test (org.junit.Test)2 PermissionSubject (org.ovirt.engine.core.bll.utils.PermissionSubject)2 Job (org.ovirt.engine.core.common.job.Job)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ActionGroup (org.ovirt.engine.core.common.businessentities.ActionGroup)1 SubjectEntity (org.ovirt.engine.core.common.businessentities.SubjectEntity)1 BaseDisk (org.ovirt.engine.core.common.businessentities.storage.BaseDisk)1 Step (org.ovirt.engine.core.common.job.Step)1 GetPermissionsForObjectParameters (org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters)1 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)1 QueryParametersBase (org.ovirt.engine.core.common.queries.QueryParametersBase)1 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)1 QueryType (org.ovirt.engine.core.common.queries.QueryType)1 MapSqlParameterSource (org.springframework.jdbc.core.namedparam.MapSqlParameterSource)1