use of com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationSituationType in project midpoint by Evolveum.
the class AbstractInitializedModelIntegrationTest method assertShadowOperationalData.
protected void assertShadowOperationalData(PrismObject<ShadowType> shadow, SynchronizationSituationType expectedSituation, Long timeBeforeSync) {
ShadowType shadowType = shadow.asObjectable();
SynchronizationSituationType actualSituation = shadowType.getSynchronizationSituation();
assertEquals("Wrong situation in shadow " + shadow, expectedSituation, actualSituation);
XMLGregorianCalendar actualTimestampCal = shadowType.getSynchronizationTimestamp();
assert actualTimestampCal != null : "No synchronization timestamp in shadow " + shadow;
if (timeBeforeSync != null) {
long actualTimestamp = XmlTypeConverter.toMillis(actualTimestampCal);
assert actualTimestamp >= timeBeforeSync : "Synchronization timestamp was not updated in shadow " + shadow;
}
// TODO: assert sync description
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationSituationType in project midpoint by Evolveum.
the class PageAccounts method createTotalsModel.
private LoadableModel<Integer> createTotalsModel(final SynchronizationSituationType situation) {
return new LoadableModel<Integer>(false) {
@Override
protected Integer load() {
ObjectFilter resourceFilter = createResourceQueryFilter();
if (resourceFilter == null) {
return 0;
}
ObjectFilter filter = createObjectQuery().getFilter();
Collection<SelectorOptions<GetOperationOptions>> options = SelectorOptions.createCollection(GetOperationOptions.createRaw());
Task task = createSimpleTask(OPERATION_GET_TOTALS);
OperationResult result = new OperationResult(OPERATION_GET_TOTALS);
try {
ObjectFilter situationFilter = QueryBuilder.queryFor(ShadowType.class, getPrismContext()).item(ShadowType.F_SYNCHRONIZATION_SITUATION).eq(situation).buildFilter();
ObjectQuery query = ObjectQuery.createObjectQuery(AndFilter.createAnd(filter, situationFilter));
return getModelService().countObjects(ShadowType.class, query, options, task, result);
} catch (CommonException | RuntimeException ex) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't count shadows", ex);
}
return 0;
}
};
}
Aggregations