We distinguish four interfaces for the use of the trading service: the TraderAdministrationInterface interface, the TraderPublicationInterface interface, the TraderSearchInterface interface and the SemanticTraderSearchInterface interface. Only the SemanticTraderSearchInterface interface appears in the SemanticTrader and not in the Trader.
SemanticTrader Trader Matcher Registry DataBaseRegistry FileRegistry SemanticMatcher AlgebricMatcher
a) TraderAdministrationInterface Interface
The TraderAdministrationInterface interface allows the administrator of the trading service to manage the users’ rights of the trading service (customer and provider components). Users are identified through their “Id”. Each user owns a key with which are associated its rights, and that he/she must provide for publishing/requesting components.
String saveUser (User user, String adminKey)
The saveProvider operation enables the administrator of the trading service to add in the directory a provider or a customer of components. It takes as arguments a user instance (user) and the key of the admin (adminkey), then returns the key of the user if added or empty String otherwise. Only the suppliers added by the administrator will have the right to publish components in the directory. Only the customers added by the administrator will have the right to use the trading service to ask the directory.
boolean deleteUser (String userId, String adminKey)
The deleteUser operation enables the administrator of the trading service to remove a user from the directory. It takes as arguments the id of the user (userId) and the key of the administrator (adminKey), then returns true if success and false otherwise. In case the user is a provider, then all its registered components are also removed.
String getUserKey (String userId, String adminKey)
This method returns the key of a user. It takes as arguments the id of the user (userId) and the key of the administrator (adminKey).
String[] getProvidersId (String requesterKey)
This method returns the list of the providers id. It takes as argument the key of the requester (requesterKey). String[] getCustomersId(String requesterKey)
This method returns the list of the customers id. It takes as argument the key of the requester (requesterKey). b) TraderPublicationInterface Interface
The TraderPublicationInterface interface allows the providers of authorized services to publish, or remove information concerning the services they offer. This interface offers the operations saveComponent, saveComposite, saveComponents, deleteComponent, and deleteComposite.
The saveComponent operation allows the authorized provider of a service to publish a component in the registry. The saveComposite operation allows authorized service providers to publish a composite in the registry. The saveComponents operation allows authorized service providers to publish all the components within a composite in the registry. The deleteComponent operation allows removing a component from the registry by an authorized provider. The deleteAbstractComposite and deleteConcreteComposite allows removing a composite from the registry by an authorized provider.
String saveComponent (Component component, Provider provider)
The saveComponent operation enables an authorized provider of a service to publish a component in the directory. It takes as arguments the description instance of the component to be published (component) and the provider instance (provider), and returns the key of the saved component if success and null otherwise.
The saveComposite operation enables an authorized provider of a service to publish a composite in the directory. It takes as arguments the description instance of the composite to be published (composite) and the provider instance (provider), and returns the key of the saved composite if success and null otherwise.
String saveComponent (Composite composite, Provider provider)
This method saves the unique concrete component within a composite. It takes as arguments the description instance of the composite containing the component to be published (composite) and the provider instance (provider), and returns the key of the saved component if success and null otherwise.
List<String> saveComponents (Composite composite, Provider provider)
The saveComponents operation enables an authorized provider of a service to publish all the components within a composite in the directory. It takes as arguments the description instance of the composite containing the components to be published (composite) and the provider instance (provider), and returns the keys of the saved components if success and null otherwise.
String saveComposite (String compositePath, Provider provider)
This method enables an authorized provider of a service to publish a serialized composite in the directory. It takes as arguments the composite file path of the composite to be published (compositePath) and the provider instance (provider), and returns the key of the saved composite if success and null otherwise.
String saveComponent (String compositePath, Provider provider)
This method saves the unique concrete component within a serialized composite. It takes as arguments the composite file path of the composite containing the component to be published (compositePath) and the provider instance (provider), and returns the key of the saved component if success and null otherwise.
boolean deleteComponent (String componentKey, String providerKey)
The deleteComponent operation enables an authorized provider of a service to remove one of its components from the directory. It takes as arguments the key of the component (componentKey) and the key of the provider (providerKey), then returns true if the component is removed from the registry.
boolean deleteAbstractComposite (String compositeKey, String providerKey)
The deleteAbstractComposite operation enables an authorized provider of a service to remove one of its abstract composites from the directory. It takes as arguments the key of the composite (compositeKey) and the key of the provider (providerKey), then returns true if the composite is removed from the registry.
boolean deleteConcreteComposite (String compositeKey, String providerKey)
The deleteConcreteComposite operation enables an authorized provider of a service to remove one of its concrete composites, given by its key, from the directory. It takes as arguments the key of the composite (compositeKey) and the key of the provider (providerKey), then returns true if the composite is removed from the registry.
c) TraderSearchInterface Interface
The TraderSearchInterface interface allows the authorized consumers of services to search the offered SCA components and SCA composites registered by providers. This interface offers operations:
–that find components by name, provider, key –that find abstract composites by name, provider, key –that find concrete composites by name, provider, key
The CompInfo object used by these methods gives access, for the component with which it is initialized, to :
–the XML text describing the component,
List<CompInfo> findComponents (String customerKey)
This method returns all the components registered in the directory. It takes as argument the key of the requester (customerKey) and returns a list of CompInfo related to the searched components.
List<CompInfo> findComponentsOfProvider (String providerId, String customerKey) This method returns all the components published by a provider. It takes as arguments the key of the requester (customerKey), the id of the provider of requested components (providerId) and returns a list of CompInfo related to the searched components.
List<CompInfo> findComponentsWithName (String componentName, String customerKey) This method returns all the components whose name is given. It takes as arguments the key of the requester (customerKey), the name of the requested components (componentName) and returns a list of CompInfo related to the searched components.
List<CompInfo> findComponentsOfProviderWithName (String componentName, String providerId, String customerKey)
This method returns all the components published by a given provider and whose name is given. It takes as arguments the key of the requester (customerKey), the name of the requested components (componentName), the id of the provider of requested components (providerId) and returns a list of CompInfo related to the searched components. CompInfo findComponentWithKey (String componentKey, String customerKey)
This method returns the unique component whose key is given. It takes as arguments the key of the requester (customerKey), the key of the requested components (componentKey) and returns the CompInfo related to the searched component.
List<CompInfo> findAbstractComposites (String customerKey)
This method returns all the abstract composites registered in the directory. It takes as argument the key of the requester (customerKey), and returns a list of CompInfo related to the searched components.
List<CompInfo> findAbstractCompositesOfProvider (String providerId, String customerKey)
This method returns all the abstract composites published by a given provider. It takes as arguments the key of the requester (customerKey), the id of the provider (providerId) and returns a list of CompInfo related to the searched components.
List<CompInfo> findAbstractCompositesWithName (String compositeName, String customerKey)
This method returns all the abstract composites whose name is given. It takes as arguments the key of the requester (customerKey), the name of the composite (compositeName) and returns a list of CompInfo related to the searched components.
List<CompInfo> findAbstractCompositesOfProviderWithName (String compositeName, String providerId, String customerKey)
This method returns all the abstract composites published by a given provider and whose name is given. It takes as arguments the key of the requester (customerKey), the name of the composite (compositeName), the id of the provider (providerId) and returns a list of CompInfo related to the searched components.
CompInfo findAbstractCompositeWithKey (String compositeKey, String customerKey) This method returns the unique abstract composite whose key is given. It takes as arguments the key of the requester (customerKey), the key of the composite (compositeKey), and returns the CompInfo related to the searched component.
List<CompInfo> findConcreteComposites (String customerKey)
This method returns all the registered concrete composites. It takes as argument the key of the requester (customerKey), and returns a list of CompInfo related to the searched components.
List<CompInfo> findConcreteCompositesOfProvider (String providerId, String customerKey)
This method returns all the concrete composites published by a given provider. It takes as arguments the key of the requester (customerKey), the id of the provider (providerId) and returns a list of CompInfo related to the searched components.
List<CompInfo> findConcreteCompositesWithName (String compositeName, String customerKey)
This method returns all the concrete composites whose name is given. It takes as arguments the key of the requester (customerKey), the name of the composite (compositeName) and returns a list of CompInfo related to the searched components.
List<CompInfo> findConcreteCompositesOfProviderWithName (String compositeName, String providerId, String customerKey)
This method returns all the concrete composites published by a given provider and whose name is given. It takes as arguments the key of the requester (customerKey), the name of the composite (compositeName), the id of the provider (providerId) and returns a list of CompInfo related to the searched components.
CompInfo findConcreteCompositeWithKey (String compositeKey, String customerKey) This method returns the unique concrete composite whose key is given. It takes as arguments the key of the requester (customerKey), the key of the composite (compositeKey), and returns the CompInfo related to the searched component.
d) SemanticTraderSearchInterface Interface
This interface provides methods that return, from the registry, concrete components semantically equivalent to the given abstract ones.
List<CompInfo> findConcreteComponents (Component abstractComponent, CustomerKey customerKey)throws NullCustomerKeyException
This method returns all the concrete components that matches with the abstract one. It takes as arguments the key of the requester (customerKey), the abstract component description instance (abstractComponent), and returns a list of CompInfo related to the matching concrete components. It will raise a NullCustomerKeyException if the customer key is null.
List<CompInfo> findConcreteComponents (Component abstractComponent, String providerId, CustomerKey customerKey) throws NullCustomerKeyException
takes as arguments the key of the requester (customerKey), the abstract component description instance (abstractComponent), the id of the provider (providerId), and returns a list of CompInfo related to the matching concrete components. It will raise a NullCustomerKeyException if the customer key is null.
List<CompInfo> findConcreteComposites (Composite abstractComposite, CustomerKey customerKey) throws NullCustomerKeyException
This method returns all the concrete composites that matches with the abstract one. It takes as arguments the key of the requester (customerKey), the abstract composite description instance (abstractComposite), and returns a list of CompInfo related to the matching concrete composites. It will raise a NullCustomerKeyException if the customer key is null.
List<CompInfo> findConcreteComposites (Composite abstractComposite,
String providerId, CustomerKey customerKey) throws NullCustomerKeyException This method returns all the concrete composites published by a provider that matches with the abstract one. It takes as arguments the key of the requester (customerKey), the abstract composite description instance (abstractComponent), the id of the provider (providerId), and returns a list of CompInfo related to the matching concrete composites. It will raise a NullCustomerKeyException if the customer key is null.
7.3 The ExtendedComposer
7.3.1 The ExtendedComposer architecture
The ExtendedComposer is the class in charge of the transformation of the abstract composition description. It is a “Facade” for the ShallowComposer and the DeepComposer which are respectively in charge of building shallow and deep concrete composites from abstract ones. They both rely on the SemanticTrader to retrieve concrete components before including them in the abstract composite in a way that can be parameterized.