X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=datarouter-prov%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fprovisioning%2Fbeans%2FGroup.java;h=be4c6409e47297dd99c733fd14a1310889f8f75b;hb=refs%2Fchanges%2F55%2F87355%2F1;hp=3f5f7c7669cf64d7ad4f46121cf380835145b5ef;hpb=112f99a100d4e41ea891e7a18a3d8858b6eac7bd;p=dmaap%2Fdatarouter.git diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Group.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Group.java index 3f5f7c76..be4c6409 100644 --- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Group.java +++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/Group.java @@ -31,10 +31,10 @@ import java.sql.SQLException; import java.sql.Statement; import java.util.*; -import org.apache.log4j.Logger; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; import org.json.JSONObject; import org.onap.dmaap.datarouter.provisioning.utils.DB; -import org.onap.dmaap.datarouter.provisioning.utils.URLUtilities; /** * The representation of a Subscription. Subscriptions can be retrieved from the DB, or stored/updated in the DB. @@ -44,8 +44,9 @@ import org.onap.dmaap.datarouter.provisioning.utils.URLUtilities; */ public class Group extends Syncable { - private static Logger intlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal"); + private static EELFLogger intlogger = EELFManager.getInstance().getLogger("InternalLog"); private static int next_groupid = getMaxGroupID() + 1; + private static final String SQLEXCEPTION = "SQLException: "; private int groupid; private String authid; @@ -107,7 +108,7 @@ public class Group extends Syncable { } db.release(conn); } catch (SQLException e) { - intlogger.error("SQLException " + e.getMessage()); + intlogger.error("PROV0009 getGroupsForSQL: " + e.getMessage(), e); } return list; } @@ -127,7 +128,7 @@ public class Group extends Syncable { } db.release(conn); } catch (SQLException e) { - intlogger.info("getMaxSubID: " + e.getMessage()); + intlogger.info("PROV0001 getMaxSubID: " + e.getMessage(), e); } return max; } @@ -150,7 +151,7 @@ public class Group extends Syncable { } db.release(conn); } catch (SQLException e) { - intlogger.error("SQLException " + e.getMessage()); + intlogger.error("PROV0002 getGroupsByClassfication: " + e.getMessage(), e); } return list; } @@ -175,7 +176,7 @@ public class Group extends Syncable { } db.release(conn); } catch (SQLException e) { - intlogger.warn("PROV0008 countActiveSubscriptions: " + e.getMessage()); + intlogger.warn("PROV0008 countActiveSubscriptions: " + e.getMessage(), e); } return count; } @@ -209,7 +210,7 @@ public class Group extends Syncable { public Group(JSONObject jo) throws InvalidObjectException { this("", "", ""); try { - // The JSONObject is assumed to contain a vnd.att-dr.group representation + // The JSONObject is assumed to contain a vnd.dmaap-dr.group representation this.groupid = jo.optInt("groupid", -1); String gname = jo.getString("name"); String gdescription = jo.getString("description"); @@ -229,7 +230,8 @@ public class Group extends Syncable { } catch (InvalidObjectException e) { throw e; } catch (Exception e) { - throw new InvalidObjectException("invalid JSON: " + e.getMessage()); + intlogger.warn("Invalid JSON: " + e.getMessage(), e); + throw new InvalidObjectException("Invalid JSON: " + e.getMessage()); } } @@ -237,7 +239,7 @@ public class Group extends Syncable { return groupid; } - public static Logger getIntlogger() { + public static EELFLogger getIntlogger() { return intlogger; } @@ -245,7 +247,7 @@ public class Group extends Syncable { this.groupid = groupid; } - public static void setIntlogger(Logger intlogger) { + public static void setIntlogger(EELFLogger intlogger) { Group.intlogger = intlogger; } @@ -346,14 +348,14 @@ public class Group extends Syncable { ps.close(); } catch (SQLException e) { rv = false; - intlogger.warn("PROV0005 doInsert: " + e.getMessage()); + intlogger.warn("PROV0005 doInsert: " + e.getMessage(), e); } finally { try { if (ps != null) { ps.close(); } } catch (SQLException e) { - intlogger.error("SQLException " + e.getMessage()); + intlogger.error(SQLEXCEPTION + e.getMessage(), e); } } return rv; @@ -375,14 +377,14 @@ public class Group extends Syncable { ps.executeUpdate(); } catch (SQLException e) { rv = false; - intlogger.warn("PROV0006 doUpdate: " + e.getMessage()); + intlogger.warn("PROV0006 doUpdate: " + e.getMessage(), e); } finally { try { if (ps != null) { ps.close(); } } catch (SQLException e) { - intlogger.error("SQLException " + e.getMessage()); + intlogger.error(SQLEXCEPTION + e.getMessage(), e); } } return rv; @@ -399,14 +401,14 @@ public class Group extends Syncable { ps.execute(); } catch (SQLException e) { rv = false; - intlogger.warn("PROV0007 doDelete: " + e.getMessage()); + intlogger.warn("PROV0007 doDelete: " + e.getMessage(), e); } finally { try { if (ps != null) { ps.close(); } } catch (SQLException e) { - intlogger.error("SQLException " + e.getMessage()); + intlogger.error(SQLEXCEPTION + e.getMessage(), e); } } return rv;