Querying OSLC Resources

Once an OSLC client is obtained, you can query and update OSLC resources by executing requests.

MDAccess for OSLC provides generic requests to query and update OSLC resources:

MDAccess for OSLC also provides ready to use requests for the most common tasks involved when communicating with an OSLC application:

Below is a sample code listing Requirement Management projects in an OSLC application:

	System.out.println("Reading Root Services...");
	RootServices rootServices = new GetRootServices<RootServices>(URI.create("https://myserver/rootservices"), RootServices.class).call();
	
	URI catalogLocation = (URI) rootServices.getExtendedProperties().get(
		new QName("http://open-services.net/xmlns/rm/1.0/", "rmServiceProviders"));
	
	System.out.println("Reading Catalog...");
	ServiceProviderCatalog catalog = new GetServiceProviderCatalog(client, catalogLocation).get();
	System.out.println("Catalog has " + catalog.getServiceProviders().length + " projects:");
	for (ServiceProvider provider : catalog.getServiceProviders()) {
	    System.out.println(" - " + provider.getTitle() + ": " + provider.getAbout());
	}

Related tasks
Creating an OSLC client
Using OSLC Configurations

Related reference
API Reference