public synchronized void addDestination(AbstractHTTPDestination destination) { String path = getTrimmedPath(destination.getEndpointInfo().getAddress()); AbstractHTTPDestination dest = destinations.putIfAbsent(path, destination); if (dest != null && dest != destination) { throw new RuntimeException("Already a destination on " + path); } try { String path2 = URLDecoder.decode(path, "UTF-8"); if (!path.equals(path2)) { decodedDestinations.put(path2, destination); } } catch (UnsupportedEncodingException e) { throw new RuntimeException("Unsupported Encoding", e); } }
public int compare(AbstractHTTPDestination o1, AbstractHTTPDestination o2) { InterfaceInfo i1 = o1.getEndpointInfo().getInterface(); InterfaceInfo i2 = o2.getEndpointInfo().getInterface(); if (i1 == null && i2 == null) { return 0; } else if (i1 == null) { return -1; } else if (i2 == null) { return 1; } else { return i1.getName().getLocalPart() .compareTo( i2.getName().getLocalPart()); } } });
protected void updateDestination(HttpServletRequest request, String base, AbstractHTTPDestination d) { String ad = d.getEndpointInfo().getAddress(); if (ad == null && d.getAddress() != null && d.getAddress().getAddress() != null) { ad = d.getAddress().getAddress().getValue(); if (ad == null) { ad = "/"; } } // Using HTTP_PREFIX check is safe for ServletController // URI.create(ad).isRelative() can be used - a bit more expensive though if (ad != null && !ad.startsWith(HTTP_PREFIX)) { if (disableAddressUpdates) { request.setAttribute("org.apache.cxf.transport.endpoint.address", base + ad); } else { BaseUrlHelper.setAddress(d, base + ad); } } }
@Override public EndpointInfo getEndpointInfo() { return delegate.getEndpointInfo(); }
public synchronized void addDestination(AbstractHTTPDestination destination) { String path = getTrimmedPath(destination.getEndpointInfo().getAddress()); AbstractHTTPDestination dest = destinations.putIfAbsent(path, destination); if (dest != null && dest != destination) { throw new RuntimeException("Already a destination on " + path); } try { String path2 = URLDecoder.decode(path, "UTF-8"); if (!path.equals(path2)) { decodedDestinations.put(path2, destination); } } catch (UnsupportedEncodingException e) { throw new RuntimeException("Unsupported Encoding", e); } }
public synchronized void addDestination(AbstractHTTPDestination destination) { String path = getTrimmedPath(destination.getEndpointInfo().getAddress()); AbstractHTTPDestination dest = destinations.putIfAbsent(path, destination); if (dest != null && dest != destination) { throw new RuntimeException("Already a destination on " + path); } try { String path2 = URLDecoder.decode(path, "ISO-8859-1"); if (!path.equals(path2)) { decodedDestinations.put(URLDecoder.decode(path, "ISO-8859-1"), destination); } } catch (UnsupportedEncodingException e) { throw new RuntimeException("Unsupported Encoding", e); } }
public int compare(AbstractHTTPDestination o1, AbstractHTTPDestination o2) { InterfaceInfo i1 = o1.getEndpointInfo().getInterface(); InterfaceInfo i2 = o2.getEndpointInfo().getInterface(); if (i1 == null && i2 == null) { return 0; } else if (i1 == null) { return -1; } else if (i2 == null) { return 1; } else { return i1.getName().getLocalPart() .compareTo( i2.getName().getLocalPart()); } } });
public int compare(AbstractHTTPDestination o1, AbstractHTTPDestination o2) { InterfaceInfo i1 = o1.getEndpointInfo().getInterface(); InterfaceInfo i2 = o2.getEndpointInfo().getInterface(); if (i1 == null && i2 == null) { return 0; } else if (i1 == null) { return -1; } else if (i2 == null) { return 1; } else { return i1.getName().getLocalPart() .compareTo( i2.getName().getLocalPart()); } } });
public Server getServiceByRequest(HttpServletRequest request) { String pathInfo = request.getPathInfo() == null ? request.getServletPath() : request.getPathInfo(); if (pathInfo.startsWith(serviceRootUrl)) pathInfo = pathInfo.substring(serviceRootUrl.length()); for (String path : registeredServices.keySet()) { AbstractHTTPDestination d = destinationRegistry.getDestinationForPath(pathInfo, true); if (d == null) { d = destinationRegistry.checkRestfulRequest(pathInfo); } if (d!=null) { EndpointInfo ei = d.getEndpointInfo(); if (ei.getAddress().equals(registeredServices.get(path).getEndpoint().getEndpointInfo().getAddress())) { return registeredServices.get(path); } } } return null; } }
public static String getEndpointAddress(Message m) { String address = null; Destination d = m.getExchange().getDestination(); if (d != null) { if (d instanceof AbstractHTTPDestination) { EndpointInfo ei = ((AbstractHTTPDestination)d).getEndpointInfo(); HttpServletRequest request = (HttpServletRequest)m.get(AbstractHTTPDestination.HTTP_REQUEST); Object property = request != null ? request.getAttribute("org.apache.cxf.transport.endpoint.address") : null; address = property != null ? property.toString() : ei.getAddress(); } else { address = m.containsKey(Message.BASE_PATH) ? (String)m.get(Message.BASE_PATH) : d.getAddress().getAddress().getValue(); } } else { address = (String)m.get(Message.ENDPOINT_ADDRESS); } if (address.startsWith("http") && address.endsWith("//")) { address = address.substring(0, address.length() - 1); } return address; }
for (AbstractHTTPDestination destination : destinations) String path = destination.getEndpointInfo().getAddress(); try
public static String getEndpointAddress(Message m) { String address = null; Destination d = m.getExchange().getDestination(); if (d != null) { if (d instanceof AbstractHTTPDestination) { EndpointInfo ei = ((AbstractHTTPDestination)d).getEndpointInfo(); HttpServletRequest request = (HttpServletRequest)m.get(AbstractHTTPDestination.HTTP_REQUEST); Object property = request != null ? request.getAttribute("org.apache.cxf.transport.endpoint.address") : null; address = property != null ? property.toString() : ei.getAddress(); } else { address = m.containsKey(Message.BASE_PATH) ? (String)m.get(Message.BASE_PATH) : d.getAddress().getAddress().getValue(); } } else { address = (String)m.get(Message.ENDPOINT_ADDRESS); } if (address.startsWith("http") && address.endsWith("//")) { address = address.substring(0, address.length() - 1); } return address; }
protected void updateDestination(HttpServletRequest request, String base, AbstractHTTPDestination d) { String ad = d.getEndpointInfo().getAddress(); if (ad == null && d.getAddress() != null && d.getAddress().getAddress() != null) { ad = d.getAddress().getAddress().getValue(); if (ad == null) { ad = "/"; } } // Using HTTP_PREFIX check is safe for ServletController // URI.create(ad).isRelative() can be used - a bit more expensive though if (ad != null && !ad.startsWith(HTTP_PREFIX)) { if (disableAddressUpdates) { request.setAttribute("org.apache.cxf.transport.endpoint.address", base + ad); } else { BaseUrlHelper.setAddress(d, base + ad); } } }
&& queryHandlerRegistry != null) { EndpointInfo ei = d.getEndpointInfo(); String ctxUri = request.getPathInfo(); String baseUri = request.getRequestURL().toString()
final EndpointInfo endpointInfo = dest.getEndpointInfo(); final boolean autoRewrite = SoapAddressRewriteHelper.isAutoRewriteOn(dep.getAttachment(SOAPAddressRewriteMetadata.class)); endpointInfo.setProperty(WSDLGetUtils.AUTO_REWRITE_ADDRESS, autoRewrite);
protected void updateDestination(HttpServletRequest request, AbstractHTTPDestination d) { String base = getBaseURL(request); synchronized (d) { String ad = d.getEndpointInfo().getAddress(); if (ad == null && d.getAddress() != null && d.getAddress().getAddress() != null) { ad = d.getAddress().getAddress().getValue(); if (ad == null) { ad = "/"; } } // Using HTTP_PREFIX check is safe for ServletController // URI.create(ad).isRelative() can be used - a bit more expensive though if (ad != null && !ad.startsWith(HTTP_PREFIX)) { if (disableAddressUpdates) { request.setAttribute("org.apache.cxf.transport.endpoint.address", base + ad); } else { BaseUrlHelper.setAddress(d, base + ad); } } } }