Changeset 5284 for source/ariba/AribaModule.cpp
- Timestamp:
- Jul 24, 2009, 3:23:11 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/AribaModule.cpp
r4065 r5284 50 50 #include "ariba/communication/BaseCommunication.h" 51 51 #include "ariba/communication/EndpointDescriptor.h" 52 #include "ariba/communication/modules/network/NetworkLocator.h"53 52 54 53 using namespace ariba::utility::Helper; … … 58 57 namespace ariba { 59 58 59 use_logging_cpp(AribaModule); 60 60 61 AribaModule::AribaModule() 61 : base_comm(NULL), sideport_sniffer(NULL), 62 ip_addr(NULL), started(false) { 63 64 // init with default values 65 66 this->tcp_port = 41402; 67 this->udp_port = 41402; 62 : base_comm(NULL), sideport_sniffer(NULL), started(false) { 68 63 } 69 64 … … 101 96 Name name(type); 102 97 EndpointDescriptor* desc = EndpointDescriptor::fromString(data); 98 logging_debug("Added bootstap info for " << type << ": " << desc->toString() ); 103 99 addBootstrapNode(name, desc); 104 100 } … … 132 128 } 133 129 134 //logging_debug( "added bootstrap info: " << getBootstrapHints() );130 logging_debug( "Added bootstrap info: " << getBootstrapHints() ); 135 131 } 136 132 … … 171 167 started = true; 172 168 base_comm = new BaseCommunication(); 169 base_comm->setEndpoints(endpoints); 173 170 } 174 171 … … 192 189 // @see Module.h 193 190 void AribaModule::setProperty(string key, string value) { 194 if (key == "ip.addr") { 195 if (ip_addr != NULL) delete ip_addr; 196 communication::IPv4Locator* loc = new communication::IPv4Locator(); 197 *loc = communication::IPv4Locator::fromString(value); 198 ip_addr = loc; 199 } 200 else if (key == "tcp.port") tcp_port = stoi(value); 201 else if (key == "udp.port") udp_port = stoi(value); 191 if (key == "endpoints") endpoints = value; 202 192 else if (key == "bootstrap.hints") addBootstrapHints(value); 203 193 } … … 205 195 // @see Module.h 206 196 const string AribaModule::getProperty(string key) const { 207 if (key == "ip.addr") return ip_addr->toString(); 208 else if (key == "tcp.port") return ultos(tcp_port); 209 else if (key == "udp.port") return ultos(udp_port); 197 if (key == "endpoints") return endpoints; // TODO: return local endpoints 210 198 else if (key == "bootstrap.hints") return getBootstrapHints(); 211 199 } … … 214 202 const vector<string> AribaModule::getProperties() const { 215 203 vector<string> properties; 216 properties.push_back("ip.addr"); 217 properties.push_back("tcp.port"); 218 properties.push_back("udp.port"); 219 properties.push_back("hints"); 204 properties.push_back("endpoints"); 205 properties.push_back("bootstrap.hints"); 220 206 return properties; 221 207 }
Note:
See TracChangeset
for help on using the changeset viewer.