private void extractWsdlEprs(EndpointInfo endpoint) { //parse the EPR in wsdl List<ExtensibilityElement> portExtensors = endpoint.getExtensors(ExtensibilityElement.class); if (portExtensors != null) { Iterator<ExtensibilityElement> extensionElements = portExtensors.iterator(); QName wsaEpr = new QName(Names.WSA_NAMESPACE_NAME, "EndpointReference"); while (extensionElements.hasNext()) { ExtensibilityElement ext = extensionElements.next(); if (ext instanceof UnknownExtensibilityElement && wsaEpr.equals(ext.getElementType())) { DOMSource domSource = new DOMSource(((UnknownExtensibilityElement)ext).getElement()); W3CEndpointReference w3cEPR = new W3CEndpointReference(domSource); EndpointReferenceType ref = ProviderImpl.convertToInternal(w3cEPR); endpoint.getTarget().setMetadata(ref.getMetadata()); endpoint.getTarget().setReferenceParameters(ref.getReferenceParameters()); endpoint.getTarget().getOtherAttributes().putAll(ref.getOtherAttributes()); } } } }
public List<Object> getReferenceParameters() { List<Object> list = new LinkedList<Object>(); ReferenceParametersType refParams = implementation.getReferenceParameters(); if (refParams != null) { List<Object> any = refParams.getAny(); if (any != null) { list.addAll(any); } } return list; }
private String extractStringElementFromAny(QName elementQName, EndpointReferenceType epr) { String elementStringValue = null; if (null != epr.getReferenceParameters()) { for (Object o : epr.getReferenceParameters().getAny()) { if (o instanceof JAXBElement) { JAXBElement<?> el = (JAXBElement<?>)o; if (el.getName().equals(elementQName)) { elementStringValue = (String)el.getValue(); } } } } return elementStringValue; } }
private String extractStringElementFromAny(QName elementQName, EndpointReferenceType epr) { String elementStringValue = null; if (null != epr.getReferenceParameters()) { for (Object o : epr.getReferenceParameters().getAny()) { if (o instanceof JAXBElement) { JAXBElement<?> el = (JAXBElement<?>)o; if (el.getName().equals(elementQName)) { elementStringValue = (String)el.getValue(); } } } } return elementStringValue; } }
public static void applyReferenceParam(EndpointReferenceType toEpr, Object el) { if (null == toEpr.getReferenceParameters()) { toEpr.setReferenceParameters(WSA_OBJECT_FACTORY.createReferenceParametersType()); } toEpr.getReferenceParameters().getAny().add(el); }
public static void applyReferenceParam(EndpointReferenceType toEpr, Object el) { if (null == toEpr.getReferenceParameters()) { toEpr.setReferenceParameters(WSA_OBJECT_FACTORY.createReferenceParametersType()); } toEpr.getReferenceParameters().getAny().add(el); }
private String extractStringElementFromAny(QName elementQName, EndpointReferenceType epr) { String elementStringValue = null; if (null != epr.getReferenceParameters()) { for (Object o : epr.getReferenceParameters().getAny()) { if (o instanceof JAXBElement) { JAXBElement<?> el = (JAXBElement<?>)o; if (el.getName().equals(elementQName)) { elementStringValue = (String)el.getValue(); } } } } return elementStringValue; } }
public static void applyReferenceParam(EndpointReferenceType toEpr, Object el) { if (null == toEpr.getReferenceParameters()) { toEpr.setReferenceParameters(WSA_OBJECT_FACTORY.createReferenceParametersType()); } toEpr.getReferenceParameters().getAny().add(el); }
private String extractStringElementFromAny(QName elementQName, EndpointReferenceType epr) { String elementStringValue = null; if (null != epr.getReferenceParameters()) { for (Object o : epr.getReferenceParameters().getAny()) { if (o instanceof JAXBElement) { JAXBElement<?> el = (JAXBElement<?>)o; if (el.getName().equals(elementQName)) { elementStringValue = (String)el.getValue(); } } } } return elementStringValue; } }
public ReferenceParametersType getNotificationReferenceParams() { @SuppressWarnings("unchecked") JAXBElement<EndpointReferenceType> el = (JAXBElement<EndpointReferenceType>)this.getDelivery().getContent().get(0); return el.getValue().getReferenceParameters(); }
public static void applyReferenceParam(EndpointReferenceType toEpr, Object el) { if (null == toEpr.getReferenceParameters()) { toEpr.setReferenceParameters(WSA_OBJECT_FACTORY.createReferenceParametersType()); } toEpr.getReferenceParameters().getAny().add(el); }
public ReferenceParametersType getNotificationReferenceParams() { @SuppressWarnings("unchecked") JAXBElement<EndpointReferenceType> el = (JAXBElement<EndpointReferenceType>)this.getDelivery().getContent().get(0); return el.getValue().getReferenceParameters(); }
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; }
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); }
public void addReferenceParameter(Element element) { ReferenceParametersType refParams = implementation.getReferenceParameters(); if (refParams == null) { refParams = new ReferenceParametersType(); implementation.setReferenceParameters(refParams); } refParams.getAny().add(element); }
protected void grantSubscriptionManagerReference(SubscriptionTicket ticket, SubscriptionTicketGrantingResponse response) { EndpointReferenceType subscriptionManagerReference = new EndpointReferenceType(); subscriptionManagerReference.setAddress(getSubscriptionManagerAddress()); // generate a ID for this subscription UUID uuid = UUID.randomUUID(); JAXBElement<String> idqn = new JAXBElement<>(new QName(subscriptionIdNamespace, subscriptionIdElementName), String.class, uuid.toString()); subscriptionManagerReference.setReferenceParameters(new ReferenceParametersType()); subscriptionManagerReference.getReferenceParameters().getAny().add(idqn); ticket.setUuid(uuid); response.setSubscriptionManagerReference(subscriptionManagerReference); response.setUUID(uuid); }
protected void grantSubscriptionManagerReference(SubscriptionTicket ticket, SubscriptionTicketGrantingResponse response) { EndpointReferenceType subscriptionManagerReference = new EndpointReferenceType(); subscriptionManagerReference.setAddress(getSubscriptionManagerAddress()); // generate a ID for this subscription UUID uuid = UUID.randomUUID(); JAXBElement<String> idqn = new JAXBElement<>(new QName(subscriptionIdNamespace, subscriptionIdElementName), String.class, uuid.toString()); subscriptionManagerReference.setReferenceParameters(new ReferenceParametersType()); subscriptionManagerReference.getReferenceParameters().getAny().add(idqn); ticket.setUuid(uuid); response.setSubscriptionManagerReference(subscriptionManagerReference); response.setUUID(uuid); }
private void extractWsdlEprs(EndpointInfo endpoint) { //parse the EPR in wsdl List<ExtensibilityElement> portExtensors = endpoint.getExtensors(ExtensibilityElement.class); if (portExtensors != null) { Iterator<ExtensibilityElement> extensionElements = portExtensors.iterator(); QName wsaEpr = new QName(Names.WSA_NAMESPACE_NAME, "EndpointReference"); while (extensionElements.hasNext()) { ExtensibilityElement ext = extensionElements.next(); if (ext instanceof UnknownExtensibilityElement && wsaEpr.equals(ext.getElementType())) { DOMSource domSource = new DOMSource(((UnknownExtensibilityElement)ext).getElement()); W3CEndpointReference w3cEPR = new W3CEndpointReference(domSource); EndpointReferenceType ref = ProviderImpl.convertToInternal(w3cEPR); endpoint.getTarget().setMetadata(ref.getMetadata()); endpoint.getTarget().setReferenceParameters(ref.getReferenceParameters()); endpoint.getTarget().getOtherAttributes().putAll(ref.getOtherAttributes()); } } } }
/** * Builds an new endpoint reference using the current target reference as a template. * The supplied id is endcoded using a reference parameter. * This requires the ws-a interceptors to propagate the reference parameters * on subsequent invokes using the returned reference. * @param id the id to encode in the new reference * @return the new reference with the id encoded as a reference parameter * @see org.apache.cxf.transport.MultiplexDestination#getAddressWithId(java.lang.String) */ public EndpointReferenceType getAddressWithId(String id) { EndpointReferenceType epr = EndpointReferenceUtils.duplicate( EndpointReferenceUtils.mint(reference, bus)); ReferenceParametersType newParams = new org.apache.cxf.ws.addressing.ObjectFactory() .createReferenceParametersType(); ReferenceParametersType existingParams = epr.getReferenceParameters(); if (null != existingParams) { newParams.getAny().addAll(existingParams.getAny()); } newParams.getAny().add(new JAXBElement<String>(MULTIPLEX_ID_QNAME, String.class, id)); epr.setReferenceParameters(newParams); return epr; }
@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; }