#include <Trader_Interfaces.h>
Inheritance diagram for TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >:
DESCRIPTION (FROM SPEC) The admin interface enables the values of the trader attributes to be read and written. All attributes are defined as readonly in either SupportAttributes, ImportAttributes, LinkAttributes, or Admin. To set the trader "attribute" to a new value, set_<attribute_name> operations are defined in Admin. Each of these set operations returns the previous value of the attribute as its function value. If the admin interface operation set_support_proxy_offers is invoked with a value set to FALSE in a trader which supports the proxy interface, the set_support_proxy_offer value does not affect the function of operations in the proxy interface. However, in this case, it does have the effect of making any proxy offers exported via the proxy interface for that trader unavailable to satisfy queries on that trader's lookup interface.
Definition at line 514 of file Trader_Interfaces.h.
TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::TAO_Admin | ( | TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE > & | trader | ) |
Definition at line 1110 of file Trader_Interfaces.cpp.
References ACE_INET_Addr::get_ip_address(), ACE_OS::getpid(), ACE_OS::hostname(), ACE_OS::rand(), ACE_OS::srand(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::stem_id_, and ACE_OS::time().
01111 : TAO_Trader_Components <POA_CosTrading::Admin> (trader.trading_components ()), 01112 TAO_Support_Attributes <POA_CosTrading::Admin> (trader.support_attributes ()), 01113 TAO_Import_Attributes <POA_CosTrading::Admin> (trader.import_attributes ()), 01114 TAO_Link_Attributes <POA_CosTrading::Admin> (trader.link_attributes ()), 01115 trader_ (trader), 01116 sequence_number_ (0) 01117 { 01118 // A random 4-bytes will prefix the sequence number space for each 01119 // trader, making it extremely unlikely that the sequence spaces for 01120 // two traders will over lap. @@ TODO: This is a bad way to 01121 // generate pseudo random numbers. 01122 01123 // Ok, then, Carlos, we'll do it a different way: ip addr + pid. 01124 ACE_UINT32 ip_addr = 0; 01125 ACE_TCHAR host_name[BUFSIZ]; 01126 01127 if (ACE_OS::hostname (host_name, 01128 BUFSIZ) != -1) 01129 { 01130 ACE_INET_Addr addr ((u_short) 0, host_name); 01131 ip_addr = addr.get_ip_address (); 01132 } 01133 // The better way to do unique stem identifiers. 01134 this->stem_id_.length (12); 01135 01136 if (ip_addr != 0) 01137 { 01138 pid_t pid = ACE_OS::getpid (); 01139 this->stem_id_[0] = static_cast<CORBA::Octet> ((ip_addr >> 24) & 0xff); 01140 this->stem_id_[1] = static_cast<CORBA::Octet> ((ip_addr >> 16) & 0xff); 01141 this->stem_id_[2] = static_cast<CORBA::Octet> ((ip_addr >> 8) & 0xff); 01142 this->stem_id_[3] = static_cast<CORBA::Octet> (ip_addr & 0xff); 01143 this->stem_id_[4] = static_cast<CORBA::Octet> ((pid >> 24) & 0xff); 01144 this->stem_id_[5] = static_cast<CORBA::Octet> ((pid >> 16) & 0xff); 01145 this->stem_id_[6] = static_cast<CORBA::Octet> ((pid >> 8) & 0xff); 01146 this->stem_id_[7] = static_cast<CORBA::Octet> (pid & 0xff); 01147 } 01148 01149 // The default way -- eight random integers. 01150 else 01151 { 01152 time_t time_value = ACE_OS::time (); 01153 ACE_OS::srand (static_cast<u_int> (time_value)); 01154 01155 this->stem_id_[0] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01156 this->stem_id_[1] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01157 this->stem_id_[2] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01158 this->stem_id_[3] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01159 this->stem_id_[4] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01160 this->stem_id_[5] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01161 this->stem_id_[6] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01162 this->stem_id_[7] = static_cast<CORBA::Octet> (ACE_OS::rand () % 256); 01163 } 01164 }
TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::TAO_Admin | ( | const TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE > & | ) | [private] |
void TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::list_offers | ( | CORBA::ULong | how_many, | |
CosTrading::OfferIdSeq_out | ids, | |||
CosTrading::OfferIdIterator_out | id_itr | |||
) | [virtual] |
Definition at line 1411 of file Trader_Interfaces.cpp.
References CORBA::is_nil(), TAO_Offer_Id_Iterator::next_n(), TAO_Offer_Database< LOCK_TYPE >::retrieve_all_offer_ids(), and TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01414 { 01415 // This method only applies when the register interface is implemented 01416 if (CORBA::is_nil (this->trader_.trading_components().register_if())) 01417 throw CosTrading::NotImplemented(); 01418 01419 TAO_Offer_Database<MAP_LOCK_TYPE>& type_map = this->trader_.offer_database (); 01420 TAO_Offer_Id_Iterator* offer_id_iter = type_map.retrieve_all_offer_ids (); 01421 01422 id_itr = CosTrading::OfferIdIterator::_nil (); 01423 if (how_many > 0) 01424 { 01425 int check = offer_id_iter->next_n (how_many, ids); 01426 01427 if (check == 1) 01428 { 01429 id_itr = offer_id_iter->_this (); 01430 offer_id_iter->_remove_ref (); 01431 } 01432 else 01433 delete offer_id_iter; 01434 } 01435 else 01436 ids = new CosTrading::OfferIdSeq (0); 01437 }
void TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::list_proxies | ( | CORBA::ULong | , | |
CosTrading::OfferIdSeq_out | , | |||
CosTrading::OfferIdIterator_out | ||||
) | [virtual] |
Definition at line 1442 of file Trader_Interfaces.cpp.
01445 { 01446 throw CosTrading::NotImplemented (); 01447 }
void TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::operator= | ( | const TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE > & | ) | [private] |
CosTrading::Admin::OctetSeq * TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::request_id_stem | ( | void | ) | [virtual] |
Definition at line 1173 of file Trader_Interfaces.cpp.
References ACE_GUARD_RETURN, TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::sequence_number_, and TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::stem_id_.
01174 { 01175 ACE_GUARD_RETURN (TRADER_LOCK_TYPE, trader_mon, this->lock_, 0); 01176 01177 // Add one to the sequence_number and concatenate it to the unique 01178 // prefix. The sequence number is four octets long, the unique 01179 // prefix, also 4 bytes long. 01180 01181 this->stem_id_[8] = static_cast<CORBA::Octet> (this->sequence_number_ & 0xff); 01182 this->stem_id_[9] = static_cast<CORBA::Octet> ((this->sequence_number_ >> 8) & 0xff); 01183 this->stem_id_[10] = static_cast<CORBA::Octet> ((this->sequence_number_ >> 16) & 0xff); 01184 this->stem_id_[11] = static_cast<CORBA::Octet> ((this->sequence_number_ >> 24) & 0xff); 01185 01186 // Increment the sequence number and return a copy of the stem_id. 01187 this->sequence_number_++; 01188 return new CosTrading::Admin::OctetSeq (this->stem_id_); 01189 }
CosTrading::FollowOption TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_def_follow_policy | ( | CosTrading::FollowOption | policy | ) | [virtual] |
Definition at line 1350 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01352 { 01353 CosTrading::FollowOption return_value = 01354 this->trader_.import_attributes ().def_follow_policy (); 01355 01356 this->trader_.import_attributes ().def_follow_policy (policy); 01357 return return_value; 01358 }
CORBA::ULong TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_def_hop_count | ( | CORBA::ULong | value | ) | [virtual] |
Definition at line 1324 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01326 { 01327 CORBA::ULong return_value = 01328 this->trader_.import_attributes ().def_hop_count (); 01329 01330 this->trader_.import_attributes ().def_hop_count (value); 01331 return return_value; 01332 }
CORBA::ULong TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_def_match_card | ( | CORBA::ULong | value | ) | [virtual] |
Match card is the cardinality of offers found compliant with the constraints.
Definition at line 1220 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01222 { 01223 CORBA::ULong return_value = 01224 this->trader_.import_attributes ().def_match_card (); 01225 01226 this->trader_.import_attributes ().def_match_card (value); 01227 return return_value; 01228 }
CORBA::ULong TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_def_return_card | ( | CORBA::ULong | value | ) | [virtual] |
Return card is the cardinality of the offers returned from Lookup.
Definition at line 1246 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01248 { 01249 CORBA::ULong return_value = 01250 this->trader_.import_attributes ().def_return_card (); 01251 01252 this->trader_.import_attributes ().def_return_card (value); 01253 return return_value; 01254 }
CORBA::ULong TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_def_search_card | ( | CORBA::ULong | value | ) | [virtual] |
Search card is the cardinality of the offers searched for constraint compliance.
Definition at line 1194 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01196 { 01197 CORBA::ULong return_value = 01198 this->trader_.import_attributes ().def_search_card (); 01199 01200 this->trader_.import_attributes ().def_search_card (value); 01201 return return_value; 01202 }
CosTrading::FollowOption TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_follow_policy | ( | CosTrading::FollowOption | policy | ) | [virtual] |
Definition at line 1363 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01365 { 01366 CosTrading::FollowOption return_value = 01367 this->trader_.import_attributes ().max_follow_policy (); 01368 01369 this->trader_.import_attributes ().max_follow_policy (policy); 01370 return return_value; 01371 }
CORBA::ULong TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_hop_count | ( | CORBA::ULong | value | ) | [virtual] |
Definition at line 1337 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01339 { 01340 CORBA::ULong return_value = 01341 this->trader_.import_attributes ().max_hop_count (); 01342 01343 this->trader_.import_attributes ().max_hop_count (value); 01344 return return_value; 01345 }
CosTrading::FollowOption TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_link_follow_policy | ( | CosTrading::FollowOption | policy | ) | [virtual] |
Definition at line 1376 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01377 { 01378 CosTrading::FollowOption return_value = 01379 this->trader_.link_attributes ().max_link_follow_policy (); 01380 01381 this->trader_.link_attributes ().max_link_follow_policy (policy); 01382 return return_value; 01383 }
CORBA::ULong TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_list | ( | CORBA::ULong | value | ) | [virtual] |
Types of offers available for consideration. Ween out those offers with modifiable properties
Definition at line 1272 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01274 { 01275 CORBA::ULong return_value = 01276 this->trader_.import_attributes ().max_list (); 01277 01278 this->trader_.import_attributes ().max_list (value); 01279 return return_value; 01280 }
CORBA::ULong TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_match_card | ( | CORBA::ULong | value | ) | [virtual] |
Definition at line 1233 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01235 { 01236 CORBA::ULong return_value = 01237 this->trader_.import_attributes ().max_match_card (); 01238 01239 this->trader_.import_attributes ().max_match_card (value); 01240 return return_value; 01241 }
CORBA::ULong TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_return_card | ( | CORBA::ULong | value | ) | [virtual] |
Definition at line 1259 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01261 { 01262 CORBA::ULong return_value = 01263 this->trader_.import_attributes ().max_return_card (); 01264 01265 this->trader_.import_attributes ().max_return_card (value); 01266 return return_value; 01267 }
CORBA::ULong TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_search_card | ( | CORBA::ULong | value | ) | [virtual] |
Definition at line 1207 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01209 { 01210 CORBA::ULong return_value = 01211 this->trader_.import_attributes ().max_search_card (); 01212 01213 this->trader_.import_attributes ().max_search_card (value); 01214 return return_value; 01215 }
CosTrading::Admin::OctetSeq * TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_request_id_stem | ( | const CosTrading::Admin::OctetSeq & | stem | ) | [virtual] |
Definition at line 1400 of file Trader_Interfaces.cpp.
References ACE_GUARD_RETURN, and TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::stem_id_.
01401 { 01402 ACE_GUARD_RETURN (TRADER_LOCK_TYPE, trader_mon, this->lock_, 01403 &this->stem_id_); 01404 this->stem_id_ = stem; 01405 return &this->stem_id_; 01406 }
CORBA::Boolean TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_supports_dynamic_properties | ( | CORBA::Boolean | value | ) | [virtual] |
Definition at line 1298 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01300 { 01301 CORBA::Boolean return_value = 01302 this->trader_.support_attributes ().supports_dynamic_properties (); 01303 01304 this->trader_.support_attributes ().supports_dynamic_properties (value); 01305 return return_value; 01306 }
CORBA::Boolean TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_supports_modifiable_properties | ( | CORBA::Boolean | value | ) | [virtual] |
Definition at line 1285 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01287 { 01288 CORBA::Boolean return_value = 01289 this->trader_.support_attributes ().supports_modifiable_properties (); 01290 01291 this->trader_.support_attributes ().supports_modifiable_properties (value); 01292 return return_value; 01293 }
CORBA::Boolean TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_supports_proxy_offers | ( | CORBA::Boolean | value | ) | [virtual] |
Definition at line 1311 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01313 { 01314 CORBA::Boolean return_value = 01315 this->trader_.support_attributes ().supports_proxy_offers (); 01316 01317 this->trader_.support_attributes ().supports_proxy_offers (value); 01318 return return_value; 01319 }
CosTrading::TypeRepository_ptr TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_type_repos | ( | CosTrading::TypeRepository_ptr | repository | ) | [virtual] |
Definition at line 1388 of file Trader_Interfaces.cpp.
References TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_.
01389 { 01390 CosTrading::TypeRepository_ptr return_value = 01391 this->trader_.support_attributes ().type_repos (); 01392 01393 this->trader_.support_attributes ().type_repos (repository); 01394 return return_value; 01395 }
TRADER_LOCK_TYPE TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::lock_ [private] |
Definition at line 618 of file Trader_Interfaces.h.
CORBA::ULong TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::sequence_number_ [private] |
Current sequence number.
Definition at line 616 of file Trader_Interfaces.h.
Referenced by TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::request_id_stem().
CosTrading::Admin::OctetSeq TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::stem_id_ [private] |
Unique prefix to create a sequence number space.
Definition at line 613 of file Trader_Interfaces.h.
Referenced by TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::request_id_stem(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_request_id_stem(), and TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::TAO_Admin().
TAO_Trader<TRADER_LOCK_TYPE,MAP_LOCK_TYPE>& TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::trader_ [private] |
Definition at line 610 of file Trader_Interfaces.h.
Referenced by TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::list_offers(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_def_follow_policy(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_def_hop_count(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_def_match_card(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_def_return_card(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_def_search_card(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_follow_policy(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_hop_count(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_link_follow_policy(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_list(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_match_card(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_return_card(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_max_search_card(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_supports_dynamic_properties(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_supports_modifiable_properties(), TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_supports_proxy_offers(), and TAO_Admin< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::set_type_repos().