Update project structure to org.onap
[dmaap/datarouter.git] / datarouter-prov / src / main / java / org / onap / dmaap / datarouter / provisioning / beans / DeliveryExtraRecord.java
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/DeliveryExtraRecord.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/beans/DeliveryExtraRecord.java
new file mode 100644 (file)
index 0000000..bf7ead6
--- /dev/null
@@ -0,0 +1,68 @@
+/*******************************************************************************\r
+ * ============LICENSE_START==================================================\r
+ * * org.onap.dmaap\r
+ * * ===========================================================================\r
+ * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
+ * * ===========================================================================\r
+ * * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * * you may not use this file except in compliance with the License.\r
+ * * You may obtain a copy of the License at\r
+ * * \r
+ *  *      http://www.apache.org/licenses/LICENSE-2.0\r
+ * * \r
+ *  * Unless required by applicable law or agreed to in writing, software\r
+ * * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * * See the License for the specific language governing permissions and\r
+ * * limitations under the License.\r
+ * * ============LICENSE_END====================================================\r
+ * *\r
+ * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
+ * *\r
+ ******************************************************************************/\r
+\r
+\r
+package org.onap.dmaap.datarouter.provisioning.beans;\r
+\r
+import java.sql.PreparedStatement;\r
+import java.sql.ResultSet;\r
+import java.sql.SQLException;\r
+import java.sql.Types;\r
+import java.text.ParseException;\r
+\r
+/**\r
+ * The representation of a Delivery Extra (DLX) Record, as retrieved from the DB.\r
+ * @author Robert Eby\r
+ * @version $Id: DeliveryExtraRecord.java,v 1.1 2013/10/28 18:06:52 eby Exp $\r
+ */\r
+public class DeliveryExtraRecord extends BaseLogRecord {\r
+       private int  subid;\r
+       private long contentLength2;\r
+\r
+       public DeliveryExtraRecord(String[] pp) throws ParseException {\r
+               super(pp);\r
+               this.subid = Integer.parseInt(pp[4]);\r
+               this.contentLength2 = Long.parseLong(pp[6]);\r
+       }\r
+       public DeliveryExtraRecord(ResultSet rs) throws SQLException {\r
+               super(rs);\r
+               // Note: because this record should be "rare" these fields are mapped to unconventional fields in the DB\r
+               this.subid  = rs.getInt("DELIVERY_SUBID");\r
+               this.contentLength2 = rs.getInt("CONTENT_LENGTH_2");\r
+       }\r
+       @Override\r
+       public void load(PreparedStatement ps) throws SQLException {\r
+               ps.setString(1, "dlx");         // field 1: type\r
+               super.load(ps);                         // loads fields 2-8\r
+               ps.setNull( 9, Types.VARCHAR);\r
+               ps.setNull(10, Types.VARCHAR);\r
+               ps.setNull(11, Types.VARCHAR);\r
+               ps.setNull(12, Types.INTEGER);\r
+               ps.setInt (13, subid);\r
+               ps.setNull(14, Types.VARCHAR);\r
+               ps.setNull(15, Types.INTEGER);\r
+               ps.setNull(16, Types.INTEGER);\r
+               ps.setNull(17, Types.VARCHAR);\r
+               ps.setLong(19, contentLength2);\r
+       }\r
+}\r