public class ProductSearch3IndexBuild
extends java.lang.Thread
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
cvStatus
The index build process status.
|
static java.lang.Thread |
cvThread
The thread object.
|
static int |
IN_PROCESS
The status 'process running' constant.
|
protected LuceneIndexer |
ivLucene
A reference to the Lucene index utility helper class.
|
static java.lang.String |
SEARCH3_FOLDER
The full path to the search index directory.
|
private static long |
serialVersionUID
The class' serialization version id.
|
static int |
STOPPED
The status 'process idle' constant.
|
static java.lang.String |
TSFILE_NAME
The full path to the search index status timestamp file.
|
Constructor and Description |
---|
ProductSearch3IndexBuild()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
columnToString(java.sql.ResultSet rs,
java.lang.String colname)
Returns a
String object from the given result set of database
records for the specified column name. |
protected java.io.PrintWriter |
getTimestampFile()
Returns the log file's writer.
|
protected void |
init()
Initialize the class (called from constructor, implemented as a separate
method so it can be overridden in subclasses).
|
static void |
main(java.lang.String[] args)
Method called to execute product index creation task.
|
java.lang.String[] |
resultSetToStringArr(java.sql.ResultSet rs)
Returns a
String[] object from the given result set of
database records. |
void |
run()
Run command.
|
private java.lang.String |
suppressZeros(java.lang.String s)
Trims leading zeros from the left size of a string.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
private static final long serialVersionUID
public static java.lang.Thread cvThread
public static final int IN_PROCESS
public static final int STOPPED
public static int cvStatus
public static final java.lang.String SEARCH3_FOLDER
public static final java.lang.String TSFILE_NAME
protected LuceneIndexer ivLucene
protected void init()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
protected java.io.PrintWriter getTimestampFile()
public java.lang.String[] resultSetToStringArr(java.sql.ResultSet rs) throws java.sql.SQLException
String[]
object from the given result set of
database records.rs
- (ResultSet) The result set containing the database record
from which the new Product object is to be created.String[]
object,
initialized with values from the result set.java.sql.SQLException
- - if an error occurs while processing the
result set.public java.lang.String columnToString(java.sql.ResultSet rs, java.lang.String colname) throws java.sql.SQLException
String
object from the given result set of database
records for the specified column name.rs
- (ResultSet) The result set containing the database record
from which a column's string value is to be retrieved.colname
- (String) The name of the column from which a string
is to be retrieved and returned.String
.
A null column value is returned as an empty string.java.sql.SQLException
- if an error occurs while processing the
result set.private java.lang.String suppressZeros(java.lang.String s)
s
- (String) String with leading zeros.public static void main(java.lang.String[] args)
args
- (String[]) The array of command line arguments.