13 #include "schema/vnc_cfg_types.h"
17 for (
int i = 0; i < 8; i++) {
18 uu_id.data[7 - i] = ms_long & 0xFF;
19 ms_long = ms_long >> 8;
22 for (
int i = 0; i < 8; i++) {
23 uu_id.data[15 - i] = ls_long & 0xFF;
24 ls_long = ls_long >> 8;
29 std::stringstream uuid_str;
31 return uuid_str.str();
37 SetUuid(ms_long, ls_long, uu_id);
64 std::cout <<
"Printing all UUID mapper entries - UUID : type:NODE-FQN\n";
68 std::cout << iter->first <<
" : " << node->
ToString() << std::endl;
75 : db_(db), ifmap_server_(server), vm_table_(NULL), registered(false) {
102 assert(tname.compare(
"virtual-machine") == 0);
125 autogen::VirtualMachine *vm =
static_cast<autogen::VirtualMachine *
>
127 if (vm->IsPropertySet(autogen::VirtualMachine::ID_PERMS)) {
128 autogen::UuidType
uuid = vm->id_perms().uuid;
129 std::string vm_uuid =
140 bool subscribe =
true;
161 std::string vr_name,
bool subscribe) {
170 std::string *vr_name) {
173 *vr_name = loc->second;
180 std::cout <<
"Printing all pending vm-reg entries - VM-UUID : VR-FQN\n";
183 std::cout << iter->first <<
" : " << iter->second << std::endl;
197 *vm_uuid = loc->second;
212 std::cout <<
"Printing all node-UUID entries - type:NODE-FQN : uuid\n";
216 std::cout << node->
ToString() <<
" : " << iter->second << std::endl;
void ProcessVmRegAsPending(std::string vm_uuid, std::string vr_name, bool subscribe)
UuidNodeMap uuid_node_map_
std::string UuidToString(const boost::uuids::uuid &id)
NodeUuidMap node_uuid_map_
virtual std::string ToString() const
DBTable::ListenerId vm_lid_
virtual const char * Typename() const =0
IFMapNode * GetVmNodeByUuid(const std::string &vm_uuid)
bool VmNodeExists(const std::string &vm_uuid)
IFMapVmUuidMapper(DB *db, IFMapServer *server)
void Unregister(ListenerId listener)
void PrintAllNodeUuidMappedEntries()
void SetUuid(uint64_t ms_long, uint64_t ls_long, boost::uuids::uuid &uu_id)
ListenerId Register(ChangeCallback callback, const std::string &name="unspecified")
bool PendingVmRegExists(const std::string &vm_uuid, std::string *vr_name)
bool NodeToUuid(IFMapNode *vm_node, std::string *vm_uuid)
PendingVmRegMap pending_vmreg_map_
void PrintAllUuidMapperEntries()
IFMapObject * Find(IFMapOrigin origin)
bool IsFeasible(IFMapNode *node)
IFMapServerTable * vm_table_
std::string Add(uint64_t ms_long, uint64_t ls_long, IFMapNode *node)
void ProcessVmSubscribe(std::string vr_name, std::string vm_uuid, bool subscribe, bool has_vms)
bool NodeProcessed(IFMapNode *node)
bool Exists(const std::string &uuid_str)
void PrintAllPendingVmRegEntries()
IFMapNode * Find(const std::string &uuid_str)
void VmNodeProcess(DBTablePartBase *partition, DBEntryBase *entry)
IFMapUuidMapper uuid_mapper_
DBTableBase * FindTable(const std::string &name)
IFMapServer * ifmap_server_
void PrintAllMappedEntries()
void Delete(const std::string &uuid_str)