Using OSLC Configurations

MDAccess for OSLC supports configuration management. It provides facilities to present available configurations in a user interface and allows a user selecting one of them.

To query or update an OSLC resource in a specific configuration, you just need to add an oslc_config.context query parameter on the resource URI to reference the desired configuration.

Querying a non-versioned OSLC resource:

	URI resourceUri = URI.create("https://myServer/myResource");
	Object resource = new GetResource(client, resourceUri).get();

Querying a versioned OSLC resource in a specific configuration:

	URI versionResourceUri = URI.create("https://myServer/myResource?oslc_config.context=https://myServer/myConfiguration");
	Object versionedResource = new GetResource(client, versionResourceUri).get();

MDAccess for OSLC provides a helper method to obtain a versioned resource URI, which you are recommended to use:

	URI configurationUri = URI.create("https://myServer/myConfiguration");
	URI resourceUri = URI.create("https://myServer/myResource");
	URI versionResourceUri = OslcConfig.addContext(resourceUri, configurationUri);
	Object versionedResource = new GetResource(client, versionResourceUri).get();

See the OSLC Configuration Management specification for details:
https://tools.oasis-open.org/version-control/browse/wsvn/oslc-core/trunk/specs/config/oslc-config-mgt.html

Related tasks
Querying OSLC Resources
Selecting OSLC Configurations

Related reference
API Reference