Exemple #1
0
        private static TaskType[] listTasks(modelPortType modelPort)
        {
            // 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)
            ObjectSelectorType selector = new ObjectSelectorType();

            selector.path = createItemPathType("nextRunStartTimestamp");
            getNextScheduledTimeOption.selector = selector;

            GetOperationOptionsType selectorOptions = new GetOperationOptionsType();

            selectorOptions.retrieve           = RetrieveOptionType.include;
            selectorOptions.retrieveSpecified  = true;
            getNextScheduledTimeOption.options = selectorOptions;

            SelectorQualifiedGetOptionType[] operationOptions = new SelectorQualifiedGetOptionType[] { getNextScheduledTimeOption };

            searchObjects         request  = new searchObjects(TASK_TYPE, null, operationOptions);
            searchObjectsResponse response = modelPort.searchObjects(request);

            ObjectListType  objectList = response.objectList;
            List <TaskType> tasks      = new List <TaskType>();

            foreach (ObjectType1 object1 in response.objectList.@object)
            {
                tasks.Add((TaskType)object1);
            }
            return(tasks.ToArray());
        }
Exemple #2
0
        private static TaskType[] listTasks(modelPortType modelPort) 
        {
            // 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)
            ObjectSelectorType selector = new ObjectSelectorType();
            selector.path = createItemPathType("nextRunStartTimestamp");
            getNextScheduledTimeOption.selector = selector;
        
            GetOperationOptionsType selectorOptions = new GetOperationOptionsType();
            selectorOptions.retrieve = RetrieveOptionType.include;
            selectorOptions.retrieveSpecified = true;
            getNextScheduledTimeOption.options = selectorOptions;

            SelectorQualifiedGetOptionType[] operationOptions = new SelectorQualifiedGetOptionType[] { getNextScheduledTimeOption };

            searchObjects request = new searchObjects(TASK_TYPE, null, operationOptions);
            searchObjectsResponse response = modelPort.searchObjects(request);

            ObjectListType objectList = response.objectList;
            List<TaskType> tasks = new List<TaskType>();
            foreach (ObjectType1 object1 in response.objectList.@object)
            {
                tasks.Add((TaskType)object1);
            }
            return tasks.ToArray();
        }