use of com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor in project Payara by payara.
the class AuthMessagePolicy method getMessageSecurityBinding.
public static MessageSecurityBindingDescriptor getMessageSecurityBinding(String layer, Map<String, ?> properties) {
if (properties == null) {
return null;
}
MessageSecurityBindingDescriptor binding = null;
WebServiceEndpoint e = (WebServiceEndpoint) properties.get("SERVICE_ENDPOINT");
if (e != null) {
binding = e.getMessageSecurityBinding();
} else {
ServiceReferenceDescriptor s = (ServiceReferenceDescriptor) properties.get("SERVICE_REF");
if (s != null) {
WebServicesDelegate delegate = Globals.get(WebServicesDelegate.class);
if (delegate != null) {
binding = delegate.getBinding(s, properties);
}
}
}
if (binding != null) {
String bindingLayer = binding.getAttributeValue(MessageSecurityBindingDescriptor.AUTH_LAYER);
if (bindingLayer == null || layer.equals(bindingLayer)) {
return binding;
}
}
return null;
}
use of com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor in project Payara by payara.
the class PipeHelper method processSunDeploymentDescriptor.
private boolean processSunDeploymentDescriptor() {
if (factory == null) {
return false;
}
MessageSecurityBindingDescriptor binding = getMessageSecurityBinding(SOAP_LAYER, map);
if (binding != null) {
if (!hasExactMatchAuthProvider()) {
String jaspicProviderRegisID = factory.registerConfigProvider(new GFServerConfigProvider(null, null), layer, appCtxt, "GF AuthConfigProvider bound by Sun Specific Descriptor");
setRegistrationId(jaspicProviderRegisID);
}
}
WebServiceEndpoint webServiceEndpoint = (WebServiceEndpoint) map.get(SERVICE_ENDPOINT);
return webServiceEndpoint == null ? false : webServiceEndpoint.implementedByEjbComponent();
}
use of com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor in project Payara by payara.
the class WebServiceEndpointRuntimeNode method writeDescriptor.
/**
* write the descriptor class to a DOM tree and return it
*
* @param parent node for the DOM tree
* @param node name for the descriptor
* @param the descriptor to write
* @return the DOM tree top node
*/
public Node writeDescriptor(Node parent, String nodeName, WebServiceEndpoint endpoint) {
Node endpointNode = super.writeDescriptor(parent, nodeName, endpoint);
appendTextChild(endpointNode, WebServicesTagNames.PORT_COMPONENT_NAME, endpoint.getEndpointName());
appendTextChild(endpointNode, WebServicesTagNames.ENDPOINT_ADDRESS_URI, endpoint.getEndpointAddressUri());
// this info is described in web application itself.
if (endpoint.implementedByEjbComponent() && endpoint.hasAuthMethod()) {
Node loginConfigNode = appendChild(endpointNode, RuntimeTagNames.LOGIN_CONFIG);
appendTextChild(loginConfigNode, RuntimeTagNames.AUTH_METHOD, endpoint.getAuthMethod());
appendTextChild(loginConfigNode, RuntimeTagNames.REALM, endpoint.getRealm());
}
// message-security-binding
MessageSecurityBindingDescriptor messageSecBindingDesc = endpoint.getMessageSecurityBinding();
if (messageSecBindingDesc != null) {
MessageSecurityBindingNode messageSecBindingNode = new MessageSecurityBindingNode();
messageSecBindingNode.writeDescriptor(endpointNode, WebServicesTagNames.MESSAGE_SECURITY_BINDING, messageSecBindingDesc);
}
appendTextChild(endpointNode, WebServicesTagNames.TRANSPORT_GUARANTEE, endpoint.getTransportGuarantee());
QName serviceName = endpoint.getServiceName();
if (serviceName != null) {
Node serviceQnameNode = appendChild(endpointNode, WebServicesTagNames.SERVICE_QNAME);
appendTextChild(serviceQnameNode, WebServicesTagNames.NAMESPACE_URI, serviceName.getNamespaceURI());
appendTextChild(serviceQnameNode, WebServicesTagNames.LOCAL_PART, serviceName.getLocalPart());
}
appendTextChild(endpointNode, WebServicesTagNames.TIE_CLASS, endpoint.getTieClassName());
if (endpoint.implementedByWebComponent() && (endpoint.getServletImplClass() != null)) {
appendTextChild(endpointNode, WebServicesTagNames.SERVLET_IMPL_CLASS, endpoint.getServletImplClass());
}
// debugging-enabled?
appendTextChild(endpointNode, WebServicesTagNames.DEBUGGING_ENABLED, endpoint.getDebugging());
// property*
Iterator properties = endpoint.getProperties();
if (properties != null) {
RuntimeNameValuePairNode propNode = new RuntimeNameValuePairNode();
while (properties.hasNext()) {
NameValuePairDescriptor aProp = (NameValuePairDescriptor) properties.next();
propNode.writeDescriptor(endpointNode, RuntimeTagNames.PROPERTY, aProp);
}
}
return endpointNode;
}
use of com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor in project Payara by payara.
the class ServiceRefPortInfoRuntimeNode method writeDescriptor.
/**
* write the descriptor class to a DOM tree and return it
*
* @param parent node for the DOM tree
* @param node name for the descriptor
* @param the descriptor to write
* @return the DOM tree top node
*/
public Node writeDescriptor(Node parent, String nodeName, ServiceRefPortInfo desc) {
Node serviceRefPortInfoRuntimeNode = super.writeDescriptor(parent, nodeName, desc);
appendTextChild(serviceRefPortInfoRuntimeNode, WebServicesTagNames.SERVICE_ENDPOINT_INTERFACE, desc.getServiceEndpointInterface());
QName port = desc.getWsdlPort();
if (port != null) {
Node wsdlPortNode = appendChild(serviceRefPortInfoRuntimeNode, WebServicesTagNames.WSDL_PORT);
appendTextChild(wsdlPortNode, WebServicesTagNames.NAMESPACE_URI, port.getNamespaceURI());
appendTextChild(wsdlPortNode, WebServicesTagNames.LOCAL_PART, port.getLocalPart());
}
// stub-property*
NameValuePairNode nameValueNode = new NameValuePairNode();
Set stubProperties = desc.getStubProperties();
for (Iterator iter = stubProperties.iterator(); iter.hasNext(); ) {
NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
nameValueNode.writeDescriptor(serviceRefPortInfoRuntimeNode, WebServicesTagNames.STUB_PROPERTY, next);
}
// call-property*
for (Iterator iter = desc.getCallProperties().iterator(); iter.hasNext(); ) {
NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
nameValueNode.writeDescriptor(serviceRefPortInfoRuntimeNode, WebServicesTagNames.CALL_PROPERTY, next);
}
// message-security-binding
MessageSecurityBindingDescriptor messageSecBindingDesc = desc.getMessageSecurityBinding();
if (messageSecBindingDesc != null) {
MessageSecurityBindingNode messageSecBindingNode = new MessageSecurityBindingNode();
messageSecBindingNode.writeDescriptor(serviceRefPortInfoRuntimeNode, WebServicesTagNames.MESSAGE_SECURITY_BINDING, messageSecBindingDesc);
}
return serviceRefPortInfoRuntimeNode;
}
use of com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor in project Payara by payara.
the class PipeHelper method processSunDeploymentDescriptor.
private boolean processSunDeploymentDescriptor() {
if (factory == null) {
return false;
}
MessageSecurityBindingDescriptor binding = AuthMessagePolicy.getMessageSecurityBinding(PipeConstants.SOAP_LAYER, map);
if (binding != null) {
if (!hasExactMatchAuthProvider()) {
String jmacProviderRegisID = factory.registerConfigProvider(new GFServerConfigProvider(null, null), layer, appCtxt, "GF AuthConfigProvider bound by Sun Specific Descriptor");
this.setJmacProviderRegisID(jmacProviderRegisID);
}
}
WebServiceEndpoint e = (WebServiceEndpoint) map.get(PipeConstants.SERVICE_ENDPOINT);
return (e == null ? false : e.implementedByEjbComponent());
}
Aggregations