wt.index
Class BulkIndexHelper

java.lang.Object
  extended bywt.index.BulkIndexHelper
All Implemented Interfaces:
Externalizable, RemoteAccess, Serializable

public class BulkIndexHelper
extends Object
implements RemoteAccess, Externalizable

This is a helper class for running the BulkIndexTool. It provides utility methods to the BulkIndexTool that do the following operations. 1. Building the BulkIndex list of object 2. Starting and Stopping the bulk indexing queue 3. Scheduling the bulk indexing queue 4. Getting the status of the queue 5. Implementing the actual indexing process

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String BULK_INDEX_QUEUE
           
private static boolean bulkIndexExit
           
private static PrintWriter bulkIndexLog
           
private static ProcessingQueue bulkIndexQueue
           
private static boolean bulkLog
           
private static String CLASSNAME
           
private static SimpleDateFormat DATE_FORMAT
           
static long EXTERNALIZATION_VERSION_UID
           
private static String FC_RESOURCE
           
private static String FILE_SEPARATOR
           
private static String INDEX_QUEUE_NAME
           
private static String LINE_SEPARATOR
           
protected static long OLD_FORMAT_VERSION_UID
           
private static WTPrincipal principal
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
(package private) static boolean SERVER
           
private static StandardIndexPolicyManager sipm
           
 
Fields inherited from interface wt.method.RemoteAccess
versionID
 
Constructor Summary
BulkIndexHelper()
           
 
Method Summary
protected static void _deleteBulkIndexingTable(boolean processed)
          Deletes the bulk indexing entries.
protected static String _getBulkStatus()
          Gets the status of bulk indexing and will output to the log

Supported API: false
protected static int _getIteratedObjectsForIndexing(boolean filterIndexedObjects, boolean filterPolicyRules)
          Gets the list of iterated objects that are requested for bulk indexing

Supported API: false
protected static int _getNonIteratedObjectsForIndexing(boolean filterIndexedObjects, boolean filterPolicyRules)
          Gets the list of non-iterated objects that are requested for bulk indexing

Supported API: false
protected static void _reBulkIndexFailed()
          This method will reset the failed entries and re-index them

Supported API: false
protected static void _scheduleBulkQueue(Timestamp startTime, Timestamp stopTime, long runs, long periodicity)
          This task will schedule the bulk indexing task to execute at a predetermined time

Supported API: false
protected static void _startBulkQueue()
          Starts the Bulk Indexing Queue

Supported API: false
protected static void _stopBulkQueue()
          Stops the bulk indexing queue and sets a flag to discontinuing index process

Supported API: false
static int buildBulkObjectList(boolean filterPolicyRules, boolean filterIndexedObjects)
          

Supported API: false
static void bulkIndexTask()
          This is the task that controls the Bulk Indexing Process

Supported API: false
static void deleteBulkIndexingTable(boolean processed)
          Deletes the bulk indexing entries.
static String getBulkStatus()
          Gets the status of bulk indexing and will output to the log

Supported API: false
static int getIteratedObjectsForIndexing(boolean filterIndexedObjects, boolean filterPolicyRules)
          Gets the list of iterated objects that are requested for bulk indexing

Supported API: false
static int getNonIteratedObjectsForIndexing(boolean filterIndexedObjects, boolean filterPolicyRules)
          Gets the list of non-iterated objects that are requested for bulk indexing

Supported API: false
private static String getObjectInfo(Persistable object)
           
private static WTPrincipal getPrincipal()
           
private static Object getPropValueObj(ClassInfo objInfo, String propStr, Persistable object)
           
static boolean hasBulkList()
          

Supported API: false
private static void LogBulkIndex(String message, boolean tee, boolean override)
           
private static void LogBulkIndex(Throwable t)
           
protected  void queueRequest(WTCollection targetCollection)
          Add a set of objects onto the queue for background processing by rware

Supported API: false
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(BulkIndexHelper thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
static void reBulkIndexFailed()
          This method will reset the failed entries and re-index them

Supported API: false
static void scheduleBulkQueue(Timestamp startTime, Timestamp stopTime, long runs, long periodicity)
          This task will schedule the bulk indexing task to execute at a predetermined time

Supported API: false
static void startBulkQueue()
          Starts the Bulk Indexing Queue

Supported API: false
static void stopBulkQueue()
          Stops the bulk indexing queue and sets a flag to discontinuing index process

Supported API: false
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

SERVER

static final boolean SERVER

FC_RESOURCE

private static final String FC_RESOURCE
See Also:
Constant Field Values

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

LINE_SEPARATOR

private static String LINE_SEPARATOR

FILE_SEPARATOR

private static String FILE_SEPARATOR

DATE_FORMAT

private static SimpleDateFormat DATE_FORMAT

bulkLog

private static boolean bulkLog

sipm

private static StandardIndexPolicyManager sipm

bulkIndexLog

private static PrintWriter bulkIndexLog

INDEX_QUEUE_NAME

private static final String INDEX_QUEUE_NAME
See Also:
Constant Field Values

BULK_INDEX_QUEUE

private static final String BULK_INDEX_QUEUE
See Also:
Constant Field Values

bulkIndexQueue

private static ProcessingQueue bulkIndexQueue

principal

private static WTPrincipal principal

bulkIndexExit

private static boolean bulkIndexExit
Constructor Detail

BulkIndexHelper

public BulkIndexHelper()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(BulkIndexHelper thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getIteratedObjectsForIndexing

public static int getIteratedObjectsForIndexing(boolean filterIndexedObjects,
                                                boolean filterPolicyRules)
                                         throws WTException
Gets the list of iterated objects that are requested for bulk indexing

Supported API: false

Parameters:
filterIndexedObjects - Indicates if the objects that have been indexed already should be filtered
filterPolicyRules - Indicates if the objects should be filtered based on current indexing policy rules
Returns:
int
Throws:
WTException

_getIteratedObjectsForIndexing

protected static int _getIteratedObjectsForIndexing(boolean filterIndexedObjects,
                                                    boolean filterPolicyRules)
                                             throws WTException
Gets the list of iterated objects that are requested for bulk indexing

Supported API: false

Parameters:
filterIndexedObjects - Indicates if the objects that have been indexed already should be filtered
filterPolicyRules - Indicates if the objects should be filtered based on current indexing policy rules
Returns:
int
Throws:
WTException

getNonIteratedObjectsForIndexing

public static int getNonIteratedObjectsForIndexing(boolean filterIndexedObjects,
                                                   boolean filterPolicyRules)
                                            throws WTException
Gets the list of non-iterated objects that are requested for bulk indexing

Supported API: false

Parameters:
filterIndexedObjects - Indicates if the objects that have been indexed already should be filtered
filterPolicyRules - Indicates if the objects should be filtered based on current indexing policy rules
Returns:
int
Throws:
WTException

_getNonIteratedObjectsForIndexing

protected static int _getNonIteratedObjectsForIndexing(boolean filterIndexedObjects,
                                                       boolean filterPolicyRules)
                                                throws WTException
Gets the list of non-iterated objects that are requested for bulk indexing

Supported API: false

Parameters:
filterIndexedObjects - Indicates if the objects that have been indexed already should be filtered
filterPolicyRules - Indicates if the objects should be filtered based on current indexing policy rules
Returns:
int
Throws:
WTException

startBulkQueue

public static void startBulkQueue()
                           throws WTException
Starts the Bulk Indexing Queue

Supported API: false

Throws:
WTException

_startBulkQueue

protected static void _startBulkQueue()
                               throws WTException
Starts the Bulk Indexing Queue

Supported API: false

Throws:
WTException

stopBulkQueue

public static void stopBulkQueue()
                          throws WTException
Stops the bulk indexing queue and sets a flag to discontinuing index process

Supported API: false

Throws:
WTException

_stopBulkQueue

protected static void _stopBulkQueue()
                              throws WTException
Stops the bulk indexing queue and sets a flag to discontinuing index process

Supported API: false

Throws:
WTException

bulkIndexTask

public static void bulkIndexTask()
                          throws WTException
This is the task that controls the Bulk Indexing Process

Supported API: false

Throws:
WTException

reBulkIndexFailed

public static void reBulkIndexFailed()
                              throws WTException
This method will reset the failed entries and re-index them

Supported API: false

Throws:
WTException

_reBulkIndexFailed

protected static void _reBulkIndexFailed()
                                  throws WTException
This method will reset the failed entries and re-index them

Supported API: false

Throws:
WTException

scheduleBulkQueue

public static void scheduleBulkQueue(Timestamp startTime,
                                     Timestamp stopTime,
                                     long runs,
                                     long periodicity)
                              throws WTException
This task will schedule the bulk indexing task to execute at a predetermined time

Supported API: false

Parameters:
startTime - When bulk indexing should start
stopTime -
runs -
periodicity -
Throws:
WTException

_scheduleBulkQueue

protected static void _scheduleBulkQueue(Timestamp startTime,
                                         Timestamp stopTime,
                                         long runs,
                                         long periodicity)
                                  throws WTException
This task will schedule the bulk indexing task to execute at a predetermined time

Supported API: false

Parameters:
startTime - When bulk indexing should start
stopTime -
runs -
periodicity -
Throws:
WTException

getBulkStatus

public static String getBulkStatus()
                            throws WTException
Gets the status of bulk indexing and will output to the log

Supported API: false

Returns:
String
Throws:
WTException

_getBulkStatus

protected static String _getBulkStatus()
                                throws WTException
Gets the status of bulk indexing and will output to the log

Supported API: false

Returns:
String
Throws:
WTException

deleteBulkIndexingTable

public static void deleteBulkIndexingTable(boolean processed)
                                    throws WTException
Deletes the bulk indexing entries.

Supported API: false

Parameters:
processed - If true, this method will only delete the processed entries from the table
Throws:
WTException

_deleteBulkIndexingTable

protected static void _deleteBulkIndexingTable(boolean processed)
                                        throws WTException
Deletes the bulk indexing entries.

Supported API: false

Parameters:
processed - If true, this method will only delete the processed entries from the table
Throws:
WTException

buildBulkObjectList

public static int buildBulkObjectList(boolean filterPolicyRules,
                                      boolean filterIndexedObjects)
                               throws WTException


Supported API: false

Parameters:
filterPolicyRules - If this parameter is set to true, then the BulkIndexEntryList table will only include objects that have current Indexing Policy Rules set for them.
filterIndexedObjects - If this is set to true, then the BulkIndexEntryList table will only include those objects that have not yet been indexed.
Throws:
WTException

hasBulkList

public static boolean hasBulkList()
                           throws WTException


Supported API: false

Returns:
boolean
Throws:
WTException

LogBulkIndex

private static void LogBulkIndex(String message,
                                 boolean tee,
                                 boolean override)

LogBulkIndex

private static void LogBulkIndex(Throwable t)

getPrincipal

private static WTPrincipal getPrincipal()
                                 throws IndexPolicyException,
                                        WTException
Throws:
IndexPolicyException
WTException

getObjectInfo

private static String getObjectInfo(Persistable object)
                             throws WTIntrospectionException,
                                    WTException
Throws:
WTIntrospectionException
WTException

getPropValueObj

private static Object getPropValueObj(ClassInfo objInfo,
                                      String propStr,
                                      Persistable object)
                               throws WTException
Throws:
WTException

queueRequest

protected void queueRequest(WTCollection targetCollection)
                     throws WTException,
                            IOException,
                            WTPropertyVetoException
Add a set of objects onto the queue for background processing by rware

Supported API: false

Parameters:
targetCollection -
Throws:
WTException
IOException
WTPropertyVetoException