es.upv.dsic.gti_ia.organization
Class SFProxy

java.lang.Object
  extended by es.upv.dsic.gti_ia.organization.THOMASProxy
      extended by es.upv.dsic.gti_ia.organization.SFProxy

public class SFProxy
extends THOMASProxy

This class provides access to services that implements the SF agent.

Author:
Joan Bellver Faus GTI-IA.DSIC.UPV

Constructor Summary
SFProxy(BaseAgent agent)
          This class gives us the support to accede to the services of the SF, Checked that the data contained in the file configuration/Settings.xml, the URL ServiceDescriptionLocation is not empty and is the correct path.
SFProxy(BaseAgent agent, String SFServiceDescriptionLocation)
          This class gives us the support to accede to the services of the SF
 
Method Summary
 String deregisterService(String serviceProfile)
          The Deregister Service deregisters the specified service deleting all the related data from the SF.
 String getService(String serviceProfile)
          Returns an OWL-S specification with the all data of the specified service profile as parameter
 ArrayList<String> registerService(String serviceURL)
          The Register Service tries to register the service that is specified as parameter.
 String removeProvider(String serviceProfile, String providerID)
          Removes a provider: agent, organization or web service (grounding); from a registered service profile
 ArrayList<ArrayList<String>> searchService(ArrayList<String> inputs, ArrayList<String> outputs, ArrayList<String> keywords)
          Searches the most similar services profiles to the given data type inputs, data type outputs and keywords in the description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SFProxy

public SFProxy(BaseAgent agent,
               String SFServiceDescriptionLocation)
This class gives us the support to accede to the services of the SF

Parameters:
agent - is a Magentix2 Agent, this agent implemented the communication protocol
SFServiceDescriptionLocation - The URL where the owl-s documents are located

SFProxy

public SFProxy(BaseAgent agent)
This class gives us the support to accede to the services of the SF, Checked that the data contained in the file configuration/Settings.xml, the URL ServiceDescriptionLocation is not empty and is the correct path.

Parameters:
agent - is a Magentix2 Agent, this agent implemented the communication protocol
Method Detail

registerService

public ArrayList<String> registerService(String serviceURL)
                                  throws THOMASException
The Register Service tries to register the service that is specified as parameter. In the specification, if there is one or more groundings, it means that the service is provided by a Web Service. If one or more providers (agents or organization) are specified in the profile:contactInformation of the service, it means that the service is provided by agents or/and organizations

Parameters:
serviceURL - the original URL of the OWL-S specification of the service
Returns:
A description of the changes made, and an OWL-S specification of the registered services or all data of the already registered service in the SF
Throws:
THOMASException - If there is any error result

deregisterService

public String deregisterService(String serviceProfile)
                         throws THOMASException
The Deregister Service deregisters the specified service deleting all the related data from the SF.

Parameters:
serviceProfile - the URI representing the service profile to deregister
Returns:
A description of the result of the service execution.
Throws:
THOMASException - If there is any error result

removeProvider

public String removeProvider(String serviceProfile,
                             String providerID)
                      throws THOMASException
Removes a provider: agent, organization or web service (grounding); from a registered service profile

Parameters:
serviceProfile - URI of the service profile to remove the provider
providerID - of the provider to remove (provider name or grounding ID)
Returns:
A description of the result of the service execution
Throws:
THOMASException - If there is any error result

getService

public String getService(String serviceProfile)
                  throws THOMASException
Returns an OWL-S specification with the all data of the specified service profile as parameter

Parameters:
serviceProfile - URI of the service profile to get its OWL-S specification
Returns:
an OWL-S specification with the all data of the specified service profile as parameter
Throws:
THOMASException - If there is any error result

searchService

public ArrayList<ArrayList<String>> searchService(ArrayList<String> inputs,
                                                  ArrayList<String> outputs,
                                                  ArrayList<String> keywords)
                                           throws THOMASException
Searches the most similar services profiles to the given data type inputs, data type outputs and keywords in the description. Returns an ordered list of the services found with a similarity degree obtained in function of the similarity to the given parameters.

Parameters:
inputs - data type inputs to search a service with these inputs. Example: \"http://127.0.0.1/ontology/books.owl#Novel\"^^xsd:anyURI
outputs - data type outputs to search a service with these outputs. Example: \"http://127.0.0.1/ontology/books.owl#Novel\"^^xsd:anyURI
keywords - list to search in the text description of the service
Returns:
an ordered list of the services found with a similarity degree
Throws:
THOMASException - If there is any error result


Copyright © 2012 GTI-IA. All Rights Reserved.