use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType in project midpoint by Evolveum.
the class OperationalDataManager method applyAssignmentValueMetadataAdd.
private <F extends FocusType> void applyAssignmentValueMetadataAdd(LensContext<F> context, PrismContainerValue<AssignmentType> assignmentContainerValue, String desc, XMLGregorianCalendar now, Task task, OperationResult result) throws SchemaException {
AssignmentType assignmentType = assignmentContainerValue.asContainerable();
MetadataType metadataType = assignmentType.getMetadata();
if (metadataType == null) {
metadataType = new MetadataType();
assignmentType.setMetadata(metadataType);
}
transplantRequestMetadata(context, metadataType);
ActivationType activationType = assignmentType.getActivation();
ActivationStatusType effectiveStatus = activationComputer.getEffectiveStatus(assignmentType.getLifecycleState(), activationType);
if (activationType == null) {
activationType = new ActivationType();
assignmentType.setActivation(activationType);
}
activationType.setEffectiveStatus(effectiveStatus);
applyCreateMetadata(context, metadataType, now, task);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Adding operational data {} to assignment cval ({}):\nMETADATA:\n{}\nACTIVATION:\n{}", metadataType, desc, assignmentContainerValue.debugDump(1), activationType.asPrismContainerValue().debugDump(1));
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method assertSideEffectiveDeltasOnly.
protected <F extends FocusType> void assertSideEffectiveDeltasOnly(String desc, ObjectDelta<F> focusDelta) {
if (focusDelta == null) {
return;
}
int expectedModifications = 0;
// There may be metadata modification, we tolerate that
Collection<? extends ItemDelta<?, ?>> metadataDelta = focusDelta.findItemDeltasSubPath(new ItemPath(UserType.F_METADATA));
if (metadataDelta != null && !metadataDelta.isEmpty()) {
expectedModifications += metadataDelta.size();
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_ACTIVATION, ActivationType.F_ENABLE_TIMESTAMP)) != null) {
expectedModifications++;
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_ACTIVATION, ActivationType.F_DISABLE_TIMESTAMP)) != null) {
expectedModifications++;
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_ACTIVATION, ActivationType.F_ARCHIVE_TIMESTAMP)) != null) {
expectedModifications++;
}
PropertyDelta<ActivationStatusType> effectiveStatusDelta = focusDelta.findPropertyDelta(new ItemPath(UserType.F_ACTIVATION, ActivationType.F_EFFECTIVE_STATUS));
if (effectiveStatusDelta != null) {
expectedModifications++;
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_ITERATION)) != null) {
expectedModifications++;
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_ROLE_MEMBERSHIP_REF)) != null) {
expectedModifications++;
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_DELEGATED_REF)) != null) {
expectedModifications++;
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_ITERATION_TOKEN)) != null) {
expectedModifications++;
}
assertEquals("Unexpected modifications in " + desc + ": " + focusDelta, expectedModifications, focusDelta.getModifications().size());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method assertEffectualDeltas.
protected <F extends FocusType> void assertEffectualDeltas(ObjectDelta<F> focusDelta, String desc, ActivationStatusType expectedEfficientActivation, int expectedEffectualModifications) {
if (focusDelta == null) {
return;
}
int expectedModifications = expectedEffectualModifications;
// There may be metadata modification, we tolerate that
for (ItemDelta<?, ?> modification : focusDelta.getModifications()) {
if (modification.getPath().containsName(ObjectType.F_METADATA)) {
expectedModifications++;
}
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_ACTIVATION, ActivationType.F_ENABLE_TIMESTAMP)) != null) {
expectedModifications++;
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_ACTIVATION, ActivationType.F_DISABLE_TIMESTAMP)) != null) {
expectedModifications++;
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_ACTIVATION, ActivationType.F_ARCHIVE_TIMESTAMP)) != null) {
expectedModifications++;
}
PropertyDelta<ActivationStatusType> effectiveStatusDelta = focusDelta.findPropertyDelta(new ItemPath(UserType.F_ACTIVATION, ActivationType.F_EFFECTIVE_STATUS));
if (effectiveStatusDelta != null) {
expectedModifications++;
PrismAsserts.assertReplace(effectiveStatusDelta, expectedEfficientActivation);
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_ROLE_MEMBERSHIP_REF)) != null) {
expectedModifications++;
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_DELEGATED_REF)) != null) {
expectedModifications++;
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_ITERATION)) != null) {
expectedModifications++;
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_ITERATION_TOKEN)) != null) {
expectedModifications++;
}
assertEquals("Unexpected modifications in " + desc + ": " + focusDelta, expectedModifications, focusDelta.getModifications().size());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType in project midpoint by Evolveum.
the class TestDummyCaching method assertRepoShadowCacheActivation.
@Override
protected void assertRepoShadowCacheActivation(PrismObject<ShadowType> shadowRepo, ActivationStatusType expectedAdministrativeStatus) {
ActivationType activationType = shadowRepo.asObjectable().getActivation();
assertNotNull("No activation in repo shadow " + shadowRepo, activationType);
ActivationStatusType administrativeStatus = activationType.getAdministrativeStatus();
assertEquals("Wrong activation administrativeStatus in repo shadow " + shadowRepo, expectedAdministrativeStatus, administrativeStatus);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType in project midpoint by Evolveum.
the class TestMachineIntelligence method assertAssignment.
private void assertAssignment(UserType userType, ActivationStatusType administrativeStatus, XMLGregorianCalendar validTo) {
List<AssignmentType> assignments = userType.getAssignment();
assertEquals("Unexpected assignment in user, expected 1, found " + assignments.size(), 1, assignments.size());
AssignmentType assignmentType = assignments.iterator().next();
ActivationType assignmentActivation = assignmentType.getActivation();
assertEquals(administrativeStatus, assignmentActivation.getAdministrativeStatus());
assertEquals(administrativeStatus, assignmentActivation.getEffectiveStatus());
if (validTo == null) {
assertNull("Unexpected validTo value: " + assignmentActivation.getValidTo(), assignmentActivation.getValidTo());
} else {
//TODO:
}
}
Aggregations