Search in sources :

Example 1 with SelectorQualifiedGetOptionType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionType in project midpoint by Evolveum.

the class ExportAction method createOptions.

private SelectorQualifiedGetOptionsType createOptions() {
    SelectorQualifiedGetOptionsType options = new SelectorQualifiedGetOptionsType();
    if (getParams().isRaw()) {
        SelectorQualifiedGetOptionType raw = new SelectorQualifiedGetOptionType();
        GetOperationOptionsType option = new GetOperationOptionsType();
        option.setRaw(true);
        raw.setOptions(option);
        options.getOption().add(raw);
    }
    return options;
}
Also used : GetOperationOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.GetOperationOptionsType) SelectorQualifiedGetOptionType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionType) SelectorQualifiedGetOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType)

Example 2 with SelectorQualifiedGetOptionType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionType in project midpoint by Evolveum.

the class AbstractTestForExchangeConnector method listTasks.

protected Collection<TaskType> listTasks() throws SAXException, IOException, FaultMessage {
    SelectorQualifiedGetOptionsType operationOptions = new SelectorQualifiedGetOptionsType();
    // Let's say we want to retrieve tasks' next scheduled time (because this may be a costly operation if
    // JDBC based quartz scheduler is used, the fetching of this attribute has to be explicitly requested)
    SelectorQualifiedGetOptionType getNextScheduledTimeOption = new SelectorQualifiedGetOptionType();
    // prepare a selector (described by path) + options (saying to retrieve that attribute)
    OptionObjectSelectorType selector = new OptionObjectSelectorType();
    selector.setPath(ModelClientUtil.createItemPathType("nextRunStartTimestamp"));
    getNextScheduledTimeOption.setSelector(selector);
    GetOperationOptionsType selectorOptions = new GetOperationOptionsType();
    selectorOptions.setRetrieve(RetrieveOptionType.INCLUDE);
    getNextScheduledTimeOption.setOptions(selectorOptions);
    // add newly created option to the list of operation options
    operationOptions.getOption().add(getNextScheduledTimeOption);
    Holder<ObjectListType> objectListHolder = new Holder<ObjectListType>();
    Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
    modelPort.searchObjects(ModelClientUtil.getTypeQName(TaskType.class), null, operationOptions, objectListHolder, resultHolder);
    ObjectListType objectList = objectListHolder.value;
    return (Collection) objectList.getObject();
}
Also used : GetOperationOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.GetOperationOptionsType) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) OptionObjectSelectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.OptionObjectSelectorType) Holder(javax.xml.ws.Holder) TaskType(com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType) Collection(java.util.Collection) SelectorQualifiedGetOptionType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionType) ObjectListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectListType) SelectorQualifiedGetOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType)

Example 3 with SelectorQualifiedGetOptionType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionType in project midpoint by Evolveum.

the class GetOperationOptionsUtil method optionsToOptionsBean.

@SuppressWarnings("WeakerAccess")
@NotNull
public static SelectorQualifiedGetOptionsType optionsToOptionsBean(@NotNull Collection<SelectorOptions<GetOperationOptions>> options) {
    SelectorQualifiedGetOptionsType optionsType = new SelectorQualifiedGetOptionsType();
    List<SelectorQualifiedGetOptionType> retval = new ArrayList<>();
    for (SelectorOptions<GetOperationOptions> option : options) {
        retval.add(selectorOptionToSelectorQualifiedGetOptionType(option));
    }
    optionsType.getOption().addAll(retval);
    return optionsType;
}
Also used : ArrayList(java.util.ArrayList) SelectorQualifiedGetOptionType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionType) SelectorQualifiedGetOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType) NotNull(org.jetbrains.annotations.NotNull)

Example 4 with SelectorQualifiedGetOptionType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionType in project midpoint by Evolveum.

the class Main method listTasks.

private static Collection<TaskType> listTasks(ModelPortType modelPort) throws SAXException, IOException, FaultMessage {
    SelectorQualifiedGetOptionsType operationOptions = new SelectorQualifiedGetOptionsType();
    // Let's say we want to retrieve tasks' next scheduled time (because this may be a costly operation if
    // JDBC based quartz scheduler is used, the fetching of this attribute has to be explicitly requested)
    SelectorQualifiedGetOptionType getNextScheduledTimeOption = new SelectorQualifiedGetOptionType();
    // prepare a selector (described by path) + options (saying to retrieve that attribute)
    OptionObjectSelectorType selector = new OptionObjectSelectorType();
    selector.setPath(ModelClientUtil.createItemPathType("nextRunStartTimestamp"));
    getNextScheduledTimeOption.setSelector(selector);
    GetOperationOptionsType selectorOptions = new GetOperationOptionsType();
    selectorOptions.setRetrieve(RetrieveOptionType.INCLUDE);
    getNextScheduledTimeOption.setOptions(selectorOptions);
    // add newly created option to the list of operation options
    operationOptions.getOption().add(getNextScheduledTimeOption);
    Holder<ObjectListType> objectListHolder = new Holder<ObjectListType>();
    Holder<OperationResultType> resultHolder = new Holder<OperationResultType>();
    modelPort.searchObjects(ModelClientUtil.getTypeQName(TaskType.class), null, operationOptions, objectListHolder, resultHolder);
    ObjectListType objectList = objectListHolder.value;
    return (Collection) objectList.getObject();
}
Also used : GetOperationOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.GetOperationOptionsType) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) OptionObjectSelectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.OptionObjectSelectorType) Holder(javax.xml.ws.Holder) TaskType(com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType) Collection(java.util.Collection) SelectorQualifiedGetOptionType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionType) ObjectListType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectListType) SelectorQualifiedGetOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType)

Example 5 with SelectorQualifiedGetOptionType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionType in project midpoint by Evolveum.

the class AbstractTestForExchangeConnector method getObjectNoFetch.

protected <T extends ObjectType> T getObjectNoFetch(Class<T> clazz, String oid) throws SAXException, IOException, FaultMessage {
    SelectorQualifiedGetOptionsType options = new SelectorQualifiedGetOptionsType();
    SelectorQualifiedGetOptionType option = new SelectorQualifiedGetOptionType();
    GetOperationOptionsType getOptions = new GetOperationOptionsType();
    getOptions.setNoFetch(true);
    option.setOptions(getOptions);
    options.getOption().add(option);
    return getObject(clazz, oid, options);
}
Also used : GetOperationOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.GetOperationOptionsType) SelectorQualifiedGetOptionType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionType) SelectorQualifiedGetOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType)

Aggregations

SelectorQualifiedGetOptionType (com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionType)7 SelectorQualifiedGetOptionsType (com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType)6 GetOperationOptionsType (com.evolveum.midpoint.xml.ns._public.common.common_3.GetOperationOptionsType)5 OptionObjectSelectorType (com.evolveum.midpoint.xml.ns._public.common.common_3.OptionObjectSelectorType)3 ObjectListType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectListType)2 OperationResultType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)2 TaskType (com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType)2 Collection (java.util.Collection)2 Holder (javax.xml.ws.Holder)2 ArrayList (java.util.ArrayList)1 NotNull (org.jetbrains.annotations.NotNull)1