Class SubversionLogVTI

java.lang.Object
org.apache.derby.vti.VTITemplate
org.apache.derby.vti.StringColumnVTI
org.apache.derbyDemo.vtis.core.FlatFileVTI
org.apache.derbyDemo.vtis.example.SubversionLogVTI
All Implemented Interfaces:
AutoCloseable, ResultSet, Wrapper, org.apache.derby.vti.AwareVTI

public class SubversionLogVTI extends FlatFileVTI

This VTI makes a table out of the output of the subversion log ("svn log") command.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.derby.vti.VTITemplate

    org.apache.derby.vti.VTITemplate.ColumnDescriptor
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    private static final String[]
     
    private static final int
     
    private static final int
     
    private static final int
     
    private static final int
     
    private static final String
     
    private static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    SubversionLogVTI(String logFileName)
    Build a SubversionLogVTI given the name of the output file created by the "svn log" command.
  • Method Summary

    Modifier and Type
    Method
    Description
    Subversion formats timestamps thusly: "2007-09-16 11:17:37 -0700 (Sun, 16 Sep 2007)"
    getTimestamp(int columnIndex)
    Subversion formats timestamps thusly: "2007-09-16 11:17:37 -0700 (Sun, 16 Sep 2007)"
    private boolean
    Returns true if a line is a record header.
    protected String[]
    Parse the next chunk of text, using readLine(), and return the next row.
    private String
    readField(String mainline, int[] oldIdx)
    Read the next field in the main line of the record.
    private String
    Read a line, possibly just using the last line that was pushed back.
    static ResultSet
    subversionLogVTI(String logFileName)
    This is the method which is registered as a table function.

    Methods inherited from class org.apache.derbyDemo.vtis.core.FlatFileVTI

    close, getLineNumber, getMetaData, getRawColumn, getTextFileName, next, readLine, wrap, wrap

    Methods inherited from class org.apache.derby.vti.StringColumnVTI

    findColumn, getAsciiStream, getBigDecimal, getBinaryStream, getBlob, getBoolean, getByte, getBytes, getClob, getColumnCount, getColumnName, getDate, getDouble, getFloat, getInt, getLong, getShort, getString, getTime, setColumnNames, wasNull

    Methods inherited from class org.apache.derby.vti.VTITemplate

    absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, first, getArray, getArray, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBlob, getBoolean, getByte, getBytes, getCharacterStream, getCharacterStream, getClob, getConcurrency, getContext, getCursorName, getDate, getDate, getDate, getDouble, getFetchDirection, getFetchSize, getFloat, getHoldability, getInt, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getReturnTableSignature, getRow, getRowId, getRowId, getShort, getSQLXML, getSQLXML, getStatement, getString, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, isWrapperFor, last, moveToCurrentRow, moveToInsertRow, notImplemented, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setContext, setFetchDirection, setFetchSize, unwrap, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.sql.ResultSet

    updateObject, updateObject, updateObject, updateObject
  • Field Details

  • Constructor Details

    • SubversionLogVTI

      public SubversionLogVTI(String logFileName)

      Build a SubversionLogVTI given the name of the output file created by the "svn log" command.

  • Method Details

    • subversionLogVTI

      public static ResultSet subversionLogVTI(String logFileName) throws SQLException

      This is the method which is registered as a table function.

      Throws:
      SQLException
    • parseRow

      protected String[] parseRow() throws SQLException

      Parse the next chunk of text, using readLine(), and return the next row. Returns null if the file is exhausted.

      Specified by:
      parseRow in class FlatFileVTI
      Throws:
      SQLException
    • getTimestamp

      public Timestamp getTimestamp(int columnIndex) throws SQLException

      Subversion formats timestamps thusly: "2007-09-16 11:17:37 -0700 (Sun, 16 Sep 2007)"

      Specified by:
      getTimestamp in interface ResultSet
      Overrides:
      getTimestamp in class org.apache.derby.vti.StringColumnVTI
      Throws:
      SQLException
    • readField

      private String readField(String mainline, int[] oldIdx) throws SQLException

      Read the next field in the main line of the record. Fields are delimited by | or line-end.

      Throws:
      SQLException
    • isRecordHeader

      private boolean isRecordHeader(String line)

      Returns true if a line is a record header.

    • readNextLine

      private String readNextLine() throws SQLException

      Read a line, possibly just using the last line that was pushed back.

      Throws:
      SQLException
    • getDateFormatter

      private SimpleDateFormat getDateFormatter()

      Subversion formats timestamps thusly: "2007-09-16 11:17:37 -0700 (Sun, 16 Sep 2007)"