Methods Summary |
---|
public void | addHandler(WebServiceHandler handler)Append handler to end of handler chain for this endpoint.
handlers.addLast(handler);
super.changed();
|
public void | addHandlerChain(WebServiceHandlerChain handlerChain)Append handlerchain to end of handlerchain for this endpoint.
handlerChains.addLast(handlerChain);
super.changed();
|
public void | addProperty(NameValuePairDescriptor newProp)
if (props==null) {
props = new ArrayList();
}
props.add(newProp);
|
public java.net.URL | composeEndpointAddress(java.net.URL root)Given the root portion of a URL representing the ::
of the webserver, return the endpoint address used to make web
service invocations on this endpoint.
String uri = null;
// Compose file portion of URL depending on endpoint type.
// The file portion of the URL MUST have a single leading slash.
// Note that the context root and the endpoint address uri strings
// from the descriptors may or may not each have a leading slash.
if( implementedByWebComponent() ) {
if (endpointAddressUri == null) {
updateServletEndpointRuntime();
}
// for servlets, endpoint address uri is relative to
// web app context root.
WebBundleDescriptor webBundle =
webComponentImpl.getWebBundleDescriptor();
String contextRoot = webBundle.getContextRoot();
if( contextRoot != null ) {
if( !contextRoot.startsWith("/") ) {
contextRoot = "/" + contextRoot;
}
uri = contextRoot +
(endpointAddressUri.startsWith("/") ?
endpointAddressUri : ("/" + endpointAddressUri));
}
} else {
if( hasEndpointAddressUri() ) {
uri = endpointAddressUri.startsWith("/") ?
endpointAddressUri : ("/" + endpointAddressUri);
} else {
// we need to define a standard endpoint address
uri = "/" + getWebService().getName() + "/" +
getEndpointName();
setEndpointAddressUri(uri);
}
}
URL endpointAddressURL =
new URL(root.getProtocol(), root.getHost(), root.getPort(), uri);
return endpointAddressURL;
|
public java.net.URL | composeFinalWsdlUrl(java.net.URL root)Generate a URL pointing to the initial wsdl document for this
endpoint's web service.
// WSDL for this webservice is published in a subcontext created
// under the endpoint address uri. The hierarchy under there mirrors
// the structure of the module file in which this endpoint's
// webservice is defined. This allows easy retrieval of the wsdl
// content using jar URLs.
URL context = composeEndpointAddress(root);
String mainFile = context.getFile() + "/" +
PUBLISHING_SUBCONTEXT + "/" + webService.getWsdlFileUri();
URL finalWsdlUrl = new URL(context.getProtocol(), context.getHost(),
context.getPort(), mainFile);
return finalWsdlUrl;
|
public java.lang.String | getAuthMethod()
return authMethod;
|
public BundleDescriptor | getBundleDescriptor()
return getWebService().getBundleDescriptor();
|
public java.lang.String | getDebugging()
return debuggingEnabled;
|
private EjbBundleDescriptor | getEjbBundle()
return (EjbBundleDescriptor) getBundleDescriptor();
|
public EjbDescriptor | getEjbComponentImpl()
return ejbComponentImpl;
|
public java.lang.String | getEjbLink()
return ejbLink;
|
public java.lang.String | getEndpointAddressUri()
return endpointAddressUri;
|
public java.lang.String | getEndpointName()
return endpointName;
|
public java.util.LinkedList | getHandlerChain()Get ordered list of WebServiceHandler handler chains for this endpoint.
return handlerChains;
|
public java.util.LinkedList | getHandlers()Get ordered list of WebServiceHandler handler for this endpoint.
return handlers;
|
public java.lang.String | getLinkName()
String linkName = null;
if( implementedByEjbComponent() ) {
linkName = ejbLink;
} else if( implementedByWebComponent() ) {
linkName = webComponentLink;
}
return linkName;
|
public com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor | getMessageSecurityBinding()
return messageSecBindingDesc;
|
public java.lang.String | getMtomEnabled()
return mtomEnabled;
|
public java.util.Iterator | getProperties()
if (props == null) {
return null;
}
return props.iterator();
|
public java.lang.String | getProtocolBinding()
return ((protocolBinding==null) ?
javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING : protocolBinding);
|
public java.lang.String | getPublishingUri()This is the logical equivalent to endpoint address uri, but for
url publishing. Like endpoint address uri, it does not include the
context root for servlet endpoints.
String uri = endpointAddressUri.startsWith("/") ?
endpointAddressUri.substring(1) : endpointAddressUri;
return uri + "/" + PUBLISHING_SUBCONTEXT;
|
public java.lang.String | getRealm()
return realm;
|
public java.lang.String | getServiceEndpointInterface()
return serviceEndpointInterface;
|
public javax.xml.namespace.QName | getServiceName()
// NOTE : Here we do not return getWsdlService to maintain backward
// compatibility with JAXRPC 1.X
return hasServiceName() ?
new QName(serviceNamespaceUri, serviceLocalPart) :
null;
|
public java.lang.String | getServletImplClass()
return servletImplClass;
|
public java.lang.String | getSoapAddressPrefix()
if((SOAPBinding.SOAP12HTTP_BINDING.equals(protocolBinding)) ||
(SOAPBinding.SOAP12HTTP_MTOM_BINDING.equals(protocolBinding)) ||
(SOAP12_TOKEN.equals(protocolBinding)) ||
(SOAP12_MTOM_TOKEN.equals(protocolBinding))) {
return "soap12";
}
// anything else should be soap11
return "soap";
|
public java.lang.String | getTieClassName()
return tieClassName;
|
public java.lang.String | getTransportGuarantee()
return transportGuarantee;
|
private WebBundleDescriptor | getWebBundle()
return (WebBundleDescriptor) getBundleDescriptor();
|
public WebComponentDescriptor | getWebComponentImpl()
return webComponentImpl;
|
public java.lang.String | getWebComponentLink()
return webComponentLink;
|
public WebService | getWebService()
return webService;
|
public java.lang.String | getWsdlContentPath(java.lang.String requestUri)
// Strip off leading slash.
String uri = (requestUri.charAt(0) == '/") ? requestUri.substring(1) :
requestUri;
// get "raw" internal publishing uri. this value
// does NOT have a leading slash.
String publishingUriRaw = getPublishingUri();
// Construct the publishing root. This should NOT have a
// leading slash but SHOULD have a trailing slash.
String publishingRoot = null;
if( implementedByWebComponent() ) {
WebBundleDescriptor webBundle =
webComponentImpl.getWebBundleDescriptor();
String contextRoot = webBundle.getContextRoot();
if( contextRoot.startsWith("/") ) {
contextRoot = contextRoot.substring(1);
}
publishingRoot = contextRoot + "/" +
publishingUriRaw + "/";
} else {
publishingRoot = publishingUriRaw + "/";
}
String wsdlPath = uri.startsWith(publishingRoot) ?
uri.substring(publishingRoot.length()) : null;
return wsdlPath;
|
public javax.xml.namespace.QName | getWsdlPort()
return wsdlPort;
|
public java.lang.String | getWsdlPortNamespacePrefix()
return wsdlPortNamespacePrefix;
|
public javax.xml.namespace.QName | getWsdlService()
return wsdlService;
|
public java.lang.String | getWsdlServiceNamespacePrefix()
return wsdlServiceNamespacePrefix;
|
public boolean | hasAuthMethod()
return (authMethod != null);
|
public boolean | hasBasicAuth()
return ( (authMethod != null) &&
(authMethod.equals(HttpServletRequest.BASIC_AUTH)) );
|
public boolean | hasClientCertAuth()
return ( (authMethod != null) &&
(authMethod.equals(CLIENT_CERT)) );
|
public boolean | hasEndpointAddressUri()
return (endpointAddressUri != null);
|
public boolean | hasHandlerChain()
return ( handlerChains.size() > 0 );
|
public boolean | hasHandlers()
return ( handlers.size() > 0 );
|
public boolean | hasSecurePipeline()
return securePipeline;
|
public boolean | hasServiceName()
return ((serviceNamespaceUri != null) && (serviceLocalPart != null));
|
public boolean | hasServletImplClass()
return (servletImplClass != null);
|
public boolean | hasTieClassName()
return (tieClassName != null);
|
public boolean | hasTransportGuarantee()
return (transportGuarantee != null);
|
public boolean | hasUserSpecifiedProtocolBinding()
return ((protocolBinding==null) ? false : true);
|
public boolean | hasWsdlPort()
return (wsdlPort != null);
|
public boolean | hasWsdlPortNamespacePrefix()
return (wsdlPortNamespacePrefix != null);
|
public boolean | hasWsdlServiceNamespacePrefix()
return (wsdlServiceNamespacePrefix != null);
|
public boolean | implementedByEjbComponent()
return (ejbLink != null);
|
public boolean | implementedByEjbComponent(EjbDescriptor ejb)
return (ejbLink != null) && ejbLink.equals(ejb.getName());
|
public boolean | implementedByWebComponent()
return (webComponentLink != null);
|
public boolean | implementedByWebComponent(WebComponentDescriptor webComp)
return ( (webComponentLink != null) &&
(webComponentLink.equals(webComp.getCanonicalName())) );
|
public boolean | isSecure()
return ( hasTransportGuarantee() &&
(transportGuarantee.equals(TRANSPORT_INTEGRAL) ||
transportGuarantee.equals(TRANSPORT_CONFIDENTIAL)) );
|
public boolean | matchesEjbPublishRequest(java.lang.String requestUriRaw, java.lang.String query)Checks an ejb request uri to see if it represents a legal request
for the wsdl content associated with this endpoint's web service.
Equivalent matching for servlets is performed automatically by the
web server. Should only be called for HTTP(S) GET.
// Strip off leading slash.
String requestUri = (requestUriRaw.charAt(0) == '/") ?
requestUriRaw.substring(1) : requestUriRaw;
boolean matches = false;
// If request of form http<s>://<host>:<port>/<endpoint-address>?WSDL
if( query != null ) {
String toMatch = (endpointAddressUri.charAt(0) == '/") ?
endpointAddressUri.substring(1) : endpointAddressUri;
matches = requestUri.equals(toMatch) &&
(query.equalsIgnoreCase("WSDL") ||
query.startsWith("xsd=") ||
query.startsWith("wsdl="));
} else {
// Add trailing slash to make sure sub context is an exact match.
String publishingUri = getPublishingUri() + "/";
matches = requestUri.startsWith(publishingUri);
}
return matches;
|
public void | print(java.lang.StringBuffer toStringBuffer)
super.print(toStringBuffer);
toStringBuffer.append("\n endpoint name = ").append(endpointName);
toStringBuffer.append( "\n endpoint intf = ").append(serviceEndpointInterface);
toStringBuffer.append( "\n wsdl Port = ").append(wsdlPort);
toStringBuffer.append( "\n ejb Link = ").append(ejbLink);
toStringBuffer.append( "\n web Link = ").append(webComponentLink);
|
public void | removeHandler(WebServiceHandler handler)
handlers.remove(handler);
super.changed();
|
public void | removeHandlerByName(java.lang.String handlerName)
for(Iterator iter = handlers.iterator(); iter.hasNext();) {
WebServiceHandler next = (WebServiceHandler) iter.next();
if( next.getHandlerName().equals(handlerName) ) {
iter.remove();
super.changed();
break;
}
}
|
public void | removeHandlerChain(WebServiceHandlerChain handlerChain)
handlerChains.remove(handlerChain);
super.changed();
|
public boolean | resolveComponentLink()Convert the contents of the ejb-link or servlet-link element to
an object representing the implementation component.
boolean resolved = false;
if( ejbLink != null ) {
EjbBundleDescriptor ejbBundle = getEjbBundle();
if( ejbBundle.hasEjbByName(ejbLink) ) {
resolved = true;
EjbDescriptor ejb = ejbBundle.getEjbByName(ejbLink);
setEjbComponentImpl(ejb);
}
} else if( webComponentLink != null ) {
WebBundleDescriptor webBundle = getWebBundle();
WebComponentDescriptor webComponent =
(WebComponentDescriptor) webBundle.
getWebComponentByCanonicalName(webComponentLink);
if( webComponent != null ) {
resolved = true;
setWebComponentImpl(webComponent);
}
}
super.changed();
return resolved;
|
public void | saveServletImplClass()Store current contents of servlet impl class in a runtime descriptor
element. The standard deployment descriptor element will be replaced at
deployment time with a container-provided servlet impl, so we need
to make a copy of this value in the runtime information.
if( implementedByWebComponent() ) {
servletImplClass = ((WebComponentDescriptor) webComponentImpl).
getWebComponentImplementation();
} else {
throw new IllegalStateException("requires ejb");
}
super.changed();
|
public void | setAuthMethod(java.lang.String authType)
authMethod = authType;
super.changed();
|
public void | setDebugging(java.lang.String debuggingEnabled)
this.debuggingEnabled = debuggingEnabled;
|
public void | setEjbComponentImpl(EjbDescriptor ejbComponent)
webComponentImpl = null;
webComponentLink = null;
ejbLink = ejbComponent.getName();
ejbComponentImpl = ejbComponent;
super.changed();
|
public void | setEjbLink(java.lang.String link)
ejbLink = link;
super.changed();
|
public void | setEndpointAddressUri(java.lang.String uri)
if(!uri.startsWith("/")) {
uri = "/"+uri;
}
endpointAddressUri = uri;
super.changed();
|
public void | setEndpointName(java.lang.String name)
endpointName = name;
super.changed();
|
public void | setMessageSecurityBinding(com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor messageSecBindingDesc)
this.messageSecBindingDesc = messageSecBindingDesc;
|
public void | setMtomEnabled(java.lang.String value)
mtomEnabled =value;
super.changed();
|
public void | setProtocolBinding(java.lang.String value)
if(SOAP11_TOKEN.equals(value)) {
protocolBinding = SOAPBinding.SOAP11HTTP_BINDING;
} else if(SOAP11_MTOM_TOKEN.equals(value)) {
protocolBinding = SOAPBinding.SOAP11HTTP_MTOM_BINDING;
} else if(SOAP12_TOKEN.equals(value)) {
protocolBinding = SOAPBinding.SOAP12HTTP_BINDING;
} else if(SOAP12_MTOM_TOKEN.equals(value)) {
protocolBinding = SOAPBinding.SOAP12HTTP_MTOM_BINDING;
} else if(XML_TOKEN.equals(value)) {
protocolBinding = HTTPBinding.HTTP_BINDING;
} else {
protocolBinding = value;
}
super.changed();
|
public void | setRealm(java.lang.String realm)
this.realm = realm;
|
public void | setSecurePipeline()
securePipeline = true;
|
public void | setServiceEndpointInterface(java.lang.String endpointInterface)
serviceEndpointInterface = endpointInterface;
super.changed();
|
public void | setServiceLocalPart(java.lang.String localpart)
serviceLocalPart = localpart;
super.changed();
|
public void | setServiceNamespaceUri(java.lang.String uri)
serviceNamespaceUri = uri;
super.changed();
|
public void | setServletImplClass(java.lang.String implClass)
servletImplClass = implClass;
super.changed();
|
public void | setTieClassName(java.lang.String tieClass)
tieClassName = tieClass;
|
public void | setTransportGuarantee(java.lang.String guarantee)
transportGuarantee = guarantee;
super.changed();
|
public void | setWebComponentImpl(WebComponentDescriptor webComponent)
ejbComponentImpl = null;
ejbLink = null;
webComponentLink = webComponent.getCanonicalName();
webComponentImpl = webComponent;
super.changed();
|
public void | setWebComponentLink(java.lang.String link)
webComponentLink = link;
super.changed();
|
public void | setWebService(WebService service)
webService = service;
super.changed();
|
public void | setWsdlPort(javax.xml.namespace.QName port, java.lang.String prefix)
wsdlPort = port;
wsdlPortNamespacePrefix = prefix;
super.changed();
|
public void | setWsdlPort(javax.xml.namespace.QName port)
wsdlPort = port;
wsdlPortNamespacePrefix = port.getPrefix();
super.changed();
|
public void | setWsdlService(javax.xml.namespace.QName svc, java.lang.String prefix)
wsdlService = svc;
wsdlServiceNamespacePrefix = prefix;
serviceNamespaceUri = svc.getNamespaceURI();
serviceLocalPart = svc.getLocalPart();
super.changed();
|
public void | setWsdlService(javax.xml.namespace.QName service)
wsdlService = service;
wsdlServiceNamespacePrefix = service.getPrefix();
serviceNamespaceUri = service.getNamespaceURI();
serviceLocalPart = service.getLocalPart();
super.changed();
|
private void | updateServletEndpointRuntime()
// Copy the value of the servlet impl bean class into
// the runtime information. This way, we'll still
// remember it after the servlet-class element has been
// replaced with the name of the container's servlet class.
saveServletImplClass();
WebComponentDescriptor webComp =
(WebComponentDescriptor) getWebComponentImpl();
WebBundleDescriptor bundle = webComp.getWebBundleDescriptor();
WebServicesDescriptor webServices = bundle.getWebServices();
Collection endpoints =
webServices.getEndpointsImplementedBy(webComp);
if( endpoints.size() > 1 ) {
String msg = "Servlet " + getWebComponentLink() +
" implements " + endpoints.size() + " web service endpoints " +
" but must only implement 1";
throw new IllegalStateException(msg);
}
if( getEndpointAddressUri() == null ) {
Set urlPatterns = webComp.getUrlPatternsSet();
if( urlPatterns.size() == 1 ) {
// Set endpoint-address-uri runtime info to uri.
// Final endpoint address will still be relative to context root
String uri = (String) urlPatterns.iterator().next();
setEndpointAddressUri(uri);
// Set transport guarantee in runtime info if transport
// guarantee is INTEGRAL or CONDIFIDENTIAL for any
// security constraint with this url-pattern.
Collection constraints =
bundle.getSecurityConstraintsForUrlPattern(uri);
for(Iterator i = constraints.iterator(); i.hasNext();) {
SecurityConstraint next = (SecurityConstraint) i.next();
UserDataConstraint dataConstraint =
next.getUserDataConstraint();
String guarantee = (dataConstraint != null) ?
dataConstraint.getTransportGuarantee() : null;
if( (guarantee != null) &&
( guarantee.equals
(UserDataConstraint.INTEGRAL_TRANSPORT) ||
guarantee.equals
(UserDataConstraint.CONFIDENTIAL_TRANSPORT) ) ) {
setTransportGuarantee(guarantee);
break;
}
}
} else {
String msg = "Endpoint " + getEndpointName() +
" has not been assigned an endpoint address " +
" and is associated with servlet " +
webComp.getCanonicalName() + " , which has " +
urlPatterns.size() + " url patterns";
throw new IllegalStateException(msg);
}
}
|