Search in sources :

Example 11 with GetObjectType

use of com.evolveum.midpoint.xml.ns._public.model.model_3.GetObjectType in project midpoint by Evolveum.

the class FocusTypeAssignmentPopupTabPanel method getSelectedAssignmentsMap.

@Override
protected Map<String, AssignmentType> getSelectedAssignmentsMap() {
    Map<String, AssignmentType> assignmentsMap = new HashMap<>();
    List<F> selectedObjects = getObjectType().equals(ObjectTypes.ORG) ? getPreselectedObjects() : getSelectedObjectsList();
    QName relation = getRelationValue();
    selectedObjects.forEach(selectedObject -> assignmentsMap.put(selectedObject.getOid(), ObjectTypeUtil.createAssignmentTo(selectedObject, relation)));
    return assignmentsMap;
}
Also used : HashMap(java.util.HashMap) QName(javax.xml.namespace.QName) AssignmentType(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType)

Example 12 with GetObjectType

use of com.evolveum.midpoint.xml.ns._public.model.model_3.GetObjectType in project midpoint by Evolveum.

the class PageShadow method createPageTitleModel.

@Override
protected IModel<String> createPageTitleModel() {
    return new LoadableModel<>(false) {

        private static final long serialVersionUID = 1L;

        @Override
        protected String load() {
            ShadowType account = getObjectDetailsModels().getObjectType();
            String accName = WebComponentUtil.getName(account);
            ResourceType resource = (ResourceType) account.getResourceRef().asReferenceValue().getObject().asObjectable();
            String name = WebComponentUtil.getName(resource);
            // TODO: refactor
            return createStringResourceStatic(PageShadow.this, "PageAccount.title", accName, name).getString();
        }
    };
}
Also used : ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) LoadableModel(com.evolveum.midpoint.gui.api.model.LoadableModel) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)

Example 13 with GetObjectType

use of com.evolveum.midpoint.xml.ns._public.model.model_3.GetObjectType in project midpoint by Evolveum.

the class ActionsExecutedSummarizer method mapToBean.

private void mapToBean(Map<ActionsExecutedObjectsKey, ObjectActionsExecutedEntryType> map, List<ObjectActionsExecutedEntryType> list) {
    for (Map.Entry<ActionsExecutedObjectsKey, ObjectActionsExecutedEntryType> entry : map.entrySet()) {
        ObjectActionsExecutedEntryType e = entry.getValue().clone();
        e.setObjectType(entry.getKey().getObjectType());
        e.setOperation(ChangeType.toChangeTypeType(entry.getKey().getOperation()));
        e.setChannel(entry.getKey().getChannel());
        list.add(e);
    }
}
Also used : Map(java.util.Map) HashMap(java.util.HashMap) ObjectActionsExecutedEntryType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectActionsExecutedEntryType)

Example 14 with GetObjectType

use of com.evolveum.midpoint.xml.ns._public.model.model_3.GetObjectType in project midpoint by Evolveum.

the class GlobalObjectCache method getStateInformation.

public Collection<SingleCacheStateInformationType> getStateInformation() {
    Map<Class<?>, Integer> counts = new HashMap<>();
    AtomicInteger size = new AtomicInteger(0);
    if (cache != null) {
        cache.invokeAll(cache.keys(), e -> {
            Class<?> objectType = e.getValue().getObjectType();
            counts.compute(objectType, (type, count) -> count != null ? count + 1 : 1);
            size.incrementAndGet();
            return null;
        });
        SingleCacheStateInformationType info = new SingleCacheStateInformationType(prismContext).name(GlobalObjectCache.class.getName()).size(size.get());
        counts.forEach((type, count) -> info.beginComponent().name(type.getSimpleName()).size(count));
        return Collections.singleton(info);
    } else {
        return Collections.emptySet();
    }
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) HashMap(java.util.HashMap) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) SingleCacheStateInformationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SingleCacheStateInformationType)

Example 15 with GetObjectType

use of com.evolveum.midpoint.xml.ns._public.model.model_3.GetObjectType in project midpoint by Evolveum.

the class GlobalVersionCache method getStateInformation.

public Collection<SingleCacheStateInformationType> getStateInformation() {
    Map<Class<?>, Integer> counts = new HashMap<>();
    AtomicInteger size = new AtomicInteger(0);
    if (cache != null) {
        cache.invokeAll(cache.keys(), e -> {
            Class<?> objectType = e.getValue().getObjectType();
            counts.compute(objectType, (type, count) -> count != null ? count + 1 : 1);
            size.incrementAndGet();
            return null;
        });
        SingleCacheStateInformationType info = new SingleCacheStateInformationType(prismContext).name(GlobalVersionCache.class.getName()).size(size.get());
        counts.forEach((type, count) -> info.beginComponent().name(type.getSimpleName()).size(count));
        return Collections.singleton(info);
    } else {
        return Collections.emptySet();
    }
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) HashMap(java.util.HashMap) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) SingleCacheStateInformationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SingleCacheStateInformationType)

Aggregations

HashMap (java.util.HashMap)5 ResourceObjectTypeDefinitionType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceObjectTypeDefinitionType)3 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)2 ObjectActionsExecutedEntryType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectActionsExecutedEntryType)2 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)2 OperationResultType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)2 SingleCacheStateInformationType (com.evolveum.midpoint.xml.ns._public.common.common_3.SingleCacheStateInformationType)2 Map (java.util.Map)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)2 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 PrismContext (com.evolveum.midpoint.prism.PrismContext)1 PrismPropertyDefinition (com.evolveum.midpoint.prism.PrismPropertyDefinition)1 PrismPropertyValue (com.evolveum.midpoint.prism.PrismPropertyValue)1 ObjectFilter (com.evolveum.midpoint.prism.query.ObjectFilter)1 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)1 OrFilter (com.evolveum.midpoint.prism.query.OrFilter)1 RefFilter (com.evolveum.midpoint.prism.query.RefFilter)1 ExpressionEvaluationContext (com.evolveum.midpoint.repo.common.expression.ExpressionEvaluationContext)1 ExpressionFactory (com.evolveum.midpoint.repo.common.expression.ExpressionFactory)1