Package com.sun.xml.registry.common
Class BulkResponseImpl
- java.lang.Object
-
- com.sun.xml.registry.common.JAXRResponseImpl
-
- com.sun.xml.registry.common.BulkResponseImpl
-
- All Implemented Interfaces:
javax.xml.registry.BulkResponse,javax.xml.registry.JAXRResponse
public class BulkResponseImpl extends JAXRResponseImpl implements javax.xml.registry.BulkResponse
Implementation of BulkResponse.- Author:
- Farrukh S. Najmi
-
-
Field Summary
-
Fields inherited from class com.sun.xml.registry.common.JAXRResponseImpl
requestId, status
-
-
Constructor Summary
Constructors Constructor Description BulkResponseImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCollection(Collection bCollection)Helper method for adding to the response's already existing collection.voidaddException(Collection bException)Add multiple exceptions to exception collection.voidaddException(javax.xml.registry.JAXRException except)Add single exception to exceptions collection.static javax.xml.registry.BulkResponsecombineBulkResponses(Collection responses)Utility method for combining the contents of many bulk responses into one.CollectiongetCollection()Get the Collection of of objects returned as a response of a bulk operation.CollectiongetExceptions()Get the JAXRException in case of partial commit.booleanisPartialResponse()Returns true if the reponse is a partial response due to a large result set.voidsetCollection(Collection collection)Set the collection of the bulk response.voidsetExceptions(Collection bException)Add multiple exceptions to exception collection.voidsetPartialResponse(boolean isPartial)Sets isPartial, which is true in the case of a large result set.voidsetPartialResponse(String isPartial)Bindings classes return a string rather than boolean, which is passed here to set isPartial.voidupdateResponse(javax.xml.registry.BulkResponse update)Updates information in BulkResponse in the case of asynchronous connection.-
Methods inherited from class com.sun.xml.registry.common.JAXRResponseImpl
getRequestId, getStatus, isAvailable, setRequestId, setStatus
-
-
-
-
Method Detail
-
getCollection
public Collection getCollection() throws javax.xml.registry.JAXRException
Get the Collection of of objects returned as a response of a bulk operation. This method should block when the response content is not yet available.- Specified by:
getCollectionin interfacejavax.xml.registry.BulkResponse- Throws:
javax.xml.registry.JAXRException
-
setCollection
public void setCollection(Collection collection)
Set the collection of the bulk response. This should only be set before sending to the client. Setting the collection after returning to the client should be done through the updateResponse() method.
-
addCollection
public void addCollection(Collection bCollection)
Helper method for adding to the response's already existing collection. This method should only be called before returning the response to the client.
-
getExceptions
public Collection getExceptions() throws javax.xml.registry.JAXRException
Get the JAXRException in case of partial commit. Return null if none. This method should block when the response content is not yet available.- Specified by:
getExceptionsin interfacejavax.xml.registry.BulkResponse- Throws:
javax.xml.registry.JAXRException
-
addException
public void addException(Collection bException)
Add multiple exceptions to exception collection. This method should only be called before returning the response to the client.
-
setExceptions
public void setExceptions(Collection bException)
Add multiple exceptions to exception collection. This method should only be called before returning the response to the client.
-
addException
public void addException(javax.xml.registry.JAXRException except)
Add single exception to exceptions collection. This method should only be called before returning the response to the client.
-
isPartialResponse
public boolean isPartialResponse() throws javax.xml.registry.JAXRExceptionReturns true if the reponse is a partial response due to a large result set.- Specified by:
isPartialResponsein interfacejavax.xml.registry.BulkResponse- Throws:
javax.xml.registry.JAXRException
-
setPartialResponse
public void setPartialResponse(boolean isPartial) throws javax.xml.registry.JAXRExceptionSets isPartial, which is true in the case of a large result set. This should be set before setting the collection when creating the bulk response.- Throws:
javax.xml.registry.JAXRException
-
setPartialResponse
public void setPartialResponse(String isPartial) throws javax.xml.registry.JAXRException
Bindings classes return a string rather than boolean, which is passed here to set isPartial. This should be set before setting the collection when creating a bulk response.- Throws:
javax.xml.registry.JAXRException
-
updateResponse
public void updateResponse(javax.xml.registry.BulkResponse update) throws javax.xml.registry.JAXRExceptionUpdates information in BulkResponse in the case of asynchronous connection. If connection is asynchronous, the response should be sent with status = STATUS_UNAVAILABLE. The provider calls the update method to store the information, reset the status, and notify() the thread in case a client has called a method resulting in a wait() until the information is available.- Throws:
javax.xml.registry.JAXRException
-
combineBulkResponses
public static javax.xml.registry.BulkResponse combineBulkResponses(Collection responses)
Utility method for combining the contents of many bulk responses into one. This is useful for JAXR calls that will include multiple calls to the registry for information. If any of the given responses have isPartial set to true, then the returned response will have isPartial set to true as well. This method does not set requestId on the returned bulk response. Status for the returned response is determined after the information has been filled in as follows: 1. default = STATUS_SUCCESS 2. if partial, STATUS_WARNING 3. if exceptions.size() > 0, STATUS_FAILURE- Parameters:
responses- A Collection of BulkResponses- Returns:
- A BulkResponse containing all the included information
-
-