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 API. The lifetime of a Provider object is controlled by the client. The lifetime of some server resources is tied to the lifetime 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 VersionVault CM API, StpProvider, and CcProvider 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.