public class ProblemSolverMediator
extends org.licas.service.InformationMediator
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
infoServiceType
The main type of service being run
|
protected java.util.ArrayList<java.lang.String> |
serviceNames
List of service names
|
serverIP, serverUri, serviceSpec, syncOn
Constructor and Description |
---|
ProblemSolverMediator(org.licas.PasswordHandler thePasswordHandler)
Create a new instance of ProblemSolverMediator.
|
ProblemSolverMediator(java.lang.String thisPassword,
java.lang.String thisAdminKey,
org.licas.PasswordHandler thePasswordHandler)
Creates a new instance of ProblemSolverMediator.
|
Modifier and Type | Method and Description |
---|---|
org.licas_xml.abs.Element |
createAdminScript(java.lang.String serviceUuid,
int index)
Create the admin script to initialise the service with.
|
void |
createService(java.lang.String serviceUuid,
java.lang.String dataOrUrl,
int index)
Create an information service for each of the listed sources and initiate each
one with the source information.
|
void |
createServices()
Create an information service for each of the listed sources and initiate each
one with the source information.
|
java.util.ArrayList<java.lang.String> |
getServiceNames()
Get a list of retrieved service names.
|
java.util.LinkedHashMap<java.lang.String,java.lang.Object> |
getServicesData(TestSpec testSpec)
Get the dataset elements from all running services.
|
java.util.ArrayList<org.ai_heuristic.eval.metric.MetricDataset> |
getServicesInfo(TestSpec testSpec,
ProblemMediator probMediator)
Retrieve the information from each information source in XML format and create
a data object by parsing it and adding it to a
MetricValue object. |
boolean |
initialiseServerInfo(ProblemScript theServiceSpec)
Initialise the solver mediator with the server details.
|
void |
replyToServices(TestSpec testSpec,
org.licas_xml.abs.Element replyXml)
Send the solution reply to any services on the
serviceNames list. |
createServices, initialiseServerInfo, initialiseServices, sortGroupsForEach, updateQueryInfo
createAssociationLinks, createPermanentLinks, dynamicLinksToXml, getLinkedServiceUuids, initialiseInfo, startServices, updateDynamicLinks
addCommunicationID, addDefaultService, addDefaultService, addDefaultService, addDefaultService, addLinkFromService, addLinkToService, addMessageMetrics, addService, addService, addService, addService, addServiceAssociation, addServicePassword, addTempPassword, allowAddService, canAccess, canAccess, canAccess, canAccess, canAccessMeta, canAccessNested, canAccessTemp, canRun, classNameOK, clearServiceLinks, clearServices, clearServices, close, createMetaForRepos, createMetaFull, createPermanentLinkTo, createServiceWrapper, defaultAdminToRemove, dynamicLinkQuery, dynamicLinksToPermanent, dynamicLinksToXml, execute, finaliseInitialisation, finaliseInitialisation, finaliseModule, finaliseThisConfig, GET, getAllLinkToService, getAllowAddService, getAutonomicManagerConfig, getCommunicationClientURI, getData, getData, getDescription, getFullPath, getInstanceValue, getIsRemoteCall, getLinkFromService, getLinkToService, getLocalRemoteID, getParent, getParent, getPassword, getPassword, getPassword, getPasswordHandler, getPrivateMethods, getPublicMethods, getPublicServiceClassname, getServerPassword, getService, getService, getServiceAdmin, getServiceClasses, getServiceGrade, getServiceLinks, getServiceNames, getServiceNames, getServiceOrWrapper, getServiceState, getServiceType, getServiceTypes, handshake, hasCommunicationID, hasLinkTo, hasServerPassword, hasService, hasServiceType, interrupt, isAdminKey, isCorrectPassword, isPrivateMethod, isPublicMethod, isStarted, linksToXml, passwordsStateToXml, permanentLinksToXml, removeAllLinksTo, removeAllServices, removeAllServices, removeCommunicationID, removeLinkFromService, removeLinkToService, removePermanentLinkTo, removeServiceAssociation, removeServiceID, removeServicePath, removeServicePath, removeTempPassword, serviceNegotiate, serviceToXml, serviceToXml, setAdminInfo, setCanAccessMeta, setCanAccessNested, setData, setDataModule, setDataModule, setDescription, setInstanceValues, setIsRemoteCall, setOtherMeta, setParent, setParent, setSerializeValues, setServerPassword, setServiceGrade, setServiceModule, setServiceState, startAllThreads, startThread, stopAllThreads, syncToAsync, syncToAsyncReply, syncToAsyncTransit, xmlToDynamicLinks, xmlToService
canAccess, getServicePassword, getServiceType, setServiceDetails, setServiceType
getJarFile, getUUID, loadObject, setJarFile, setUUID, threadAliveState
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
protected java.lang.String infoServiceType
protected java.util.ArrayList<java.lang.String> serviceNames
public ProblemSolverMediator(org.licas.PasswordHandler thePasswordHandler) throws java.lang.Exception
thePasswordHandler
- the password handler.java.lang.Exception
- any error.public ProblemSolverMediator(java.lang.String thisPassword, java.lang.String thisAdminKey, org.licas.PasswordHandler thePasswordHandler) throws java.lang.Exception
thisPassword
- the component password.thisAdminKey
- the unique service key.thePasswordHandler
- the password handler.java.lang.Exception
- any error.public boolean initialiseServerInfo(ProblemScript theServiceSpec) throws java.lang.Exception
theServiceSpec
- the test script with all of the test config. Of type
ProblemScript
.java.lang.Exception
- any error.public void createServices() throws java.lang.Exception
java.lang.Exception
- any error.public void createService(java.lang.String serviceUuid, java.lang.String dataOrUrl, int index) throws java.lang.Exception
serviceUuid
- uuid for the service to create.dataOrUrl
- address of a resource to load, or string data itself.index
- for unique ids.java.lang.Exception
- any error.public org.licas_xml.abs.Element createAdminScript(java.lang.String serviceUuid, int index) throws java.lang.Exception
serviceUuid
- uuid for the service to create.index
- for unique ids.java.lang.Exception
- any error.public void replyToServices(TestSpec testSpec, org.licas_xml.abs.Element replyXml) throws java.lang.Exception
serviceNames
list.
Use the messageReply
method to return the result, passing a
MessageInfo
object with an AiConst
.NOACTION
message state..testSpec
- the model of the tests to perform.replyXml
- the result from the problem solver.java.lang.Exception
- any error.public java.util.ArrayList<org.ai_heuristic.eval.metric.MetricDataset> getServicesInfo(TestSpec testSpec, ProblemMediator probMediator) throws java.lang.Exception
MetricValue
object.
This is to seed the problem-solving solutions with and so is probably scientific
information in nature.testSpec
- the model of the tests to perform.probMediator
- the problem mediator.java.lang.Exception
- any error.public java.util.LinkedHashMap<java.lang.String,java.lang.Object> getServicesData(TestSpec testSpec) throws java.lang.Exception
testSpec
- the model of the tests to perform.java.lang.Exception
- any error.public java.util.ArrayList<java.lang.String> getServiceNames()
getServiceNames
in class org.licas.Service