EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

Programmatically retrieving jobs from the Intelligence Server using the Web SDK


Community Admin

• Strategy


This Java snippet demonstrates how the JobSource can be used to retrieve information on the current jobs in an Intelligence Server, tied to the current WebIServerSession.

This Java snippet demonstrates how the JobSource can be used to retrieve information on the current jobs in an Intelligence Server, tied to the current WebIServerSession:


// Fetch a WebObjectsFactory instance from the current WebIServerSession
WebObjectsFactory factory = serverSession.getFactory();

// Get the job source object
JobSource source = (JobSource) factory.getMonitorSource(EnumWebMonitorType.WebMonitorTypeJob);

// Set up the count settings to group the counts by user name, then by project name
CountSettings settings = source.getCountSettings();
settings.add(EnumDSSXMLJobInfo.DssXmlJobInfoUserName);
settings.add(EnumDSSXMLJobInfo.DssXmlJobInfoProjectName);

// Set level flag to only obtain count information
source.setLevel(EnumDSSXMLLevelFlags.DssXmlCountLevel);

try {
	// Sends the request to Intelligence Server to retrieve job information
	JobResults results = source.getJobs();

	// Retrieve the count summary object and loop through it
	CountSummary summary = results.getCountSummary();

	System.out.println("Total Jobs: " + summary.getCount());

	// Loop through each job that we've found
	for (int i = 0; i < summary.size(); i++) {

		// Get the count info object and print out its information
		CountInfo outerInfo = summary.get(i);
		System.out.println("\tUser " + outerInfo.getValue() + ": " + outerInfo.getCount() + " job(s)");

		// Loop through its children count info objects
		for (int j = 0; j < outerInfo.size(); j++) {
		
			CountInfo innerInfo = outerInfo.get(j);
			System.out.println("\t\tProject \"" + innerInfo.getValue() + "\":" + innerInfo.getCount() + " job(s)");
		}
	}
	
} catch (WebObjectsAdminException woae) {
	woae.printStackTrace();
}

Additional Information: Monitoring Interfaces


Comment

0 comments

Details

Example

Published:

April 26, 2017

Last Updated:

February 16, 2024