com.sap.ip.me.api.smartsync
Interface SyncBo


public interface SyncBo

A SyncBo is a data repository object representing a business object. It has the following parts that are accessible thru the provided methods:

The SyncBo's top row is an undeletable Row object and no other TOP Row instance could be inserted in a SyncBo. This top row's key field value represents the SyncBo's SyncKey value. SyncBo can be used for

Example: Inserting a new row in a SyncBo

 SyncBo unlinkedCopy = existingSyncBo.createUnlinkedCopy();
 Row newRow = unlinkedCopy.createEmptyRow(rowDesc);
 //Set some values to the new row
 //Insert the row into the syncbo
 unlinkedCopy.insertRow(newRow);
 //Commit the txn
 

Version:
2.1
Author:
SAP

Method Summary
 Row createEmptyRow(RowDescriptor rowDescriptor)
          Returns an empty Row instance for the specified RowDescriptor.
 SyncBo createInitialCopy()
          Creates an INITIAL copy of this SyncBo instance.
 SyncBo createUnlinkedCopy()
          Deprecated. for performant write access to SyncBo and its Rows use Row.modifyFieldValue(FieldDescriptor, Object) in conjunction with modifyRow(Row) instead.
 void deleteRow(Row row)
          Deletes the specified Row from this SyncBo.
 void deleteRow(RowDescriptor rowDescriptor, java.math.BigInteger primaryKey)
          Deletes an existing child Row having the specified RowDescriptor and primary key from this SyncBo.
 void deleteRow(RowDescriptor rowDescriptor, java.lang.String primaryKey)
          Deletes an existing child Row having the specified RowDescriptor and primary key from this SyncBo.
 void deleteRow(java.lang.String primaryKey)
          Deprecated. Use deleteRow(RowDescriptor rowDescriptor, String primaryKey) or deleteRow(Row row)
 PositionStatusType getPositionStatus()
          Deprecated. This method will be removed in next MI releases. Use getSyncState() instead.
 ProcessingStatusType getProcessingStatus()
          Deprecated. This method will be removed in next MI releases. Use getSyncState() instead.
 Row getRow(RowDescriptor rowDescriptor, java.math.BigInteger primaryKey)
          Returns the child Row instance having the specified primary key of this SyncBo object.
 Row getRow(RowDescriptor rowDescriptor, java.lang.String primaryKey)
          Returns the child Row instance having the specified primary key of this SyncBo object.
 Row getRow(java.lang.String primaryKey)
          Deprecated. Use getRow(RowDescriptor rowDescriptor, String primaryKey).
 RowCollection[] getRows()
          Returns the array of static collections of all the child Row objects of this SyncBo.
 RowList getRows(Query query)
          Returns a static list of child Row objects for a specified query from this SyncBo.
 RowCollection getRows(RowDescriptor rowDescriptor)
          Returns a static collection of all child Row objects for the specified RowDescriptor from this SyncBo.
 java.lang.String getStateId()
          gets state id of this SyncBo
 StatusType getStatus()
          Returns the status property of this SyncBo
 SyncBoDescriptor getSyncBoDescriptor()
          Returns the SyncBoDescriptor of this SyncBo object.
 java.lang.String getSyncKey()
          Returns the SyncKey value of this SyncBo
 SyncState getSyncState()
          Get the sync status of this SyncBo.
 java.lang.String getTimeStamp()
          Deprecated.  
 Row getTopRow()
          Returns the TOP Row object of this SyncBo.
 void insertRow(Row row)
          Adds the specified Row object to this SyncBo instance.
 void modifyRow(Row row)
          This method must be called to make the field changes after Row.modifyFieldValue(FieldDescriptor, Object) persistent.
 void replaceRow(Row row)
          Replaces an existing child Row in this SyncBo with the specified Row instance.
 int size(Query query)
          Returns a the number of child Row objects for a specified query from this SyncBo.
 void verifyOperation(Row row, RowChangeActionType action)
          verify the operation to this SyncBo
 

Method Detail

createEmptyRow

public Row createEmptyRow(RowDescriptor rowDescriptor)
                   throws InvalidDescriptorException
Returns an empty Row instance for the specified RowDescriptor. The returned instance has an INITIAL status and can be added into the repository thru the insertRow method.

Parameters:
rowDescriptor - the RowDescriptor of the Row object to be created
Returns:
an empty Row instance for the specified RowDescriptor
Throws:
InvalidDescriptorException - is thrown if the RowDescriptor is not a member of this SyncBo's descriptor or is a TOP row descriptor of this SyncBo

insertRow

public void insertRow(Row row)
               throws ModificationNotAllowedException,
                      PersistenceException
Adds the specified Row object to this SyncBo instance. The specified Row's status will be set to LOCAL after the insertion.

Parameters:
row - the Row to be added to this SyncBo
Throws:
ModificationNotAllowedException - is thrown for the following cases:
- if the specified Row has a non-INITIAL status
- is a TOP row of this SyncBo
- has a RowDescriptor that is not a member of this SyncBo' descriptor
- the SyncBo update is not allowed as defined in the descriptor
- the SyncBo object is in synchronization state or in IN_SYNC state.
PersistenceException - is thrown if any persistent layer related error occurred during the insertion

replaceRow

public void replaceRow(Row row)
                throws ModificationNotAllowedException,
                       PersistenceException
Replaces an existing child Row in this SyncBo with the specified Row instance. The specified Row's status will be set to LOCAL after the replace operation.
Note: The application should discard and avoid further use of either unlinked copy or the original row after replacing the original row. Instead, re-get the row to validate the changes in the unlinked copy or further data manipulation.

Parameters:
row - the Row to be replaced to the existing child row in this SyncBo
Throws:
ModificationNotAllowedException - is thrown for the following cases:
- if the specified Row is not of UNLINKED status
- is a TOP row of this SyncBo
- has a RowDescriptor that is not a member of this SyncBo' descriptor
- the SyncBo update is not allowed as defined in the descriptor.
- the SyncBo object is in synchronization state or in IN_SYNC state.
PersistenceException - is thrown if any persistent layer related error occurred during the replace operation

modifyRow

public void modifyRow(Row row)
               throws ModificationNotAllowedException,
                      PersistenceException
This method must be called to make the field changes after Row.modifyFieldValue(FieldDescriptor, Object) persistent.

Parameters:
row - the Row with the modified fieldValues
Throws:
ModificationNotAllowedException
PersistenceException

deleteRow

public void deleteRow(Row row)
               throws ModificationNotAllowedException,
                      PersistenceException
Deletes the specified Row from this SyncBo.

Parameters:
row - the child Row to be deleted from this SyncBo
Throws:
ModificationNotAllowedException - is thrown for the following cases:
- if the specified Row is of INITIAL or UNLINKED status
- is a TOP row of this SyncBo
- has a RowDescriptor that is not a member of this SyncBo' descriptor
- the SyncBo update is not allowed as defined in the descriptor.
- the SyncBo object is in synchronization state or in IN_SYNC state.
PersistenceException - is thrown if any persistent layer related error occurred during the delete operation

deleteRow

public void deleteRow(java.lang.String primaryKey)
               throws ModificationNotAllowedException,
                      PersistenceException
Deprecated. Use deleteRow(RowDescriptor rowDescriptor, String primaryKey) or deleteRow(Row row)

Deletes an existing child Row having the specified primary key from this SyncBo.

Parameters:
primaryKey - the primary key of the child Row to be deleted from this SyncBo
Throws:
ModificationNotAllowedException - is thrown for the following cases:
- if the specified Row is of INITIAL or UNLINKED status
- is a TOP row of this SyncBo
- has a RowDescriptor that is not a member of this SyncBo' descriptor
- the SyncBo update is not allowed as defined in the descriptor
- the SyncBo object is in synchronization state or in IN_SYNC state.
PersistenceException - is thrown if any persistent layer related error occurred during the delete operation

deleteRow

public void deleteRow(RowDescriptor rowDescriptor,
                      java.lang.String primaryKey)
               throws ModificationNotAllowedException,
                      PersistenceException
Deletes an existing child Row having the specified RowDescriptor and primary key from this SyncBo.

Parameters:
rowDescriptor - the RowDescriptor of the child Row to be deleted from this SyncBo
primaryKey - the primary key of the child Row to be deleted from this SyncBo in String format
Throws:
PersistenceException - is thrown if any persistent layer related error occurred during the delete operation
ModificationNotAllowedException

deleteRow

public void deleteRow(RowDescriptor rowDescriptor,
                      java.math.BigInteger primaryKey)
               throws ModificationNotAllowedException,
                      PersistenceException
Deletes an existing child Row having the specified RowDescriptor and primary key from this SyncBo.

Parameters:
rowDescriptor - the RowDescriptor of the child Row to be deleted from this SyncBo
primaryKey - the primary key of the child Row to be deleted from this SyncBo in BigInteger format
Throws:
PersistenceException - is thrown if any persistent layer related error occurred during the delete operation
ModificationNotAllowedException
Since:
2.5

getRow

public Row getRow(java.lang.String primaryKey)
           throws PersistenceException
Deprecated. Use getRow(RowDescriptor rowDescriptor, String primaryKey).

Returns the child Row instance having the specified primary key of this SyncBo object. NOTE: The specified primary key should have its leading zeros described if it has one.

Parameters:
primaryKey - the primary key of the child Row to be retrieved from this SyncBo
Returns:
the child Row instance having the specified primary key
Throws:
PersistenceException - is thrown if any persistent layer related error occurred during the retrieval

getRow

public Row getRow(RowDescriptor rowDescriptor,
                  java.lang.String primaryKey)
           throws PersistenceException
Returns the child Row instance having the specified primary key of this SyncBo object.

Parameters:
rowDescriptor - the RowDescriptor of the child Row to be retrieved from this SyncBo
primaryKey - the primary key of the child Row to be retrieved from this SyncBo in String format
Returns:
the child Row instance having the specified RowDescriptor and primary key
Throws:
PersistenceException - is thrown if any persistent layer related error occurred during the retrieval

getRow

public Row getRow(RowDescriptor rowDescriptor,
                  java.math.BigInteger primaryKey)
           throws PersistenceException
Returns the child Row instance having the specified primary key of this SyncBo object.

Parameters:
rowDescriptor - the RowDescriptor of the child Row to be retrieved from this SyncBo
primaryKey - the primary key of the child Row to be retrieved from this SyncBo in BigInteger format
Returns:
the child Row instance having the specified RowDescriptor and primary key
Throws:
PersistenceException - is thrown if any persistent layer related error occurred during the retrieval
Since:
2.5

getRows

public RowCollection getRows(RowDescriptor rowDescriptor)
                      throws PersistenceException
Returns a static collection of all child Row objects for the specified RowDescriptor from this SyncBo.

Parameters:
rowDescriptor - the RowDescriptor of the Row objects to be retrieved
Returns:
a static collection of all child Row objects for the specified RowDescriptor
Throws:
PersistenceException - is thrown if any persistent layer related error occurred during the retrieval

getRows

public RowList getRows(Query query)
                throws PersistenceException
Returns a static list of child Row objects for a specified query from this SyncBo.

Parameters:
query - the Query object that contains the condtion
Returns:
a list of the Row objects that complies to the query condition
Throws:
PersistenceException - is thrown if any persistent layer related error occurred during the retrieval

size

public int size(Query query)
         throws PersistenceException
Returns a the number of child Row objects for a specified query from this SyncBo.

Parameters:
query - the Query object that contains the condtion
Returns:
the number of child Row objects that complies to the query condition
Throws:
PersistenceException - is thrown if any persistent layer related error occurred during the retrieval

getSyncBoDescriptor

public SyncBoDescriptor getSyncBoDescriptor()
Returns the SyncBoDescriptor of this SyncBo object.

Returns:
the SyncBoDescriptor of this SyncBo object

getTopRow

public Row getTopRow()
Returns the TOP Row object of this SyncBo.

Returns:
the TOP Row object of this SyncBo

createUnlinkedCopy

public SyncBo createUnlinkedCopy()
                          throws PersistenceException
Deprecated. for performant write access to SyncBo and its Rows use Row.modifyFieldValue(FieldDescriptor, Object) in conjunction with modifyRow(Row) instead.

Creates an UNLINKED copy of this SyncBo instance. This copy has following characteristics:

  • it is not (yet) a Repository component; it will become a repository component by invocating SyncBoDataFacade.replaceSyncBo method
  • it has the same structure and field values with this SyncBo including the field keys
  • all the Rows including top and items are copied with UNLINKED StatusType.
  • it has an UNLINKED status

    NOTE:
    An initial copy will be returned if the SyncBo to be copied has an INITIAL status.

    Returns:
    an UNLINKED copy of this SyncBo instance
    Throws:
    PersistenceException - is thrown if any persistent layer related error occurred during the creation

  • createInitialCopy

    public SyncBo createInitialCopy()
                             throws PersistenceException
    Creates an INITIAL copy of this SyncBo instance. This copy has following characteristics:
  • it is not (yet) a Repository component; it will become a repository component by invocating SyncBoDataFacade.insertSyncBo method
  • it has the same structure and field values with this SyncBo excluding the field keys
  • it has an INITIAL status

    Returns:
    an INITIAL copy of this SyncBo instance
    Throws:
    PersistenceException - is thrown if any persistent layer related error occurred during the creation

  • getStatus

    public StatusType getStatus()
    Returns the status property of this SyncBo

    Returns:
    the status property of this SyncBo

    getRows

    public RowCollection[] getRows()
                            throws PersistenceException
    Returns the array of static collections of all the child Row objects of this SyncBo.

    Returns:
    the array of RowCollection objects per descriptor
    Throws:
    PersistenceException - is thrown if any persistent layer related error occurred during the retrieval

    getSyncKey

    public java.lang.String getSyncKey()
    Returns the SyncKey value of this SyncBo

    Returns:
    the SyncKey value of this SyncBo

    verifyOperation

    public void verifyOperation(Row row,
                                RowChangeActionType action)
                         throws ModificationNotAllowedException
    verify the operation to this SyncBo

    Parameters:
    row - row instance of the operation
    action - action type of the operation
    Throws:
    ModificationNotAllowedException - thrown when operation is not allowed

    getTimeStamp

    public java.lang.String getTimeStamp()
    Deprecated.  

    gets time stamp of this SyncBo

    Returns:
    time stamp

    getPositionStatus

    public PositionStatusType getPositionStatus()
    Deprecated. This method will be removed in next MI releases. Use getSyncState() instead.

    gets PositionStatusType of this syncbo

    Returns:
    position status type

    getProcessingStatus

    public ProcessingStatusType getProcessingStatus()
    Deprecated. This method will be removed in next MI releases. Use getSyncState() instead.

    gets ProcessingStatusType of this syncbo

    Returns:
    position status type

    getStateId

    public java.lang.String getStateId()
    gets state id of this SyncBo

    Returns:
    state id

    getSyncState

    public SyncState getSyncState()
    Get the sync status of this SyncBo.

    Returns:
    the sync status


    Copyright © 2005 SAP AG. All Rights Reserved.