/** * Obtain id from reference parameters of the ws-a to address * Requires the existance of ws-a interceptors on dispatch path to provide access * to the ws-a headers * @param contextMap the current invocation or message context * @return the id from the reference parameters of the ws-a-to address or null if not found * @see org.apache.cxf.transport.MultiplexDestination#getId(java.util.Map) */ public String getId(Map<String, Object> contextMap) { String markedParam = null; AddressingProperties maps = (AddressingProperties)contextMap .get(ADDRESSING_PROPERTIES_INBOUND); if (null != maps) { EndpointReferenceType toEpr = maps.getToEndpointReference(); if (null != toEpr) { markedParam = extractStringElementFromAny(MULTIPLEX_ID_QNAME, toEpr); } } return markedParam; }
/** * Obtain id from reference parameters of the ws-a to address * Requires the existance of ws-a interceptors on dispatch path to provide access * to the ws-a headers * @param contextMap the current invocation or message context * @return the id from the reference parameters of the ws-a-to address or null if not found * @see org.apache.cxf.transport.MultiplexDestination#getId(java.util.Map) */ public String getId(Map<String, Object> contextMap) { String markedParam = null; AddressingProperties maps = (AddressingProperties)contextMap .get(ADDRESSING_PROPERTIES_INBOUND); if (null != maps) { EndpointReferenceType toEpr = maps.getToEndpointReference(); if (null != toEpr) { markedParam = extractStringElementFromAny(MULTIPLEX_ID_QNAME, toEpr); } } return markedParam; }
/** * Obtain id from reference parameters of the ws-a to address * Requires the existance of ws-a interceptors on dispatch path to provide access * to the ws-a headers * @param contextMap the current invocation or message context * @return the id from the reference parameters of the ws-a-to address or null if not found * @see org.apache.cxf.transport.MultiplexDestination#getId(java.util.Map) */ public String getId(Map<String, Object> contextMap) { String markedParam = null; AddressingProperties maps = (AddressingProperties)contextMap .get(SERVER_ADDRESSING_PROPERTIES_INBOUND); if (null != maps) { EndpointReferenceType toEpr = maps.getToEndpointReference(); if (null != toEpr) { markedParam = extractStringElementFromAny(MULTIPLEX_ID_QNAME, toEpr); } } return markedParam; }
/** * Obtain id from reference parameters of the ws-a to address * Requires the existance of ws-a interceptors on dispatch path to provide access * to the ws-a headers * @param contextMap the current invocation or message context * @return the id from the reference parameters of the ws-a-to address or null if not found * @see org.apache.cxf.transport.MultiplexDestination#getId(java.util.Map) */ public String getId(Map<String, Object> contextMap) { String markedParam = null; AddressingProperties maps = (AddressingProperties)contextMap .get(SERVER_ADDRESSING_PROPERTIES_INBOUND); if (null != maps) { EndpointReferenceType toEpr = maps.getToEndpointReference(); if (null != toEpr) { markedParam = extractStringElementFromAny(MULTIPLEX_ID_QNAME, toEpr); } } return markedParam; }
public List<Object> getReferenceParameters() { List<Object> list = new LinkedList<Object>(); ReferenceParametersType refParams = implementation.getToEndpointReference().getReferenceParameters(); if (refParams != null) { List<Object> any = refParams.getAny(); if (any != null) { list.addAll(any); } } return list; }
private void decodeReferenceParameters(Set<Element> referenceParameterHeaders, AddressingProperties maps, Unmarshaller unmarshaller) throws JAXBException { EndpointReferenceType toEpr = maps.getToEndpointReference(); if (null != toEpr) { for (Element e : referenceParameterHeaders) { if (DOMUtils.getChild(e, Node.ELEMENT_NODE) == null) { JAXBElement<String> el = unmarshaller.unmarshal(e, String.class); ContextUtils.applyReferenceParam(toEpr, el); } else { ContextUtils.applyReferenceParam(toEpr, e); } } } }
private void decodeReferenceParameters(Set<Element> referenceParameterHeaders, AddressingProperties maps, Unmarshaller unmarshaller) throws JAXBException { EndpointReferenceType toEpr = maps.getToEndpointReference(); if (null != toEpr) { for (Element e : referenceParameterHeaders) { if (DOMUtils.getChild(e, Node.ELEMENT_NODE) == null) { JAXBElement<String> el = unmarshaller.unmarshal(e, String.class); ContextUtils.applyReferenceParam(toEpr, el); } else { ContextUtils.applyReferenceParam(toEpr, e); } } } }
Element header = null; EndpointReferenceType toEpr = maps.getToEndpointReference(); if (null != toEpr) { ReferenceParametersType params = toEpr.getReferenceParameters();
public void addReferenceParameter(Element refParam) { EndpointReferenceType eprt = implementation.getToEndpointReference(); ReferenceParametersType refParams = eprt.getReferenceParameters(); if (refParams == null) { refParams = new ReferenceParametersType(); eprt.setReferenceParameters(refParams); } eprt.getReferenceParameters().getAny().add(refParam); //implementation.getToEndpointReference().getReferenceParameters().getAny().add(refParam); }
Element header = null; EndpointReferenceType toEpr = maps.getToEndpointReference(); if (null != toEpr) { ReferenceParametersType params = toEpr.getReferenceParameters();
@Override public GetResponse get(Get body) { // Getting reference paramaters AddressingProperties addrProps = (AddressingProperties) ((WrappedMessageContext) context .getMessageContext()).getWrappedMessage() .getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND); ReferenceParametersType refParams = addrProps .getToEndpointReference() .getReferenceParameters(); GetResponse response = new GetResponse(); // Getting representation from the ResourceManager Representation representation = manager.get(refParams); // Dialect processing if (body.getDialect() != null && !body.getDialect().isEmpty()) { if (dialects.containsKey(body.getDialect())) { Dialect dialect = dialects.get(body.getDialect()); // Send fragment of resource instead it's representation. response.getAny().add(dialect.processGet(body, representation)); } else { throw new UnknownDialect(); } } else { // Send representation obtained from ResourceManager. response.setRepresentation(representation); } return response; }
@Override public GetResponse get(Get body) { // Getting reference paramaters AddressingProperties addrProps = (AddressingProperties) ((WrappedMessageContext) context .getMessageContext()).getWrappedMessage() .getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND); ReferenceParametersType refParams = addrProps .getToEndpointReference() .getReferenceParameters(); GetResponse response = new GetResponse(); // Getting representation from the ResourceManager Representation representation = manager.get(refParams); // Dialect processing if (body.getDialect() != null && !body.getDialect().isEmpty()) { if (dialects.containsKey(body.getDialect())) { Dialect dialect = dialects.get(body.getDialect()); // Send fragment of resource instead it's representation. response.getAny().add(dialect.processGet(body, representation)); } else { throw new UnknownDialect(); } } else { // Send representation obtained from ResourceManager. response.setRepresentation(representation); } return response; }
@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(); }
@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(); }
@Override public PutResponse put(Put body) { // Getting reference paramaters AddressingProperties addrProps = (AddressingProperties) ((WrappedMessageContext) context .getMessageContext()).getWrappedMessage() .getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND); ReferenceParametersType refParams = addrProps .getToEndpointReference() .getReferenceParameters(); // Getting representation from the ResourceManager Representation storedRepresentation = manager.get(refParams); // Getting representation from the incoming SOAP message. This representation will be stored. Representation putRepresentation = body.getRepresentation(); // Dialect processing if (body.getDialect() != null && !body.getDialect().isEmpty()) { if (dialects.containsKey(body.getDialect())) { Dialect dialect = dialects.get(body.getDialect()); putRepresentation = dialect.processPut(body, storedRepresentation); } else { throw new UnknownDialect(); } } ValidAndTransformHelper.validationAndTransformation( resourceTypeIdentifiers, putRepresentation, storedRepresentation); manager.put(refParams, putRepresentation); PutResponse response = new PutResponse(); response.setRepresentation(putRepresentation); return response; }
@Override public PutResponse put(Put body) { // Getting reference paramaters AddressingProperties addrProps = (AddressingProperties) ((WrappedMessageContext) context .getMessageContext()).getWrappedMessage() .getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND); ReferenceParametersType refParams = addrProps .getToEndpointReference() .getReferenceParameters(); // Getting representation from the ResourceManager Representation storedRepresentation = manager.get(refParams); // Getting representation from the incoming SOAP message. This representation will be stored. Representation putRepresentation = body.getRepresentation(); // Dialect processing if (body.getDialect() != null && !body.getDialect().isEmpty()) { if (dialects.containsKey(body.getDialect())) { Dialect dialect = dialects.get(body.getDialect()); putRepresentation = dialect.processPut(body, storedRepresentation); } else { throw new UnknownDialect(); } } ValidAndTransformHelper.validationAndTransformation( resourceTypeIdentifiers, putRepresentation, storedRepresentation); manager.put(refParams, putRepresentation); PutResponse response = new PutResponse(); response.setRepresentation(putRepresentation); return response; }