import java.sql.Statement;\r
import java.util.*;\r
\r
-import org.apache.log4j.Logger;\r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
import org.json.JSONObject;\r
import org.onap.dmaap.datarouter.provisioning.utils.DB;\r
-import org.onap.dmaap.datarouter.provisioning.utils.URLUtilities;\r
\r
/**\r
* The representation of a Subscription. Subscriptions can be retrieved from the DB, or stored/updated in the DB.\r
*/\r
public class Group extends Syncable {\r
\r
- private static Logger intlogger = Logger.getLogger("org.onap.dmaap.datarouter.provisioning.internal");\r
+ private static EELFLogger intlogger = EELFManager.getInstance().getLogger("InternalLog");\r
private static int next_groupid = getMaxGroupID() + 1;\r
+ private static final String SQLEXCEPTION = "SQLException: ";\r
\r
private int groupid;\r
private String authid;\r
}\r
db.release(conn);\r
} catch (SQLException e) {\r
- intlogger.error("SQLException " + e.getMessage());\r
+ intlogger.error("PROV0009 getGroupsForSQL: " + e.getMessage(), e);\r
}\r
return list;\r
}\r
}\r
db.release(conn);\r
} catch (SQLException e) {\r
- intlogger.info("getMaxSubID: " + e.getMessage());\r
+ intlogger.info("PROV0001 getMaxSubID: " + e.getMessage(), e);\r
}\r
return max;\r
}\r
}\r
db.release(conn);\r
} catch (SQLException e) {\r
- intlogger.error("SQLException " + e.getMessage());\r
+ intlogger.error("PROV0002 getGroupsByClassfication: " + e.getMessage(), e);\r
}\r
return list;\r
}\r
}\r
db.release(conn);\r
} catch (SQLException e) {\r
- intlogger.warn("PROV0008 countActiveSubscriptions: " + e.getMessage());\r
+ intlogger.warn("PROV0008 countActiveSubscriptions: " + e.getMessage(), e);\r
}\r
return count;\r
}\r
public Group(JSONObject jo) throws InvalidObjectException {\r
this("", "", "");\r
try {\r
- // The JSONObject is assumed to contain a vnd.att-dr.group representation\r
+ // The JSONObject is assumed to contain a vnd.dmaap-dr.group representation\r
this.groupid = jo.optInt("groupid", -1);\r
String gname = jo.getString("name");\r
String gdescription = jo.getString("description");\r
} catch (InvalidObjectException e) {\r
throw e;\r
} catch (Exception e) {\r
- throw new InvalidObjectException("invalid JSON: " + e.getMessage());\r
+ intlogger.warn("Invalid JSON: " + e.getMessage(), e);\r
+ throw new InvalidObjectException("Invalid JSON: " + e.getMessage());\r
}\r
}\r
\r
return groupid;\r
}\r
\r
- public static Logger getIntlogger() {\r
+ public static EELFLogger getIntlogger() {\r
return intlogger;\r
}\r
\r
this.groupid = groupid;\r
}\r
\r
- public static void setIntlogger(Logger intlogger) {\r
+ public static void setIntlogger(EELFLogger intlogger) {\r
Group.intlogger = intlogger;\r
}\r
\r
ps.close();\r
} catch (SQLException e) {\r
rv = false;\r
- intlogger.warn("PROV0005 doInsert: " + e.getMessage());\r
+ intlogger.warn("PROV0005 doInsert: " + e.getMessage(), e);\r
} finally {\r
try {\r
if (ps != null) {\r
ps.close();\r
}\r
} catch (SQLException e) {\r
- intlogger.error("SQLException " + e.getMessage());\r
+ intlogger.error(SQLEXCEPTION + e.getMessage(), e);\r
}\r
}\r
return rv;\r
ps.executeUpdate();\r
} catch (SQLException e) {\r
rv = false;\r
- intlogger.warn("PROV0006 doUpdate: " + e.getMessage());\r
+ intlogger.warn("PROV0006 doUpdate: " + e.getMessage(), e);\r
} finally {\r
try {\r
if (ps != null) {\r
ps.close();\r
}\r
} catch (SQLException e) {\r
- intlogger.error("SQLException " + e.getMessage());\r
+ intlogger.error(SQLEXCEPTION + e.getMessage(), e);\r
}\r
}\r
return rv;\r
ps.execute();\r
} catch (SQLException e) {\r
rv = false;\r
- intlogger.warn("PROV0007 doDelete: " + e.getMessage());\r
+ intlogger.warn("PROV0007 doDelete: " + e.getMessage(), e);\r
} finally {\r
try {\r
if (ps != null) {\r
ps.close();\r
}\r
} catch (SQLException e) {\r
- intlogger.error("SQLException " + e.getMessage());\r
+ intlogger.error(SQLEXCEPTION + e.getMessage(), e);\r
}\r
}\r
return rv;\r