public interface CommonInterface extends IntRowSet
Modifier and Type | Field and Description |
---|---|
static int |
COMPANY |
static int |
CORPORATE |
static java.lang.String |
DELETE_ACTION |
static java.lang.String |
INSERT_ACTION |
static int |
PLANT |
static java.lang.String |
UPDATE_ACTION |
Modifier and Type | Method and Description |
---|---|
void |
addRow(java.util.Calendar timestamp)
adds row to the document that can later be submitted to SFT system using submit();
method also sets 'context' on the row so you can populate its fields by calling set* methods ;
use this method when you what to add new or update existing row in the SFT system ;
addRow can potentially submit request to the rerver if internal buffer of rows gets full
see also addRow(String actionType)
|
void |
addRow(java.util.Calendar timestamp,
java.lang.String actionType)
adds row to the document that can later be submitted to SFT system using submit();
method also sets 'context' on the row so you can populate its fields by calling set* methods ;
use this method when you what to delete existing row in the SFT system or you know for sure whether Insert or Update action needs to be performed;
addRow can potentially submit request to the rerver if internal buffer of rows gets full
see also addRow()
|
void |
changeLocationToCompany(java.lang.String companyId)
changes location to company - data will be send to all plants that belong to this company;
this method submits request to the previous location if internal buffer contains any rows;
after that object reinitialyzes its state so new documents will be submitted to the new location
|
void |
changeLocationToCorporate()
changes location to all corporate ( which is also a default setting) - data will be send to all plants;
this method submits request to the previous location if internal buffer contains any rows;
after that object reinitialyzes its state so new documents will be submitted to the new location
|
void |
changeLocationToPlant(java.lang.String plantId)
changes location to plan - data will be send to one plant
this method submits request to the previous location if internal buffer contains any rows;
after that object reinitialyzes its state so new documents will be submitted to the new location
|
void |
close()
close method submits unsubmitted documents ( previously built by calling addRow ) to all locations unless one of the change location method was invoked ;
then it updates last synchronization time and then it closes all resourses so no other methods can be called after that
|
int |
getInterfaceScope()
returns interafce scope : PLANT,COMPANY or CORPORATE
|
java.util.Calendar |
getLastSyncDate()
Returns the earliest successful sync date among all plants for given interface type - interface type you used to get instance of object;
this date should be used to select all entities that were modified after it; method will return null if all plants have empty location
in which case sync process should stop.
|
java.util.Map<java.lang.String,java.lang.String> |
getLocations()
Returns list of all locations
|
void |
setDefaultErrorMessage(java.lang.String errorMessage,
java.util.ArrayList<java.lang.String> primaryKeyIds)
Call this method to set default eror message you want to log into system table if document submission to
3rd party system fails.
|
void |
setErrorHandler(ErrorHandler errorHandler)
If application needs to do some custom error handling it needs to invoke setDefaultErrorMessage() to setup default
error handling logic and then call setErrorHandler to pass ErrorHandler to the framework that would allow
application to get back reference to the failed rows; error message returned by 3party system and
it can potentially overwride default error message set up by setDefaultErrorMessage
|
addChildRS, addRow, addRow
setBoolean, setDate, setDouble, setInteger, setLong, setString
static final java.lang.String INSERT_ACTION
static final java.lang.String UPDATE_ACTION
static final java.lang.String DELETE_ACTION
static final int PLANT
static final int COMPANY
static final int CORPORATE
void addRow(java.util.Calendar timestamp) throws DEException
timestamp
- TIME_STAMP of the entity we are trying to synch (in case where entity comes from several tables the latest date should be used)DEException
- if submit fails for whatever reasonvoid addRow(java.util.Calendar timestamp, java.lang.String actionType) throws DEException
timestamp
- TIME_STAMP of the entity we are trying to synch (in case where entity comes from several tables the latest date should be used)actionType
- one of the *_ACTION constants defined by this class , in most cases you will use this method with DELETE_ACTIONDEException
- if submit fails for whatever reasonvoid close() throws DEException
DEException
- if close fails for whatever reasonvoid changeLocationToCorporate() throws DEException
DEException
- if method fails for whatever reasonvoid changeLocationToCompany(java.lang.String companyId) throws DEException
companyId
- DEException
- if method fails for whatever reasonvoid changeLocationToPlant(java.lang.String plantId) throws DEException
plantId
- DEException
- if method fails for whatever reasonjava.util.Map<java.lang.String,java.lang.String> getLocations()
java.util.Calendar getLastSyncDate() throws DEException
DEException
int getInterfaceScope()
void setDefaultErrorMessage(java.lang.String errorMessage, java.util.ArrayList<java.lang.String> primaryKeyIds) throws DEException
errorMessage
- error message you want to print , it can contain references to the top level row
values encoded same way we do it in messages : ~XXX~ (where XXX is the OBJ_ID) - it will be replaced with object's value.primaryKeyIds
- list of primary key object ids , it will be used to generate error message idDEException
void setErrorHandler(ErrorHandler errorHandler)
errorHandler
- to use