com.retek.component.rcombatch
Class RcomAbstractBatchProgram

java.lang.Object
  extended bycom.retek.component.rcombatch.RcomAbstractBatchProgram
Direct Known Subclasses:
BackorderNotificationBatch, CancelPendedOrderBatch, CatalogRequestExportBatch, CustomerFileExportBatch, CustomerFileImportBatch, CustomerMergeExportBatch, CustomerMergeImportBatch, DailyMessageBatch, DirectShipOrderBatch, InternetMediaExportBatch, MasterCreditCardAuthBatch, MediaDemandUpdateBatch, PaymentSettlementBatch, PublishCorrespondenceBatch, RecalculateBackorderLineECDDBatch, ReleaseBackorderedLinesBatch, ReleaseOrderToWmsBatch, ResaRtlogTransformerBatch, SalesAuditExportBatch, SecurityUserUpdateBatch, UpdateMediaStatusBatch

public abstract class RcomAbstractBatchProgram
extends java.lang.Object

Base class for all RCOM batch programs providing:

  1. constants
  2. option handling methods
  3. batch process invocation
  4. user lookup


Field Summary
static int DEFAULT_FILE_WORK_UNIT_SIZE
          The default size of file work unit.
static int DEFAULT_WORK_UNIT_SIZE
          The default size of work unit.
static java.lang.String DIRECTORY_PATH_ARGUMENT_KEY
          Batch argument for directory path.
static java.lang.String FILE_WORK_UNIT_SIZE_ARGUMENT_KEY
          Batch argument for file work unit size (optional).
static java.lang.String USER_ID_ARGUMENT_KEY
          Batch argument for user identifier.
static java.lang.String WORK_UNIT_SIZE_ARGUMENT_KEY
          Batch argument for work unit size (optional).
 
Constructor Summary
RcomAbstractBatchProgram()
           
 
Method Summary
static void addFileWorkUnitArgument(org.apache.commons.cli.Options options)
          Adds an optional file work unit size batch argument template to the given set.
static void addRequiredDirectoryPathArgument(org.apache.commons.cli.Options options)
          Adds a directory-path batch argument template to the given set.
static void addRequiredUserArgument(org.apache.commons.cli.Options options)
          Adds a user id argument template to the given set.
static void addWorkUnitArgument(org.apache.commons.cli.Options options)
          Adds an optional work unit size batch argument template to the given set.
abstract  void doBatchProcess(java.util.Map args)
          Placeholder for the implementation's batch process.
 BatchResult getBatchResult()
          Returns batch result (SUCCESS, PARTIAL_FAILURE, or COMPLETE_FAILURE).
 User getBatchUser(DistributedContext context, java.lang.String userId)
          Provides user id lookup/authentication.
 int getExitValue()
          Returns the exit value of the batch result (0 = SUCCESS, 1 = PARTIAL_FAILURE, or -1 = COMPLETE_FAILURE).
 int getFileWorkUnitSize(java.util.Map args)
           
protected abstract  RetekLogger getLogger()
          Placeholder for the implementation's logger initialization.
 int getWorkUnitSize(java.util.Map args)
          Gets the size of the work unit.
 void promoteToCompleteFailure()
          Set status of the batch program to "complete failure".
 void promoteToPartialFailure()
          Set status of the batch program to "partial failure", unless already promoted to complete failure.
protected  void runBatchProcessCalledFromMain(java.util.Map args)
          Invoke the implementation's batch process and consistently handle exceptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_ID_ARGUMENT_KEY

public static final java.lang.String USER_ID_ARGUMENT_KEY
Batch argument for user identifier.

See Also:
Constant Field Values

DIRECTORY_PATH_ARGUMENT_KEY

public static final java.lang.String DIRECTORY_PATH_ARGUMENT_KEY
Batch argument for directory path.

See Also:
Constant Field Values

WORK_UNIT_SIZE_ARGUMENT_KEY

public static final java.lang.String WORK_UNIT_SIZE_ARGUMENT_KEY
Batch argument for work unit size (optional). The work unit is the unit of work that will be committed together. For example, processing of 50 customer orders might be considered as one unit of work and commited together.

See Also:
Constant Field Values

DEFAULT_WORK_UNIT_SIZE

public static final int DEFAULT_WORK_UNIT_SIZE
The default size of work unit.

See Also:
Constant Field Values

FILE_WORK_UNIT_SIZE_ARGUMENT_KEY

public static final java.lang.String FILE_WORK_UNIT_SIZE_ARGUMENT_KEY
Batch argument for file work unit size (optional).

See Also:
Constant Field Values

DEFAULT_FILE_WORK_UNIT_SIZE

public static final int DEFAULT_FILE_WORK_UNIT_SIZE
The default size of file work unit.

See Also:
Constant Field Values
Constructor Detail

RcomAbstractBatchProgram

public RcomAbstractBatchProgram()
Method Detail

promoteToPartialFailure

public final void promoteToPartialFailure()
Set status of the batch program to "partial failure", unless already promoted to complete failure.


getLogger

protected abstract RetekLogger getLogger()
Placeholder for the implementation's logger initialization.


promoteToCompleteFailure

public final void promoteToCompleteFailure()
Set status of the batch program to "complete failure".


getExitValue

public int getExitValue()
Returns the exit value of the batch result (0 = SUCCESS, 1 = PARTIAL_FAILURE, or -1 = COMPLETE_FAILURE).


getBatchResult

public BatchResult getBatchResult()
Returns batch result (SUCCESS, PARTIAL_FAILURE, or COMPLETE_FAILURE).


doBatchProcess

public abstract void doBatchProcess(java.util.Map args)
Placeholder for the implementation's batch process.

Parameters:
args - map of (String to String) batch execution arguments

runBatchProcessCalledFromMain

protected void runBatchProcessCalledFromMain(java.util.Map args)
Invoke the implementation's batch process and consistently handle exceptions.

Parameters:
args - map of (String to String) batch execution arguments

addRequiredUserArgument

public static void addRequiredUserArgument(org.apache.commons.cli.Options options)
Adds a user id argument template to the given set.

Parameters:
options - set of options to which the user id argument will be added

addRequiredDirectoryPathArgument

public static void addRequiredDirectoryPathArgument(org.apache.commons.cli.Options options)
Adds a directory-path batch argument template to the given set.

Parameters:
options - set of options to which the directory argument will be added

addWorkUnitArgument

public static void addWorkUnitArgument(org.apache.commons.cli.Options options)
Adds an optional work unit size batch argument template to the given set.

Parameters:
options - set of options to which the directory argument will be added

addFileWorkUnitArgument

public static void addFileWorkUnitArgument(org.apache.commons.cli.Options options)
Adds an optional file work unit size batch argument template to the given set.

Parameters:
options - set of options to which the directory argument will be added

getBatchUser

public final User getBatchUser(DistributedContext context,
                               java.lang.String userId)
                        throws SystemException
Provides user id lookup/authentication.

Parameters:
context - distributed context provided by the batch environment
userId - system-known name identifying a user
Throws:
SystemException

getWorkUnitSize

public final int getWorkUnitSize(java.util.Map args)
Gets the size of the work unit.

Parameters:
args - the arguments from which the size of work unit will be looked up.

getFileWorkUnitSize

public final int getFileWorkUnitSize(java.util.Map args)


Copyright © 2004 Retek Inc. All Rights Reserved. - Generated at Fri, 10/22/2004 07:28