#include <Trader_Utils.h>
Collaboration diagram for TAO_Policies:
Public Types | |
STARTING_TRADER | |
EXACT_TYPE_MATCH | |
HOP_COUNT | |
LINK_FOLLOW_RULE | |
MATCH_CARD | |
RETURN_CARD | |
SEARCH_CARD | |
USE_DYNAMIC_PROPERTIES | |
USE_MODIFIABLE_PROPERTIES | |
USE_PROXY_OFFERS | |
REQUEST_ID | |
enum | POLICY_TYPE { STARTING_TRADER, EXACT_TYPE_MATCH, HOP_COUNT, LINK_FOLLOW_RULE, MATCH_CARD, RETURN_CARD, SEARCH_CARD, USE_DYNAMIC_PROPERTIES, USE_MODIFIABLE_PROPERTIES, USE_PROXY_OFFERS, REQUEST_ID } |
Public Member Functions | |
TAO_Policies (TAO_Trader_Base &trader, const CosTrading::PolicySeq &policies) throw (CosTrading::Lookup::IllegalPolicyName, CosTrading::DuplicatePolicyName) | |
~TAO_Policies (void) | |
CORBA::ULong | search_card () const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CORBA::ULong | match_card () const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CORBA::ULong | return_card () const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CORBA::Boolean | use_modifiable_properties () const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CORBA::Boolean | use_dynamic_properties () const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CORBA::Boolean | use_proxy_offers () const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CORBA::Boolean | exact_type_match () const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CosTrading::TraderName * | starting_trader () const throw (CosTrading::Lookup::PolicyTypeMismatch, CosTrading::Lookup::InvalidPolicyValue) |
CosTrading::FollowOption | link_follow_rule () const throw (CosTrading::Lookup::PolicyTypeMismatch) |
Determine the link follow policy for this query overall. | |
CosTrading::FollowOption | link_follow_rule (const CosTrading::Link::LinkInfo &link_info) const throw (CosTrading::Lookup::PolicyTypeMismatch, CosTrading::Lookup::InvalidPolicyValue, CosTrading::Link::IllegalLinkName, CosTrading::Link::UnknownLinkName) |
CORBA::ULong | hop_count () const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CosTrading::Admin::OctetSeq * | request_id () const throw (CosTrading::Lookup::PolicyTypeMismatch) |
void | copy_to_pass (CosTrading::PolicySeq &policy_seq, const CosTrading::Admin::OctetSeq &request_id) const |
Policies to forward to the next trader in a federated query. | |
void | copy_to_forward (CosTrading::PolicySeq &policy_seq, const CosTrading::TraderName &name) const |
Policies to forward to the next trader in a directed query. | |
void | copy_in_follow_option (CosTrading::PolicySeq &policy_seq, const CosTrading::Link::LinkInfo &link_info) const throw (CosTrading::Lookup::PolicyTypeMismatch, CosTrading::Lookup::InvalidPolicyValue) |
Static Public Attributes | |
static const char * | POLICY_NAMES [] |
Private Member Functions | |
CORBA::ULong | ulong_prop (POLICY_TYPE pol) const throw (CosTrading::Lookup::PolicyTypeMismatch) |
Reconclile a ULong property with its default. | |
CORBA::Boolean | boolean_prop (POLICY_TYPE pol) const throw (CosTrading::Lookup::PolicyTypeMismatch) |
Reconcile a Boolean property with its debault. | |
TAO_Policies (const TAO_Policies &) | |
TAO_Policies & | operator= (const TAO_Policies &) |
Private Attributes | |
CosTrading::Policy * | policies_ [TAO_NUM_POLICIES] |
The policies indexable from the enumerated type. | |
TAO_Trader_Base & | trader_ |
For the validating identifier names. |
TAO_Policies does an admirable job of reconciling differences between the default parameter settings of the Trader and the import and other policies set by the client. Unbeknownst to its client TAO_Policies hides this arbitration, and records whether the user policy was chosen, or the default. This information gets returned to the invoker of the query method.
This enum represents the relative order that properties are passed from one trader to another. Hence, as recommended by the spec, the starting_trader policies will be the first element in the polcy sequence if it's set for a query.
TAO_Policies::TAO_Policies | ( | TAO_Trader_Base & | trader, | |
const CosTrading::PolicySeq & | policies | |||
) | throw (CosTrading::Lookup::IllegalPolicyName, CosTrading::DuplicatePolicyName) |
TAO_Policies::~TAO_Policies | ( | void | ) |
TAO_Policies::TAO_Policies | ( | const TAO_Policies & | ) | [private] |
CORBA::Boolean TAO_Policies::boolean_prop | ( | POLICY_TYPE | pol | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch) [private] |
Reconcile a Boolean property with its debault.
void TAO_Policies::copy_in_follow_option | ( | CosTrading::PolicySeq & | policy_seq, | |
const CosTrading::Link::LinkInfo & | link_info | |||
) | const throw (CosTrading::Lookup::PolicyTypeMismatch, CosTrading::Lookup::InvalidPolicyValue) |
Determine the link follow policy to pass down the link with <link_name>. This method returns the link_follow_rule for a link whose name is <link_name> using the following formula: If the importer specified a link_follow_rule, policy pass on min(query.link_follow_rule, link.limiting_follow_rule, trader.max_follow_policy) else pass on min(link.def_pass_on_follow_rule, trader.max_follow_policy)
void TAO_Policies::copy_to_forward | ( | CosTrading::PolicySeq & | policy_seq, | |
const CosTrading::TraderName & | name | |||
) | const |
Policies to forward to the next trader in a directed query.
void TAO_Policies::copy_to_pass | ( | CosTrading::PolicySeq & | policy_seq, | |
const CosTrading::Admin::OctetSeq & | request_id | |||
) | const |
Policies to forward to the next trader in a federated query.
CORBA::Boolean TAO_Policies::exact_type_match | ( | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CORBA::ULong TAO_Policies::hop_count | ( | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CosTrading::FollowOption TAO_Policies::link_follow_rule | ( | const CosTrading::Link::LinkInfo & | link_info | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch, CosTrading::Lookup::InvalidPolicyValue, CosTrading::Link::IllegalLinkName, CosTrading::Link::UnknownLinkName) |
Determine the link follow policy for a given <link_name>. This method returns the link_follow_rule for a link whose name is <link_name> using the following formula: if the importer specified a link_follow_rule policy min(trader.max_follow_policy, link.limiting_follow_rule, query.link_follow_rule) else min(trader.max_follow_policy, link.limiting_follow_rule, trader.def_follow_policy)
CosTrading::FollowOption TAO_Policies::link_follow_rule | ( | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch) |
Determine the link follow policy for this query overall.
CORBA::ULong TAO_Policies::match_card | ( | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch) |
TAO_Policies& TAO_Policies::operator= | ( | const TAO_Policies & | ) | [private] |
CosTrading::Admin::OctetSeq * TAO_Policies::request_id | ( | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch) |
Return the request_id passed to the query method across a link to another trader.
CORBA::ULong TAO_Policies::return_card | ( | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CORBA::ULong TAO_Policies::search_card | ( | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CosTrading::TraderName * TAO_Policies::starting_trader | ( | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch, CosTrading::Lookup::InvalidPolicyValue) |
BEGIN SPEC The "starting_trader" policy facilitates the distribution of the trading service itself. It allows an importer to scope a search by choosing to explicitly navigate the links of the trading graph. If the policy is used in a query invocation it is recommended that it be the first policy-value pair; this facilitates an optimal forwarding of the query operation. A "policies" parameter need not include a value for the "starting_trader" policy. Where this policy is present, the first name component is compared against the name held in each link. If no match is found, the InvalidPolicyValue exception is raised. Otherwise, the trader invokes query() on the Lookup interface held by the named link, but passing the "starting_trader" policy with the first component removed. END SPEC
CORBA::ULong TAO_Policies::ulong_prop | ( | POLICY_TYPE | pol | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch) [private] |
Reconclile a ULong property with its default.
CORBA::Boolean TAO_Policies::use_dynamic_properties | ( | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CORBA::Boolean TAO_Policies::use_modifiable_properties | ( | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CORBA::Boolean TAO_Policies::use_proxy_offers | ( | ) | const throw (CosTrading::Lookup::PolicyTypeMismatch) |
CosTrading::Policy* TAO_Policies::policies_[TAO_NUM_POLICIES] [private] |
The policies indexable from the enumerated type.
const char * TAO_Policies::POLICY_NAMES [static] |
Initial value:
{ "starting_trader", "exact_type_match", "hop_count", "link_follow_rule", "match_card", "return_card", "search_card", "use_dynamic_properties", "use_modifiable_properties", "use_proxy_offers", "request_id" }
TAO_Trader_Base& TAO_Policies::trader_ [private] |
For the validating identifier names.