Exemple #1
0
//deep copy of credentials
void SipLine::copyCredentials(const SipLine &rSipLine)
{
   UtlString Realm;
   UtlString UserID;
   UtlString Type;
   UtlString Password;

   if(!mCredentials.isEmpty())
   {
      mCredentials.destroyAll();
   }
   UtlHashBagIterator observerIterator(const_cast<UtlHashBag&> (rSipLine.mCredentials));
   SipLineCredentials* credential = NULL;
   do
   {
     credential = (SipLineCredentials*) observerIterator();
     if ( credential)
     {
         credential->getRealm(&Realm);
         credential->getUserId(&UserID);
         credential->getType(&Type);
         credential->getPasswordToken(&Password);
         addCredentials(Realm , UserID , Password , Type);
     }
   }
   while(credential != NULL) ;
}
Exemple #2
0
UtlBoolean SipLine::getAllCredentials( int MaxEnteries/*[in]*/ ,
      int& actualEnteries /*[out/int]*/,
      UtlString realm[]/*[out/int]*/,
      UtlString userId[]/*[out/int]*/,
      UtlString type[]/*[out/int]*/,
      UtlString passtoken[]/*[out/int]*/)
{
    UtlBoolean credentialsFound = FALSE;
    UtlString Realm;
    UtlString UserID;
    UtlString Type;
    UtlString PassToken;
    int i = 0;

    UtlHashBagIterator observerIterator(mCredentials);
    SipLineCredentials* credential = NULL;

    do
    {
        credential = (SipLineCredentials*) observerIterator();
        if ( credential)
        {
            credential->getRealm(&Realm);
            credential->getUserId(&UserID);
            credential->getType(&Type);
            credential->getPasswordToken(&PassToken) ;
            
            realm[i].remove(0);
            realm[i].append(Realm);
            
            userId[i].remove(0);
            userId[i].append(UserID);

            type[i].remove(0);
            type[i].append(Type);

            passtoken[i].remove(0) ;
            passtoken[i].append(PassToken) ;

            i++;
            credentialsFound = TRUE;
        }
    }
    while(credential != NULL && i< MaxEnteries) ;
    actualEnteries = i;
    return  credentialsFound ;
}
 readierForNewPoint::~readierForNewPoint()
 {
   // the readierForNewPoint has to let all its obsevers know that its
   // destructor is being called:
   for( std::list< bool* >::iterator
        observerIterator( observerBoolsForReadierExistence.begin() );
        observerBoolsForReadierExistence.end() != observerIterator;
        ++observerIterator )
     // go through the list of observed bools...
     {
       *(*observerIterator) = false;
       // this should let any remaining observers know that they should *not*
       // attempt to de-register themselves from this readierForNewPoint.
     }
 }