Search in sources :

Example 1 with OptionObjectSelectorType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.OptionObjectSelectorType 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 2 with OptionObjectSelectorType

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

the class GetOperationOptionsUtil method selectorToSelectorType.

private static OptionObjectSelectorType selectorToSelectorType(ObjectSelector selector) {
    if (selector == null) {
        return null;
    }
    OptionObjectSelectorType selectorType = new OptionObjectSelectorType();
    selectorType.setPath(new ItemPathType(selector.getPath()));
    return selectorType;
}
Also used : ItemPathType(com.evolveum.prism.xml.ns._public.types_3.ItemPathType) OptionObjectSelectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.OptionObjectSelectorType)

Example 3 with OptionObjectSelectorType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.OptionObjectSelectorType 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 4 with OptionObjectSelectorType

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

the class GetOperationOptionsUtil method selectorOptionToSelectorQualifiedGetOptionType.

private static SelectorQualifiedGetOptionType selectorOptionToSelectorQualifiedGetOptionType(SelectorOptions<GetOperationOptions> selectorOption) {
    OptionObjectSelectorType selectorType = selectorToSelectorType(selectorOption.getSelector());
    GetOperationOptionsType getOptionsType = getOptionsToGetOptionsType(selectorOption.getOptions());
    SelectorQualifiedGetOptionType selectorOptionType = new SelectorQualifiedGetOptionType();
    selectorOptionType.setOptions(getOptionsType);
    selectorOptionType.setSelector(selectorType);
    return selectorOptionType;
}
Also used : GetOperationOptionsType(com.evolveum.midpoint.xml.ns._public.common.common_3.GetOperationOptionsType) OptionObjectSelectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.OptionObjectSelectorType) SelectorQualifiedGetOptionType(com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionType)

Aggregations

OptionObjectSelectorType (com.evolveum.midpoint.xml.ns._public.common.common_3.OptionObjectSelectorType)4 GetOperationOptionsType (com.evolveum.midpoint.xml.ns._public.common.common_3.GetOperationOptionsType)3 SelectorQualifiedGetOptionType (com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionType)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 SelectorQualifiedGetOptionsType (com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType)2 TaskType (com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType)2 Collection (java.util.Collection)2 Holder (javax.xml.ws.Holder)2 ItemPathType (com.evolveum.prism.xml.ns._public.types_3.ItemPathType)1