Skip to main content

Agent

Each machine in the Site must have at least one Replication Agent running to be included in the site.

Class

FCREPLAgent

The Replication Manager has a distributed management so it requires at least one Replication Manager agent per machine. This class manages this agent information.

Note

Do not manually create/change any of these objects since it is managed internally. You can look at the values of these objects but do not change them.

Getters

Table 1. Getters

Current agent status

FCREPLAgentStatus GetStatus() { return (FCREPLAgentStatus)((pRCESAgent)this)->GetStatus(); };



Inherited getters

Table 2. Inherited getters

Agent identification

int GetID();

OpSystem identification that is running the agent

Note

This is linked to FCREPLOpSystem class.

int GetOSID();

DBEngine identification that has the agent embedded with.

Note

This is linked to FCREPLDBEngine class.

int GetDBEngineID();

Status

RCESAgentStatus GetStatus();

Agent status string

const char *GetStatusStr();

Last time that the agent status changed

FCREPLDateTime GetStatusTime();

Agent's working volume identification

Note

This is linked to FCREPLVolume class.

int GetWorkingVolumeID();

Agent's working volume name

char *GetWorkingVolumeName();

Agent's working directory

char *GetWorkingDir();

Agent consumer list

ppRCESAgentConsumer GetConsumerList();

Agent customer count

int GetConsumerCount();



Setters

Table 3. Setters

Current agent status

void SetStatus(FCREPLAgentStatus status) { ((pRCESAgent)this)->SetStatus((RCESAgentStatus)status); };

Agent's working volume name

void SetWorkingVolumeName(const char *workingVolumeName) { ((pRCESAgent)this)->SetWorkingVolumeName(workingVolumeName);

Agent's working directory

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



Inherited setters

Table 4. Inherited setters

Agent identification

void SetID(int id);

OpSystem identification that is running the agent

Note

This is linked to FCREPLOpSystem class.

void SetOSID(int osID);

DBEngine identification that has the agent embedded with

Note

It is linked to FCREPLDBEngine class.

void SetDBEngineID(int dbEngineID);

Status

void SetStatus(RCESAgentStatus status);

Last time that the agent status changed

void SetStatusTime(FCREPLDateTime statusTime);

Agent's working volume identification

Note

This is linked to FCREPLVolume class.

void SetWorkingVolumeID(int workingVolumeID) ;

Working volume name

void SetWorkingVolumeName(const char *workingVolumeName);

Working directory

void SetWorkingDir(const char *workingDir);

Agent consumer list

void SetConsumerList(ppRCESAgentConsumer agentConsumerList, int agentConsumerCount);



Retrieve all the agent entity objects for the given opSystem identification.

Prototype

FCREPL_API int fcReplGetAgents(pFCREPLConn replConn, int osID, ppFCREPLAgent *agentList, int *agentCount);

Parameters

Table 5. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

osId [IN]

OS identification or -1 for all agents

agentList [OUT]

Agent entity list

agentCount [OUT]

Number of agent entities in the list



Return

Error code

Retrieve the agent entity object by its DBEngine identification.

Prototype

FCREPL_API int fcReplGetAgentByDBEngine(pFCREPLConn replConn, int dbEngineID, ppFCREPLAgent agent);

Parameters

Table 6. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

dbEngineID [IN]

Embedded DBEngine identification

agent [OUT]

Agent entity retrieved



Return

Error code

Retrieve the agent entity object by working path.

Prototype

FCREPL_API int fcReplGetAgentByPath(pFCREPLConn replConn, int workingVolumeID, const char *workingDir, ppFCREPLAgent agent);

Parameters

Table 7. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

workingVolumeID [IN]

Working volume identification

workingDir [IN]

Working directory

agent [OUT]

Agent entity retrieved



Return

Error code

Add an agent entity into the database. If there already is an agent with the given working path, update the existing record.

Prototype

FCREPL_API int fcReplPersistAgent(pFCREPLConn replConn, pFCREPLAgent agent);

Parameters

Table 8. Parameters

Parameter

Description

eplConn [IN]

Replication connection handle

agent [IN]

Agent entity to be persisted



Return

Error code

Delete the agent by its ID.

Prototype

FCREPL_API int fcReplRemoveAgent(pFCREPLConn replConn, int agentID, bool recursive);

Parameters

Table 9. Parameters

Parameter

Description

replConn [IN] -

Replication connection handle

agentID [IN] -

Agent identification

recursive [IN]

Recursive flag



Return

Error code

Push a heartbeat action to check if the agent is running or not and update its status. After validating it, returns its status.

Prototype

FCREPL_API int fcReplCheckAgentStatus(pFCREPLConn replConn, int agentID, ppFCREPLAgent *agentList, int *agentCount);

Parameters

Table 10. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

agentID [IN]

Agent identification or -1 if it is for all the agents

agentList [OUT]

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

agentCount [OUT]

Agent entity list count



Return

Error code

Update the current status for the given agent.

Prototype

FCREPL_API int fcReplSetAgentStatus(pFCREPLConn replConn, int agentID, FCREPLAgentStatus status);

Parameters

Table 11. Parameters

Parameter

Description

replConn [IN]

Replication connection handle

agentID [IN]

Agent identification

status [IN]

New status



Return

Error code