Code style cleanup for prov authz and beans
[dmaap/datarouter.git] / datarouter-prov / src / main / java / org / onap / dmaap / datarouter / provisioning / beans / PubFailRecord.java
index de2ad73..719b44f 100644 (file)
@@ -7,9 +7,9 @@
  * * 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
+ * *\r
  *  *      http://www.apache.org/licenses/LICENSE-2.0\r
- * * \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
 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 Publish Failure (PBF) Record, as retrieved from the DB.\r
+ *\r
  * @author Robert Eby\r
  * @version $Id: PubFailRecord.java,v 1.1 2013/10/28 18:06:53 eby Exp $\r
  */\r
+\r
 public class PubFailRecord extends BaseLogRecord {\r
-       private long contentLengthReceived;\r
-       private String sourceIP;\r
-       private String user;\r
-       private String error;\r
+    private long contentLengthReceived;\r
+    private String sourceIP;\r
+    private String user;\r
+    private String error;\r
+\r
+    /**\r
+     * PBF record constructor.\r
+     * @param pp string array of PBF attributes\r
+     * @throws ParseException in case of parse error\r
+     */\r
+    public PubFailRecord(String[] pp) throws ParseException {\r
+        super(pp);\r
+        this.contentLengthReceived = Long.parseLong(pp[8]);\r
+        this.sourceIP = pp[9];\r
+        this.user = pp[10];\r
+        this.error = pp[11];\r
+    }\r
+\r
+    public long getContentLengthReceived() {\r
+        return contentLengthReceived;\r
+    }\r
+\r
+    public String getSourceIP() {\r
+        return sourceIP;\r
+    }\r
+\r
+    public String getUser() {\r
+        return user;\r
+    }\r
+\r
+    public String getError() {\r
+        return error;\r
+    }\r
 \r
-       public PubFailRecord(String[] pp) throws ParseException {\r
-               super(pp);\r
-               this.contentLengthReceived = Long.parseLong(pp[8]);\r
-               this.sourceIP = pp[9];\r
-               this.user     = pp[10];\r
-               this.error    = pp[11];\r
-       }\r
-       public PubFailRecord(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.contentLengthReceived = rs.getLong("CONTENT_LENGTH_2");\r
-               this.sourceIP = rs.getString("REMOTE_ADDR");\r
-               this.user     = rs.getString("USER");\r
-               this.error    = rs.getString("FEED_FILEID");\r
-       }\r
-       public long getContentLengthReceived() {\r
-               return contentLengthReceived;\r
-       }\r
-       public String getSourceIP() {\r
-               return sourceIP;\r
-       }\r
-       public String getUser() {\r
-               return user;\r
-       }\r
-       public String getError() {\r
-               return error;\r
-       }\r
-       @Override\r
-       public void load(PreparedStatement ps) throws SQLException {\r
-               ps.setString(1, "pbf");         // field 1: type\r
-               super.load(ps);                         // loads fields 2-8\r
-               ps.setString( 9, getError());\r
-               ps.setString(10, getSourceIP());\r
-               ps.setString(11, getUser());\r
-               ps.setNull  (12, Types.INTEGER);\r
-               ps.setNull  (13, Types.INTEGER);\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, getContentLengthReceived());\r
-       }\r
+    @Override\r
+    public void load(PreparedStatement ps) throws SQLException {\r
+        ps.setString(1, "pbf");        // field 1: type\r
+        super.load(ps);                // loads fields 2-8\r
+        ps.setString(9, getError());\r
+        ps.setString(10, getSourceIP());\r
+        ps.setString(11, getUser());\r
+        ps.setNull(12, Types.INTEGER);\r
+        ps.setNull(13, Types.INTEGER);\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, getContentLengthReceived());\r
+        ps.setNull(20, Types.VARCHAR);\r
+    }\r
 }\r