Magentix2
2.1.1
|
Public Member Functions | |
SFProxy (BaseAgent agent, String SFServiceDescriptionLocation) throws Exception | |
SFProxy (BaseAgent agent) throws Exception | |
ArrayList< String > | registerService (String serviceURL) throws DBConnectionException, AlreadyRegisteredException, InvalidServiceURLException, ServiceProfileNotFoundException, InvalidDataTypeException, MySQLException |
String | deregisterService (String serviceProfile) throws ServiceURINotFoundException, ServiceProfileNotFoundException, DBConnectionException, MySQLException |
String | removeProvider (String serviceProfile, String providerID) throws ServiceProfileNotFoundException, DBConnectionException |
String | getService (String serviceProfile) throws ServiceProfileNotFoundException, DBConnectionException, MySQLException |
ArrayList< ArrayList< String > > | searchService (ArrayList< String > inputs, ArrayList< String > outputs, ArrayList< String > keywords) throws DBConnectionException, InvalidDataTypeException, ServicesNotFoundException, MySQLException |
Package Attributes | |
ServiceTools | st = new ServiceTools() |
This class provides access to services that implements the SF agent.
Definition at line 26 of file SFProxy.java.
es.upv.dsic.gti_ia.organization.SFProxy.SFProxy | ( | BaseAgent | agent, |
String | SFServiceDescriptionLocation | ||
) | throws Exception |
This class gives us the support to accede to the services of the SF
agent | is a Magentix2 Agent, this agent implemented the communication protocol |
SFServiceDescriptionLocation | The URL where the owl-s documents are located |
Definition at line 39 of file SFProxy.java.
{ super(agent, "SF", SFServiceDescriptionLocation); }
es.upv.dsic.gti_ia.organization.SFProxy.SFProxy | ( | BaseAgent | agent | ) | throws Exception |
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.
agent | is a Magentix2 Agent, this agent implemented the communication protocol |
Definition at line 56 of file SFProxy.java.
{ super(agent, "SF"); ServiceDescriptionLocation = c.getSFServiceDescriptionLocation(); }
String es.upv.dsic.gti_ia.organization.SFProxy.deregisterService | ( | String | serviceProfile | ) | throws ServiceURINotFoundException, ServiceProfileNotFoundException, DBConnectionException, MySQLException |
The Deregister Service deregisters the specified service deleting all the related data from the SF.
serviceProfile | the URI representing the service profile to deregister |
ServiceURINotFoundException | If service URI is not found in Jena DataBase. |
ServiceProfileNotFoundException | If service profile is not found in Jena DataBase. |
DBConnectionException | If a data base connection exception occurs. |
MySQLException | If a MySql exception occurs. |
Definition at line 131 of file SFProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("ServiceProfile", serviceProfile); call = st.buildServiceContent("DeregisterService", inputs); String result = new String(); try { result = (String) this.sendInform(); } catch (ServiceURINotFoundException e){ throw e; } catch (ServiceProfileNotFoundException e) { throw e; } catch (DBConnectionException e) { throw e; } catch (MySQLException e) { throw e; }catch (THOMASException e) { e.printStackTrace(); } return result; }
String es.upv.dsic.gti_ia.organization.SFProxy.getService | ( | String | serviceProfile | ) | throws ServiceProfileNotFoundException, DBConnectionException, MySQLException |
Returns an OWL-S specification with the all data of the specified service profile as parameter.
serviceProfile | URI of the service profile to get its OWL-S specification |
ServiceProfileNotFoundException | If service profile is not found in Jena DataBase. |
DBConnectionException | If a data base connection exception occurs. |
MySQLException | If a MySql exception occurs. |
Definition at line 204 of file SFProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("ServiceProfile", serviceProfile); call = st.buildServiceContent("GetService", inputs); String result = new String(); try { result = (String) this.sendInform(); } catch (ServiceProfileNotFoundException e) { throw e; } catch (DBConnectionException e) { throw e; } catch (MySQLException e) { throw e; }catch (THOMASException e) { e.printStackTrace(); } return result; }
ArrayList<String> es.upv.dsic.gti_ia.organization.SFProxy.registerService | ( | String | serviceURL | ) | throws DBConnectionException, AlreadyRegisteredException, InvalidServiceURLException, ServiceProfileNotFoundException, InvalidDataTypeException, MySQLException |
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
serviceURL | the original URL of the OWL-S specification of the service |
DBConnectionException | If a data base connection exception occurs. |
AlreadyRegisteredException | If information is already registered in service profile. |
InvalidServiceURLException | If service URL is not a valid OWL-S document. |
ServiceProfileNotFoundException | If service profile is not found in Jena DataBase. |
InvalidDataTypeException | If input or output data type is invalid. |
MySQLException | If a MySql exception occurs. |
Definition at line 83 of file SFProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("ServiceURL", serviceURL); call = st.buildServiceContent("RegisterService", inputs); ArrayList<String> result = new ArrayList<String>(); try { result = (ArrayList<String>) this.sendInform(); } catch (AlreadyRegisteredException e) { throw e; } catch (DBConnectionException e) { throw e; } catch (InvalidDataTypeException e) { throw e; } catch (MySQLException e) { throw e; } catch (InvalidServiceURLException e) { throw e; } catch (ServiceProfileNotFoundException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); } return result; }
String es.upv.dsic.gti_ia.organization.SFProxy.removeProvider | ( | String | serviceProfile, |
String | providerID | ||
) | throws ServiceProfileNotFoundException, DBConnectionException |
Removes a provider: agent, organization or web service (grounding); from a registered service profile.
serviceProfile | URI of the service profile to remove the provider |
providerID | of the provider to remove (provider name or grounding ID) |
ServiceProfileNotFoundException | If service profile is not found in Jena DataBase. |
DBConnectionException | If a data base connection exception occurs. |
Definition at line 169 of file SFProxy.java.
{ HashMap<String, String> inputs = new HashMap<String, String>(); inputs.put("ServiceProfile", serviceProfile); inputs.put("ProviderID", providerID); call = st.buildServiceContent("RemoveProvider", inputs); String result = new String(); try { result = (String) this.sendInform(); } catch (ServiceProfileNotFoundException e) { throw e; } catch (DBConnectionException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); } return result; }
ArrayList<ArrayList<String> > es.upv.dsic.gti_ia.organization.SFProxy.searchService | ( | ArrayList< String > | inputs, |
ArrayList< String > | outputs, | ||
ArrayList< String > | keywords | ||
) | throws DBConnectionException, InvalidDataTypeException, ServicesNotFoundException, MySQLException |
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.
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 |
DBConnectionException | If a data base connection exception occurs. |
InvalidDataTypeException | If input or output data type is invalid. |
ServicesNotFoundException | If service is not found. |
MySQLException | If a MySql exception occurs. |
Definition at line 250 of file SFProxy.java.
{ String inputsStr = ""; if (inputs != null && !inputs.isEmpty()) { Iterator<String> iterInputs = inputs.iterator(); while (iterInputs.hasNext()) { String in = iterInputs.next(); inputsStr += in + "|"; } } String outputsStr = ""; if (outputs != null && !outputs.isEmpty()) { Iterator<String> iterOutputs = outputs.iterator(); while (iterOutputs.hasNext()) { String out = iterOutputs.next(); outputsStr += out + "|"; } } String keywordsStr = ""; if (keywords != null && !keywords.isEmpty()) { Iterator<String> iterKeywords = keywords.iterator(); while (iterKeywords.hasNext()) { String key = iterKeywords.next(); keywordsStr += key + "|"; } } HashMap<String, String> inputsService = new HashMap<String, String>(); inputsService.put("Inputs", inputsStr); inputsService.put("Outputs", outputsStr); inputsService.put("Keywords", keywordsStr); call = st.buildServiceContent("SearchService", inputsService); ArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>> (); try { result = (ArrayList<ArrayList<String>>) this.sendInform(); } catch (ServicesNotFoundException e) { throw e; } catch (DBConnectionException e) { throw e; } catch (InvalidDataTypeException e) { throw e; } catch (MySQLException e) { throw e; } catch (THOMASException e) { e.printStackTrace(); } return result; }
ServiceTools es.upv.dsic.gti_ia.organization.SFProxy.st = new ServiceTools() [package] |
Definition at line 28 of file SFProxy.java.