use of com.evolveum.midpoint.xml.ns._public.common.common_3.TracingProfileType in project midpoint by Evolveum.
the class TestModelServiceContract method test103GetAccountRaw.
/**
* MID-6716
*/
@Test
public void test103GetAccountRaw() throws Exception {
given();
Task task = getTestTask();
OperationResult parentResult = task.getResult();
preTestCleanup(AssignmentPolicyEnforcementType.POSITIVE);
Collection<SelectorOptions<GetOperationOptions>> options = schemaService.getOperationOptionsBuilder().raw().build();
when();
// Just to avoid result pruning.
CompiledTracingProfile tracingProfile = tracer.compileProfile(new TracingProfileType(prismContext).createTraceFile(false), parentResult);
OperationResult result = parentResult.subresult("get").tracingProfile(tracingProfile).build();
PrismObject<ShadowType> account = modelService.getObject(ShadowType.class, accountJackOid, options, task, result);
then();
display("Account", account);
displayDumpable("Account def", account.getDefinition());
assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 0);
PrismContainer<Containerable> accountContainer = account.findContainer(ShadowType.F_ATTRIBUTES);
displayDumpable("Account attributes def", accountContainer.getDefinition());
displayDumpable("Account attributes def complex type def", accountContainer.getDefinition().getComplexTypeDefinition());
assertDummyAccountShadowRepo(account, accountJackOid, "jack");
assertSuccess("getObject result", result);
assertSteadyResources();
displayDumpable("result", result);
List<String> provisioningOperations = result.getResultStream().map(OperationResult::getOperation).filter(operation -> operation.startsWith(ProvisioningService.class.getName())).collect(Collectors.toList());
assertThat(provisioningOperations).as("provisioning operations").isEmpty();
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.TracingProfileType in project midpoint by Evolveum.
the class ExecuteChangeOptionsPanel method createTracingRadioChoicesFragment.
private Fragment createTracingRadioChoicesFragment(String componentId) {
Fragment fragment = new Fragment(componentId, ID_TRACING_CONTAINER, ExecuteChangeOptionsPanel.this);
RadioChoice<TracingProfileType> tracingProfile = new RadioChoice<>(ID_TRACING, PropertyModel.of(ExecuteChangeOptionsPanel.this.getModel(), ExecuteChangeOptionsDto.F_TRACING), PropertyModel.of(ExecuteChangeOptionsPanel.this.getModel(), ExecuteChangeOptionsDto.F_TRACING_CHOICES), createTracinnChoiceRenderer());
fragment.add(tracingProfile);
AjaxLink<Void> resetChoices = new AjaxLink<>(ID_RESET_CHOICES) {
@Override
public void onClick(AjaxRequestTarget target) {
ExecuteChangeOptionsPanel.this.getModelObject().setTracing(null);
target.add(ExecuteChangeOptionsPanel.this);
}
};
fragment.add(resetChoices);
return fragment;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.TracingProfileType in project midpoint by Evolveum.
the class ExecuteChangeOptionsPanel method initLayout.
private void initLayout() {
setOutputMarkupId(true);
createContainer(ID_FORCE_CONTAINER, new PropertyModel<>(getModel(), ExecuteChangeOptionsDto.F_FORCE), FORCE_LABEL, FORCE_HELP, true);
createContainer(ID_RECONCILE_CONTAINER, new PropertyModel<>(getModel(), ExecuteChangeOptionsDto.F_RECONCILE), RECONCILE_LABEL, RECONCILE_HELP, showReconcile);
createContainer(ID_RECONCILE_AFFECTED_CONTAINER, new PropertyModel<>(getModel(), ExecuteChangeOptionsDto.F_RECONCILE_AFFECTED), RECONCILE_AFFECTED_LABEL, RECONCILE_AFFECTED_HELP, showReconcileAffected);
createContainer(ID_EXECUTE_AFTER_ALL_APPROVALS_CONTAINER, new PropertyModel<>(getModel(), ExecuteChangeOptionsDto.F_EXECUTE_AFTER_ALL_APPROVALS), EXECUTE_AFTER_ALL_APPROVALS_LABEL, EXECUTE_AFTER_ALL_APPROVALS_HELP, true);
createContainer(ID_KEEP_DISPLAYING_RESULTS_CONTAINER, new PropertyModel<>(getModel(), ExecuteChangeOptionsDto.F_KEEP_DISPLAYING_RESULTS), KEEP_DISPLAYING_RESULTS_LABEL, KEEP_DISPLAYING_RESULTS_HELP, showKeepDisplayingResults, true);
createContainer(ID_SAVE_IN_BACKGROUND_CONTAINER, new PropertyModel<>(getModel(), ExecuteChangeOptionsDto.F_SAVE_IN_BACKGROUND), SAVE_IN_BACKGROUND_LABEL, SAVE_IN_BACKGROUND_HELP, showKeepDisplayingResults, true);
boolean canRecordTrace;
try {
canRecordTrace = getPageBase().isAuthorized(ModelAuthorizationAction.RECORD_TRACE.getUrl());
} catch (Throwable t) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't check trace recording authorization", t);
canRecordTrace = false;
}
WebMarkupContainer tracingContainer = new WebMarkupContainer(ID_TRACING_CONTAINER);
tracingContainer.setVisible(canRecordTrace && WebModelServiceUtils.isEnableExperimentalFeature(getPageBase()));
add(tracingContainer);
DropDownChoice tracing = new DropDownChoice<>(ID_TRACING, PropertyModel.of(getModel(), ExecuteChangeOptionsDto.F_TRACING), PropertyModel.of(getModel(), ExecuteChangeOptionsDto.F_TRACING_CHOICES), new IChoiceRenderer<TracingProfileType>() {
private static final long serialVersionUID = 1L;
@Override
public Object getDisplayValue(TracingProfileType profile) {
if (profile == null) {
return "(none)";
} else if (profile.getDisplayName() != null) {
return profile.getDisplayName();
} else if (profile.getName() != null) {
return profile.getName();
} else {
return "(unnamed profile)";
}
}
@Override
public String getIdValue(TracingProfileType object, int index) {
return String.valueOf(index);
}
@Override
public TracingProfileType getObject(String id, IModel<? extends List<? extends TracingProfileType>> choices) {
return StringUtils.isNotBlank(id) ? choices.getObject().get(Integer.parseInt(id)) : null;
}
});
tracing.setNullValid(true);
tracingContainer.add(tracing);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.TracingProfileType in project midpoint by Evolveum.
the class ItemProcessingMonitor method startTracing.
private void startTracing(@NotNull ActivityTracingDefinitionType tracingDefinition) {
tracingDefinitionUsed = tracingDefinition;
// This is on debug level because we may start tracing "just for sure" (with low overhead)
// and write trace only if after-condition is true.
LOGGER.debug("Starting tracing for object number {}", activityRun.getItemsProcessed());
TracingProfileType configuredProfile = tracingDefinition.getTracingProfile();
List<TracingRootType> configuredPoints = tracingDefinition.getTracingPoint();
TracingProfileType profile = configuredProfile != null ? configuredProfile : activityRun.getBeans().tracer.getDefaultProfile();
Collection<TracingRootType> points = !configuredPoints.isEmpty() ? configuredPoints : List.of(TracingRootType.ACTIVITY_ITEM_PROCESSING);
points.forEach(workerTask::addTracingRequest);
workerTask.setTracingProfile(profile);
}
Aggregations