[Beepcore-java-commits] CVS: beepcore-java/src/org/beepcore/beep/profile/sasl Blob.java,1.6,1.7 SASL
Status: Beta
Brought to you by:
huston
|
From: Huston F. <hu...@us...> - 2002-10-05 15:32:26
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl
In directory usw-pr-cvs1:/tmp/cvs-serv7994/src/org/beepcore/beep/profile/sasl
Modified Files:
Blob.java SASLSessionTable.java
Log Message:
changed to use commons-logging
Index: Blob.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/Blob.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** Blob.java 4 May 2002 22:42:41 -0000 1.6
--- Blob.java 5 Oct 2002 15:32:22 -0000 1.7
***************
*** 19,30 ****
import java.io.IOException;
import java.util.Hashtable;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
! import org.beepcore.beep.util.Log;
/**
--- 19,37 ----
import java.io.IOException;
+
import java.util.Hashtable;
+
import javax.xml.parsers.*;
+
import org.w3c.dom.*;
+
import org.xml.sax.SAXException;
+
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
! import org.apache.commons.logging.Log;
! import org.apache.commons.logging.LogFactory;
!
/**
***************
*** 75,78 ****
--- 82,87 ----
// Data
+ private Log log = LogFactory.getLog(this.getClass());
+
private int status;
private String blobData;
***************
*** 93,97 ****
throws SASLException
{
! Log.logEntry(Log.SEV_DEBUG, "Created blob=>"+status);
if (!initialized) {
init();
--- 102,108 ----
throws SASLException
{
! if (log.isDebugEnabled()) {
! log.debug("Created blob=>"+status);
! }
if (!initialized) {
init();
***************
*** 130,134 ****
stringified = buff.toString();
! Log.logEntry(Log.SEV_DEBUG, "Created blob=>" + stringified);
}
--- 141,147 ----
stringified = buff.toString();
! if (log.isDebugEnabled()) {
! log.debug("Created blob=>" + stringified);
! }
}
***************
*** 145,149 ****
throws SASLException
{
! Log.logEntry(Log.SEV_DEBUG, "Created blob=>" + status + "," + data);
if (!initialized) {
init();
--- 158,164 ----
throws SASLException
{
! if (log.isDebugEnabled()) {
! log.debug("Created blob=>" + status + "," + data);
! }
if (!initialized) {
init();
***************
*** 192,196 ****
stringified = buff.toString();
! Log.logEntry(Log.SEV_DEBUG, "Created blob=>" + stringified);
}
--- 207,213 ----
stringified = buff.toString();
! if (log.isDebugEnabled()) {
! log.debug("Created blob=>" + stringified);
! }
}
***************
*** 247,251 ****
stringified = buff.toString();
! Log.logEntry(Log.SEV_DEBUG, "Created blob=>" + stringified);
}
--- 264,270 ----
stringified = buff.toString();
! if (log.isDebugEnabled()) {
! log.debug("Created blob=>" + stringified);
! }
}
***************
*** 260,264 ****
public Blob(String blob) throws SASLException
{
! Log.logEntry(Log.SEV_DEBUG, "Receiving blob of=>"+blob);
if (!initialized) {
init();
--- 279,285 ----
public Blob(String blob) throws SASLException
{
! if (log.isDebugEnabled()) {
! log.debug("Receiving blob of=>"+blob);
! }
if (!initialized) {
init();
***************
*** 301,306 ****
throw new SASLException("No valid data in blob");
}
!
! Log.logEntry(Log.SEV_DEBUG, "Received Blob of =>" + stringified);
}
--- 322,329 ----
throw new SASLException("No valid data in blob");
}
!
! if (log.isDebugEnabled()) {
! log.debug("Received Blob of =>" + stringified);
! }
}
***************
*** 392,402 ****
try {
! Log.logEntry(Log.SEV_DEBUG, "Tuning Profile Parse Routine");
doc = builder.parse(new java.io.ByteArrayInputStream(blob.getBytes()));
! Log.logEntry(Log.SEV_DEBUG, "parsed message");
} catch (Exception e) {
! Log.logEntry(Log.SEV_DEBUG, e);
throw new SASLException(ERR_XML_PARSE_FAILURE);
}
--- 415,425 ----
try {
! log.debug("Tuning Profile Parse Routine");
doc = builder.parse(new java.io.ByteArrayInputStream(blob.getBytes()));
! log.debug("parsed message");
} catch (Exception e) {
! log.debug("Error parsing", e);
throw new SASLException(ERR_XML_PARSE_FAILURE);
}
Index: SASLSessionTable.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/sasl/SASLSessionTable.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** SASLSessionTable.java 22 Nov 2001 15:25:29 -0000 1.5
--- SASLSessionTable.java 5 Oct 2002 15:32:22 -0000 1.6
***************
*** 20,23 ****
--- 20,26 ----
import java.util.Hashtable;
+ import org.apache.commons.logging.Log;
+ import org.apache.commons.logging.LogFactory;
+
import org.beepcore.beep.core.Session;
import org.beepcore.beep.core.SessionCredential;
***************
*** 25,29 ****
import org.beepcore.beep.core.event.SessionListener;
import org.beepcore.beep.profile.sasl.anonymous.SASLAnonymousProfile;
- import org.beepcore.beep.util.Log;
/**
--- 28,31 ----
***************
*** 41,45 ****
public class SASLSessionTable implements SessionListener
{
- private Hashtable nameToSession, sessionToName;
private final static int DEFAULT_SIZE = 4;
--- 43,46 ----
***************
*** 51,54 ****
--- 52,58 ----
private static final String MSG_SESSIONS_TABLE_TRAILER="===] End of Table";
+ private Log log = LogFactory.getLog(this.getClass());
+ private Hashtable nameToSession, sessionToName;
+
SASLSessionTable()
{
***************
*** 175,179 ****
catch(SASLException x)
{
! Log.logEntry(Log.SEV_ERROR, x);
}
}
--- 179,183 ----
catch(SASLException x)
{
! log.error("Error removing entry", x);
}
}
***************
*** 185,192 ****
void printContents()
{
! Log.logEntry(Log.SEV_DEBUG, MSG_SESSIONS_TABLE_HEADER);
if(sessionToName.size()==0)
{
! Log.logEntry(Log.SEV_DEBUG, MSG_EMPTY);
}
else
--- 189,196 ----
void printContents()
{
! log.debug(MSG_SESSIONS_TABLE_HEADER);
if(sessionToName.size()==0)
{
! log.debug(MSG_EMPTY);
}
else
***************
*** 202,210 ****
else
mech = "UNKNOWN";
! Log.logEntry(Log.SEV_DEBUG, MSG_USER_PREFIX + user +
! MSG_MECHANISM_PREFIX + mech );
}
}
! Log.logEntry(Log.SEV_DEBUG,MSG_SESSIONS_TABLE_TRAILER);
}
}
--- 206,217 ----
else
mech = "UNKNOWN";
!
! if (log.isDebugEnabled()) {
! log.debug(MSG_USER_PREFIX + user +
! MSG_MECHANISM_PREFIX + mech );
! }
}
}
! log.debug(MSG_SESSIONS_TABLE_TRAILER);
}
}
|