Presentation is loading. Please wait.

Presentation is loading. Please wait.

Trading Service 1  Outline  What is trading service  How to use trading service  Printer Example.

Similar presentations

Presentation on theme: "Trading Service 1  Outline  What is trading service  How to use trading service  Printer Example."— Presentation transcript:

1 Trading Service 1  Outline  What is trading service  How to use trading service  Printer Example

2 Trading Service 2 Motivation  Locating objects in location transparent way  Naming simple but may not be suitable when  clients do not know server  there are multiple servers to choose from  Trading supports locating servers based on service functionality and quality  Naming  White pages  Trading  Yellow Pages

3 Trading Service 3 Trading Characteristics  Trader operates as broker between client and server.  Enables client to change perspective from ´who?´ to ´what?´ Exporter Trader Importer 3: invoke 1:export 2: Query Similar ideas in: mortgage broker insurance broker stock brokerage

4 Trading Service 4 Trading Characteristics  Common language between client and server:  Service types  Qualities of service  Server registers service with trader.  Server defines assured quality of service:  Static QoS definition  Dynamic QoS definition.

5 Trading Service 5 Trading Characteristics  Clients ask trader for  a service of a certain type  at a certain level of quality  Trader supports  service matching  service shopping

6 Trading Service 6 Example  Hongkong Telecom video-on-demand server: Trader MGM Warner Independent Video-on- demand provider Server User

7 Trading Service 7 CORBA Trading Service Client Application proxy objectImpl Server lookupregister link proxyAdmin Query() export() modify() withdraw() CORBA Trading Service

8 Trading Service 8 The Trading Process  Example: Video-on-demand server :Client :TraderMGM:VoDSWarner:VoDS Query( ) export( ) modify( ) download( )

9 Trading Service 9 Trading Service Interface  Service type repository  Trader components  Iterators  Dynamic properties  Lookup: importers make queries  Register: exporters advertise new service offers  Link: admins federate traders  Admin: admins set policies  Proxy: legacy mechanisms for advertising services

10 Trading Service 10 Service Type Definition  Service types define  Functionality provided by a service and  Qualities of Service (QoS) provision.  Functionality defined by object type  QoS defined based on properties, i.e.  property name  property type  property value  property mode  mandatory/optional  readonly/modifiable

11 Trading Service 11 Service Type Example typedef enum {VGA,SVGA,XGA} Resolution; service video_on_demand { interface VideoServer; readonly mandatory property float fee; readonly mandatory property Resolution res; modifiable optional property float bandwidth; }

12 Trading Service 12 Service Type Hierarchy  An object type might have several implementations with different QoS.  Same object type might be used in different service types.  Service type S is subtype of service S’ iff  object type of S is identical or subtype of object type of S’  S has at least all properties defined for S’  Subtype relationship can be exploited by trader for service matching purposes

13 Trading Service 13 Constraint Definition  Importer defines the desired qualities of service as part of the query:  Example: fee =SGA AND bandwidth>=256  In a query, trader matches only those offers that meet the constraint

14 Trading Service 14 Trading Policies  Depending on constraint and available services, a large set of offer might be returned by a query.  Trading policies are used to restrict the size of the matched offers  Specification of an upper limit  Restriction on service replacements  Restriction on modifiable properties (these might change between match making and service requests)

15 Trading Service 15 Federated Traders  Scalability demands federation of traders  A trader participating in a federation  offers the services it knows about to other traders  forwards queries it cannot satisfy to other traders  Problems  Non-termination of import  Duplication of matched offers

16 Trading Service 16 Trading Graph T1 T2T3 T4 query.hop_count=4 def_follow_policy=always max_hop_count=5 query.hop_count=0Service Offer Trader Attribute Link max_hop_count=1

17 Trading Service 17 CORBA Trading Service Application Objects CORBA facilities CORBAservices Domain Interfaces Object Request Broker Object Trader

18 Trading Service 18 CORBA Trading Interfaces TraderComponents Support AttributesImportAttributesLinkAttributes list_offers() … export() withdraw() modify() RegisterLink add_link() remove_link() describe_link() modify_link() Lookup query() Admin

19 Trading Service 19 Defining Quality of Service typedef Istring PropertyName; typedef sequence PropertyNameSeq; typedef any PropertyValue; struct Property { PropertyName name; PropertyValue value; }; typedef sequence PropertySeq; enum HowManyProps {none, some, all} union SpecifiedProps switch (HowManyProps) { case some : PropertyNameSeq prop_names; };

20 Trading Service 20 Trader Interface for Exporters interface Register { OfferId export(in Object reference, in ServiceTypeName type, in PropertySeq properties) raises(...); OfferId withdraw(in OfferId id) raises(...); void modify(in OfferId id, in PropertyNameSeq del_list, in PropertySeq modify_list) raises (...); };

21 Trading Service 21 Trader Interface for Importers interface Lookup { void query(in ServiceTypeName type, in Constraint const, in Preference pref, in PolicySeq policies, in SpecifiedProps desired_props, in unsigned long how_many, out OfferSeq offers, out OfferIterator offer_itr, out PolicyNameSeq Limits_applied) raises (...); };

22 Trading Service 22 Service Type Repository  Service type  Name  Interfact type  Set of properties  Name  Typecode  Read-only/modifiable  Mandatory/optional

23 Trading Service 23 Service Type Repository  Substitutability of service types  The interface type of a derived service type may be a subtype of the interface type in the base service type  The property set may be extended in a derived service type with new property name (and their associated type and mode specification)  Inherited properties may be strengthened  Optional  mandatory  Modifiable  read-only

24 Trading Service 24 Service Type Repository  creating service type // operation signatures IncarnationNumber add_type ( in CosTrading::ServiceTypeName name, in Identifier if_name, in PropStructSeq props, in ServiceTypeNameSeq super_types ) raises ( CosTrading::IllegalServiceType, ServiceTypeExists, InterfaceTypeMismatch, CosTrading::IllegalPropertyName, CosTrading::DuplicatePropertyName, ValueTypeRedefinition, CosTrading::UnknownServiceType, DuplicateServiceTypeName );

25 Trading Service 25 Service Type Repository  Removing service type void remove_type ( in CosTrading::ServiceTypeName name ) raises ( CosTrading::IllegalServiceType, CosTrading::UnknownServiceType, HasSubTypes );

26 Trading Service 26 Service Type Repository  Obtaining service type info ServiceTypeNameSeq list_types ( in SpecifiedServiceTypes which_types ); TypeStruct describe_type ( in CosTrading::ServiceTypeName name ) raises ( CosTrading::IllegalServiceType, CosTrading::UnknownServiceType ); TypeStruct fully_describe_type ( in CosTrading::ServiceTypeName name ) raises ( CosTrading::IllegalServiceType, CosTrading::UnknownServiceType );

27 Trading Service 27 Service Type Repository  Masking/unmasking types void mask_type ( in CosTrading::ServiceTypeName name ) raises ( CosTrading::IllegalServiceType, CosTrading::UnknownServiceType, AlreadyMasked ); void unmask_type ( in CosTrading::ServiceTypeName name ) raises ( CosTrading::IllegalServiceType, CosTrading::UnknownServiceType, NotMasked );

28 Trading Service 28 Service Type Repository  properties interface ServiceTypeRepository { enum PropertyMode { PROP_NORMAL, PROP_READONLY, PROP_MANDATORY, PROP_MANDATORY_READONLY }; struct PropStruct { CosTrading::PropertyName name; CORBA::TypeCode value_type; PropertyMode mode; };

29 Trading Service 29 Printer Example  Printer interface Printer { typedef string filename; exception PrinterOffLine { short code; }; void print_file(in filename fn) raises(PrinterOffLine); short queue_length() raises(PrinterOffLine); }; interface TradingPrinter : Printer, CosTradingDynamic::DynamicPropEval {}; };

30 Trading Service 30 Printer Example  Printer property  Building“A Block”, “A Block” ; “ A Block”  Floor2, 3, 7  LanguagePostScript, PostScript, PostScript  Resolution300, 600, 600  Colorblack, black, 256color  Queue_len-  [PrinterObjectRef]->queue_length()  Name “12ps”, “monster”, “rib”

31 Trading Service 31 Printer Example  Implementing the Printer Interface  void print_file(string fn);  Short queue_length();  Any evalDP(string name, TypeCode returned_type, Any extra_info);

32 Trading Service 32 Printer Example  Implementing the Printer Server  ORB initialization  Get trader reference  Find service type repository  Check for service type existence, if not exist, create it:  Create a prop struct ist with the property name for a printer service type  Add the new service type  Create service offer property seq to use for export  Create printers (use command-line arguments) and making them available to ORB  Update the template service offer to advertise them

33 Trading Service 33 Printer Example  Implementing the Printer Client  Arguments:  Name of the file to print  Constraint expression for searching criteria  Preference expression to order the printer service offers returned  Implementation:  Check for arguments  Find Lookup object  Process the commend-line arguments  Establish basic policies for a trader query  Make the query  The returned Printer object are tried in order until the file is successfully printed

34 Trading Service 34 Key Points  Distributed objects can be located by naming and trading  Naming binds externally known names to an object reference and supports name resolution to reveal the object reference  Trading supports locating objects based on the functionality that they offer and the quality of service that they guarantee

Download ppt "Trading Service 1  Outline  What is trading service  How to use trading service  Printer Example."

Similar presentations

Ads by Google