+ *
+ * Copyright 2003, Avantia inc.
*
- *
- * Copyright 2003, Avantia inc.
- * @version $Revision: 1.3 $
- * @author scohen
+ * @author scohen
+ * @version $Revision: 1.3 $
*/
public class OperatorMap {
+ private final static Logger logger = LoggerFactory.getLogger(OperatorMap.class);
+
private static Hashtable map;
- static Category cat = Category.getInstance(OperatorMap.class);
+
private static String packageName = "org.realtor.rets.validation.operators";
static {
@@ -58,7 +61,7 @@ public class OperatorMap {
try {
// Try to create an instance of the object
- cat.debug("getAllOperators instantiating class= " + classname);
+ logger.debug("getAllOperators instantiating class= " + classname);
Object o = Class.forName(classname).newInstance();
@@ -67,18 +70,18 @@ public class OperatorMap {
map.put(oper.getSymbol(), oper);
}
} catch (ClassNotFoundException cnfex) {
- cat.error("error:" + classname, cnfex);
+ logger.error("error:" + classname, cnfex);
} catch (InstantiationException iex) {
- cat.error("error: " + classname +
- " We try to instantiate an interface or an object that does not have a default constructor ",
- iex);
+ logger.error("error: " + classname +
+ " We try to instantiate an interface or an object that does not have a default constructor ",
+ iex);
// We try to instantiate an interface
// or an object that does not have a
// default constructor
} catch (IllegalAccessException iaex) {
- cat.error("error: " + classname + " The class is not public ",
- iaex);
+ logger.error("error: " + classname + " The class is not public ",
+ iaex);
// The class is not public
}
@@ -105,19 +108,19 @@ public class OperatorMap {
while (entries.hasMoreElements()) {
JarEntry entry = (JarEntry) entries.nextElement();
String entryName = entry.getName().replace('/', '.');
- cat.debug("entryName prior to add" + entryName);
- cat.debug("packageName" + packageName);
+ logger.debug("entryName prior to add" + entryName);
+ logger.debug("packageName" + packageName);
if (entryName.startsWith(packageName) &&
entryName.endsWith("class")) {
- cat.debug("adding entryName " + entryName);
+ logger.debug("adding entryName " + entryName);
classList.add(entryName);
}
}
files = (String[]) classList.toArray(new String[classList.size()]);
} catch (IOException io) {
- cat.error("error creating jarfile ", io);
+ logger.error("error creating jarfile ", io);
}
return files;
@@ -130,7 +133,7 @@ public class OperatorMap {
// we are only interested in .class files
if (files[i].endsWith(".class")) {
files[i] = packageName + "." + files[i];
- cat.debug("getClassListFromDirectory file is " + files[i]);
+ logger.debug("getClassListFromDirectory file is " + files[i]);
}
}
diff --git a/src/main/java/org/realtor/rets/validation/RETSUpdateValidator.java b/src/main/java/org/realtor/rets/validation/RETSUpdateValidator.java
index dbf2e64..f249983 100644
--- a/src/main/java/org/realtor/rets/validation/RETSUpdateValidator.java
+++ b/src/main/java/org/realtor/rets/validation/RETSUpdateValidator.java
@@ -13,13 +13,14 @@ import java.util.Map;
import javax.xml.transform.TransformerException;
-import org.apache.log4j.Category;
import org.apache.xpath.XPathAPI;
import org.realtor.rets.util.XMLUtils;
import org.realtor.rets.validation.terms.AbstractTerm;
import org.realtor.rets.validation.terms.DateTerm;
import org.realtor.rets.validation.terms.NumericTerm;
import org.realtor.rets.validation.terms.StringTerm;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -36,7 +37,8 @@ import org.w3c.dom.NodeList;
*/
public class RETSUpdateValidator {
// log4j category
- static Category cat = Category.getInstance(RETSUpdateValidator.class);
+ private final static Logger logger = LoggerFactory.getLogger(RETSUpdateValidator.class);
+
protected static final String AGENT_CODE_KEY = "AGENT-CODE";
protected static final String USER_CLASS_KEY = "USER-CLASS";
protected static final String USER_LEVEL_KEY = "USER-LEVEL";
@@ -146,10 +148,10 @@ public class RETSUpdateValidator {
Constructor constructor = termTypeClass.getConstructor(new Class [] {String.class});
AbstractTerm term = (AbstractTerm) constructor.newInstance(new Object [] {entry});
rv.put(key, term);
- cat.debug("Added value: " + key + " = " + term);
+ logger.debug("Added value: " + key + " = " + term);
}
catch (Exception e) {
- cat.error(e);
+ logger.debug(e);
}
}
}
diff --git a/target/test-classes/log4j2.xml b/target/test-classes/log4j2.xml
new file mode 100644
index 0000000..ff28157
--- /dev/null
+++ b/target/test-classes/log4j2.xml
@@ -0,0 +1,97 @@
+
+
+