Smart class to manage IDataDistributionCallback and IDataDistributionMastershipCallback. More...
#include <SmartDataDistributionManager.h>
Public Member Functions | |
SmartDataDistributionBase () | |
Initialize a new SmartDataDistributionBase. | |
~SmartDataDistributionBase () | |
Destructor of SmartDataDistributionBase. | |
OPERATION_RESULT | Initialize (const char *conf_file, const char *hostAddress=0, const char *channelTrailer=0) |
Initialize SmartDataDistributionBase system. | |
OPERATION_RESULT | Initialize (const char *arrayParams[], int len, const char *hostAddress=0, const char *channelTrailer=0) |
Initialize IDataDistribution instance. | |
OPERATION_RESULT | RequestMastershipManager (const char *hostAddress=NULL, const char *arrayParams[]=NULL, int len=0) |
Allocate and initialize the mastership manager. | |
BOOL | Start (unsigned long timeout) |
Start the common manager. | |
BOOL | Stop (unsigned long timeout) |
Stop the common manager. | |
std::string | GetProtocol () |
Returns the protocol in use from IDataDistribution instance. | |
std::string | GetProtocolLib () |
Returns the protocol library in use from IDataDistribution instance. | |
std::string | GetMastershipLib () |
Returns the mastership library in use from IDataDistribution instance. | |
Protected Member Functions | |
virtual const char * | OnConfiguration (const char *channelName, const char *key, const char *value) |
Function invoked during configuration validation. | |
virtual void | OnLogging (DDM_LOG_LEVEL level, const char *source, const char *function, const char *logStr) |
Function invoked when a log is emitted from subsystem. | |
virtual void | OnCompletelyDisconnected (const char *channelName, const char *reason) |
Callback invoked on a complete disconnection. | |
virtual void | OnClusterStateChange (DDM_CLUSTEREVENT change, int64_t serverid) |
Callback invoked to report cluster state change. | |
virtual void | OnStateChange (DDM_INSTANCE_STATE newState, DDM_INSTANCE_STATE oldState) |
Callback invoked to report a state change. | |
virtual void | OnStateReady (void *pState, int64_t len) |
Callback invoked when a state transfer is completed. | |
virtual void | OnRequestedState (void **pState, size_t *len) |
Callback invoked when a state transfer is requested. | |
virtual void | OnMultiplePrimary (int64_t myId, int64_t otherId) |
Callback invoked when multiple primary server are detected. | |
virtual void | FirstStateChange (DDM_INSTANCE_STATE newState) |
Callback invoked to report a first state change. | |
virtual void | ChangingState (DDM_INSTANCE_STATE actualState, DDM_INSTANCE_STATE futureState) |
Callback invoked to report a starting instance state change. | |
virtual void | ChangedState (DDM_INSTANCE_STATE actualState) |
Callback invoked to report a finished instance state change. | |
Protected Member Functions inherited from IDataDistributionCallback | |
Protected Member Functions inherited from IDataDistributionMastershipCallback |
Protected Attributes | |
IDataDistribution * | m_pIDataDistribution |
IDataDistributionMastershipCommon * | m_pIDataDistributionMastershipCommon |
OPERATION_RESULT | m_pInitializeHRESULT |
Smart class to manage IDataDistributionCallback and IDataDistributionMastershipCallback.
The main class to manage Data Distribution
SmartDataDistributionBase::SmartDataDistributionBase | ( | ) |
Initialize a new SmartDataDistributionBase.
SmartDataDistributionBase::~SmartDataDistributionBase | ( | ) |
Destructor of SmartDataDistributionBase.
|
protectedvirtual |
Callback invoked to report a finished instance state change.
Callback invoked when subsystem needs to report a state change.
actualState
reports the actual DDM_INSTANCE_STATE state
Implements IDataDistributionMastershipCallback.
|
protectedvirtual |
Callback invoked to report a starting instance state change.
Callback invoked when subsystem needs to report a state change.
futureState
reports the future DDM_INSTANCE_STATE state actualState
reports the actual DDM_INSTANCE_STATE state
Implements IDataDistributionMastershipCallback.
|
protectedvirtual |
Callback invoked to report a first state change.
Callback invoked when subsystem needs to to report a first state change
newState
DDM_INSTANCE_STATE state
Implements IDataDistributionMastershipCallback.
std::string SmartDataDistributionBase::GetMastershipLib | ( | ) |
Returns the mastership library in use from IDataDistribution instance.
std::string SmartDataDistributionBase::GetProtocol | ( | ) |
Returns the protocol in use from IDataDistribution instance.
std::string SmartDataDistributionBase::GetProtocolLib | ( | ) |
Returns the protocol library in use from IDataDistribution instance.
OPERATION_RESULT SmartDataDistributionBase::Initialize | ( | const char * | arrayParams[], |
int | len, | ||
const char * | hostAddress = 0, | ||
const char * | channelTrailer = 0 ) |
Initialize IDataDistribution instance.
arrayParams
an array of string in the form key=value len
length of arrayParams
hostAddress
optional host address or host name channelTrailer
the optional trailer to be appended to channel name when each channel is created
OPERATION_RESULT SmartDataDistributionBase::Initialize | ( | const char * | conf_file, |
const char * | hostAddress = 0, | ||
const char * | channelTrailer = 0 ) |
Initialize SmartDataDistributionBase system.
conf_file
the external ASCII configuration file with lines written as key=value hostAddress
optional host address or host name channelTrailer
the optional trailer to be appended to channel name when each channel is created
|
protectedvirtual |
Callback invoked to report cluster state change.
Callback invoked when subsystem needs to report a cluster state change.
change
reports the DDM_CLUSTEREVENT event serverid
the server id reporting the change
Implements IDataDistributionMastershipCallback.
|
protectedvirtual |
Callback invoked on a complete disconnection.
Callback invoked when subsystem detects a complete disconnection from central server or other peers. channelName
reports the disconnected channel reason
is the reason of disconnection.
Implements IDataDistributionCallback.
|
protectedvirtual |
Function invoked during configuration validation.
The callback is usable to override configuration parameters in some special conditions. channelName
reports the channel involved (null for global parameters), key
is the parameter key to be checked and value
is the actual value.
value
if no change is needed, otherwise any new string value according to the expected parameter type Implements IDataDistributionCallback.
|
protectedvirtual |
Function invoked when a log is emitted from subsystem.
The callback is usable to receive log information. level
is the DDM_LOG_LEVEL of the log reported source
is the module source name of the log function
is the function, within the module, reporting the log logStr
is the reported log string
Implements IDataDistributionCallback.
|
protectedvirtual |
Callback invoked when multiple primary server are detected.
Callback invoked when subsystem needs to report there are multiple primary server are detected
myId
my primary identifier otherId
other primary identifier
Implements IDataDistributionMastershipCallback.
|
protectedvirtual |
Callback invoked when a state transfer is requested.
Callback invoked when subsystem needs to request a state transfer. Fill pState
and len
with state information
pState
pointer to the buffer of the state len
the length of the buffer
Implements IDataDistributionMastershipCallback.
|
protectedvirtual |
Callback invoked to report a state change.
Callback invoked when subsystem needs to report a state change.
newState
reports the new DDM_INSTANCE_STATE state oldState
reports the new DDM_INSTANCE_STATE state
Implements IDataDistributionMastershipCallback.
|
protectedvirtual |
Callback invoked when a state transfer is completed.
Callback invoked when subsystem needs to report a completed state transfer
pState
pointer to the buffer of the state len
the length of the buffer
Implements IDataDistributionMastershipCallback.
OPERATION_RESULT SmartDataDistributionBase::RequestMastershipManager | ( | const char * | hostAddress = NULL, |
const char * | arrayParams[] = NULL, | ||
int | len = 0 ) |
Allocate and initialize the mastership manager.
hostAddress
optional host address or host name arrayParams
an array of string in the form key=value len
length of arrayParams
BOOL SmartDataDistributionBase::Start | ( | unsigned long | timeout | ) |
Start the common manager.
timeout
the operation timeout in milliseconds
BOOL SmartDataDistributionBase::Stop | ( | unsigned long | timeout | ) |
Stop the common manager.
timeout
the operation timeout in milliseconds
|
protected |
|
protected |
|
protected |