Skip to main content

Subscription

A Subscription contains one Publication and indicates the target where the published files are to be replicated. A subscription may belong to a replication plan.

Class

FCREPLSubscription

Represents a group of files published and subscribed for replication. In order to set a replication, this publication must be subscribed, which forms a FCREPLSubscription, which is assigned to a FCREPLReplPlan (replication plan).

Getters

Table 1. Getters

Publication entity object

pFCREPLPublication GetPublication() { return (pFCREPLPublication)((pRCESSubscription)this)->GetPublication(); };

DBEngine entity object

pFCREPLDBEngine GetDBEngine() { return (pFCREPLDBEngine)((pRCESSubscription)this)->GetDBEngine(); };

Database entity object

pRCESDatabase GetDatabase() { return (pRCESDatabase)((pRCESSubscription)this)->GetDatabase(); };



Inherited getters

Table 2. Inherited getters

Subscription identification

int GetID();

Publication identification

Note

This is linked to FCREPLPublication class.

int GetPublicationID();

Publication

pRCESPublication GetPublication();

DBEngine identification

Note

This is linked to FCREPLDBEngine class.

int GetDBEngineID();

DBEngine

pRCESDBEngine GetDBEngine() { return _dbEngine; };

Database identification

Note

This is linked to FCREPLDatabase class.

int GetDatabaseID();

Subscription name

const char *GetName();

Subscription description

const char *GetDescription();

Return if the subscription is bidirectional

bool GetIsBiDir();

replication plan identification

Note

This is linked to FCREPLReplPlan class.

int GetReplPlanID();

Redirection list

ppRCESReplRedir GetRedirList();

Redirection list count

int GetRedirListCount();



Setters

Table 3. Setters

Publication entity object

void SetPublication(pFCREPLPublication publication) { ((pRCESSubscription)this)->SetPublication((pRCESPublication)publication); };

DBEngine entity object

void SetDBEngine(pFCREPLDBEngine dbEngine) { ((pRCESSubscription)this)->SetDBEngine((pRCESDBEngine)dbEngine); };

Database entity object

void SetDatabase(pFCREPLDatabase database) { ((pRCESSubscription)this)->SetDatabase((pRCESDatabase)database); };

Subscription name

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

Subscription description

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

Redirection list

void SetRedirList(ppFCREPLReplRedir redirList, int redirListCount) { ((pRCESSubscription)this)->SetRedirList((ppRCESReplRedir)redirList, redirListCount); };



Inherited setters

Table 4. Inherited setters

Subscription identification

void SetID(int id);

Publication identification

Note

This is linked to FCREPLPublication class.

void SetPublicationID(int publicationID);

Publication

void SetPublication(pRCESPublication publication);

DBEngine identification

Note

This is linked to FCREPLDBEngine class.

void SetDBEngineID(int dbEngineID);

DBEngine

void SetDBEngine(pRCESDBEngine dbEngine);

Database identification

Note

This is linked to FCREPLDatabase class.

void SetDatabaseID(int databaseID);

Database

void SetDatabase(pRCESDatabase database);

Name

void SetName(const char *name);

Description

void SetDescription(const char *description);

Return if the subscription is bidirectional

void SetIsBiDir(bool isBiDir);

replication plan identification

Note

This is linked to FCREPLReplPlan class.

void SetReplPlanID(int replPlanID);

Redirection list

void SetRedirList(ppRCESReplRedir redirList, int redirListCount);



Retrieve all the subscription entity objects

Prototype

FCREPL_API int fcReplGetSubscriptions(pFCREPLConn replConn, int publication, int dbEngine, int subscriptionListSize, int subscriptionStart, ppFCREPLSubscription *subscriptionList, int *subscriptionCount, int *totalSubscriptions);

Parameters

Table 5. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

publication [IN]

Publication Identification

dbEngine [IN]

DBEngine Identification

subscriptionListSize [IN]

Subscription list count to be retrieved

subscriptionStart [IN]

Subscription list start record

subscriptionList [OUT]

Subscription entity list

subscriptionCount [OUT]

Number of subscription entities in the list

totalSubscriptions [OUT]

Total number of subscription entities



Return

Error code

Retrieve all the subscription entity objects for the given replication plan.

Prototype

FCREPL_API int fcReplGetSubscriptions(pFCREPLConn replConn, int replPlanID, int replSubsListSize, int replSubsStart, ppFCREPLSubscription *subsList, int *subsCount, int *totalReplSubs);

Parameters

Table 6. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

replPlanID [IN]

Replication plan identification

replSubsListSize [IN]

Replication subscription list count to be retrieved

replSubsStart [IN]

Replication subscription list start record

subsList [OUT]

Subscription entity list

subsCount [OUT]

Number of subscription entities in the list

totalReplSubs [OUT]

Total replication subscription



Return

  • Error code

  • FCREPL_MORE_RESULT (in case of pending files to be read)

Retrieve the publication list by name or partially filter by name.

Prototype

FCREPL_API int fcReplGetSubscriptionsByName(pFCREPLConn replConn, int publication, int dbEngine, const char *name, bool partial, int subscriptionListSize, int subscriptionStart, ppFCREPLSubscription *subscriptionList,

	int *subscriptionCount, int *totalSubscriptions);

Parameters

Table 7. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

publication [IN]

Publication ID

dbEngine [IN]

DBEngine ID

name [IN]

Publication name

partial [IN]

Flag indicating that the search by name should use a partial name

subscriptionListSize [IN]

Subscription list count to be retrieved

subscriptionStart [IN]

Subscription list start record

subscriptionList [OUT]

Subscription entity list

subscriptionCount [OUT]

Number of subscription entities in the list

totalSubscriptions [OUT]

Total number of subscription entities



Return

Error code

Retrieve the subscription entity object by its ID.

Prototype

FCREPL_API int fcReplGetSubscription(pFCREPLConn replConn, int subscriptionID, ppFCREPLSubscription subscription);

Parameters

Table 8. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

subscriptionID [IN]

Subscription identification

subscription [OUT]

Subscription entity retrieved



Return

Error code

Add a subscription entity to the database. If there already is a subscription with the given ID, update the existing record.

Prototype

FCREPL_API int fcReplPersistSubscription(pFCREPLConn replConn, pFCREPLSubscription subscription);

Parameters

Table 9. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

subscription [IN]

Subscription entity to be persisted



Return

Error code

Delete the subscription by its ID.

Prototype

FCREPL_API int fcReplRemoveSubscription(pFCREPLConn replConn, int subscriptionID);

Parameters

Table 10. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

subscriptionID [IN]

Subscription identification



Return

Error code

Build a list of target files for the given publication and subscription root path setup in a preview mode.

Prototype

FCREPL_API int fcReplSubsFilesPreview(pFCREPLConn replConn, int publicationID, int rootVolumeID, const char *rootPath, int dbEngineID, int fileListSize, int fileStart, int *calcRootVolume, char **calcRootPath, ppFCREPLFile *fileList, int *fileCount, int *totalFiles);

Parameters

Table 11. Parameters

Parameter

Description

publicationID [IN]

Publication identification

publicationID [IN]

Publication identification

rootVolumeID [IN]

Subscription root volume identification

rootPath [IN]

Subscription root path

dbEngineID [IN]

Subscription DBEngine

fileListSize [IN]

File list count to be retrieved

fileStart [IN]

File list start record

calcRootVolume [OUT]

Subscription's calculated root volume

calcRootPath [OUT]

Subscription's calculated root path

fileList [OUT]

File entity list

fileCount [OUT]

Number of file entities in the list

totalFiles [OUT]

Total file



Return

Error code

Retrieve the next available default name for a subscription.

Prototype

FCREPL_API int fcReplGetTempSubsName(pFCREPLConn replConn, char *tempSubsName);

Parameters

Table 12. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

tempSubsName [OUT]

Temporary subscription name



Return

Error code