Author: muthulee
Date: Thu Jul 12 04:37:56 2007
New Revision: 555588
URL: http://svn.apache.org/viewvc?view=rev&rev=555588
Log:
Adding logs to trust
Modified:
webservices/rampart/trunk/java/modules/rampart-trust/src/main/java/org/apache/rahas/TokenRequestDispatcher.java
Modified:
webservices/rampart/trunk/java/modules/rampart-trust/src/main/java/org/apache/rahas/TokenRequestDispatcher.java
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/java/modules/rampart-trust/src/main/java/org/apache/rahas/TokenRequestDispatcher.java?view=diff&rev=555588&r1=555587&r2=555588
==============================================================================
---
webservices/rampart/trunk/java/modules/rampart-trust/src/main/java/org/apache/rahas/TokenRequestDispatcher.java
(original)
+++
webservices/rampart/trunk/java/modules/rampart-trust/src/main/java/org/apache/rahas/TokenRequestDispatcher.java
Thu Jul 12 04:37:56 2007
@@ -18,10 +18,15 @@
import org.apache.axiom.om.OMElement;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axis2.context.MessageContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
public class TokenRequestDispatcher {
private TokenRequestDispatcherConfig config;
+
+ private static Log mlog = LogFactory.getLog("org.apache.rampart.messages");
+ private static Log log =
LogFactory.getLog(TokenRequestDispatcher.class.getName());
public TokenRequestDispatcher(TokenRequestDispatcherConfig config) throws
TrustException {
this.config = config;
@@ -44,12 +49,16 @@
public SOAPEnvelope handle(MessageContext inMsgCtx,
MessageContext outMsgCtx) throws TrustException
{
+ if(mlog.isDebugEnabled()){
+ mlog.debug("*********************** TokenRequestDispatcher
recieved \n"+inMsgCtx.getEnvelope());
+ }
RahasData data = new RahasData(inMsgCtx);
String reqType = data.getRequestType();
String tokenType = data.getTokenType();
if ((RahasConstants.WST_NS_05_02 +
RahasConstants.REQ_TYPE_ISSUE).equals(reqType) ||
(RahasConstants.WST_NS_05_12 +
RahasConstants.REQ_TYPE_ISSUE).equals(reqType)) {
+ log.debug("issue");
TokenIssuer issuer;
if (tokenType == null || tokenType.trim().length() == 0) {
issuer = config.getDefaultIssuerInstace();
@@ -62,18 +71,24 @@
//set the response wsa/soap action in teh out message context
outMsgCtx.getOptions().setAction(issuer.getResponseAction(data));
+ if(mlog.isDebugEnabled()){
+ mlog.debug("***********************
TokenRequestDispatcher sent out \n"+response);
+ }
+
return response;
} else if((RahasConstants.WST_NS_05_02 +
RahasConstants.REQ_TYPE_VALIDATE).equals(reqType) ||
(RahasConstants.WST_NS_05_12 +
RahasConstants.REQ_TYPE_VALIDATE).equals(reqType)) {
+ log.debug("validate");
throw new UnsupportedOperationException("TODO: handle " +
"validate requests");
} else if((RahasConstants.WST_NS_05_02 +
RahasConstants.REQ_TYPE_RENEW).equals(reqType) ||
(RahasConstants.WST_NS_05_12 +
RahasConstants.REQ_TYPE_RENEW).equals(reqType)) {
+ log.debug("renew");
throw new UnsupportedOperationException("TODO: handle " +
"renew requests");
} else if((RahasConstants.WST_NS_05_02 +
RahasConstants.REQ_TYPE_CANCEL).equals(reqType) ||
(RahasConstants.WST_NS_05_12 +
RahasConstants.REQ_TYPE_CANCEL).equals(reqType)) {
-
+ log.debug("cancel");
TokenCanceler canceler = config.getDefaultCancelerInstance();
SOAPEnvelope response = canceler.cancel(data);
@@ -83,6 +98,12 @@
} else {
throw new TrustException(TrustException.INVALID_REQUEST);
}
- }
+
+
+
+ }
+
+
+
}