public class WinstonUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_DBURL |
static java.lang.String |
DEFAULT_PREFIX |
static java.lang.String |
KEY_DBURL |
static java.lang.String |
KEY_DRIVER |
static java.lang.String |
KEY_PREFIX |
static java.lang.String |
MYSQL_DRIVER |
static long |
Y1970_TO_Y2000_SECONDS |
Constructor and Description |
---|
WinstonUtil(java.util.Properties winstonConfig) |
WinstonUtil(java.lang.String databaseURL,
java.lang.String username,
java.lang.String password) |
WinstonUtil(java.lang.String databaseURL,
java.lang.String username,
java.lang.String password,
java.lang.String prefix) |
WinstonUtil(java.lang.String databaseURL,
java.lang.String username,
java.lang.String password,
java.lang.String prefix,
java.lang.String driverClassname) |
Modifier and Type | Method and Description |
---|---|
SyncFile |
calculateSyncBetweenDates(WinstonSCNL channel,
int startYear,
int startMonth,
int startDay,
int endYear,
int endMonth,
int endDay,
java.lang.String dataCenterName) |
SyncFile |
calculateSyncForDay(WinstonTable table) |
void |
close() |
WinstonSCNL |
createWinstonSCNL(java.lang.String station,
java.lang.String channel,
java.lang.String network,
java.lang.String locId) |
WinstonTable |
createWinstonTable(WinstonSCNL database,
int year,
int month,
int day) |
static double |
dateToJ2kSeconds(java.util.Date date) |
java.util.List<TraceBuf2> |
extractData(WinstonSCNL channel,
java.util.Date startTime,
java.util.Date endTime) |
java.util.List<TraceBuf2> |
extractData(WinstonTable table,
java.util.Date startTime,
java.util.Date endTime) |
TraceBuf2 |
extractFromBlob(byte[] tbBlob) |
java.lang.String |
getDatabaseURL() |
java.lang.String |
getPassword() |
java.lang.String |
getPrefix() |
static java.lang.String |
getUrlQueryParam(java.lang.String name,
java.lang.String url) |
java.lang.String |
getUsername() |
static boolean |
isVerbose() |
static java.util.Date |
j2KSecondsToDate(double j2kSeconds) |
java.util.List<WinstonSCNL> |
listChannelDatabases() |
java.util.List<WinstonTable> |
listDayTables(WinstonSCNL channel) |
java.util.List<WinstonTable> |
listTablesBetweenDates(WinstonSCNL channel,
int startYear,
int startMonth,
int startDay,
int endYear,
int endMonth,
int endDay) |
static java.lang.String |
prefixTableName(java.lang.String prefix,
java.lang.String tableName) |
static void |
setVerbose(boolean b) |
void |
useDatabase(WinstonSCNL channel) |
void |
writeSyncBetweenDates(WinstonSCNL channel,
int startYear,
int startMonth,
int startDay,
int endYear,
int endMonth,
int endDay,
SyncFileWriter writer) |
public static final java.lang.String KEY_PREFIX
public static final java.lang.String KEY_DRIVER
public static final java.lang.String KEY_DBURL
public static final java.lang.String MYSQL_DRIVER
public static final java.lang.String DEFAULT_PREFIX
public static final java.lang.String DEFAULT_DBURL
public static final long Y1970_TO_Y2000_SECONDS
public WinstonUtil(java.util.Properties winstonConfig) throws SeisFileException, java.net.URISyntaxException
SeisFileException
java.net.URISyntaxException
public WinstonUtil(java.lang.String databaseURL, java.lang.String username, java.lang.String password)
public WinstonUtil(java.lang.String databaseURL, java.lang.String username, java.lang.String password, java.lang.String prefix)
public WinstonUtil(java.lang.String databaseURL, java.lang.String username, java.lang.String password, java.lang.String prefix, java.lang.String driverClassname)
public WinstonSCNL createWinstonSCNL(java.lang.String station, java.lang.String channel, java.lang.String network, java.lang.String locId)
public WinstonTable createWinstonTable(WinstonSCNL database, int year, int month, int day)
public java.util.List<WinstonSCNL> listChannelDatabases() throws java.sql.SQLException
java.sql.SQLException
public void useDatabase(WinstonSCNL channel) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<WinstonTable> listDayTables(WinstonSCNL channel) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<WinstonTable> listTablesBetweenDates(WinstonSCNL channel, int startYear, int startMonth, int startDay, int endYear, int endMonth, int endDay) throws java.sql.SQLException
java.sql.SQLException
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
java.sql.SQLException
public void writeSyncBetweenDates(WinstonSCNL channel, int startYear, int startMonth, int startDay, int endYear, int endMonth, int endDay, SyncFileWriter writer) throws java.sql.SQLException
java.sql.SQLException
public SyncFile calculateSyncForDay(WinstonTable table) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<TraceBuf2> extractData(WinstonSCNL channel, java.util.Date startTime, java.util.Date endTime) throws java.sql.SQLException, java.util.zip.DataFormatException
java.sql.SQLException
java.util.zip.DataFormatException
public java.util.List<TraceBuf2> extractData(WinstonTable table, java.util.Date startTime, java.util.Date endTime) throws java.sql.SQLException, java.util.zip.DataFormatException
java.sql.SQLException
java.util.zip.DataFormatException
public TraceBuf2 extractFromBlob(byte[] tbBlob) throws java.util.zip.DataFormatException
java.util.zip.DataFormatException
public static java.util.Date j2KSecondsToDate(double j2kSeconds)
public static double dateToJ2kSeconds(java.util.Date date)
public java.lang.String getDatabaseURL()
public java.lang.String getUsername()
public java.lang.String getPassword()
public java.lang.String getPrefix()
public static java.lang.String prefixTableName(java.lang.String prefix, java.lang.String tableName)
public void close() throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String getUrlQueryParam(java.lang.String name, java.lang.String url) throws SeisFileException, java.net.URISyntaxException
SeisFileException
java.net.URISyntaxException
public static boolean isVerbose()
public static void setVerbose(boolean b)