reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
genUsers.cxx
Go to the documentation of this file.
1
2#include "rutil/ResipAssert.h"
3#include <iostream>
4
5#include "repro/UserStore.hxx"
8#include "rutil/Data.hxx"
9#include "rutil/Logger.hxx"
10
11using namespace resip;
12using namespace repro;
13using namespace std;
14
15#define RESIPROCATE_SUBSYSTEM Subsystem::REPRO
16
17
18int
19main(int argc, char* argv[])
20{
23
24 const int numUsers = 100*1000;
25
26 AbstractDb* db = new BerkeleyDb;
27
28 UserStore store( *db );
29
30 for ( int i=0; i<numUsers;i++)
31 {
32 Data user = Data("User") + Data(i);
33
34 store.addUser( user,
35 "localhost", // domain
36 "localhost", // realm
37 "password", // password
38 true, // apply hash to password
39 "Alice W. Here", // fullName
40 "alice@example.com" /*email*/ );
41
42 if ( i%100 == 0 )
43 {
44 InfoLog( << "Created " << user );
45 }
46 }
47
48 return 0;
49}
#define InfoLog(args_)
Definition Logger.hxx:131
bool addUser(const resip::Data &user, const resip::Data &domain, const resip::Data &realm, const resip::Data &password, bool applyA1HashToPassword, const resip::Data &fullName, const resip::Data &emailAddress, const resip::Data &passwordHashAlt=resip::Data::Empty)
Definition UserStore.cxx:50
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
static void setLevel(Level level)
Set logging level for current thread.
Definition Log.cxx:423
static void initialize(Type type, Level level, const Data &appName, const char *logFileName=0, ExternalLogger *externalLogger=0, const Data &syslogFacility="LOG_DAEMON", MessageStructure messageStructure=Unstructured, const Data &instanceName="")
Definition Log.cxx:268
int main(int argc, char *argv[])
Definition genUsers.cxx:19
This Class is used to implement a primitive form of RPC using loose XML formatting.
dcm! – add UnusedChecking(_enum) below;