Methods Summary |
---|
private java.lang.String | getAction(com.sun.xml.ws.api.model.wsdl.WSDLOperation operation)
if(!isClient){
return operation.getInput().getAction();
}else{
return operation.getOutput().getAction();
}
|
private java.lang.String | getAction(com.sun.xml.ws.api.message.Message msg)
if(addVer != null){
HeaderList hl = msg.getHeaders();
String action = hl.getAction(addVer, pipeConfig.getBinding().getSOAPVersion());
return action;
}
return "";
|
protected com.sun.xml.ws.policy.PolicyAssertion | getInBoundSCP()
SecurityPolicyHolder sph = null;
Collection coll = inMessagePolicyMap.values();
Iterator itr = coll.iterator();
while(itr.hasNext()){
SecurityPolicyHolder ph = (SecurityPolicyHolder) itr.next();
if(ph != null){
sph = ph;
break;
}
}
if(sph == null){
return null;
}
List<PolicyAssertion> policies = sph.getSecureConversationTokens();
if(!policies.isEmpty()) {
return (PolicyAssertion)policies.get(0);
}
return null;
|
private com.sun.xml.wss.impl.policy.mls.MessagePolicy | getInboundFaultPolicy(javax.xml.soap.SOAPMessage msg)
if(cachedOperation != null){
WSDLOperation operation = cachedOperation.getOperation();
try{
SOAPBody body = msg.getSOAPBody();
NodeList nodes = body.getElementsByTagName("detail");
if(nodes.getLength() == 0){
nodes = body.getElementsByTagNameNS(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE,"Detail");
}
if(nodes.getLength() >0){
Node node = nodes.item(0);
Node faultNode = node.getFirstChild();
if(faultNode == null){
return new MessagePolicy();
}
String uri = faultNode.getNamespaceURI();
QName faultDetail = null;
if(uri != null && uri.length() >0){
faultDetail = new QName(faultNode.getNamespaceURI(),faultNode.getNodeName());
}else{
faultDetail = new QName(faultNode.getNodeName());
}
WSDLFault fault = operation.getFault(faultDetail);
SecurityPolicyHolder sph = inMessagePolicyMap.get(cachedOperation);
SecurityPolicyHolder faultPolicyHolder = sph.getFaultPolicy(fault);
MessagePolicy faultPolicy = (faultPolicyHolder == null) ? new MessagePolicy() : faultPolicyHolder.getMessagePolicy();
return faultPolicy;
}
}catch(SOAPException sx){
//sx.printStackTrace();
//log error
}
}
return new MessagePolicy();
|
private com.sun.xml.wss.impl.policy.mls.MessagePolicy | getInboundXWSBootstrapPolicy(com.sun.xml.ws.security.policy.Token scAssertion)
return ((SCTokenWrapper)scAssertion).getMessagePolicy();
|
private com.sun.xml.wss.impl.policy.mls.MessagePolicy | getInboundXWSSecurityPolicy(com.sun.xml.ws.api.message.Message msg)
MessagePolicy mp = null;
//Review : Will this return operation name in all cases , doclit,rpclit, wrap / non wrap ?
WSDLBoundOperation operation = null;
if(cachedOperation != null){
operation = cachedOperation;
}else{
operation = msg.getOperation(pipeConfig.getWSDLModel());
if(operation == null)
operation = getWSDLOpFromAction();
}
SecurityPolicyHolder sph = (SecurityPolicyHolder) inMessagePolicyMap.get(operation);
//TODO: pass isTrustMessage Flag to this method later
if (sph == null && (isTrustMessage() || isSCMessage)) {
operation = getWSDLOpFromAction();
sph = (SecurityPolicyHolder) inMessagePolicyMap.get(operation);
}
if(sph == null){
return null;
}
mp = sph.getMessagePolicy();
return mp;
|
private com.sun.xml.ws.api.model.wsdl.WSDLBoundOperation | getWSDLOpFromAction()
Set <WSDLBoundOperation>keys = inMessagePolicyMap.keySet();
for(WSDLBoundOperation wbo : keys){
WSDLOperation wo = wbo.getOperation();
// WsaWSDLOperationExtension extensions = wo.getExtension(WsaWSDLOperationExtension.class);
String confAction = getAction(wo);
if(confAction != null && confAction.equals(action)){
return wbo;
}
}
return null;
|
private boolean | isRMMessage()
if (RM_CREATE_SEQ.equals(action) || RM_CREATE_SEQ_RESP.equals(action)
|| RM_SEQ_ACK.equals(action) || RM_TERMINATE_SEQ.equals(action)
|| RM_LAST_MESSAGE.equals(action)) {
return true;
}
return false;
|
private boolean | isSCCancel()
if(WSSCConstants.CANCEL_SECURITY_CONTEXT_TOKEN_RESPONSE_ACTION.equals(action) ||
WSSCConstants.CANCEL_SECURITY_CONTEXT_TOKEN_ACTION .equals(action)) {
return true;
}
return false;
|
private boolean | isSCMessage()
if (rstSCTURI.equals(action) || rstrSCTURI.equals(action)){
return true;
}
return false;
|
private boolean | isTrustMessage()
if(WSTrustConstants.REQUEST_SECURITY_TOKEN_ISSUE_ACTION.equals(action) ||
WSTrustConstants.REQUEST_SECURITY_TOKEN_RESPONSE_ISSUE_ACTION.equals(action)){
return true;
}
return false;
|
public com.sun.xml.wss.impl.policy.mls.MessagePolicy | resolvePolicy(com.sun.xml.wss.ProcessingContext ctx)
Message msg = (Message)ctx.getExtraneousProperty(JAXWS_21_MESSAGE);
Packet packet = null;
MessagePolicy mp = null;
SOAPMessage soapMsg = null;
if(msg == null){
if(ctx instanceof JAXBFilterProcessingContext){
msg = ((JAXBFilterProcessingContext)ctx).getJAXWSMessage();
} else{
soapMsg = ctx.getSOAPMessage();
msg = Messages.create(soapMsg);
}
ctx.setExtraneousProperty(JAXWS_21_MESSAGE,msg);
}
action = getAction(msg);
if (isRMMessage()) {
SecurityPolicyHolder holder = inProtocolPM.get("RM");
return holder.getMessagePolicy();
}
if(isSCCancel()){
SecurityPolicyHolder holder = inProtocolPM.get("SC");
return holder.getMessagePolicy();
}
isSCMessage = isSCMessage();
if (isSCMessage ) {
Token scToken = (Token)getInBoundSCP();
return getInboundXWSBootstrapPolicy(scToken);
}
if (msg.isFault()) {
if(soapMsg == null){
try {
soapMsg = msg.readAsSOAPMessage();
} catch (SOAPException ex) {
//ex.printStackTrace();
}
}
mp = getInboundFaultPolicy(soapMsg);
} else{
mp = getInboundXWSSecurityPolicy(msg);
}
if(mp == null){
return new MessagePolicy();
}
return mp;
|