1 /*******************************************************************************
\r 
   2  * ============LICENSE_START==================================================
\r 
   4  * * ===========================================================================
\r 
   5  * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r 
   6  * * ===========================================================================
\r 
   7  * * Licensed under the Apache License, Version 2.0 (the "License");
\r 
   8  * * you may not use this file except in compliance with the License.
\r 
   9  * * You may obtain a copy of the License at
\r 
  11  *  *      http://www.apache.org/licenses/LICENSE-2.0
\r 
  13  *  * Unless required by applicable law or agreed to in writing, software
\r 
  14  * * distributed under the License is distributed on an "AS IS" BASIS,
\r 
  15  * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r 
  16  * * See the License for the specific language governing permissions and
\r 
  17  * * limitations under the License.
\r 
  18  * * ============LICENSE_END====================================================
\r 
  20  * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r 
  22  ******************************************************************************/
\r 
  25 package com.att.research.datarouter.provisioning.beans;
\r 
  27 import java.sql.PreparedStatement;
\r 
  28 import java.sql.ResultSet;
\r 
  29 import java.sql.SQLException;
\r 
  30 import java.sql.Types;
\r 
  31 import java.text.ParseException;
\r 
  34  * The representation of a Delivery Extra (DLX) Record, as retrieved from the DB.
\r 
  35  * @author Robert Eby
\r 
  36  * @version $Id: DeliveryExtraRecord.java,v 1.1 2013/10/28 18:06:52 eby Exp $
\r 
  38 public class DeliveryExtraRecord extends BaseLogRecord {
\r 
  40         private long contentLength2;
\r 
  42         public DeliveryExtraRecord(String[] pp) throws ParseException {
\r 
  44                 this.subid = Integer.parseInt(pp[4]);
\r 
  45                 this.contentLength2 = Long.parseLong(pp[6]);
\r 
  47         public DeliveryExtraRecord(ResultSet rs) throws SQLException {
\r 
  49                 // Note: because this record should be "rare" these fields are mapped to unconventional fields in the DB
\r 
  50                 this.subid  = rs.getInt("DELIVERY_SUBID");
\r 
  51                 this.contentLength2 = rs.getInt("CONTENT_LENGTH_2");
\r 
  54         public void load(PreparedStatement ps) throws SQLException {
\r 
  55                 ps.setString(1, "dlx");         // field 1: type
\r 
  56                 super.load(ps);                         // loads fields 2-8
\r 
  57                 ps.setNull( 9, Types.VARCHAR);
\r 
  58                 ps.setNull(10, Types.VARCHAR);
\r 
  59                 ps.setNull(11, Types.VARCHAR);
\r 
  60                 ps.setNull(12, Types.INTEGER);
\r 
  61                 ps.setInt (13, subid);
\r 
  62                 ps.setNull(14, Types.VARCHAR);
\r 
  63                 ps.setNull(15, Types.INTEGER);
\r 
  64                 ps.setNull(16, Types.INTEGER);
\r 
  65                 ps.setNull(17, Types.VARCHAR);
\r 
  66                 ps.setLong(19, contentLength2);
\r