Project: stp

Package javax.wvcm

The specification for the JSR-147 Workspace Versioning and Configuration Management (WVCM) API.

See: Description

Package javax.wvcm Description

The specification for the JSR-147 Workspace Versioning and Configuration Management (WVCM) API.

The WVCM API provides a set of in-memory proxies for the persistent resources in a versioning or configuration management repository.   As a typographical convention, when an object type is stated without the qualifier "proxy" or "persistent", a lower case identifier will be used to refer to a type of persistent resource, while an upper case identifier will be used to refer to a type of proxy.  So for example "activity" and "Activity" refer to a persistent activity and an activity proxy, respectively, while "workspace" and "Workspace" refer to a persistent workspace and a workspace proxy, respectively. 

A method whose name begins with the prefix "do", as in "doCheckin", is redirected by the proxy to the persistent resource, and has no effect on the proxy itself. Unless the definition of the "do" method explicitly states otherwise, if no persistent resource exists at the location of the proxy, the "do" method MUST throw a WvcmException with a WvcmException.ReasonCode.PROPERTY_NOT_REQUESTED reason code (exceptions include resource creation and query methods).   If a persistent resource exists at the location of the proxy, and that persistent resource does not support this method, then the method MUST throw a WvcmException with a WvcmException.ReasonCode.FORBIDDEN reason code.  The "do" methods will use persistent data stored locally on the client machine whenever it is available, to avoid sending and receiving messages over the network, but clients should be programmed with the possibility that one or more network roundtrips to the server might be required when a "do" method is executed.

A method whose name does not begin with the prefix "do" operate just on the proxy itself, and has no access to the persistent resource associated with that proxy.

A method whose name begins with "get" returns the value of properties that were requested when the proxy was created. Note that this can be "stale" information if the persistent resource has been changed since the proxy was created.  For example, if a "do" request resulted in a change to any of the property values of the persistent resource of the proxy, those changes are not reflected in the existing proxy, but must be obtained in a new proxy such as by a doReadProperties request. If a caller attempts to get the value of a property from a proxy on which that property was not set and that was not created with that property as a "wanted property", then a WvcmException is thrown with a reason code of WvcmException.ReasonCode.PROPERTY_NOT_REQUESTED. If a wanted property could not be retrieved from the server, then the "get" method will throw a WvcmException with an appropriate response code and condition failure value.

Methods whose name begin with "set" (for example r.setXyx(newValue)), update the value of a proxy property, mark that property as "updated", and subsequent requests to "get" that property value from that proxy (for example, r.getXyz()) will return the new value. These updates are accumulated by a proxy, until a "doXyz" method is applied to the proxy, at which time the property updates are sent along with the "doXyz" method to be applied to the persistent resource. If the property updates succeed on the server, the "update flags" are cleared on the proxy. For the "doCreateXyz" methods that create new persistent resources, the property updates are applied after the persistent resource is created. For all other "doXyz" methods, the property updates are applied before the "doXyz" method is applied, and the "doXyz" method is only attempted if the property updates are successful.

As an example of getting and setting a property value on a persistent resource, the following example appends some text to the Resource.COMMENT property of a resource:

    Provider myProvider = ProviderFactory.createProvider("com.mycompany.myprovider.wvcm", null);

    PropertyRequest wantComment = new PropertyRequest(new PropertyRequestItem[] {

       Resource.COMMENT});

    Resource myResource = myProvider.resource(

       myProvider.location("/my/resource/loc")).doReadProperties(wantComment, null);

    String comment = myResource.getComment();

    myResource.setComment(comment + "addition to comment");

    myResource.doWriteProperties(null);     

 
 
Generated Tue 7-Feb-2017 08:52 PM

Copyright © IBM 2017. All rights reserved.