use of com.evolveum.midpoint.schema.ResourceShadowDiscriminator in project midpoint by Evolveum.
the class AssignmentProcessor method getConstructionMapKey.
private <F extends FocusType> ResourceShadowDiscriminator getConstructionMapKey(LensContext<F> context, Construction<F> construction, Task task, OperationResult result) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException {
String resourceOid = construction.getResource(task, result).getOid();
String intent = construction.getIntent();
ShadowKindType kind = construction.getKind();
ResourceType resource = LensUtil.getResourceReadOnly(context, resourceOid, provisioningService, task, result);
intent = LensUtil.refineProjectionIntent(kind, intent, resource, prismContext);
ResourceShadowDiscriminator rat = new ResourceShadowDiscriminator(resourceOid, kind, intent);
return rat;
}
use of com.evolveum.midpoint.schema.ResourceShadowDiscriminator in project midpoint by Evolveum.
the class AssignmentProcessor method propagateLegalDecisionToHigherOrders.
private <F extends ObjectType> void propagateLegalDecisionToHigherOrders(LensContext<F> context, LensProjectionContext refProjCtx) {
ResourceShadowDiscriminator refDiscr = refProjCtx.getResourceShadowDiscriminator();
if (refDiscr == null) {
return;
}
for (LensProjectionContext aProjCtx : context.getProjectionContexts()) {
ResourceShadowDiscriminator aDiscr = aProjCtx.getResourceShadowDiscriminator();
if (aDiscr != null && refDiscr.equivalent(aDiscr) && (refDiscr.getOrder() < aDiscr.getOrder())) {
aProjCtx.setLegal(refProjCtx.isLegal());
aProjCtx.setLegalOld(refProjCtx.isLegalOld());
aProjCtx.setExists(refProjCtx.isExists());
}
}
}
use of com.evolveum.midpoint.schema.ResourceShadowDiscriminator in project midpoint by Evolveum.
the class TestEditSchema method test260EditShadowSchemaKindIntent.
@Test
public void test260EditShadowSchemaKindIntent() throws Exception {
final String TEST_NAME = "test260EditShadowSchemaKindIntent";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(TestEditSchema.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
ResourceShadowDiscriminator discr = new ResourceShadowDiscriminator(RESOURCE_DUMMY_OID, ShadowKindType.ACCOUNT, null);
// WHEN
TestUtil.displayWhen(TEST_NAME);
PrismObjectDefinition<ShadowType> editDef = modelInteractionService.getEditShadowDefinition(discr, AuthorizationPhaseType.REQUEST, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
PrismPropertyDefinition<PolyString> nameDef = editDef.findPropertyDefinition(ShadowType.F_NAME);
assertNotNull("No definition for name in shadow", nameDef);
assertEquals("Wrong shadow name displayName", "ObjectType.name", nameDef.getDisplayName());
assertTrue("additionalName not readable", nameDef.canRead());
PrismPropertyDefinition<Object> attrFullNameDef = editDef.findPropertyDefinition(dummyResourceCtl.getAttributeFullnamePath());
assertNotNull("No definition for fullname attribute in shadow", attrFullNameDef);
assertEquals("Wrong shadow fullname attribute displayName", "Full Name", attrFullNameDef.getDisplayName());
assertTrue("additionalName not readable", attrFullNameDef.canRead());
assertSteadyResources();
}
use of com.evolveum.midpoint.schema.ResourceShadowDiscriminator in project midpoint by Evolveum.
the class ProvisioningContext method spawn.
/**
* Creates a context for a different object class on the same resource.
*/
public ProvisioningContext spawn(ShadowKindType kind, String intent) {
ProvisioningContext ctx = spawnSameResource();
ctx.shadowCoordinates = new ResourceShadowDiscriminator(getResourceOid(), kind, intent);
return ctx;
}
use of com.evolveum.midpoint.schema.ResourceShadowDiscriminator in project midpoint by Evolveum.
the class ProvisioningContext method spawn.
/**
* Creates a context for a different object class on the same resource.
*/
public ProvisioningContext spawn(QName objectClassQName) throws SchemaException {
ProvisioningContext ctx = spawnSameResource();
ctx.shadowCoordinates = new ResourceShadowDiscriminator(getResourceOid(), null, null);
ctx.shadowCoordinates.setObjectClass(objectClassQName);
return ctx;
}
Aggregations