\r
package org.onap.dmaap.datarouter.provisioning.beans;\r
\r
-import java.io.InvalidObjectException;\r
-import java.sql.Connection;\r
-import java.sql.PreparedStatement;\r
-import java.sql.ResultSet;\r
-import java.sql.SQLException;\r
-import java.sql.Statement;\r
-import java.util.ArrayList;\r
-import java.util.Collection;\r
-import java.util.Date;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-import java.util.Set;\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.JSONArray;\r
+import org.json.JSONException;\r
import org.json.JSONObject;\r
import org.onap.dmaap.datarouter.provisioning.utils.DB;\r
import org.onap.dmaap.datarouter.provisioning.utils.JSONUtilities;\r
import org.onap.dmaap.datarouter.provisioning.utils.URLUtilities;\r
\r
+import java.io.InvalidObjectException;\r
+import java.sql.*;\r
+import java.util.Date;\r
+import java.util.*;\r
+\r
/**\r
* The representation of a Feed. Feeds can be retrieved from the DB, or stored/updated in the DB.\r
*\r
* @version $Id: Feed.java,v 1.13 2013/10/28 18:06:52 eby Exp $\r
*/\r
public class Feed extends Syncable {\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_feedid = getMaxFeedID() + 1;\r
+ private static final String SQLEXCEPTION = "SQLException: ";\r
\r
private int feedid;\r
private int groupid; //New field is added - Groups feature Rally:US708115 - 1610\r
private boolean suspended;\r
private Date last_mod;\r
private Date created_date;\r
+ private String aaf_instance;\r
\r
/**\r
* Check if a feed ID is valid.\r
try {\r
DB db = new DB();\r
Connection conn = db.getConnection();\r
- Statement stmt = conn.createStatement();\r
- ResultSet rs = stmt.executeQuery("select COUNT(*) from FEEDS where FEEDID = " + id);\r
- if (rs.next()) {\r
- count = rs.getInt(1);\r
+ try(PreparedStatement stmt = conn.prepareStatement("select COUNT(*) from FEEDS where FEEDID = ?")) {\r
+ stmt.setInt(1, id);\r
+ try(ResultSet rs = stmt.executeQuery()) {\r
+ if (rs.next()) {\r
+ count = rs.getInt(1);\r
+ }\r
+ }\r
}\r
- rs.close();\r
- stmt.close();\r
db.release(conn);\r
} catch (SQLException e) {\r
- e.printStackTrace();\r
+ intlogger.warn("PROV0024 Feed.isFeedValid: " + e.getMessage(), e);\r
}\r
return count != 0;\r
}\r
DB db = new DB();\r
@SuppressWarnings("resource")\r
Connection conn = db.getConnection();\r
- Statement stmt = conn.createStatement();\r
- ResultSet rs = stmt.executeQuery("select count(*) from FEEDS where DELETED = 0");\r
- if (rs.next()) {\r
- count = rs.getInt(1);\r
+ try(Statement stmt = conn.createStatement()) {\r
+ try (ResultSet rs = stmt.executeQuery("select count(*) from FEEDS where DELETED = 0")) {\r
+ if (rs.next()) {\r
+ count = rs.getInt(1);\r
+ }\r
+ }\r
}\r
- rs.close();\r
- stmt.close();\r
db.release(conn);\r
} catch (SQLException e) {\r
- intlogger.info("countActiveFeeds: " + e.getMessage());\r
- e.printStackTrace();\r
+ intlogger.warn("PROV0025 Feed.countActiveFeeds: " + e.getMessage(), e);\r
}\r
return count;\r
}\r
DB db = new DB();\r
@SuppressWarnings("resource")\r
Connection conn = db.getConnection();\r
- Statement stmt = conn.createStatement();\r
- ResultSet rs = stmt.executeQuery("select MAX(feedid) from FEEDS");\r
- if (rs.next()) {\r
- max = rs.getInt(1);\r
+ try(Statement stmt = conn.createStatement()) {\r
+ try (ResultSet rs = stmt.executeQuery("select MAX(feedid) from FEEDS")) {\r
+ if (rs.next()) {\r
+ max = rs.getInt(1);\r
+ }\r
+ }\r
}\r
- rs.close();\r
- stmt.close();\r
db.release(conn);\r
} catch (SQLException e) {\r
- intlogger.info("getMaxFeedID: " + e.getMessage());\r
- e.printStackTrace();\r
+ intlogger.warn("PROV0026 Feed.getMaxFeedID: " + e.getMessage(), e);\r
}\r
return max;\r
}\r
\r
public static Collection<Feed> getAllFeeds() {\r
- Map<Integer, Feed> map = new HashMap<Integer, Feed>();\r
+ Map<Integer, Feed> map = new HashMap<>();\r
try {\r
DB db = new DB();\r
@SuppressWarnings("resource")\r
Connection conn = db.getConnection();\r
- Statement stmt = conn.createStatement();\r
- ResultSet rs = stmt.executeQuery("select * from FEEDS");\r
- while (rs.next()) {\r
- Feed feed = new Feed(rs);\r
- map.put(feed.getFeedid(), feed);\r
- }\r
- rs.close();\r
+ try(Statement stmt = conn.createStatement()) {\r
+ try(ResultSet rs = stmt.executeQuery("select * from FEEDS")) {\r
+ while (rs.next()) {\r
+ Feed feed = new Feed(rs);\r
+ map.put(feed.getFeedid(), feed);\r
+ }\r
+ }\r
\r
- String sql = "select * from FEED_ENDPOINT_IDS";\r
- rs = stmt.executeQuery(sql);\r
- while (rs.next()) {\r
- int id = rs.getInt("FEEDID");\r
- Feed feed = map.get(id);\r
- if (feed != null) {\r
- FeedEndpointID epi = new FeedEndpointID(rs);\r
- Collection<FeedEndpointID> ecoll = feed.getAuthorization().getEndpoint_ids();\r
- ecoll.add(epi);\r
+ String sql = "select * from FEED_ENDPOINT_IDS";\r
+ try(ResultSet rs = stmt.executeQuery(sql)){\r
+ while (rs.next()) {\r
+ int id = rs.getInt("FEEDID");\r
+ Feed feed = map.get(id);\r
+ if (feed != null) {\r
+ FeedEndpointID epi = new FeedEndpointID(rs);\r
+ Collection<FeedEndpointID> ecoll = feed.getAuthorization().getEndpoint_ids();\r
+ ecoll.add(epi);\r
+ }\r
+ }\r
}\r
- }\r
- rs.close();\r
\r
- sql = "select * from FEED_ENDPOINT_ADDRS";\r
- rs = stmt.executeQuery(sql);\r
- while (rs.next()) {\r
- int id = rs.getInt("FEEDID");\r
- Feed feed = map.get(id);\r
- if (feed != null) {\r
- Collection<String> acoll = feed.getAuthorization().getEndpoint_addrs();\r
- acoll.add(rs.getString("ADDR"));\r
+ sql = "select * from FEED_ENDPOINT_ADDRS";\r
+ try(ResultSet rs = stmt.executeQuery(sql)) {\r
+ while (rs.next()) {\r
+ int id = rs.getInt("FEEDID");\r
+ Feed feed = map.get(id);\r
+ if (feed != null) {\r
+ Collection<String> acoll = feed.getAuthorization().getEndpoint_addrs();\r
+ acoll.add(rs.getString("ADDR"));\r
+ }\r
+ }\r
}\r
}\r
- rs.close();\r
-\r
- stmt.close();\r
db.release(conn);\r
} catch (SQLException e) {\r
- e.printStackTrace();\r
+ intlogger.warn("PROV0027 Feed.getAllFeeds: " + e.getMessage(), e);\r
}\r
return map.values();\r
}\r
\r
public static List<String> getFilteredFeedUrlList(final String name, final String val) {\r
- List<String> list = new ArrayList<String>();\r
+ List<String> list = new ArrayList<>();\r
String sql = "select SELF_LINK from FEEDS where DELETED = 0";\r
if (name.equals("name")) {\r
sql += " and NAME = ?";\r
DB db = new DB();\r
@SuppressWarnings("resource")\r
Connection conn = db.getConnection();\r
- PreparedStatement ps = conn.prepareStatement(sql);\r
- if (sql.indexOf('?') >= 0)\r
- ps.setString(1, val);\r
- ResultSet rs = ps.executeQuery();\r
- while (rs.next()) {\r
- String t = rs.getString(1);\r
- list.add(t.trim());\r
+ try(PreparedStatement ps = conn.prepareStatement(sql)) {\r
+ if (sql.indexOf('?') >= 0)\r
+ ps.setString(1, val);\r
+ try(ResultSet rs = ps.executeQuery()) {\r
+ while (rs.next()) {\r
+ String t = rs.getString(1);\r
+ list.add(t.trim());\r
+ }\r
+ }\r
}\r
- rs.close();\r
- ps.close();\r
db.release(conn);\r
} catch (SQLException e) {\r
- e.printStackTrace();\r
+ intlogger.warn("PROV0028 Feed.getFilteredFeedUrlList: " + e.getMessage(), e);\r
}\r
return list;\r
}\r
try {\r
DB db = new DB();\r
Connection conn = db.getConnection();\r
- Statement stmt = conn.createStatement();\r
- ResultSet rs = stmt.executeQuery(sql);\r
- if (rs.next()) {\r
- feed = new Feed(rs);\r
- rs.close();\r
-\r
- sql = "select * from FEED_ENDPOINT_IDS where FEEDID = " + feed.feedid;\r
- rs = stmt.executeQuery(sql);\r
- Collection<FeedEndpointID> ecoll = feed.getAuthorization().getEndpoint_ids();\r
- while (rs.next()) {\r
- FeedEndpointID epi = new FeedEndpointID(rs);\r
- ecoll.add(epi);\r
+ try (Statement stmt = conn.createStatement()) {\r
+ try (ResultSet rs = stmt.executeQuery(sql)) {\r
+ if (rs.next()) {\r
+ feed = new Feed(rs);\r
+ }\r
}\r
- rs.close();\r
-\r
- sql = "select * from FEED_ENDPOINT_ADDRS where FEEDID = " + feed.feedid;\r
- rs = stmt.executeQuery(sql);\r
- Collection<String> acoll = feed.getAuthorization().getEndpoint_addrs();\r
- while (rs.next()) {\r
- acoll.add(rs.getString("ADDR"));\r
+ if (feed != null) {\r
+ sql = "select * from FEED_ENDPOINT_IDS where FEEDID = " + feed.feedid;\r
+ try (ResultSet rs = stmt.executeQuery(sql)) {\r
+ Collection<FeedEndpointID> ecoll = feed.getAuthorization().getEndpoint_ids();\r
+ while (rs.next()) {\r
+ FeedEndpointID epi = new FeedEndpointID(rs);\r
+ ecoll.add(epi);\r
+ }\r
+ }\r
+ sql = "select * from FEED_ENDPOINT_ADDRS where FEEDID = " + feed.feedid;\r
+ try (ResultSet rs = stmt.executeQuery(sql)) {\r
+ Collection<String> acoll = feed.getAuthorization().getEndpoint_addrs();\r
+ while (rs.next()) {\r
+ acoll.add(rs.getString("ADDR"));\r
+ }\r
+ }\r
}\r
}\r
- rs.close();\r
- stmt.close();\r
db.release(conn);\r
} catch (SQLException e) {\r
- e.printStackTrace();\r
+ intlogger.warn("PROV0029 Feed.getFeedBySQL: " + e.getMessage(), e);\r
}\r
return feed;\r
}\r
this.suspended = false;\r
this.last_mod = new Date();\r
this.created_date = new Date();\r
+ this.aaf_instance = "";\r
}\r
\r
public Feed(ResultSet rs) throws SQLException {\r
this.suspended = rs.getBoolean("SUSPENDED");\r
this.last_mod = rs.getDate("LAST_MOD");\r
this.created_date = rs.getTimestamp("CREATED_DATE");\r
+ this.aaf_instance = rs.getString("AAF_INSTANCE");\r
}\r
\r
public Feed(JSONObject jo) throws InvalidObjectException {\r
this("", "", "", "");\r
try {\r
- // The JSONObject is assumed to contain a vnd.att-dr.feed representation\r
+ // The JSONObject is assumed to contain a vnd.dmaap-dr.feed representation\r
this.feedid = jo.optInt("feedid", -1);\r
- this.groupid = jo.optInt("groupid"); //New field is added - Groups feature Rally:US708115 - 1610\r
+ this.groupid = jo.optInt("groupid");\r
this.name = jo.getString("name");\r
+ this.aaf_instance = jo.optString("aaf_instance", "legacy");\r
+ if(!(aaf_instance.equalsIgnoreCase("legacy")) && aaf_instance.length() > 255){\r
+ throw new InvalidObjectException("aaf_instance field is too long");\r
+ }\r
if (name.length() > 255)\r
throw new InvalidObjectException("name field is too long");\r
- this.version = jo.getString("version");\r
- if (version.length() > 20)\r
+ try {\r
+ this.version = jo.getString("version");\r
+ } catch (JSONException e) {\r
+ intlogger.warn("PROV0023 Feed.Feed: " + e.getMessage(), e);\r
+ this.version = null;\r
+ }\r
+ if(version != null && version.length() > 20)\r
throw new InvalidObjectException("version field is too long");\r
this.description = jo.optString("description");\r
- this.business_description = jo.optString("business_description"); // New field is added - Groups feature Rally:US708102 - 1610\r
+ this.business_description = jo.optString("business_description");\r
if (description.length() > 1000)\r
throw new InvalidObjectException("technical description field is too long");\r
-\r
- if (business_description.length() > 1000) // New field is added - Groups feature Rally:US708102 - 1610\r
+ if (business_description.length() > 1000)\r
throw new InvalidObjectException("business description field is too long");\r
-\r
this.authorization = new FeedAuthorization();\r
JSONObject jauth = jo.getJSONObject("authorization");\r
this.authorization.setClassification(jauth.getString("classification"));\r
if (this.authorization.getClassification().length() > 32)\r
throw new InvalidObjectException("classification field is too long");\r
- JSONArray ja = jauth.getJSONArray("endpoint_ids");\r
- for (int i = 0; i < ja.length(); i++) {\r
- JSONObject id = ja.getJSONObject(i);\r
+ JSONArray endPointIds = jauth.getJSONArray("endpoint_ids");\r
+ for (int i = 0; i < endPointIds.length(); i++) {\r
+ JSONObject id = endPointIds.getJSONObject(i);\r
FeedEndpointID fid = new FeedEndpointID(id.getString("id"), id.getString("password"));\r
- if (fid.getId().length() > 20)\r
+ if (fid.getId().length() > 60)\r
throw new InvalidObjectException("id field is too long (" + fid.getId() + ")");\r
if (fid.getPassword().length() > 32)\r
- throw new InvalidObjectException("password field is too long (" + fid.getPassword() + ")");\r
+ throw new InvalidObjectException("password field is too long ("+ fid.getPassword()+")"); //Fortify scan fixes - Privacy Violation\r
this.authorization.getEndpoint_ids().add(fid);\r
}\r
- if (this.authorization.getEndpoint_ids().size() < 1)\r
+ if (this.authorization.getEndpoint_ids().isEmpty())\r
throw new InvalidObjectException("need to specify at least one endpoint_id");\r
- ja = jauth.getJSONArray("endpoint_addrs");\r
- for (int i = 0; i < ja.length(); i++) {\r
- String addr = ja.getString(i);\r
+ endPointIds = jauth.getJSONArray("endpoint_addrs");\r
+ for (int i = 0; i < endPointIds.length(); i++) {\r
+ String addr = endPointIds.getString(i);\r
if (!JSONUtilities.validIPAddrOrSubnet(addr))\r
throw new InvalidObjectException("bad IP addr or subnet mask: " + addr);\r
this.authorization.getEndpoint_addrs().add(addr);\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
fl.setLog(URLUtilities.generateFeedLogURL(feedid));\r
}\r
\r
+ public String getAafInstance() {\r
+ return aaf_instance;\r
+ }\r
+\r
+ public void setAaf_instance(String aaf_instance) {\r
+ this.aaf_instance = aaf_instance;\r
+ }\r
+\r
//new getter setters for groups- Rally:US708115 - 1610\r
public int getGroupid() {\r
return groupid;\r
this.suspended = suspended;\r
}\r
\r
- public Date getLast_mod() {\r
- return last_mod;\r
- }\r
-\r
- public Date getCreated_date() {\r
- return created_date;\r
- }\r
-\r
@Override\r
public JSONObject asJSONObject() {\r
JSONObject jo = new JSONObject();\r
jo.put("suspend", suspended);\r
jo.put("last_mod", last_mod.getTime());\r
jo.put("created_date", created_date.getTime());\r
+ jo.put("aaf_instance", aaf_instance);\r
return jo;\r
}\r
\r
ps.execute();\r
} catch (SQLException e) {\r
rv = false;\r
- intlogger.warn("PROV0007 doDelete: " + e.getMessage());\r
- e.printStackTrace();\r
+ intlogger.error("PROV0007 doDelete: " + e.getMessage(), e);\r
} finally {\r
try {\r
- ps.close();\r
+ if(ps!=null) {\r
+ ps.close();\r
+ }\r
} catch (SQLException e) {\r
- e.printStackTrace();\r
+ intlogger.error(SQLEXCEPTION + e.getMessage(), e);\r
}\r
}\r
return rv;\r
@Override\r
public synchronized boolean doInsert(Connection c) {\r
boolean rv = true;\r
-// PreparedStatement ps = null;\r
try {\r
if (feedid == -1) {\r
-// // Get the next feedid\r
-// String sql = "insert into FEEDS_UNIQUEID (FEEDID) values (0)";\r
-// ps = c.prepareStatement(sql, new String[] { "FEEDID" });\r
-// ps.execute();\r
-// ResultSet rs = ps.getGeneratedKeys();\r
-// rs.first();\r
-// setFeedid(rs.getInt(1));\r
- // No feed ID assigned yet, so assign the next available one\r
setFeedid(next_feedid++);\r
}\r
// In case we insert a feed from synchronization\r
// Create FEED_ENDPOINT_IDS rows\r
FeedAuthorization auth = getAuthorization();\r
String sql = "insert into FEED_ENDPOINT_IDS values (?, ?, ?)";\r
- PreparedStatement ps2 = c.prepareStatement(sql);\r
- for (FeedEndpointID fid : auth.getEndpoint_ids()) {\r
- ps2.setInt(1, feedid);\r
- ps2.setString(2, fid.getId());\r
- ps2.setString(3, fid.getPassword());\r
- ps2.executeUpdate();\r
+ try(PreparedStatement ps2 = c.prepareStatement(sql)) {\r
+ for (FeedEndpointID fid : auth.getEndpoint_ids()) {\r
+ ps2.setInt(1, feedid);\r
+ ps2.setString(2, fid.getId());\r
+ ps2.setString(3, fid.getPassword());\r
+ ps2.executeUpdate();\r
+ }\r
}\r
- ps2.close();\r
\r
// Create FEED_ENDPOINT_ADDRS rows\r
sql = "insert into FEED_ENDPOINT_ADDRS values (?, ?)";\r
- ps2 = c.prepareStatement(sql);\r
- for (String t : auth.getEndpoint_addrs()) {\r
- ps2.setInt(1, feedid);\r
- ps2.setString(2, t);\r
- ps2.executeUpdate();\r
+ try(PreparedStatement ps2 = c.prepareStatement(sql)) {\r
+ for (String t : auth.getEndpoint_addrs()) {\r
+ ps2.setInt(1, feedid);\r
+ ps2.setString(2, t);\r
+ ps2.executeUpdate();\r
+ }\r
}\r
- ps2.close();\r
\r
// Finally, create the FEEDS row\r
- sql = "insert into FEEDS (FEEDID, NAME, VERSION, DESCRIPTION, AUTH_CLASS, PUBLISHER, SELF_LINK, PUBLISH_LINK, SUBSCRIBE_LINK, LOG_LINK, DELETED, SUSPENDED,BUSINESS_DESCRIPTION, GROUPID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?, ?)";\r
- ps2 = c.prepareStatement(sql);\r
- ps2.setInt(1, feedid);\r
- ps2.setString(2, getName());\r
- ps2.setString(3, getVersion());\r
- ps2.setString(4, getDescription());\r
- ps2.setString(5, getAuthorization().getClassification());\r
- ps2.setString(6, getPublisher());\r
- ps2.setString(7, getLinks().getSelf());\r
- ps2.setString(8, getLinks().getPublish());\r
- ps2.setString(9, getLinks().getSubscribe());\r
- ps2.setString(10, getLinks().getLog());\r
- ps2.setBoolean(11, isDeleted());\r
- ps2.setBoolean(12, isSuspended());\r
- ps2.setString(13, getBusiness_description()); // New field is added - Groups feature Rally:US708102 - 1610\r
- ps2.setInt(14, groupid); //New field is added - Groups feature Rally:US708115 - 1610\r
- ps2.executeUpdate();\r
- ps2.close();\r
+ sql = "insert into FEEDS (FEEDID, NAME, VERSION, DESCRIPTION, AUTH_CLASS, PUBLISHER, SELF_LINK, PUBLISH_LINK, SUBSCRIBE_LINK, LOG_LINK, DELETED, SUSPENDED,BUSINESS_DESCRIPTION, GROUPID, AAF_INSTANCE) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";\r
+ try(PreparedStatement ps2 = c.prepareStatement(sql)) {\r
+ ps2.setInt(1, feedid);\r
+ ps2.setString(2, getName());\r
+ ps2.setString(3, getVersion());\r
+ ps2.setString(4, getDescription());\r
+ ps2.setString(5, getAuthorization().getClassification());\r
+ ps2.setString(6, getPublisher());\r
+ ps2.setString(7, getLinks().getSelf());\r
+ ps2.setString(8, getLinks().getPublish());\r
+ ps2.setString(9, getLinks().getSubscribe());\r
+ ps2.setString(10, getLinks().getLog());\r
+ ps2.setBoolean(11, isDeleted());\r
+ ps2.setBoolean(12, isSuspended());\r
+ ps2.setString(13, getBusiness_description());\r
+ ps2.setInt(14, groupid);\r
+ ps2.setString(15, getAafInstance());\r
+ ps2.executeUpdate();\r
+ }\r
} catch (SQLException e) {\r
rv = false;\r
- intlogger.warn("PROV0005 doInsert: " + e.getMessage());\r
- e.printStackTrace();\r
-// } finally {\r
-// try {\r
-// ps.close();\r
-// } catch (SQLException e) {\r
-// e.printStackTrace();\r
-// }\r
+ intlogger.error("PROV0005 doInsert: " + e.getMessage(), e);\r
}\r
return rv;\r
}\r
ps.setString(2, getAuthorization().getClassification());\r
ps.setInt(3, deleted ? 1 : 0);\r
ps.setInt(4, suspended ? 1 : 0);\r
- ps.setString(5, getBusiness_description()); // New field is added - Groups feature Rally:US708102 - 1610\r
- ps.setInt(6, groupid); //New field is added - Groups feature Rally:US708115 - 1610\r
+ ps.setString(5, getBusiness_description());\r
+ ps.setInt(6, groupid);\r
ps.setInt(7, feedid);\r
ps.executeUpdate();\r
ps.close();\r
} catch (SQLException e) {\r
rv = false;\r
- intlogger.warn("PROV0006 doUpdate: " + e.getMessage());\r
- e.printStackTrace();\r
+ intlogger.warn("PROV0006 doUpdate: " + e.getMessage(), e);\r
} finally {\r
try {\r
if (ps != null)\r
ps.close();\r
} catch (SQLException e) {\r
- e.printStackTrace();\r
+ intlogger.error(SQLEXCEPTION + e.getMessage(), e);\r
}\r
}\r
return rv;\r
ps.close();\r
} catch (SQLException e) {\r
rv = false;\r
- intlogger.warn("PROV0006 doUpdate: " + e.getMessage());\r
- e.printStackTrace();\r
+ intlogger.warn("PROV0008 changeOwnerShip: " + e.getMessage(), e);\r
} finally {\r
try {\r
- ps.close();\r
+ if(ps!=null) {\r
+ ps.close();\r
+ }\r
} catch (SQLException e) {\r
- e.printStackTrace();\r
+ intlogger.error(SQLEXCEPTION + e.getMessage(), e);\r
}\r
}\r
return rv;\r
return false;\r
if (suspended != of.suspended)\r
return false;\r
+ if (!aaf_instance.equals(of.aaf_instance))\r
+ return false;\r
return true;\r
}\r
\r
public String toString() {\r
return "FEED: feedid=" + feedid + ", name=" + name + ", version=" + version;\r
}\r
-}\r
+\r
+ @Override\r
+ public int hashCode() {\r
+ return super.hashCode();\r
+ }\r
+}
\ No newline at end of file