Getting a provider

A client must get a Provider object before it can get resource proxies and access resources.

A Provider is a temporary object that represents a single identity within a single client process that interacts with one or more repositories through the HCL Compass CM API. The life time of a Provider object is controlled by the client. The life time of some server resources is tied to the life time of a Provider.

The following code example creates a Provider object for a session on a server by calling ProviderFactory.createProvider().
Provider getProvider()
throws WvcmException
{
	Provider provider = null;

	// Set up the parameters for instantiating a provider.
	// The provider name is the fully-qualified class name of the provider.
	String providerName = StpProvider.PROVIDER_CLASS;

	// A Callback provides authentication information to the provider.
	Callback callback = new MyCallback();   

	// The provider factory class instantiates a provider. 
	provider = ProviderFactory.createProvider(providerName, callback);
	return provider;
}

After a provider is instantiated, the client application can make requests to the provider for resource proxies. In the HCL Compass CM API, StpProvider, CcProvider, and CqProvider are product-specific extensions to the WVCM Provider. These extensions include methods for navigating between the different types of providers and for navigating product-specific resource types and capabilities.