Methods Summary |
---|
public java.lang.String | getAppContext()
return appContext;
|
public javax.security.auth.message.config.ClientAuthContext | getAuthContext(java.lang.String operation, javax.security.auth.Subject subject, java.util.Map map)
PolicyMap pMap = (PolicyMap)map.get("POLICY");
WSDLPort port =(WSDLPort)map.get("WSDL_MODEL");
if (pMap == null || pMap.isEmpty()) {
return null;
}
//now check if security is enabled
//if the policy has changed due to redeploy recheck if security is enabled
if (this.secDisabled == null || (policyMap != pMap)) {
try {
this.wLock.lock();
if (this.secDisabled == null || (policyMap != pMap)) {
if (!WSITAuthConfigProvider.isSecurityEnabled(pMap,port)) {
this.secDisabled = TRUE;
return null;
} else {
this.secDisabled = FALSE;
}
}
} finally {
this.wLock.unlock();
}
}
if (this.secDisabled == TRUE) {
return null;
}
boolean authContextInitialized = false;
try {
this.rLock.lock();
if (clientAuthContext != null) {
//probably the app was redeployed
//if so reacquire the AuthContext
if (pMap == policyMap) {
authContextInitialized = true;
}
}
} finally {
this.rLock.unlock();
}
if (!authContextInitialized) {
try {
this.wLock.lock();
// recheck the precondition, since the rlock was released.
if (clientAuthContext == null || (policyMap != pMap)) {
clientAuthContext = new WSITClientAuthContext(operation, subject, map);
policyMap = pMap;
}
} finally {
this.wLock.unlock();
}
}
this.startSecureConversation(map);
return clientAuthContext;
|
public java.lang.String | getAuthContextID(javax.security.auth.message.MessageInfo messageInfo)
return null;
|
public java.lang.String | getMessageLayer()
return layer;
|
public java.lang.String | getOperation(javax.security.auth.message.MessageInfo messageInfo)
return null;
|
public boolean | isProtected()
return true;
|
public void | refresh()
|
public javax.xml.bind.JAXBElement | startSecureConversation(java.util.Map map)
//check if we need to start secure conversation
JAXBElement ret = null;
try {
MessageInfo info = (MessageInfo)map.get("SECURITY_TOKEN");
if (info != null) {
Packet packet = (Packet)info.getMap().get(WSITAuthContextBase.REQ_PACKET);
if (packet != null) {
if (clientAuthContext != null) {
ret = ((WSITClientAuthContext)clientAuthContext).startSecureConversation(packet);
//map.put("SECURITY_TOKEN", ret);
info.getMap().put("SECURITY_TOKEN", ret);
} else {
log.log(Level.SEVERE,
LogStringsMessages.WSITPVD_0024_NULL_CLIENT_AUTH_CONTEXT());
throw new WSSecureConversationException(
LogStringsMessages.WSITPVD_0024_NULL_CLIENT_AUTH_CONTEXT());
}
} else {
log.log(Level.SEVERE, LogStringsMessages.WSITPVD_0025_NULL_PACKET());
throw new RuntimeException(LogStringsMessages.WSITPVD_0025_NULL_PACKET());
}
}
} catch (WSSecureConversationException ex) {
log.log(Level.SEVERE, LogStringsMessages.WSITPVD_0026_ERROR_STARTING_SC(), ex);
throw new RuntimeException(LogStringsMessages.WSITPVD_0026_ERROR_STARTING_SC(), ex);
}
return ret;
|