Package fi.tut.mei.matchmaking.process
Class MatchMaker
- java.lang.Object
-
- fi.tut.mei.matchmaking.process.MatchMaker
-
- All Implemented Interfaces:
IMatchMaker
public class MatchMaker extends Object implements IMatchMaker
This class handles the match making process itself.- Author:
- hylli
-
-
Constructor Summary
Constructors Constructor Description MatchMaker()
Create a matchmaker for processing a single match making request.MatchMaker(boolean useLocalRules)
Create a matchmaker for processing a single match making request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description fi.tut.mei.capabilityQueryLib.Client
getClient()
Get CapabilityQueryLibrary Client used by the matchmaker.org.apache.jena.ontology.OntModel
getCombinedCapabilityOntology()
Get the combinations used in matchmaking.fi.tut.mei.matchmaking.model.xml.msg.MatchmakingReq
getMatchmakingRequest()
Get the matchmaking request used in executing the matchmaking.Map<String,org.apache.jena.ontology.OntModel>
getResultOntologies()
After executing makeMatch get result ontologies.fi.tut.mei.matchmaking.model.xml.msg.MatchmakingResult
makeMatch(String config, fi.tut.mei.matchmaking.model.xml.msg.MatchmakingReq mmReq, Map<String,InputStream> prds, Map<String,InputStream> resources)
performs the match making process based on given parameters.void
setCombinedCapabilityOntology(InputStream input)
Give MatchMaker a previously created combinations ontology whose resources are used in matchmaking.void
setResultOntologies(Map<String,InputStream> results)
Give matchmaking result ontologies that will be used to create the matchmaking result.
-
-
-
Constructor Detail
-
MatchMaker
public MatchMaker()
Create a matchmaker for processing a single match making request. Always create a new matchmaker for each request. This matchmaker uses matchmaking ontology from the server not the local copy.
-
MatchMaker
public MatchMaker(boolean useLocalRules)
Create a matchmaker for processing a single match making request. Always create a new matchmaker for each request.- Parameters:
useLocalRules
- If true uses local copy of matchmaking rules if false use rules from server.
-
-
Method Detail
-
getMatchmakingRequest
public fi.tut.mei.matchmaking.model.xml.msg.MatchmakingReq getMatchmakingRequest()
Get the matchmaking request used in executing the matchmaking.- Returns:
- Null before makeMatch is called. After that request given to makeMatch.
-
getClient
public fi.tut.mei.capabilityQueryLib.Client getClient()
Get CapabilityQueryLibrary Client used by the matchmaker.- Returns:
- the Client used
-
makeMatch
public fi.tut.mei.matchmaking.model.xml.msg.MatchmakingResult makeMatch(String config, fi.tut.mei.matchmaking.model.xml.msg.MatchmakingReq mmReq, Map<String,InputStream> prds, Map<String,InputStream> resources)
performs the match making process based on given parameters.- Specified by:
makeMatch
in interfaceIMatchMaker
- Parameters:
config
- Match making configurationmmReq
- the match making request that defines which process steps are matched for and other options for the process.prds
- The product requirement ontologies for which the process is performed. Key is the prdid and input should contain a valid process requirements ontology.resources
- Resources available for the match making process. Contains resource instance ontologies for each involved resource catalogue and/or an existing system layout. Key is catalogue id or layout id and value a resource instances ontology in the rdf/xml format .
-
setCombinedCapabilityOntology
public void setCombinedCapabilityOntology(InputStream input)
Give MatchMaker a previously created combinations ontology whose resources are used in matchmaking. If combinations is given before executing makeMatch MatchMaker does not calculated combined capabilities or create combination possibilities. Resource instances given to make match should correspond to combinations i.e. combinations contains combined capabilities calculated from them or device combination possibilities created from them.- Parameters:
input
- A combinations ontology for example created by a previous MatchMaker instance
-
getCombinedCapabilityOntology
public org.apache.jena.ontology.OntModel getCombinedCapabilityOntology()
Get the combinations used in matchmaking. Can be called after makeMatch to get combinations used. Can contain combined capabilities calculated for existing resources or generated combination possibilities.- Returns:
- MatchMakers combinations ontology. Can be used with a new MatchMaker.
-
setResultOntologies
public void setResultOntologies(Map<String,InputStream> results)
Give matchmaking result ontologies that will be used to create the matchmaking result. Can be used before makeMatch in which case matchmaking rules are not executed and the previously created result ontologies are used instead to create the matchmaking result. If this is used the corresponding combinations has to be also given and the same resource instances has to be given to makeMatch- Parameters:
results
- result ontologies from previous matchmaking operations. Key is id of the prd ontology contains result for.
-
-