/** * Method to generate the ContactEntry object for batch delete. * * @param messageContext ESB message context. * @param entryElement OMElement object containing a batch entry. * @return ContactEntry object for batch operations. */ private ContactEntry getDeleteContact(final MessageContext messageContext, final OMElement entryElement) { final ContactEntry contactEntry = generateContactEntry(messageContext, entryElement); contactEntry.setEtag(Constants.ETAG); // Set the batch related details. BatchUtils.setBatchOperationType(contactEntry, BatchOperationType.DELETE); final OMElement batchIdElem = entryElement.getFirstChildWithName(new QName(Constants.ID)); if (batchIdElem != null) { BatchUtils.setBatchId(contactEntry, batchIdElem.getText()); } return contactEntry; }
/** * Method to generate the ContactEntry object for batch update. * * @param messageContext ESB message context. * @param entryElement OMElement object containing a batch entry. * @return ContactEntry object for batch operations. * @throws ParseException unexpected issue in parsing. * @throws XMLStreamException unexpected processing conditions. */ private ContactEntry getUpdateContact(final MessageContext messageContext, final OMElement entryElement) throws ParseException, XMLStreamException { final ContactEntry contactEntry = generateContactEntry(messageContext, entryElement); contactEntry.setEtag(Constants.ETAG); // Set new details. setContactDetails(contactEntry, entryElement); // Set the batch related details. BatchUtils.setBatchOperationType(contactEntry, BatchOperationType.UPDATE); final OMElement batchIdElem = entryElement.getFirstChildWithName(new QName(Constants.ID)); if (batchIdElem != null) { BatchUtils.setBatchId(contactEntry, batchIdElem.getText()); } return contactEntry; }
contactEntry.setEtag(Constants.ETAG); contactEntry.delete(); messageContext.getEnvelope().detach();
contactEntry.setEtag(Constants.ETAG);
contactEntry.setEtag(Constants.ETAG);