org.rococoa.cocoa.syncservices
Class ISyncSession
java.lang.Object
org.rococoa.cocoa.foundation.NSObject
org.rococoa.cocoa.syncservices.ISyncSession
- All Implemented Interfaces:
- ABActionDelegate, AMWorkflowControllerDelegate, IMVideoDataSource, NSAccessibility, NSAccessibilityAdditions, NSAnimationDelegate, NSApplicationScriptingDelegation, NSArchiverCallback, NSBrowserDelegate, NSClassDescriptionPrimitives, NSCoderMethods, NSColorPanelResponderMethod, NSComboBoxCellDataSource, NSComboBoxDataSource, NSComboBoxNotifications, NSComparisonMethods, NSConnectionDelegateMethods, NSControlSubclassDelegate, NSControlSubclassNotifications, NSCopyLinkMoveHandler, NSDatePickerCellDelegate, NSDelayedPerforming, NSDeprecatedKeyValueCoding, NSDeprecatedKeyValueObservingCustomization, NSDeprecatedMethods, NSDictionaryControllerKeyValuePair, NSDistantObjectRequestMethods, NSDistributedObjects, NSDraggingDestination, NSDraggingSource, NSDrawerDelegate, NSDrawerNotifications, NSEditor, NSEditorRegistration, NSErrorRecoveryAttempting, NSExceptionHandlerDelegate, NSFileManagerFileOperationAdditions, NSFontManagerDelegate, NSFontManagerResponderMethod, NSFontPanelValidationAdditions, NSImageDelegate, NSKeyedArchiverDelegate, NSKeyedArchiverObjectSubstitution, NSKeyedUnarchiverDelegate, NSKeyedUnarchiverObjectSubstitution, NSKeyValueBindingCreation, NSKeyValueCoding, NSKeyValueObserverNotification, NSKeyValueObserverRegistration, NSKeyValueObserving, NSKeyValueObservingCustomization, NSLayoutManagerDelegate, NSMenuDelegate, NSMenuValidation, NSMetadataQueryDelegate, NSNetServiceBrowserDelegateMethods, NSNetServiceDelegateMethods, NSNibAwaking, NSOutlineViewDataSource, NSOutlineViewDelegate, NSOutlineViewNotifications, NSPasteboardOwner, NSPlaceholders, NSPortDelegateMethods, NSRuleEditorDelegateMethods, NSSavePanelDelegate, NSScriptClassDescription, NSScripting, NSScriptingComparisonMethods, NSScriptKeyValueCoding, NSScriptObjectSpecifiers, NSSoundDelegateMethods, NSSpeechRecognizerDelegate, NSSpeechSynthesizerDelegate, NSSpellServerDelegate, NSSplitViewDelegate, NSStreamDelegateEventExtensions, NSTabViewDelegate, NSTextDelegate, NSTextViewDelegate, NSThreadPerformAdditions, NSTokenFieldCellDelegate, NSTokenFieldDelegate, NSToolbarDelegate, NSToolbarNotifications, NSURLClient, NSURLConnectionDelegate, NSURLDownloadDelegate, NSWindowDelegate, NSWindowNotifications, NSXMLParserDelegateEventAdditions, QTCaptureDecompressedVideoOutputDelegate, QTCaptureFileOutputDelegate, QTCaptureVideoPreviewOutputDelegate, QTCaptureViewDelegate, QTMovieDelegate, QTMovieViewDelegate, SFAuthorizationViewDelegate, SFCertificatePanelDelegate, SFChooseIdentityPanelDelegate, WebDownloadDelegate, WebFrameLoadDelegate, WebJavaPlugIn, WebPlugIn, WebPlugInContainer, WebPolicyDelegate, WebResourceLoadDelegate, WebScripting, WebUIDelegate, WebViewEditingDelegate, NSObject
public abstract class ISyncSession
- extends NSObject
This file was autogenerated by JNAerator,
a tool written by Olivier Chafik that uses a few opensource projects..
For help, please visit NativeLibs4Java, Rococoa, or JNA.
Method Summary |
static ISyncSession |
alloc()
|
static void |
beginSessionInBackgroundWithClient_entityNames_target_selector_lastAnchors(ISyncClient client,
NSArray entityNames,
org.rococoa.ID target,
org.rococoa.Selector selector,
NSDictionary anchors)
Original signature : +(void)beginSessionInBackgroundWithClient:(ISyncClient*) entityNames:(NSArray*) target:(id) selector:(SEL) lastAnchors:(NSDictionary*)
entity name |
static void |
beginSessionInBackgroundWithClient_entityNames_target_selector(ISyncClient client,
NSArray entityNames,
org.rococoa.ID target,
org.rococoa.Selector selector)
Returns immediately and invokes a target callback when the session can start or if the session. |
static ISyncSession |
beginSessionWithClient_entityNames_beforeDate_lastAnchors(ISyncClient client,
NSArray entityNames,
NSDate date,
NSDictionary anchors)
If a client is using sync anchors, when starting a sync session, the client passes in the previous
sync anchors, one per entity. |
static ISyncSession |
beginSessionWithClient_entityNames_beforeDate(ISyncClient client,
NSArray entityNames,
NSDate date)
Phase I: negotiating the sync mode. |
static void |
cancelPreviousBeginSessionWithClient(ISyncClient client)
|
abstract void |
cancelSyncing()
|
abstract NSEnumerator |
changeEnumeratorForEntityNames(NSArray entityNames)
Original signature : -(NSEnumerator*)changeEnumeratorForEntityNames:(NSArray*)
NSString |
abstract void |
clientAcceptedChangesForRecordWithIdentifier_formattedRecord_newRecordIdentifier(NSString recordId,
NSDictionary formattedRecord,
NSString recordId2)
|
abstract void |
clientChangedRecordIdentifiers(NSDictionary oldToNew)
|
abstract void |
clientCommittedAcceptedChanges()
|
abstract void |
clientCommittedAcceptedChangesWithNextAnchors(NSDictionary anchors)
If a client is using sync anchors, after accepting pulled changes, a client must create a new sync anchor
string for each entity that was synced, save the anchors in the client datastore, and pass the anchors to
the call to clientCommittedAcceptedChangesWithNextAnchors. |
abstract void |
clientDidResetEntityNames(NSArray entityNames)
The default is to assume that a client will be fast syncing all the entities specified when the
session was created. |
abstract void |
clientFinishedPushingChangesWithNextAnchors(NSDictionary anchors)
If a client is using Sync Anchors, after pushing all changes, a client must create a new sync anchor
string for each entity name that was synced, save the anchors in the client datastore, and pass the
anchors to clientFinishedPushingChangesWithNextAnchors. |
abstract NSObject |
clientInfoForRecordWithIdentifier(NSString recordId)
Conduit-specific, unsynchronized information stored with a record. |
abstract void |
clientLostRecordWithIdentifier_shouldReplaceOnNextSync(NSString recordId,
boolean flag)
The proverbial "soft delete". |
abstract void |
clientRefusedChangesForRecordWithIdentifier(NSString recordId)
This method informs the sync engine that the client has
refused to apply the changes for the record specified by recordIdentifier. |
abstract void |
clientWantsToPushAllRecordsForEntityNames(NSArray entityNames)
Original signature : -(void)clientWantsToPushAllRecordsForEntityNames:(NSArray*)
NSString |
abstract void |
deleteRecordWithIdentifier(NSString recordId)
A convenience to delete a record so you don't have to manually construct an ISyncChange. |
abstract void |
finishSyncing()
|
abstract boolean |
isCancelled()
|
abstract boolean |
prepareToPullChangesForEntityNames_beforeDate(NSArray entityNames,
NSDate date)
Phase III: pulling changes for the client. |
abstract void |
prepareToPullChangesInBackgroundForEntityNames_target_selector(NSArray entityNames,
org.rococoa.ID target,
org.rococoa.Selector selector)
Original signature : -(void)prepareToPullChangesInBackgroundForEntityNames:(NSArray*) target:(id) selector:(SEL)
NSString |
abstract void |
pushChange(ISyncChange change)
Phase II: pushing changes from the client. |
abstract void |
pushChangesFromRecord_withIdentifier(NSDictionary record,
NSString recordId)
|
abstract void |
setClientInfo_forRecordWithIdentifier(org.rococoa.ID clientInfo,
NSString recordId)
Deprecated. use the safer method setClientInfo_forRecordWithIdentifier(org.rococoa.cocoa.foundation.protocols.NSCoding, org.rococoa.cocoa.foundation.NSString) instead |
abstract void |
setClientInfo_forRecordWithIdentifier(NSCoding clientInfo,
NSString recordId)
|
abstract boolean |
shouldPullChangesForEntityName(NSString entityName)
|
abstract boolean |
shouldPushAllRecordsForEntityName(NSString entityName)
|
abstract boolean |
shouldPushChangesForEntityName(NSString entityName)
These methods query how the engine is going to sync you, the client. |
abstract boolean |
shouldReplaceAllRecordsOnClientForEntityName(NSString entityName)
|
abstract ISyncRecordSnapshot |
snapshotOfRecordsInTruth()
Return a snapshot of the records in the Truth. |
Methods inherited from class org.rococoa.cocoa.foundation.NSObject |
copy, create, dealloc, description, doesNotRecognizeSelector, finalize, forwardInvocation, id, init, isKindOfClass, isKindOfClass, methodSignatureForSelector, mutableCopy, release, retain, retainCount |
Methods inherited from interface org.rococoa.cocoa.foundation.protocols.NSObject |
autorelease, class_, conformsToProtocol, hash, isEqual, isKindOfClass, isMemberOfClass, isProxy, performSelector_withObject_withObject, performSelector_withObject, performSelector, respondsToSelector, self, superclass, zone |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.WebUIDelegate |
webView_contextMenuItemsForElement_defaultMenuItems, webView_createWebViewModalDialogWithRequest, webView_createWebViewWithRequest, webView_dragDestinationActionMaskForDraggingInfo, webView_dragDestinationActionMaskForDraggingInfo, webView_makeFirstResponder, webView_mouseDidMoveOverElement_modifierFlags, webView_printFrameView, webView_runBeforeUnloadConfirmPanelWithMessage_initiatedByFrame, webView_runJavaScriptAlertPanelWithMessage_initiatedByFrame, webView_runJavaScriptAlertPanelWithMessage, webView_runJavaScriptConfirmPanelWithMessage_initiatedByFrame, webView_runJavaScriptConfirmPanelWithMessage, webView_runJavaScriptTextInputPanelWithPrompt_defaultText_initiatedByFrame, webView_runJavaScriptTextInputPanelWithPrompt_defaultText, webView_runOpenPanelForFileButtonWithResultListener, webView_runOpenPanelForFileButtonWithResultListener, webView_setResizable, webView_setStatusBarVisible, webView_setStatusText, webView_setToolbarsVisible, webView_shouldPerformAction_fromSender, webView_validateUserInterfaceItem_defaultValidation, webView_validateUserInterfaceItem_defaultValidation, webView_willPerformDragDestinationAction_forDraggingInfo, webView_willPerformDragDestinationAction_forDraggingInfo, webViewAreToolbarsVisible, webViewClose, webViewContentRect, webViewFirstResponder, webViewFocus, webViewFooterHeight, webViewFrame, webViewHeaderHeight, webViewIsResizable, webViewIsStatusBarVisible, webViewRunModal, webViewShow, webViewStatusText, webViewUnfocus |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.NSBrowserDelegate |
browser_acceptDrop_atRow_column_dropOperation, browser_acceptDrop_atRow_column_dropOperation, browser_canDragRowsWithIndexes_inColumn_withEvent, browser_createRowsForColumn_inMatrix, browser_isColumnValid, browser_namesOfPromisedFilesDroppedAtDestination_forDraggedRowsWithIndexes_inColumn, browser_nextTypeSelectMatchFromRow_toRow_inColumn_forString, browser_numberOfRowsInColumn, browser_selectCellWithString_inColumn, browser_selectRow_inColumn, browser_shouldShowCellExpansionForRow_column, browser_shouldSizeColumn_forUserResize_toWidth, browser_shouldTypeSelectForEvent_withCurrentSearchString, browser_sizeToFitWidthOfColumn, browser_titleOfColumn, browser_typeSelectStringForRow_inColumn, browser_validateDrop_proposedRow_column_dropOperation, browser_validateDrop_proposedRow_column_dropOperation, browser_willDisplayCell_atRow_column, browser_writeRowsWithIndexes_inColumn_toPasteboard, browserColumnConfigurationDidChange, browserDidScroll, browserWillScroll |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.NSKeyValueCoding |
dictionaryWithValuesForKeys, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, setNilValueForKey, setValue_forKey, setValue_forKeyPath, setValue_forUndefinedKey, setValuesForKeysWithDictionary, validateValue_forKey_error, validateValue_forKeyPath_error, valueForKey, valueForKeyPath, valueForUndefinedKey |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.NSOutlineViewDelegate |
outlineView_dataCellForTableColumn_item, outlineView_didClickTableColumn, outlineView_didDragTableColumn, outlineView_heightOfRowByItem, outlineView_isGroupItem, outlineView_mouseDownInHeaderOfTableColumn, outlineView_nextTypeSelectMatchFromItem_toItem_forString, outlineView_selectionIndexesForProposedSelection, outlineView_shouldCollapseItem, outlineView_shouldEditTableColumn_item, outlineView_shouldExpandItem, outlineView_shouldSelectItem, outlineView_shouldSelectTableColumn, outlineView_shouldShowCellExpansionForTableColumn_item, outlineView_shouldTrackCell_forTableColumn_item, outlineView_shouldTypeSelectForEvent_withCurrentSearchString, outlineView_typeSelectStringForTableColumn_item, outlineView_willDisplayCell_forTableColumn_item, outlineView_willDisplayOutlineCell_forTableColumn_item, selectionShouldChangeInOutlineView |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.WebViewEditingDelegate |
undoManagerForWebView, webView_doCommandBySelector, webView_shouldApplyStyle_toElementsInDOMRange, webView_shouldBeginEditingInDOMRange, webView_shouldChangeTypingStyle_toStyle, webView_shouldDeleteDOMRange, webView_shouldEndEditingInDOMRange, webView_shouldInsertNode_replacingDOMRange_givenAction, webView_shouldInsertText_replacingDOMRange_givenAction, webViewDidBeginEditing, webViewDidChange, webViewDidChangeSelection, webViewDidChangeTypingStyle, webViewDidEndEditing |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.WebFrameLoadDelegate |
webView_didCancelClientRedirectForFrame, webView_didChangeLocationWithinPageForFrame, webView_didClearWindowObject_forFrame, webView_didCommitLoadForFrame, webView_didFailLoadWithError_forFrame, webView_didFailProvisionalLoadWithError_forFrame, webView_didFinishLoadForFrame, webView_didReceiveIcon_forFrame, webView_didReceiveServerRedirectForProvisionalLoadForFrame, webView_didReceiveTitle_forFrame, webView_didStartProvisionalLoadForFrame, webView_willCloseFrame, webView_windowScriptObjectAvailable |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.NSTokenFieldDelegate |
tokenField_completionsForSubstring_indexOfToken_indexOfSelectedItem, tokenField_completionsForSubstring_indexOfToken_indexOfSelectedItem, tokenField_displayStringForRepresentedObject, tokenField_editingStringForRepresentedObject, tokenField_hasMenuForRepresentedObject, tokenField_menuForRepresentedObject, tokenField_readFromPasteboard, tokenField_representedObjectForEditingString, tokenField_shouldAddObjects_atIndex, tokenField_styleForRepresentedObject, tokenField_writeRepresentedObjects_toPasteboard |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.NSXMLParserDelegateEventAdditions |
parser_didEndElement_namespaceURI_qualifiedName, parser_didEndMappingPrefix, parser_didStartElement_namespaceURI_qualifiedName_attributes, parser_didStartMappingPrefix_toURI, parser_foundAttributeDeclarationWithName_forElement_type_defaultValue, parser_foundCDATA, parser_foundCharacters, parser_foundComment, parser_foundElementDeclarationWithName_model, parser_foundExternalEntityDeclarationWithName_publicID_systemID, parser_foundIgnorableWhitespace, parser_foundInternalEntityDeclarationWithName_value, parser_foundNotationDeclarationWithName_publicID_systemID, parser_foundProcessingInstructionWithTarget_data, parser_foundUnparsedEntityDeclarationWithName_publicID_systemID_notationName, parser_parseErrorOccurred, parser_resolveExternalEntityName_systemID, parser_validationErrorOccurred, parserDidEndDocument, parserDidStartDocument |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.NSDraggingDestination |
concludeDragOperation, concludeDragOperation, draggingEnded, draggingEnded, draggingEntered, draggingEntered, draggingExited, draggingExited, draggingUpdated, draggingUpdated, performDragOperation, performDragOperation, prepareForDragOperation, prepareForDragOperation, wantsPeriodicDraggingUpdates |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.NSOutlineViewDataSource |
outlineView_acceptDrop_item_childIndex, outlineView_acceptDrop_item_childIndex, outlineView_child_ofItem, outlineView_isItemExpandable, outlineView_itemForPersistentObject, outlineView_namesOfPromisedFilesDroppedAtDestination_forDraggedItems, outlineView_numberOfChildrenOfItem, outlineView_objectValueForTableColumn_byItem, outlineView_persistentObjectForItem, outlineView_setObjectValue_forTableColumn_byItem, outlineView_sortDescriptorsDidChange, outlineView_validateDrop_proposedItem_proposedChildIndex, outlineView_validateDrop_proposedItem_proposedChildIndex, outlineView_writeItems_toPasteboard |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.NSURLDownloadDelegate |
download_decideDestinationWithSuggestedFilename, download_didCancelAuthenticationChallenge, download_didCreateDestination, download_didFailWithError, download_didReceiveAuthenticationChallenge, download_didReceiveDataOfLength, download_didReceiveResponse, download_shouldDecodeSourceDataOfMIMEType, download_willResumeWithResponse_fromByte, download_willSendRequest_redirectResponse, downloadDidBegin, downloadDidFinish |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.NSAccessibility |
accessibilityActionDescription, accessibilityActionNames, accessibilityAttributeNames, accessibilityAttributeValue_forParameter, accessibilityAttributeValue, accessibilityFocusedUIElement, accessibilityIsAttributeSettable, accessibilityIsIgnored, accessibilityParameterizedAttributeNames, accessibilityPerformAction, accessibilitySetValue_forAttribute |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.NSTextViewDelegate |
textView_clickedOnLink_atIndex, textView_clickedOnLink, textView_doCommandBySelector, textView_menu_forEvent_atIndex, textView_shouldChangeTextInRanges_replacementStrings, textView_shouldChangeTypingAttributes_toAttributes, textView_willChangeSelectionFromCharacterRanges_toCharacterRanges, textView_willDisplayToolTip_forCharacterAtIndex, textView_writablePasteboardTypesForCell_atIndex, textView_writablePasteboardTypesForCell_atIndex, textView_writeCell_atIndex_toPasteboard_type, textView_writeCell_atIndex_toPasteboard_type, textViewDidChangeSelection, textViewDidChangeTypingAttributes, undoManagerForTextView |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.NSTokenFieldCellDelegate |
tokenFieldCell_completionsForSubstring_indexOfToken_indexOfSelectedItem, tokenFieldCell_completionsForSubstring_indexOfToken_indexOfSelectedItem, tokenFieldCell_displayStringForRepresentedObject, tokenFieldCell_editingStringForRepresentedObject, tokenFieldCell_hasMenuForRepresentedObject, tokenFieldCell_menuForRepresentedObject, tokenFieldCell_readFromPasteboard, tokenFieldCell_representedObjectForEditingString, tokenFieldCell_shouldAddObjects_atIndex, tokenFieldCell_styleForRepresentedObject, tokenFieldCell_writeRepresentedObjects_toPasteboard |
Methods inherited from interface org.rococoa.cocoa.foundation.categories.NSWindowNotifications |
windowDidBecomeKey, windowDidBecomeMain, windowDidChangeScreen, windowDidChangeScreenProfile, windowDidDeminiaturize, windowDidEndSheet, windowDidExpose, windowDidMiniaturize, windowDidMove, windowDidResignKey, windowDidResignMain, windowDidResize, windowDidUpdate, windowWillBeginSheet, windowWillClose, windowWillMiniaturize, windowWillMove |
ISyncSession
public ISyncSession()
beginSessionWithClient_entityNames_beforeDate
public static ISyncSession beginSessionWithClient_entityNames_beforeDate(ISyncClient client,
NSArray entityNames,
NSDate date)
- Phase I: negotiating the sync mode.
Original signature : +(ISyncSession*)beginSessionWithClient:(ISyncClient*) entityNames:(NSArray*) beforeDate:(NSDate*)
entity name
beginSessionInBackgroundWithClient_entityNames_target_selector
public static void beginSessionInBackgroundWithClient_entityNames_target_selector(ISyncClient client,
NSArray entityNames,
org.rococoa.ID target,
org.rococoa.Selector selector)
- Returns immediately and invokes a target callback when the session can start or if the session.
cannot be started. The target is invoked with the selector and two arguments, the ISyncClient
and the ISyncSession. The selector should be of this form:
-(void)client:(ISyncClient *)can beginSession:(ISyncSession *)session;
If the session cannot be started, the session parameter is nil.
Original signature : +(void)beginSessionInBackgroundWithClient:(ISyncClient*) entityNames:(NSArray*) target:(id) selector:(SEL)
entity name
cancelPreviousBeginSessionWithClient
public static void cancelPreviousBeginSessionWithClient(ISyncClient client)
beginSessionWithClient_entityNames_beforeDate_lastAnchors
public static ISyncSession beginSessionWithClient_entityNames_beforeDate_lastAnchors(ISyncClient client,
NSArray entityNames,
NSDate date,
NSDictionary anchors)
- If a client is using sync anchors, when starting a sync session, the client passes in the previous
sync anchors, one per entity. The anchors dictionary is a map from the entity name to the sync anchor
value, and the values are the anchors as last set in the previous sync's calls to the methods
clientFinishedPushingChangesWithNextAnchors or clientCommittedAcceptedChanges. As a convenience, the
user may specify a mapping for a single entity name for some representative entity of a
dataclass. However, if more than one mapping per dataclass is provided, then mappings are required
for every entity name being synchronized. The lack of a mapping in this case will force the entity
without a mapping to be refreshed.
The values that are passed in are compared to the previous values. If an anchor does not match for
an entity, then the method shouldPushAllRecordsForEntityName will return YES for this entity.
If there is no value for a entity's anchor, then the entity can either be left out of the dictionary,
or even better, the value [NSNull null] can be can be put in the dictionary for that entity name. If
there is no value the client will be refreshed and the sync will be treated as if it is the first
sync done by the client. The null value (or lack of value) for an anchor should be used on the
client's first sync (when there would be no value in the client's data store), or when the data store
is cleared or lost.
nil is an acceptable value for the dictionary, and will always result in a full refresh sync for all
the entities specified in the sync.
If a client is using sync anchors, it should also call the method
clientFinishedPushingChangesWithNextAnchors after pushing changes, and call the sync anchor variant
of clientCommittedAcceptedChanges as outlined below. Failure to make these calls will likely result
in the next sync of these entities being a refresh sync. Finally, an exception will be raised if
these methods are called on a session that was created using the earlier API that did not include a
lastAnchors argument.
Original signature : +(ISyncSession*)beginSessionWithClient:(ISyncClient*) entityNames:(NSArray*) beforeDate:(NSDate*) lastAnchors:(NSDictionary*)
entity name
beginSessionInBackgroundWithClient_entityNames_target_selector_lastAnchors
public static void beginSessionInBackgroundWithClient_entityNames_target_selector_lastAnchors(ISyncClient client,
NSArray entityNames,
org.rococoa.ID target,
org.rococoa.Selector selector,
NSDictionary anchors)
- Original signature :
+(void)beginSessionInBackgroundWithClient:(ISyncClient*) entityNames:(NSArray*) target:(id) selector:(SEL) lastAnchors:(NSDictionary*)
entity name
clientDidResetEntityNames
public abstract void clientDidResetEntityNames(NSArray entityNames)
- The default is to assume that a client will be fast syncing all the entities specified when the
session was created. Telling the engine that a client was reset is tantamount to saying "forget
everything you ever knew about me and let's start over again". In sync parlance, this is what we
call a refresh sync. Telling the engine that you want to push all records (ie. slow syncing) just
means that you, the client, can't figure out which records have changed since the last sync and so
you're going to give all of your records to the engine. The engine will figure out what has changed
since the last sync and only provide to you the appropriate sets of changes.
Original signature : -(void)clientDidResetEntityNames:(NSArray*)
NSString
clientWantsToPushAllRecordsForEntityNames
public abstract void clientWantsToPushAllRecordsForEntityNames(NSArray entityNames)
- Original signature :
-(void)clientWantsToPushAllRecordsForEntityNames:(NSArray*)
NSString
shouldPushChangesForEntityName
public abstract boolean shouldPushChangesForEntityName(NSString entityName)
- These methods query how the engine is going to sync you, the client. -shouldPushChangesForEntityName:
returns NO if you should not push any changes for an entity. -shouldPushAllRecordsForEntityName:
returns YES if you should give to the engine all of your records. (What we call "slow syncing" in our
parlance.) Converseley, -shouldPullChangesForEntityName: returns NO if the engine will not be giving
you any changes for an entity and -shouldReplaceAllRecordsOnClientForEntityName: returns YES if you
should delete all of your records and replace them with the records the engine will hand you. To a
certain extent, these values may be modified by the methods -clientDidResetEntityNames: and
-clientWantsToPushAllRecordsForEntityNames: as described above.
Original signature : -(BOOL)shouldPushChangesForEntityName:(NSString*)
shouldPushAllRecordsForEntityName
public abstract boolean shouldPushAllRecordsForEntityName(NSString entityName)
shouldPullChangesForEntityName
public abstract boolean shouldPullChangesForEntityName(NSString entityName)
shouldReplaceAllRecordsOnClientForEntityName
public abstract boolean shouldReplaceAllRecordsOnClientForEntityName(NSString entityName)
pushChange
public abstract void pushChange(ISyncChange change)
- Phase II: pushing changes from the client. You can create an ISyncChange object yourself and
push that directly, or you can give the engine the entire record and let it figure out what
the changes are. If you are pushing the record, it should represent the entire state of the
record from your backing store. At the very least, every record dictionary MUST have an attribute
identifying the entity this record is an instance of, keyed to ISyncRecordEntityNameKey.
Consider, for example, some (purely fictional) contact with two email address. The path of the
first name is "first name". There are two relationships involving this contact, one for the
home address and one for the email addresses. There is one home address, identified by the
record 1492.address1, and two email addresses, 1492.email1 and 1492.email2. The record dictionaries
for these four records might look something like the following:
1492 {
ISyncRecordEntityNameKey = Contact;
first name = Edgar;
last name = Qwerty;
Contact to Address = ( 1492.address1 );
Contact to EmailAddress = ( 1492.email1, 1492.email2 );
}
1492.address1 {
ISyncRecordEntityNameKey = Address;
label = home;
street = 123 Main St.;
city = Everywhere;
country = USA;
postal code = 90210;
}
1492.email1 {
ISyncRecordEntityNameKey = EmailAddress;
type = home;
email = asdf@asdf.com;
}
1492.email2 {
ISyncRecordEntityNameKey = EmailAddress;
type = work;
label = summer cottage;
email = qwerty@keyboard.com;
}
Original signature : -(void)pushChange:(ISyncChange*)
pushChangesFromRecord_withIdentifier
public abstract void pushChangesFromRecord_withIdentifier(NSDictionary record,
NSString recordId)
deleteRecordWithIdentifier
public abstract void deleteRecordWithIdentifier(NSString recordId)
- A convenience to delete a record so you don't have to manually construct an ISyncChange.
Original signature : -(void)deleteRecordWithIdentifier:(NSString*)
clientLostRecordWithIdentifier_shouldReplaceOnNextSync
public abstract void clientLostRecordWithIdentifier_shouldReplaceOnNextSync(NSString recordId,
boolean flag)
- The proverbial "soft delete". This indicates that a record no longer exists on the client but this
should not be considered a delete. This method is special in that it can be used during either the
push phase and the pull phase.
You may specify whether or not you want the record back (as an add) during the next pull phase. If you
call this method during the push phase and say YES, the record will be re-applied in the pull phase
of this same session. If you call this method during the pull phase, it will be replaced in the
pull phase of the next session.
When invoked with flag set to NO during the pulling phase, this is equivalent
to refusing a record using the method clientRefusedChangesForRecordWithIdentifier:
This method will not touch the client info, if any, associated with this record.
Original signature : -(void)clientLostRecordWithIdentifier:(NSString*) shouldReplaceOnNextSync:(BOOL)
clientFinishedPushingChangesWithNextAnchors
public abstract void clientFinishedPushingChangesWithNextAnchors(NSDictionary anchors)
- If a client is using Sync Anchors, after pushing all changes, a client must create a new sync anchor
string for each entity name that was synced, save the anchors in the client datastore, and pass the
anchors to clientFinishedPushingChangesWithNextAnchors. As a convenience a single representative
entity name to anchor mapping may be used for all of the entities in a dataclass. If the client is
pulling the truth, the anchor is specified when calling clientCommittedAcceptedChanges.
Original signature : -(void)clientFinishedPushingChangesWithNextAnchors:(NSDictionary*)
string entity name -> string anchor
prepareToPullChangesForEntityNames_beforeDate
public abstract boolean prepareToPullChangesForEntityNames_beforeDate(NSArray entityNames,
NSDate date)
- Phase III: pulling changes for the client. The entities that you specify here must be a subset of
the entities specified when the session was created.
Original signature : -(BOOL)prepareToPullChangesForEntityNames:(NSArray*) beforeDate:(NSDate*)
NSString
prepareToPullChangesInBackgroundForEntityNames_target_selector
public abstract void prepareToPullChangesInBackgroundForEntityNames_target_selector(NSArray entityNames,
org.rococoa.ID target,
org.rococoa.Selector selector)
- Original signature :
-(void)prepareToPullChangesInBackgroundForEntityNames:(NSArray*) target:(id) selector:(SEL)
NSString
changeEnumeratorForEntityNames
public abstract NSEnumerator changeEnumeratorForEntityNames(NSArray entityNames)
- Original signature :
-(NSEnumerator*)changeEnumeratorForEntityNames:(NSArray*)
NSString
clientAcceptedChangesForRecordWithIdentifier_formattedRecord_newRecordIdentifier
public abstract void clientAcceptedChangesForRecordWithIdentifier_formattedRecord_newRecordIdentifier(NSString recordId,
NSDictionary formattedRecord,
NSString recordId2)
clientRefusedChangesForRecordWithIdentifier
public abstract void clientRefusedChangesForRecordWithIdentifier(NSString recordId)
- This method informs the sync engine that the client has
refused to apply the changes for the record specified by recordIdentifier.
After invoking this method, the sync engine will not send the same change
during any subsequent syncs unless the record is modified. Use filtering if
you want to permanently ignore some records. Refusing a record does not
change the local id mapping for the client. Invoking this method will not
effect other clients participating in the same sync session.
This method will not touch the client info, if any, associated with this record.
Original signature : -(void)clientRefusedChangesForRecordWithIdentifier:(NSString*)
clientCommittedAcceptedChanges
public abstract void clientCommittedAcceptedChanges()
clientCommittedAcceptedChangesWithNextAnchors
public abstract void clientCommittedAcceptedChangesWithNextAnchors(NSDictionary anchors)
- If a client is using sync anchors, after accepting pulled changes, a client must create a new sync anchor
string for each entity that was synced, save the anchors in the client datastore, and pass the anchors to
the call to clientCommittedAcceptedChangesWithNextAnchors. As a convenience a single representative entity
name to anchor mapping may be used for all of the entities in a dataclass. If a client is pushing the
truth, this method won't be called, but that is fine, as the sync anchors passed into the method
clientFinishedPushingChangesWithNextAnchors will be used.
Original signature : -(void)clientCommittedAcceptedChangesWithNextAnchors:(NSDictionary*)
string entity name -> string anchor
clientChangedRecordIdentifiers
public abstract void clientChangedRecordIdentifiers(NSDictionary oldToNew)
isCancelled
public abstract boolean isCancelled()
cancelSyncing
public abstract void cancelSyncing()
finishSyncing
public abstract void finishSyncing()
clientInfoForRecordWithIdentifier
public abstract NSObject clientInfoForRecordWithIdentifier(NSString recordId)
- Conduit-specific, unsynchronized information stored with a record. The data is removed when
the client removes the associated record. You can specify any object here, but it must conform
to the NSCoding protocol.
Original signature : -(id)clientInfoForRecordWithIdentifier:(NSString*)
setClientInfo_forRecordWithIdentifier
@Deprecated
public abstract void setClientInfo_forRecordWithIdentifier(org.rococoa.ID clientInfo,
NSString recordId)
- Deprecated. use the safer method
setClientInfo_forRecordWithIdentifier(org.rococoa.cocoa.foundation.protocols.NSCoding, org.rococoa.cocoa.foundation.NSString)
instead
- Original signature :
-(void)setClientInfo:(id) forRecordWithIdentifier:(NSString*)
setClientInfo_forRecordWithIdentifier
public abstract void setClientInfo_forRecordWithIdentifier(NSCoding clientInfo,
NSString recordId)
snapshotOfRecordsInTruth
public abstract ISyncRecordSnapshot snapshotOfRecordsInTruth()
- Return a snapshot of the records in the Truth. ISyncSession creates two snap shots during the sync.
The first is made when the session is created. The second is made at the same time as the changes
for the client are prepared (when -prepareToPullChangesForEntityNames:beforeDate: is called).
Compare to the method on ISyncManager.
Original signature : -(ISyncRecordSnapshot*)snapshotOfRecordsInTruth
alloc
public static ISyncSession alloc()