Writing Modified Objects
[API's]


Detailed Description

These functions are used to write modified records into a datastore during a synchronization session. The input snapshot defines which record versions do not need to be retained for this session. It is typically the same snapshot passed to alp_hscm_read_modified_objects_begin() earlier in the session.

Modified objects are written to the datastore within a transaction. If a failure occurs when a particular object is written, the caller may either skip the write, commit all prior writes by calling alp_hscm_write_modified_objects_end() or rollback all prior writes by calling alp_hscm_write_modified_objects_rollback().


Functions

alp_status_t alp_hscm_write_modified_object_content (AlpHsObjectWriteHandle hWrite, AlpHsObjectPtr pObj, AlpHsObjectTypePtr pSrcType, bool moreData, size_t size, const _TCHAR *buffer)
 Write a modified object's content to an open datastore.
alp_status_t alp_hscm_write_modified_objects_begin (AlpHsChangeMgrHandle hChgMgr, AlpHsSnapshotHandle hSnapshot, AlpHsObjectWriteHandle *phWrite)
 Begin writing modified objects to an open datastore.
alp_status_t alp_hscm_write_modified_objects_end (AlpHsObjectWriteHandle hWrite)
 End writing modified objects to an open datastore and commit all prior writes.
alp_status_t alp_hscm_write_modified_objects_rollback (AlpHsObjectWriteHandle hWrite)
 End writing modified objects to an open datastore and rollback all prior writes.
alp_status_t alp_hscm_write_next_modified_object (AlpHsObjectWriteHandle hWrite, AlpHsObjectPtr pObject)
 Write a modified object to an open datastore.


Function Documentation

alp_status_t alp_hscm_write_modified_object_content AlpHsObjectWriteHandle  hWrite,
AlpHsObjectPtr  pObj,
AlpHsObjectTypePtr  pSrcType,
bool  moreData,
size_t  size,
const _TCHAR *  buffer
 

Write a modified object's content to an open datastore.

Immediately after alp_hscm_write_next_modified_object() is used to write an object whose state is not deleted, this function must be called to write the object's content to the datastore. Each call should contain the next size bytes of the modified object's content formatted according to the specified srcType.

Parameters:
[in] hWrite The write handle
[in] pObj The last object written using alp_hscm_write_next_modified_object().
[in] pSrcType The source MIME type
[in] moreData True when there is more content to write
[in] size The number of content bytes in buffer
[in] buffer The content buffer
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.
Remarks:
The caller must allocate and deallocate the input content buffer.

The Change Manager calls alp_hsds_replace(), alp_hs_add() or alp_hs_update() to implement this function.

See also:
alp_hscm_write_next_modified_object().

alp_status_t alp_hscm_write_modified_objects_begin AlpHsChangeMgrHandle  hChgMgr,
AlpHsSnapshotHandle  hSnapshot,
AlpHsObjectWriteHandle phWrite
 

Begin writing modified objects to an open datastore.

This function initiates writing of modified objects from a remote datastore to the local datastore that is currently open.

Parameters:
[in] hChgMgr Handle to a ChangeMgr open for a datastore
[in] hSnapshot Nullable. Handle for an open snapshot
[out] phWrite Pointer to a write handle
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.
Remarks:
This API does not retain object versions that fall within the input snapshot. However, it will retain object versions that fall within other open snapshots.
See also:
alp_hscm_open(), alp_hscm_open_datastore().

alp_status_t alp_hscm_write_modified_objects_end AlpHsObjectWriteHandle  hWrite  ) 
 

End writing modified objects to an open datastore and commit all prior writes.

Parameters:
[in] hWrite The write handle
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.
See also:
alp_hscm_write_modified_objects_begin().

alp_status_t alp_hscm_write_modified_objects_rollback AlpHsObjectWriteHandle  hWrite  ) 
 

End writing modified objects to an open datastore and rollback all prior writes.

Parameters:
[in] hWrite 
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.
See also:
alp_hscm_write_modified_objects_begin().

alp_status_t alp_hscm_write_next_modified_object AlpHsObjectWriteHandle  hWrite,
AlpHsObjectPtr  pObject
 

Write a modified object to an open datastore.

Parameters:
[in] hWrite The write handle returned from alp_hscm_write_modified_objects_begin().
[in] pObject Pointer to a modified object
Returns:
If successful returns ALP_STATUS_HOTSYNC_OK; otherwise returns an error.
See also:
alp_hscm_write_modified_objects_begin(), alp_hscm_write_modified_object_content().


Generated on Wed Jul 30 07:06:41 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.