Class 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
    • Constructor Detail

      • BulkResponseImpl

        public BulkResponseImpl()
    • 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:
        getCollection in interface javax.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:
        getExceptions in interface javax.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.JAXRException
        Returns true if the reponse is a partial response due to a large result set.
        Specified by:
        isPartialResponse in interface javax.xml.registry.BulkResponse
        Throws:
        javax.xml.registry.JAXRException
      • setPartialResponse

        public void setPartialResponse​(boolean isPartial)
                                throws javax.xml.registry.JAXRException
        Sets 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.JAXRException
        Updates 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