#include <SyncServices/ISyncClient.h>


@implementation    ISyncClient
/*setShouldReplaceClientRecords:forEntityNames:

Sets whether or not a client should pull the truth—replace all its records for the specified entities on the next sync.

- (void)setShouldReplaceClientRecords:(BOOL)flag forEntityNames:(NSArray *)entityNames
Discussion

If flag is YES, the client should replace all its local records with the records pulled from the sync engine.

After invoking this method, sending shouldReplaceClientRecordsForEntityName: to any new sessions created for this client returns YES, and sending shouldPushChangesForEntityName: or shouldPushAllRecordsForEntityName: returns NO.

This request takes effect on the next session created after invoking this method and remains in effect until the client successfully passes through the pull phase of that session. The sync engine needs to know whether a client is going to pull the truth before entering the negotiation phase. This is necessary to detect conflicting push the truth and pull the truth requests.

A client should not remove its local records until after the records are successfully pulled from the sync engine. The local records can be safely removed after shouldReplaceClientRecordsForEntityName: returns YES.

This method is typically used by a configuration tool that allows the user to revert to the state of the truth.
Availability
Available in Mac OS X v10.4 and later.*/
- (void)setShouldReplaceClientRecords:(BOOL)flag forEntityNames:(NSArray *)entityNames{}


/*supportedEntityNames

Returns an array of NSString objects containing the names of the entities the client supports.

- (NSArray *)supportedEntityNames
Discussion

This property is set when registering the client.
Availability
Available in Mac OS X v10.4 and later.
See Also
registerClientWithIdentifier:descriptionFilePath: (ISyncManager)*/
- (NSArray *)supportedEntityNames{}


/*SetSyncAlertHandler:selector:

Sets the target and action to be invoked when an observed client creates a session and begins syncing.

- (void)setSyncAlertHandler:(id)handler selector:(SEL)selector
Discussion

When selector is sent to handler, your client has the opportunity to join the sync session. 

The selector method is expected to take the receiver (an ISyncClient object) as the first argument and an array of entity names (an NSArray object) as the second argument. The method signature for selector should look like:- (void)client:(ISyncClient *)client willSyncEntityNames:(NSArray  *)entityNames


If selector returns without creating a session, the sync engine assumes the client will not join the session. If this client already has another handler registered—for example, from another client process—this method raises an exception. An observer is automatically removed when the client terminates.

When you create a session using the beginSessionWithClient:entityNames:beforeDate: ISyncSession class method, you specify how long you are willing to wait for the sync session. This is the length of time you are willing to wait for all the other clients to join the session. If a client takes too long to join a session, the sync engine may proceed without it.

Use this method instead of setSyncAlertToolPath: if you want to notify a running application only. Use setShouldSynchronize:withClientsOfType: to specify the types of clients the receiver wishes to observe. If both a tool and an observer are registered, only the observer is notified.

Note: If your client is multithreaded, the thread that registers the alert handler has to exist, otherwise the client does not receive the alert.

Availability
Available in Mac OS X v10.4 and later.
See Also
shouldSynchronizeWithClientsOfType:
syncAlertToolPath*/
- (void)setSyncAlertHandler:(id)handler selector:(SEL)selector{}




@end