Primavera Integration API 7.0

com.primavera
Class BatchException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.primavera.PrimaveraException
              extended by com.primavera.ServerException
                  extended by com.primavera.PhoenixException
                      extended by com.primavera.BatchException
All Implemented Interfaces:
java.io.Serializable

public class BatchException
extends PhoenixException

Exception containing all business rule exceptions that occurred during a batch create or update.

See Also:
Serialized Form

Field Summary
static int UNKNOWN_INDEX
          The index could not be determined.
 
Constructor Summary
BatchException(java.lang.String strMessage)
          Class constructor specifying a detailed message.
BatchException(java.lang.String strMessage, java.lang.Throwable thE)
          Class constructor specifying a detailed message and the original thrown exception.
 
Method Summary
 boolean addAll(BatchException src)
          Adds all exceptions contained in another BatchException to this BatchException
static BatchException addBatchException(BatchException batchException, BatchException newException)
          Adds all exceptions contained in another BatchException to a BatchException.
static BatchException addBatchException(BatchException batchException, ServerException newException, int sourceIndex)
          Adds an exception to a BatchException.
 void addExceptionToList(ServerException newException, int sourceIndex)
          Adds an exception to the list of exceptions
 java.util.List<ServerException> getExceptionList()
          Gets the list of exceptions contained in this batch exception
 java.util.Map<java.lang.Integer,java.util.List<java.lang.Exception>> getExceptionsByIndex()
          Gets the exceptions contained in this batch exception as a sorted map, where the key is the index in the batch, and the value is a list of exceptions for that index.
 java.lang.Object getSource()
          Gets the source for the first exception in the exception list.
 
Methods inherited from class com.primavera.ServerException
setSource
 
Methods inherited from class com.primavera.PrimaveraException
getOriginalException, getStackTrace, isSQLExceptionThrown, printStackTrace, printStackTrace, printStackTrace, removeOriginalException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_INDEX

public static final int UNKNOWN_INDEX
The index could not be determined.

See Also:
Constant Field Values
Constructor Detail

BatchException

public BatchException(java.lang.String strMessage,
                      java.lang.Throwable thE)
Class constructor specifying a detailed message and the original thrown exception.

Parameters:
strMessage - the detailed message of this exception
thE - the originally thrown exception

BatchException

public BatchException(java.lang.String strMessage)
Class constructor specifying a detailed message.

Parameters:
strMessage - the message of this exception
Method Detail

addBatchException

public static BatchException addBatchException(BatchException batchException,
                                               ServerException newException,
                                               int sourceIndex)
Adds an exception to a BatchException. If the BatchException parameter is null, a new BatchException gets created.

Parameters:
batchException - the batch exception to received the added exception. This parameter may be null.
newException - the exception to add.
sourceIndex - the index in the batch for which the exception occurred
Returns:
BatchException the batch exception

addBatchException

public static BatchException addBatchException(BatchException batchException,
                                               BatchException newException)
Adds all exceptions contained in another BatchException to a BatchException. If the BatchException parameter is null, a new BatchException gets created.

Parameters:
batchException - the batch exception to receive the added exception. This parameter may be null.
newException - the exception to add.
Returns:
BatchException the batch exception

addAll

public boolean addAll(BatchException src)
Adds all exceptions contained in another BatchException to this BatchException

Parameters:
src - the batch exception containing the exceptions to add
Returns:
boolean true if the exception list changed as a result of the call.

addExceptionToList

public void addExceptionToList(ServerException newException,
                               int sourceIndex)
Adds an exception to the list of exceptions

Parameters:
newException - the exception to add
sourceIndex - the index in the batch for which the exception occurred

getExceptionsByIndex

public java.util.Map<java.lang.Integer,java.util.List<java.lang.Exception>> getExceptionsByIndex()
Gets the exceptions contained in this batch exception as a sorted map, where the key is the index in the batch, and the value is a list of exceptions for that index.

Returns:
Map a sorted map of exceptions

getExceptionList

public java.util.List<ServerException> getExceptionList()
Gets the list of exceptions contained in this batch exception

Returns:
List the list of exceptions

getSource

public java.lang.Object getSource()
Gets the source for the first exception in the exception list. This method will return null if the first exception has no specified source.

Overrides:
getSource in class ServerException
Returns:
Object the source object of the first exception in the list, or null if the first exception has no specified source.

Primavera Integration API 7.0

Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.