Class WinstonUtil


  • public class WinstonUtil
    extends java.lang.Object
    • Constructor Detail

      • WinstonUtil

        public WinstonUtil​(java.util.Properties winstonConfig)
                    throws SeisFileException,
                           java.net.URISyntaxException
        Throws:
        SeisFileException
        java.net.URISyntaxException
      • WinstonUtil

        public WinstonUtil​(java.lang.String databaseURL,
                           java.lang.String username,
                           java.lang.String password)
      • WinstonUtil

        public WinstonUtil​(java.lang.String databaseURL,
                           java.lang.String username,
                           java.lang.String password,
                           java.lang.String prefix)
      • WinstonUtil

        public WinstonUtil​(java.lang.String databaseURL,
                           java.lang.String username,
                           java.lang.String password,
                           java.lang.String prefix,
                           java.lang.String driverClassname)
    • Method Detail

      • createWinstonSCNL

        public WinstonSCNL createWinstonSCNL​(java.lang.String station,
                                             java.lang.String channel,
                                             java.lang.String network,
                                             java.lang.String locId)
      • createWinstonTable

        public WinstonTable createWinstonTable​(WinstonSCNL database,
                                               int year,
                                               int month,
                                               int day)
      • listChannelDatabases

        public java.util.List<WinstonSCNL> listChannelDatabases()
                                                         throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • useDatabase

        public void useDatabase​(WinstonSCNL channel)
                         throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • listDayTables

        public java.util.List<WinstonTable> listDayTables​(WinstonSCNL channel)
                                                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • listTablesBetweenDates

        public java.util.List<WinstonTable> listTablesBetweenDates​(WinstonSCNL channel,
                                                                   int startYear,
                                                                   int startMonth,
                                                                   int startDay,
                                                                   int endYear,
                                                                   int endMonth,
                                                                   int endDay)
                                                            throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • calculateSyncBetweenDates

        public SyncFile calculateSyncBetweenDates​(WinstonSCNL channel,
                                                  int startYear,
                                                  int startMonth,
                                                  int startDay,
                                                  int endYear,
                                                  int endMonth,
                                                  int endDay,
                                                  java.lang.String dataCenterName)
                                           throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • writeSyncBetweenDates

        public void writeSyncBetweenDates​(WinstonSCNL channel,
                                          int startYear,
                                          int startMonth,
                                          int startDay,
                                          int endYear,
                                          int endMonth,
                                          int endDay,
                                          SyncFileWriter writer)
                                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • calculateSyncForDay

        public SyncFile calculateSyncForDay​(WinstonTable table)
                                     throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • extractData

        public java.util.List<TraceBuf2> extractData​(WinstonSCNL channel,
                                                     java.util.Date startTime,
                                                     java.util.Date endTime)
                                              throws java.sql.SQLException,
                                                     java.util.zip.DataFormatException
        Throws:
        java.sql.SQLException
        java.util.zip.DataFormatException
      • extractData

        public java.util.List<TraceBuf2> extractData​(WinstonTable table,
                                                     java.util.Date startTime,
                                                     java.util.Date endTime)
                                              throws java.sql.SQLException,
                                                     java.util.zip.DataFormatException
        Throws:
        java.sql.SQLException
        java.util.zip.DataFormatException
      • extractFromBlob

        public TraceBuf2 extractFromBlob​(byte[] tbBlob)
                                  throws java.util.zip.DataFormatException
        Throws:
        java.util.zip.DataFormatException
      • j2KSecondsToDate

        public static java.util.Date j2KSecondsToDate​(double j2kSeconds)
      • dateToJ2kSeconds

        public static double dateToJ2kSeconds​(java.util.Date date)
      • getDatabaseURL

        public java.lang.String getDatabaseURL()
      • getUsername

        public java.lang.String getUsername()
      • getPassword

        public java.lang.String getPassword()
      • getPrefix

        public java.lang.String getPrefix()
      • prefixTableName

        public static java.lang.String prefixTableName​(java.lang.String prefix,
                                                       java.lang.String tableName)
      • close

        public void close()
                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getUrlQueryParam

        public static java.lang.String getUrlQueryParam​(java.lang.String name,
                                                        java.lang.String url)
                                                 throws SeisFileException,
                                                        java.net.URISyntaxException
        Throws:
        SeisFileException
        java.net.URISyntaxException
      • isVerbose

        public static boolean isVerbose()
      • setVerbose

        public static void setVerbose​(boolean b)