//
//  FBReplicatorHandler.h
//  Client
//
//  Created by ryan on Thu May 31 2001.
//  Copyright (c) 2001 FrontBase, Inc. All rights reserved.
//

#import <Foundation/NSObject.h>
#import "FBDatabaseDefs.h"

@class NSString;

typedef unsigned long long FBTVersion;

@interface FBReplicatorHandler : NSObject
{
    void *access;
}

+ (BOOL)isReplicatorRunningForDatabaseNamed:(NSString *)databaseName hostName:(NSString *)hostName;
+ (void)startReplicatorForDatabaseNamed:(NSString *)databaseName hostName:(NSString *)hostName options:(NSString *)options password:(NSString *)password;

+ (FBReplicatorHandler *)handlerWithHost:(NSString *)aHostName databaseName:(NSString *)aDatabaseName;

- (id)initWithHost:(NSString *)aHostName databaseName:(NSString *)aDatabaseName;

- (void)stopReplicator;

// Master

- (NSString *)masterHostName;
- (NSString *)masterDatabaseName;
- (unsigned long long)minimumMasterVersion;
- (unsigned long long)maximumMasterVersion;

// Clients
- (unsigned int)numberOfClients;
- (NSString *)clientHostNameAtIndex:(unsigned int)index;
- (NSString *)clientDatabaseNameAtIndex:(unsigned int)index;
- (NSString *)clientStatusAtIndex:(unsigned int)index;
- (unsigned long long)clientVersionAtIndex:(unsigned int)index;

- (void)createClientWithHost:(NSString *)aHostName databaseName:(NSString *)aDatabaseName;
- (void)createClientWithHost:(NSString *)aHostName databaseName:(NSString *)aDatabaseName databasePassword:(NSString *)aDatabasePassword  userPassword:(NSString *)aUserPassword;
- (void)addClientWithHost:(NSString *)aHostName databaseName:(NSString *)aDatabaseName;
- (void)addClientWithHost:(NSString *)aHostName databaseName:(NSString *)aDatabaseName databasePassword:(NSString *)aDatabasePassword  userPassword:(NSString *)aUserPassword;
- (void)removeClientWithHost:(NSString *)aHostName databaseName:(NSString *)aDatabaseName;

@end
