Project: stp

javax.wvcm
Class PropertyRequestItem.PropertyRequest

Object
  extended by javax.wvcm.PropertyRequestItem.PropertyRequest
All Implemented Interfaces:
Feedback, PropertyRequestItem
Enclosing interface:
PropertyRequestItem

public static class PropertyRequestItem.PropertyRequest
extends Object
implements PropertyRequestItem, Feedback

A map of PropertyName to PropertyRequest objects, used to specify one or more properties whose values are to be read from a resource.

If the property value is itself a resource (or a data structure containing resources), then the PropertyRequest value of the entry for the PropertyName of that property specifies the properties that should be retrieved for that resource. Such a request can be constructed using the PropertyNameList.PropertyName.nest(javax.wvcm.PropertyRequestItem...) method.

For example, the following code fragment creates a PropertyRequest that specifies a request for the Resource.CREATOR_DISPLAY_NAME, ControllableResource.CHECKED_IN, and Resource.LAST_MODIFIED properties, as well as the Version.VERSION_NAME and Resource.CREATION_DATE properties of the resource that is the value of the ControllableResource.CHECKED_IN property:

  PropertyRequest props = new PropertyRequest(
      Resource.CREATOR_DISPLAY_NAME,
      ControllableResource.CHECKED_IN.nest(
           Version.VERSION_NAME,
           Resource.CREATION_DATE),
      Resource.LAST_MODIFIED);
 


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.wvcm.PropertyRequestItem
PropertyRequestItem.NestedPropertyName<T>, PropertyRequestItem.PropertyRequest
 
Field Summary
static PropertyRequestItem.PropertyRequest EMPTY
          An empty PropertyRequest.
 
Constructor Summary
PropertyRequestItem.PropertyRequest(PropertyNameList.PropertyName<?>[] items)
          Constructs a PropertyRequest from an array of PropertyRequestItem objects.
PropertyRequestItem.PropertyRequest(PropertyRequestItem... items)
          Constructs a PropertyRequest from an array of PropertyRequestItem objects.
PropertyRequestItem.PropertyRequest(PropertyRequestItem.NestedPropertyName<?>[] items)
          Constructs a PropertyRequest from an array of PropertyRequestItem objects.
 
Method Summary
 boolean equals(Object object)
           
 String format(String fmt, Object... arguments)
          Format a message, using MessageFormat conventions
 PropertyRequestItem.PropertyRequest get(PropertyNameList.PropertyName<?> key)
           
 PropertyRequestItem.PropertyRequest getPropertyRequestForModified()
          Called by the method to determine what properties to include in the argument to Feedback.notifyIsModified(javax.wvcm.Resource).
 PropertyRequestItem.PropertyRequest getPropertyRequestForResult()
          Called by the method to determine what properties to include in the result of the operation.
 int hashCode()
           
 boolean isAbortRequested()
          Called by the method to determine whether the client has requested that the method be aborted.
 boolean isEmpty()
           
 Feedback nest()
          Create a Feedback object like this Feedback object but with no result property request and no progress notification.
 Feedback nest(int percentCompleted)
          Create a Feedback object like this Feedback object for sub-progress notification but with a null resultPropertyRequest.
 Feedback nest(PropertyRequestItem.PropertyRequest propertyRequest)
          Create a Feedback object like this Feedback object but with the specified property request and no progress notification.
 Feedback nest(PropertyRequestItem.PropertyRequest resultPropertyRequest, int percentCompleted)
          Create a Feedback object like this Feedback object for sub-progress notification, but with the specified resultPropertyRequest.
 void notifyActive(String message)
          Called by the method to indicate work is progressing, but that it cannot estimate what percentage is completed.
 void notifyIsModified(Resource resource)
          Called by the method to indicate that the specified resource has been modified by the method.
 void notifyPercentComplete(int percentComplete)
          Called by the method to indicate the specified percentage of the work is complete.
 void notifyWarning(String message)
          Called by the method to indicate a warning.
 int size()
           
 PropertyRequestItem.NestedPropertyName<?>[] toArray()
          Returns an array containing all of the elements in this PropertyRequest.
 Map<PropertyNameList.PropertyName<?>,PropertyRequestItem.PropertyRequest> toMap()
           
 String toString()
           
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final PropertyRequestItem.PropertyRequest EMPTY
An empty PropertyRequest.

Constructor Detail

PropertyRequestItem.PropertyRequest

public PropertyRequestItem.PropertyRequest(PropertyNameList.PropertyName<?>[] items)
Constructs a PropertyRequest from an array of PropertyRequestItem objects. If there are two entries for the same PropertyName, the PropertyRequest values for those entries are logically merged.

Parameters:
items - The array of PropertyRequestItem objects that are to be combined into a new PropertyRequest. A null or empty array produces an empty PropertyRequest.

PropertyRequestItem.PropertyRequest

public PropertyRequestItem.PropertyRequest(PropertyRequestItem... items)
Constructs a PropertyRequest from an array of PropertyRequestItem objects. If there are two entries for the same PropertyName, the PropertyRequest values for those entries are logically merged.

Parameters:
items - The array of PropertyRequestItem objects that are to be combined into a new PropertyRequest. A null or empty array produces an empty PropertyRequest.

PropertyRequestItem.PropertyRequest

public PropertyRequestItem.PropertyRequest(PropertyRequestItem.NestedPropertyName<?>[] items)
Constructs a PropertyRequest from an array of PropertyRequestItem objects. If there are two entries for the same PropertyName, the PropertyRequest values for those entries are logically merged.

Parameters:
items - The array of PropertyRequestItem objects that are to be combined into a new PropertyRequest. A null or empty array produces an empty PropertyRequest.
Method Detail

equals

public boolean equals(Object object)
Overrides:
equals in class Object

format

public String format(String fmt,
                     Object... arguments)
Description copied from interface: Feedback
Format a message, using MessageFormat conventions

Specified by:
format in interface Feedback
Parameters:
fmt - a message that could be presented to a user. The message may be null.
arguments - objects to replace the {0},{1}, ... patterns in the message.

get

public PropertyRequestItem.PropertyRequest get(PropertyNameList.PropertyName<?> key)
See Also:
Map.get(java.lang.Object)

getPropertyRequestForModified

public PropertyRequestItem.PropertyRequest getPropertyRequestForModified()
Description copied from interface: Feedback
Called by the method to determine what properties to include in the argument to Feedback.notifyIsModified(javax.wvcm.Resource). The value of Feedback.getPropertyRequestForModified() is initialized when the Feedback object is created and is never changed. To avoid overloading the server, the client should limit this property list to the minimum set of properties needed to identify whether the resource is currently being displayed in the client GUI, and the client would then use Resource.doReadProperties(javax.wvcm.Feedback) to retrieve the information necessary to update the GUI for those resources that are currently being displayed.

Specified by:
getPropertyRequestForModified in interface Feedback
Returns:
the list of properties that the client wants to be available in the resource argument of Feedback.notifyIsModified(javax.wvcm.Resource). If this is null, no modification notifications are generated.

getPropertyRequestForResult

public PropertyRequestItem.PropertyRequest getPropertyRequestForResult()
Description copied from interface: Feedback
Called by the method to determine what properties to include in the result of the operation. The value of Feedback.getPropertyRequestForModified() is initialized when the Feedback object is created and is never changed.

Specified by:
getPropertyRequestForResult in interface Feedback
Returns:
the list of properties that the client wants to be available in the result of the operation. If this method returns null, only the Resource.RESOURCE_IDENTIFIER property is retrieved.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

isAbortRequested

public boolean isAbortRequested()
Description copied from interface: Feedback
Called by the method to determine whether the client has requested that the method be aborted. The Feedback object must provide a mechanism for the client to request that a method be aborted, such as defining a requestAbort() method on the Feedback object that a thread in the client can invoke. If the method aborted because isAbortRequested() was true, the method must throw WvcmException with a WvcmException.ReasonCode.ABORTED ReasonCode. Note that when a client has requested that a method be aborted, there is no guarantee that the method will actually abort. It may instead complete successfully, or it may fail for a different reason, as indicated by throwing WvcmException with a reason code other than WvcmException.ReasonCode.ABORTED.

Specified by:
isAbortRequested in interface Feedback
Returns:
true if the client has requested that the method be aborted.

isEmpty

public boolean isEmpty()
See Also:
Map.isEmpty()

nest

public Feedback nest()
Description copied from interface: Feedback
Create a Feedback object like this Feedback object but with no result property request and no progress notification.

Specified by:
nest in interface Feedback

nest

public Feedback nest(int percentCompleted)
Description copied from interface: Feedback
Create a Feedback object like this Feedback object for sub-progress notification but with a null resultPropertyRequest.

Specified by:
nest in interface Feedback
Returns:
a Feedback object like this Feedback object for sub-progress notification but with a null resultPropertyRequest.

nest

public Feedback nest(PropertyRequestItem.PropertyRequest propertyRequest)
Description copied from interface: Feedback
Create a Feedback object like this Feedback object but with the specified property request and no progress notification.

Specified by:
nest in interface Feedback

nest

public Feedback nest(PropertyRequestItem.PropertyRequest resultPropertyRequest,
                     int percentCompleted)
Description copied from interface: Feedback
Create a Feedback object like this Feedback object for sub-progress notification, but with the specified resultPropertyRequest.

Specified by:
nest in interface Feedback
Returns:
a Feedback object like this Feedback object for sub-progress notification, but with the specified resultPropertyRequest.

notifyActive

public void notifyActive(String message)
Description copied from interface: Feedback
Called by the method to indicate work is progressing, but that it cannot estimate what percentage is completed.

Specified by:
notifyActive in interface Feedback
Parameters:
message - a message that could be presented to a user.

notifyIsModified

public void notifyIsModified(Resource resource)
Description copied from interface: Feedback
Called by the method to indicate that the specified resource has been modified by the method. This is primarily intended to be used by a GUI client, so that the client can update its display of resources that have been modified by the method. This function may be called multiple times during the execution of the method, usually indicating that the specified resource has been modified more than once by the method.

Specified by:
notifyIsModified in interface Feedback
Parameters:
resource - a resource that has been modified by the task. The resource must not be null.

notifyPercentComplete

public void notifyPercentComplete(int percentComplete)
Description copied from interface: Feedback
Called by the method to indicate the specified percentage of the work is complete. Note that there is no guarantee that this accurately reflects the amount of work completed.

Specified by:
notifyPercentComplete in interface Feedback
Parameters:
percentComplete - a value between 0 and 100, where 100 means the work is complete.

notifyWarning

public void notifyWarning(String message)
Description copied from interface: Feedback
Called by the method to indicate a warning.

Specified by:
notifyWarning in interface Feedback
Parameters:
message - a message that describes an anomalous situation.

size

public int size()
See Also:
Map.size()

toArray

public PropertyRequestItem.NestedPropertyName<?>[] toArray()
Returns an array containing all of the elements in this PropertyRequest.


toMap

public Map<PropertyNameList.PropertyName<?>,PropertyRequestItem.PropertyRequest> toMap()

toString

public String toString()
Overrides:
toString in class Object

Generated Wed 11-Jun-2014 01:18 AM

Copyright © IBM 2014. All rights reserved.