Search in sources :

Example 1 with DeleteResponse

use of org.apache.cxf.ws.transfer.DeleteResponse in project cxf by apache.

the class ResourceLocal method delete.

@Override
public DeleteResponse delete(Delete body) {
    // Getting reference paramaters
    AddressingProperties addrProps = (AddressingProperties) ((WrappedMessageContext) context.getMessageContext()).getWrappedMessage().getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND);
    ReferenceParametersType refParams = addrProps.getToEndpointReference().getReferenceParameters();
    boolean delete = true;
    // Dialect processing
    if (body.getDialect() != null && !body.getDialect().isEmpty()) {
        if (dialects.containsKey(body.getDialect())) {
            Dialect dialect = dialects.get(body.getDialect());
            delete = dialect.processDelete(body, manager.get(refParams));
        } else {
            throw new UnknownDialect();
        }
    }
    if (delete) {
        manager.delete(refParams);
    }
    return new DeleteResponse();
}
Also used : UnknownDialect(org.apache.cxf.ws.transfer.shared.faults.UnknownDialect) DeleteResponse(org.apache.cxf.ws.transfer.DeleteResponse) WrappedMessageContext(org.apache.cxf.jaxws.context.WrappedMessageContext) FragmentDialect(org.apache.cxf.ws.transfer.dialect.fragment.FragmentDialect) UnknownDialect(org.apache.cxf.ws.transfer.shared.faults.UnknownDialect) Dialect(org.apache.cxf.ws.transfer.dialect.Dialect) AddressingProperties(org.apache.cxf.ws.addressing.AddressingProperties) ReferenceParametersType(org.apache.cxf.ws.addressing.ReferenceParametersType)

Aggregations

WrappedMessageContext (org.apache.cxf.jaxws.context.WrappedMessageContext)1 AddressingProperties (org.apache.cxf.ws.addressing.AddressingProperties)1 ReferenceParametersType (org.apache.cxf.ws.addressing.ReferenceParametersType)1 DeleteResponse (org.apache.cxf.ws.transfer.DeleteResponse)1 Dialect (org.apache.cxf.ws.transfer.dialect.Dialect)1 FragmentDialect (org.apache.cxf.ws.transfer.dialect.fragment.FragmentDialect)1 UnknownDialect (org.apache.cxf.ws.transfer.shared.faults.UnknownDialect)1