Class ApacheServerLogVTI

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

public class ApacheServerLogVTI extends org.apache.derby.vti.XmlVTI

This is an XML-reading VTI which has been tweaked to handle the formatting of timestamps and nulls found in Apache server logs.

  • 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
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct from the same arguments as our superclass.
  • Method Summary

    Modifier and Type
    Method
    Description
    apacheNaturalLogFile(String xmlResourceName)
    Create from a file name identifying the server log file
    The Apache Server's logs format timestamps thusly: "01/Jul/2002:17:31:19 +0200"
    getRawColumn(int columnIndex)
    The Apache Server's logs represent nulls as "-".
    getTimestamp(int columnIndex)
    The Apache Server's logs format timestamps thusly: "01/Jul/2002:17:31:19 +0200"

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

    asList, close, getMetaData, next, xmlVTI, xmlVTI, xmlVTIFromURL, xmlVTIFromURL

    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

    • ApacheServerLogVTI

      public ApacheServerLogVTI(InputStream is) throws Exception

      Construct from the same arguments as our superclass.

      Throws:
      Exception
  • Method Details

    • apacheNaturalLogFile

      public static ApacheServerLogVTI apacheNaturalLogFile(String xmlResourceName) throws Exception
      Create from a file name identifying the server log file
      Throws:
      Exception
    • getRawColumn

      public String getRawColumn(int columnIndex) throws SQLException

      The Apache Server's logs represent nulls as "-".

      Overrides:
      getRawColumn in class org.apache.derby.vti.XmlVTI
      Throws:
      SQLException
    • getTimestamp

      public Timestamp getTimestamp(int columnIndex) throws SQLException

      The Apache Server's logs format timestamps thusly: "01/Jul/2002:17:31:19 +0200"

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

      private SimpleDateFormat getDateFormatter()

      The Apache Server's logs format timestamps thusly: "01/Jul/2002:17:31:19 +0200"