BulkResponse | javax.xml.registry |
JAXR 1.0; JWSDP 1.0, J2EE 1.4 |
public interface BulkResponse extends JAXRResponse { // Public Instance Methods public abstract Collection getCollection( ) throws JAXRException; // L0 public abstract Collection getExceptions( ) throws JAXRException; // L0 public abstract boolean isPartialResponse( ) throws JAXRException; // L0 }
BulkResponse is an interface derived from JAXRResponse that is returned by the JAXR API methods that perform registry queries and by some of the registry update methods. A BulkResponse contains a set of RegistryObject s that represent the results of a search or of an update operation such as a delete, where the objects that were deleted are returned. These objects can be obtained by calling the getCollection( ) method. If any errors are encountered while the operation is in progress, one or more RegistryException s may also be included in the response. These exceptions can be retrieved using the getExceptions( ) method. It is possible for an operation to succeed in respect to some objects, but fail for others. In this case, both the getCollection( ) and getExceptions( ) methods return nonempty collections. The isPartialResponse( ) method returns true if the registry did not return all possible responses.
If a request is made on a synchronous connection, the caller is blocked until the JAXR provider receives a reply, at which point the content of the BulkResponse is valid. In the case of an asynchronous response, the getCollection( ) and getExceptions( ) methods block until the operation is complete. To avoid being blocked, the caller may use the isAvailable( ) method, which returns false until the results of the operation are available. An alternative is to monitor the return value of the getStatus( ) method, which returns STATUS_UNAVAILABLE while the operation is in progress. Once the operation has completed according to the isAvailable( ) method, the caller may use the value returned by getStatus( ) to determine its success or failure, before retrieving the results or exceptions, as appropriate. The status is set to STATUS_SUCCESS to indicate that the operation fully succeeded. STATUS_FAILURE indicates that there is at least one exception in the collection returned by getExceptions( ) ; there may also be RegistryObject s available from the getCollection( ) method. In other words, this status may represent partial success. STATUS_WARNING is used to indicate that the request was successful, but may only contain a partial response (i.e., isPartial( ) would return true).
When an asynchronous request is initiated, the JAXR provider allocates a unique identifier to it. This identifier is of use mainly to the provider itself, but application code can retrieve its value from the getRequestId( ) method.
Too many methods to list.