Skip to main content

DBEngine

DBEngines for C++ Replication API

Abstract

OpSystem (operating system) may contain one or more database servers. Only FairCom DB database servers are recognized in this release. Each DBEngineGroup may contain one or more DBEngines. A DBEngine may contain one or more Databases.

OpSystem (operating system) may contain one or more database servers. Only FairCom DB database servers are recognized in this release. Each DBEngineGroup may contain one or more DBEngines. A DBEngine may contain one or more Databases.

Table 1, “Engine status lists enums defined as values for FCREPLEngineStatus and FCREPLAgentStatus.

Table 1. Engine status

Symbolic

Code

Description

FCREPL_NOTSUP

-1

Engine invalid status

FCREPL_INACTIVE

0

Engine inactive

FCREPL_ACTIVE

1

Engine active

FCREPL_STOPPING

2

Engine stopping

FCREPL_STARTING

3

Engine starting

FCREPL_CHECKING

4

Engine checking

FCREPL_DBWARNING

5

Engine active with warning

FCREPL_DBERROR

6

Engine unavailable

FCREPL_SWITCHING

7

Switching avail group to new primary

FCREPL_UNMANAGED

8

Engine unmanaged



Class

FCREPLDBEngine

Represents a physical Replication (referred to as Memphis) database server. Initially, it supports only FairCom type.

Getters

Table 2. Getters

DBEngine status

FCREPLEngineStatus GetStatus() { return (FCREPLEngineStatus)((pRCESDBEngine)this)->GetStatus(); };

Server connection string

char *GetServName() { return ((pRCESDBEngine)this)->GetServName(); };

Full absolute local directory

char *GetFullDataPath() { return ((pRCESDBEngine)this)->GetFullDataPath(); };



Inherited getters

Table 3. Inherited getters

DBEngine identification

int GetID();

OpSystem identification that is running the agent

Note

It is linked to the FCREPLOpSystem class.

int GetOSID();

DBEngine name

char *GetName();

Status

RCESEngineStatus GetStatus();

Last time the DBEngine status changed

RCESDateTime GetStatusTime();

Last time the DBEngine status has been checked

RCESDateTime GetLastCheckTime();

Host name/IP address

char *GetHost();

DBEngine description

char *GetDescription();

Encrypted authentication information (login and password)

char *GetAuthContent();

Working volume identification

Note

It is linked to FCREPLVolume class.

int GetWorkingVolume();

Working directory

char *GetWorkingDir();

Username

char *GetUser();

Password

char *GetUserPass();

Retrieve the server name

char *GetServName();

Retrieve the server name by IP address

char *GetServNameByIP(const char *ipAddress = NULL);

Windows service name

char *GetServiceName();

Executable name

char *GetExeName();

Return if DBEngine is a SQL server

bool GetIsSQL();

ISAM port number

int GetPortNumber();

SQL port number

int GetSqlPortNumber();

Local directory's volume identification

Note

It is linked to FCREPLVolume class.

int GetLocalVolume();

Local directory

char *GetLocalDir();

Maximum number of users

int GetUsers();

Release version

char *GetVersion();

Serial number

char *GetSerial();

License OEM

int GetLicenseOEM();

License type (development, production, and so forth)

char *GetLicenseType();

License number of CPU limit

int GetLicenseCPUNbr();

License server type (ISAM, SQL, and so forth)

char *GetLicenseServerType();

License user number

int GetLicenseUserNumber();

Working volume name

char *GetWorkingVolumeName();

Local volume name

char *GetLocalVolumeName();

Retrieve the full data directory

char *GetFullDataPath();

DBEngine has Replication Manager embedded

bool GetIsAgent();

Logical name

char *GetLogicalName();

Retrieve the authentication info for the current DBEngine

void GetAuthInfo();

Return if DBEngine is the server

bool IsMaster();

Replication unique node identification

char *GetReplNodeID();

Flag indicating the DBEngine must be connected by the IP address instead of the hostname

bool IsConnectByIP();

Specify IP address to be used when trying to connect to the DBEngine

char *GetIPAddress();

Return IP address list

ppRCESIp GetIPAddressList();

Number of IP addresses in the list

int GetIPAddressCount();

Flag indicating if the DBEngine accepts external connections

bool GetAcceptConn();

Flag for the DBEngine read-only status

RCESReadOnly GetReadOnly();

Get read-only string

const char *GetReadOnlyName();

Get is Memphis flag

bool IsMemphis(pRCESConfig config);



Setters

Table 4. Setters

DBEngine status

void SetStatus(FCREPLEngineStatus status) { ((pRCESDBEngine)this)->SetStatus((RCESEngineStatus)status); };

DBEngine name

void SetName(const char *name) { ((pRCESDBEngine)this)->SetName(name); };

Host name/IP address

void SetHost(const char *host) { ((pRCESDBEngine)this)->SetHost(host); };

DBEngine description

void SetDescription(const char *description) { ((pRCESDBEngine)this)->SetDescription(description); };

Working directory

void SetWorkingDir(const char *workingDir) { ((pRCESDBEngine)this)->SetWorkingDir(workingDir); };

Username

void SetUserName(const char *userName) { ((pRCESDBEngine)this)->SetUserName(userName); };

Password

void SetUserPass(const char *userPass) { ((pRCESDBEngine)this)->SetUserPass(userPass); };

Encrypted authentication information (login and password)

void SetAuthContent(const char *authContent) { ((pRCESDBEngine)this)->SetAuthContent(authContent); };

Local directory

void SetLocalDir(const char *localDir) { ((pRCESDBEngine)this)->SetLocalDir(localDir); };

Release version

void SetVersion(const char *version) { ((pRCESDBEngine)this)->SetVersion(version); };

Serial number

void SetSerial(const char *serial) { ((pRCESDBEngine)this)->SetSerial(serial); };

License type (development, production, and so forth)

void SetLicenseType(const char *licenseType) { ((pRCESDBEngine)this)->SetLicenseType(licenseType); };

License server type (ISAM, SQL, and so forth)

void SetLicenseServerType(const char *licenseServerType) { ((pRCESDBEngine)this)->SetLicenseServerType(licenseServerType); };

Logical name

void SetLogicalName(const char *logicalName) { ((pRCESDBEngine)this)->SetLogicalName(logicalName); };

Replication unique node identification

void SetReplNodeID(char *replNodeID) { ((pRCESDBEngine)this)->SetReplNodeID(replNodeID); };

Specify IP address to be used when trying to connect to the DBEngine

void SetIPAddress(char *ipAddress) { ((pRCESDBEngine)this)->SetIPAddress(ipAddress); };



Inherited setters

Table 5. Inherited setters

DBEngine identification

void SetID(int id);

OpSystem identification that is running the agent

Note

It is linked to the FCREPLOpSystem class.

void SetOSID(int osID);

Name

void SetName(const char *name);

Status

void SetStatus(RCESEngineStatus status);

Last time the DBEngine status changed

void SetStatusTime(RCESDateTime statusTime);

Last time the DBEngine status has been checked

void SetLastCheckTime(RCESDateTime lastCheckTime);

Host

void SetHost(const char *host);

Description

void SetDescription(const char *description);

Working volume identification

Note

It is linked to FCREPLVolume class.

void SetWorkingVolume(int workingVolume);

Working directory

void SetWorkingDir(const char *workingDir);

Auth content

void SetAuthContent(const char *authContent);

Return if DBEngine is a SQL server

void SetIsSQL(bool isSQL);

ISAM port number

void SetPortNumber(int portNumber);

SQL port number

void SetSqlPortNumber(int sqlPortNumber);

Local directory's volume identification

Note

It is linked to FCREPLVolume class.

void SetLocalVolume(int localVolume);

Local directory

void SetLocalDir(const char *localDir);

Working volume name

void SetWorkingVolumeName(const char *workingVolumeName);

Local volume name

void SetLocalVolumeName(const char *localVolumeName);

Username

void SetUserName(const char *userName);

User password

void SetUserPass(const char *userPass);

DBEngine has Replication Manager embedded

void SetIsAgent(bool isAgent);

Return if DBEngine is the Memphis server

void SetIsMaster(bool isMaster);

Repl node ID

void SetReplNodeID(const char *replNodeID);

Flag indicating that the DBEngine must be connected by the IP address instead of the hostname

void SetIsConnectByIP(bool connectByIP) { _connectByIP = connectByIP; };

IP address

void SetIPAddress(char *ipAddress);

IP address list

void SetIPAddressList(ppRCESIp ipList) { _ipList = ipList; };

Number of IP addresses in the list

void SetIPAddressCount(int ipCount) { _ipCount = ipCount; };

Flag indicating if the DBEngine accepts external connections

void SetAcceptConn(bool acceptConn);

Flag for the DBEngine readonly status

void SetReadOnly(bool readOnly);



Retrieve all the DBEngines entity objects for the given OpSystem identification.

Prototype

FCREPL_API int fcReplGetDBEngines(pFCREPLConn replConn, int osID, ppFCREPLDBEngine *dbEngineList, int *dbEngineCount);

Parameters

Table 6. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

osID [IN]

OS identification

dbEngineList [OUT]

DBEngine entity list

dbEngineCount [OUT]

Number of DBEngine entities in the list



Return

Error code

Retrieve the DBEngine entity object by its name.

Prototype

FCREPL_API int fcReplGetDBEngine(pFCREPLConn replConn, int osID, int workingVolume, const char *workingDir, ppFCREPLDBEngine dbEngine);

Parameters

Table 7. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

osID [IN]

OS identification

workingVolume [IN]

Working volume

workingDir [IN]

Working directory

dbEngine [OUT]

DBEngine entity retrieved



Return

Error code

Add a DBEngine entity into the database. If there already is a DBEngine with the given osID/name, update the existing record.

Prototype

FCREPL_API int fcReplPersistDBEngine(pFCREPLConn replConn, pFCREPLDBEngine dbEngine);

Parameters

Table 8. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

dbEngine [IN]

DBEngine entity to be persisted



Return

Error code

Delete the DBEngine by its identification.

Prototype

FCREPL_API int fcReplRemoveDBEngine(pFCREPLConn replConn, int dbEngineID, bool recursive);

Parameters

Table 9. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

dbEngineId [IN]

DBEngine identification

recursive [IN]

Recursive flag



Return

Error code

Try to connect to the dbEngine from the replication server in order to update its status. After validating it, returns its status.

Prototype

FCREPL_API int fcReplCheckDBEngineStatus(pFCREPLConn replConn, int dbEngineID, bool checkConn, ppFCREPLDBEngine *dbEngineList, int *dbEngineCount, int *actionID);

Parameters

Table 10. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

dbEngineID [IN]

DBEngine identification

checkConn [IN]

Flag indicating that Replication Manager should try to connect to the DBEngine in order update the status

dbEngineList [OUT]

DBEngine entity list retrieved or NULL in case it doesn't want to retrieve it.

dbEngineCount [OUT]

DBEngine entity list count.

actionID [OUT]

Action identification returned in case of checkConnection for all the DBEngines.



Return

Error code

Remove or restore the given DBEngine to be managed by the Replication Manager system.

Prototype

FCREPL_API int fcReplSetDBEngineManaged(pFCREPLConn replConn, int dbEngineID, bool managed);

Parameters

Table 11. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

dbEngineID [IN]

DBEngine identification

managed [IN]

TRUE for restoring an unmanaged DBEngine or FALSE to unmanaged



Return

Error code

Set if the DBEngine accepts external connections or not.

Prototype

FCREPL_API int fcReplSetDBEngineAcceptConn(pFCREPLConn replConn, int dbEngineID, bool managed);

Parameters

Table 12. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

dbEngineID [IN]

DBEngine identification

managed [IN]

Flag indicating if the DBEngine can or can't accept external connections



Return

Error code

Set the DBEngine read-only status.

Prototype

FCREPL_API int fcReplSetDBEngineReadOnly(pFCREPLConn replConn, int dbEngineID, bool readOnly);

Parameters

Table 13. Parameters

Parameter

Description

masterProv [IN]

Master provider

dbEngineID [IN]

DBEngine identification

readOnly [IN]

Flag indicating if the DBEngine is read-only



Return

Error code

Prototype

FCREPL_API int fcReplSetDBEngineStatus(pFCREPLConn replConn, int dbEngineID, FCREPLEngineStatus status, bool managed);

Parameters

Table 14. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

dbEngineId [IN]

DBEngine identification

status [IN]

New status

managed [IN]

Flag indicating that DBEngine should be restored as managed



Return

Error code