Defined in file: hzDatabase.h

hdbADP - Application Delta Profile The ADP is the entire set of database entities and their delta assignments for an application. Most programs will only have a single ADP but in the case of Dissemino, there can be multiple ADP instances. Dissemino is routinely configured to listen on the standard ports for HTTP and HTTPS on behalf of multiple hosts (web applications), most of which require some form of database functionality. Any that do, get an ADP. Because of this, there is no global ADP and programs must declare ADP instances as required.

Constructors/Detructors

hdbADP*hdbADP(hdbADP&)
hdbADP*hdbADP(void)
NULL-TYPEhdbADP(void)
void~hdbADP(void)

Public Methods:

uint32_tCountAllMembers(void)
uint32_tCountBinRepos(void)
uint32_tCountDataClass(void)
uint32_tCountDataEnum(void)
uint32_tCountObjRepos(void)
hzEcodeDeltaInit(void)This description assumes knowledge of the HadronZoo Database (HDB), the Delta Server (DS), and the ADP (Application Delta Profile). Please see the HadronZoo library manual, section 5. Programs that use the DS must call DeltaInit() as part of the initialization sequence. This call must take place AFTER data model construction is complete (all repositories declared and initialized), and BEFORE data transactions commence. This function calls ReadConfigDS() in order to establish the following:- The primary objective is to verify the ADP. If the application is new (of a hitherto unknown appname), the ADP is simply accepted. This is safe if the config read succeeded as this proves the data model (from which the ADP is compiled), is viable. On ADP acceptance, the ADP description is written to a standard location, usually /etc/hzDelta/. On subsequent runs the ADP description is compared to that stored in /etc/hzDelta/. The two ADP descriptions will be identical if there has been no change to the data model since the last run. If the data model has changed the ADP descriptions will not match. The new ADP can contain entities that do not exist in the old, and can omit entities that do exists in the old. However where the entity exists in both, the two ADPs must exactly agree on every detail of the entity. The program terminates if this comparison fails. Note that ADP comparison does not involve the DS. Once the comparison succeeeds, if the application is delta enabled, the next step is to seek a connection to the DS. While the DS is intended to be omnipresent, if it isn't up this function will return E_OK, allowing the application to go into service without the DS. Applications will not necessarily be delta enabled. It is standard practice for them not to be during development. Enabling a program for DS operation is a matter of adding a note to this effect in the configs. Not all applications will expect to receive deltas from sister applications on other machines. Those that do must add a DS handler and port, to the hzIpServer singleton. Note that the DS reads ADP descriptions from the standard location. The ADP description used to be passed to the DS by the application. This is no longer the practice. Arguments: None
hzEcodeDeltaOriginateBin(hdbObjRepos* pObjRepos)hdbMember* pMbr, hzChain& Zd, hzDeltaReq eOp,
hzEcodeDeltaOriginateFile(const char* filepath)hzDeltaReq eOp, Call this to sync application file change. All this does is send the pathname of the file or dir, and the operator.
hzEcodeDeltaOriginateMbr(hdbObjRepos* pObjRepos)hdbMember* pMbr, hzAtom value, hzDeltaReq eOp,
hzEcodeDeltaOriginateObj(hdbObjRepos* pObjRepos)hzChain& Zd,
hzEcodeExportADP(void)Export the Application Delta Profile (ADP) The current ADP for any application using the HadronZoo Database Suite (HDB), will be in the standard location "/home/deltasvr/appname/appname.adps".
hdbBinRepos*GetBinRepos(hzString& dsName)
hdbClass*GetDataClass(uint32_t clsId)
uint16_tGetDataClassID(hzString& clsName)
hdbEnum*GetDataEnum(hzString& ename)
hdbEnum*GetDataEnum(uint32_t n)
hdbDatatype*GetDatatype(hzString& tname)
hdbObjRepos*GetObjRepos(hzString& rname)
hdbObjRepos*GetObjRepos(uint32_t n)
hdbClass*GetPureClass(hzString& cname)
hzEcodeImportADP(hzString& appName)Import the Application Delta Profile (ADP), of the named application. The current ADP for any application using the HadronZoo Database Suite (HDB), will be in the standard location "/home/deltasvr/appname/appname.adp".
hzEcodeInitBlockedIPs(hzString& dataDir)Create the Blocked-IP data class and repository
hzEcodeInitFinancials(hzString& dataDir)
hzEcodeInitSiteIndex(hzString& dataDir)The site index is an optional free text index for webapps that comes as standard. If deployed, it maps each word found within webapp page and article content, to the set of pages and articles in which the word appears. It is implemented directly as a hdbIndexText instance, without involving a data class or a data class repository.
hzEcodeInitStandard(hzString& appName)Add the fundamental C++ and the HadronZoo in-built data types to the global map of datatypes _hzGlobal_Datatypes. Arguments: None
hzEcodeInitSubscribers(hzString& dataDir)Create the subscriber data class and repository
boolIsSubClass(hdbClass* pMain)hdbClass* pSub, Determine if the second data class is a sub-class of the first
hzEcodeNoteSub(hzString& clsName)hdbClass* pSub,
hzEcodeRegisterBinRepos(hdbBinRepos* pRepos)
hzEcodeRegisterComposite(hzString& context)hdbClass* pClass, Insert a new data class context into the ADP. This may only be done during initialization.
hzEcodeRegisterDataClass(hdbClass* pClass)Insert a new data class into the ADP. This may only be done during initialization.
hzEcodeRegisterDataEnum(hdbEnum* pEnum)Insert a new data enum into the ADP. This may only be done during initialization.
hzEcodeRegisterMember(hdbMember* pMbr)
hzEcodeRegisterObjRepos(hdbObjRepos* pRepos)
hzEcodeRegisterRegexType(hdbRgxtype* pRgx)
voidReport(hzChain& Z)Write out ADP Diagnostics Returns: None
hzEcode_rdClass(hzXmlNode* pN)Read a <class> tag on behalf of the hdbADProfile::Import function.

Overloaded operators:

hdbADP&operator=(hdbADP&)

Member Variables:

hzStringm_DatadirDirectory of binary core regime and repository deltas
hzStringm_DeltaAltDefault dump file for deltas (to await DS transmission)
hzStringm_appNameApplication name
hzArray<hdbObjRepos*>m_arrRepositoriesRepositories by Delta id
uint16_tm_eDeltaModeDelta Mode
hzMapS<hzString,hdbBinRepos*>m_mapBinReposAll hdbBinRepos instances
hzMapS<hzString,hdbClass*>m_mapClassesAll defined data classes
hzMapS<uint16_t,hdbClass*>m_mapClsCtxDtIdMap of data class delta ids to data classes
hzMapS<hzString,uint16_t>m_mapClsCtxNameMap of classname and classname.membername (if of a data class), to data class delta ids
hzMapS<hzString,hdbDatatype*>m_mapDatatypesComplete set of names of all legal data types including enums and classes
hzMapS<hzString,hdbEnum*>m_mapEnumsTotal data enums (selectors)
hzMapS<uint16_t,hdbMember*>m_mapMembersMap of member IDs to members (all classes)
hzMapS<hzString,hdbObjRepos*>m_mapObjReposAll declared data repositories
hzMapM<hzString,hdbClass*>m_mapSubsCumulative map of all subclasses
uint16_tm_nDeltaIDAssigned by DS via DeltaInit()
uint32_tm_nsqClsCfgData class sequence for classes declared within the application configs (41-1000)
uint32_tm_nsqClsCtxData class sequence for subclass combinations (1001 upwards)
uint32_tm_nsqClsUsrData class sequence for user classes (11-40)
uint32_tm_nsqMbrCfgData class member sequence for all other config classes (1001 upwards)
uint32_tm_nsqMbrSysData class member sequence for in-built classes (1-500)
uint32_tm_nsqMbrUsrData class member sequence for user classes (501-1000)
hdbClass*m_pClassSubscriberSubscriber class
hdbMember*m_pMbr_Subscriber_UIDSubscriber member object id in applicable user class (if any)
hdbMember*m_pMbr_Subscriber_emailSubscriber member email address
hdbMember*m_pMbr_Subscriber_typeSubscriber member type (user class, if applicable)
hdbMember*m_pMbr_Subscriber_usernameSubscriber member username
hdbMember*m_pMbr_Subscriber_userpassSubscriber member userpass
hdbObjRepos*m_pReposSubscriberSubscriber repository
hdbIndexText*m_pSiteindexWebapp site index (optional)
int32_tm_unixSockUNIX socket