Create the Blocked-IP data class and repository

Return TypeFunction nameArguments
hzEcodehdbADP::InitBlockedIPs(hzString&,)

Declared in file: hzDatabase.h
Defined in file : hdbADP.cpp

Function Logic:

0:START 1:unknown 2:Return hzerr(E_SEQUENCE,This function has already been called) 3:bBeenHere 4:unknown 5:Return hzerr(E_ARGUMENT,No application data directory) 6:S pClass rc 7:unknown 8:S rc 9:unknown 10:rc 11:unknown 12:items 13:unknown 14:items 15:pRepos 16:unknown 17:items 18:rc 19:unknown 20:items 21:S rc 22:unknown 23:items 24:rc 25:unknown 26:items 27:rc 28:Return rc

Function body:

hzEcode hdbADP::InitBlockedIPs (hzString& dataDir)
{
   //  Create the Blocked-IP data class and repository
   _hzfunc("hdbADP::InitBlockedIPs") ;
   static  bool    bBeenHere = false ;     //  Set once run
   hdbClass*       pClass ;        //  Subscriber class pointer
   hdbObjRepos*    pRepos ;        //  Subscriber repository pointer
   hzString        S ;             //  Temporary string
   hzEcode         rc ;            //  Return code
   if (bBeenHere)
       return hzerr(E_SEQUENCE, "This function has already been called") ;
   bBeenHere = true ;
   if (!dataDir)
       return hzerr(E_ARGUMENT, "No application data directory") ;
   //  Allocate and initialize subscriber class
   S = "blockedIP" ;
   pClass = new hdbClass(*this, HDB_CLASS_DESIG_SYS) ;
   rc = pClass->InitStart(S) ;
   if (rc == E_OK) { S = "ipa" ;   rc = pClass->InitMember(S, datatype_IPADDR, HDB_MBR_POP_SINGLE_COMPULSORY) ; }
   if (rc == E_OK)
       rc = pClass->InitDone() ;
   //  Resister subscriber class
   if (rc == E_OK)
       RegisterDataClass(pClass) ;
   if (rc != E_OK)
       hzexit(rc, "Could not init blockedIP class") ;
   //  Create and initialize susscriber repository
   pRepos = new hdbObjRepos(*this) ;
   if (!pRepos)
       hzexit(E_MEMORY, "No blockedIP cache allocated") ;
   rc = pRepos->InitStart(pClass, pClass->strType(), dataDir, HDB_REPOS_CACHE) ;
   if (rc != E_OK)
       hzexit(rc, "Could not init blockedIP repos") ;
   S = "ipa" ;
   rc = pRepos->InitMbrIndex(S, true) ;
   if (rc != E_OK)
       hzexit(rc, "Could not init subsriber repos index") ;
   rc = pRepos->InitDone() ;
   if (rc != E_OK)
       hzexit(rc, "Could not complete subsriber repos initialization") ;
   //  Resister subscriber repository
   rc = m_mapObjRepos.Insert(pRepos->strName(), pRepos) ;
   return rc ;
}