public class LinkService extends Auto
Auto
class.
Through the evaluateBehaviour
method, a service id is removed after only 1
evaluation with it and so the dataset values would be retrieved and compared only once.
This service can be used as part of the problem solving package and can be used with the clustering services there, for example.
autoEngine, autoManager, bm, iterations, sleepTime
dataCompare, dataMethod, resultObj
canAccessMeta, canAccessNested, dm, finalised, isRemoteCall, messageStore, serviceAdmin, serviceGrade, serviceInitialise, serviceLinks, serviceState, sm, toLoadScript
shutDown
passwordHandler, service, serviceType
jarFile, syncOn, uuid
Constructor and Description |
---|
LinkService()
Create a new instance of LinkService.
|
LinkService(java.lang.String thisPassword,
java.lang.String thisAdminKey)
Creates a new instance of LinkService.
|
LinkService(java.lang.String thisPassword,
java.lang.String thisAdminKey,
org.licas_xml.abs.Element adminXml)
Creates a new instance of LinkService.
|
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<?> |
addDynamicLink(org.licas_xml.abs.Element serviceUri)
Add a dynamic link for the service with an empty path description.
|
java.util.ArrayList<?> |
addDynamicLinks(java.util.ArrayList<?> sourceList,
java.util.ArrayList<java.lang.String> conceptList)
Add related sources to the dynamic linking service of this service.
|
void |
addPermanentLink(org.licas_xml.abs.Element serviceUri)
Add a permanent link between this service and the service specified.
|
protected MessageInfo |
behaviourAction(MessageInfo messageInfo)
This behaviour compares service data and tries to cluster them.
|
org.licas_xml.abs.Element |
createProcessScript()
Create the policy description that can be used as a default script for initialising the
auto engine of this service.
|
org.ai_heuristic.eval.metric.MetricDataset |
getDataRandomID()
Randomly retrieve the next dataset for evaluation.
|
protected java.lang.String |
getMessageState(java.lang.String communicationID,
java.lang.Object message)
Calculate the current state for the message and related conversation.
|
void |
removeAllPermanentLinks()
Remove all of the permanent links from this service.
|
void |
removePermanentLink(java.lang.String serviceUuid)
Remove a permanent link between this service and the service specified.
|
void |
resetValues()
Reset variables for another test run.
|
void |
updateDynamicLinks(java.util.ArrayList<java.lang.String> conceptList,
java.util.ArrayList<?> serviceGroups,
boolean toPermanent,
java.lang.String adminKey)
Update dynamic links for the services that are grouped together.
|
autoAction, autoQueueMessage, getAutoEngine, getInstanceValue, getMessageState, interrupt, invokeBehaviour, messageReply, removeCommunicationID, run, setAutoEngine, setAutonomicManager, setBehaviourModule, setInstanceValues, setProcessScript, setSerializeValues
createEvaluateData, createEvaluateData, dataTypeOK, dataXmlBM, dataXmlBM, dataXmlDH, dataXmlDH, evaluate, getData, getData, getDataType, getResultObj, setData, setData, setFixedDataValue, setGenData, setResultObj
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, dynamicLinksToXml, execute, finaliseInitialisation, finaliseInitialisation, finaliseModule, finaliseThisConfig, GET, getAllLinkToService, getAllowAddService, getAutonomicManagerConfig, getCommunicationClientURI, getDescription, getFullPath, getIsRemoteCall, getLinkFromService, getLinkToService, getLocalRemoteID, getParent, getParent, getPassword, getPassword, getPassword, getPasswordHandler, getPrivateMethods, getPublicMethods, getPublicServiceClassname, getServerPassword, getService, getService, getServiceAdmin, getServiceClasses, getServiceGrade, getServiceLinks, getServiceNames, getServiceNames, getServiceNames, getServiceNumber, getServiceOrWrapper, getServiceState, getServiceType, getServiceTypes, handshake, hasCommunicationID, hasLinkTo, hasServerPassword, hasService, hasServiceType, isCorrectPassword, isPrivateMethod, isPublicMethod, isStarted, linksToXml, passwordsStateToXml, permanentLinksToXml, reflectionMethods, reflectionObject, removeAllLinksTo, removeAllServices, removeAllServices, removeLinkFromService, removeLinkToService, removePermanentLinkTo, removeServiceAssociation, removeServiceID, removeServicePath, removeServicePath, removeTempPassword, serviceNegotiate, serviceToXml, serviceToXml, setAdminInfo, setCanAccessMeta, setCanAccessNested, setData, setDataModule, setDataModule, setDescription, setIsRemoteCall, setOtherMeta, setParent, setParent, setServerPassword, setServiceGrade, setServiceModule, setServiceState, startAllThreads, startThread, stopAllThreads, syncToAsync, syncToAsyncReply, syncToAsyncTransit, xmlToDynamicLinks, xmlToService
getShutDown, setShutDown, setShutDown
canAccess, getPasswordHandler, getServicePassword, getServiceType, isAdminKey, 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, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setData
getUUID, setJarFile, setUUID
public LinkService() throws java.lang.Exception
java.lang.Exception
- any error.public LinkService(java.lang.String thisPassword, java.lang.String thisAdminKey) throws java.lang.Exception
thisPassword
- the component password.thisAdminKey
- the unique service key.java.lang.Exception
- any error.public LinkService(java.lang.String thisPassword, java.lang.String thisAdminKey, org.licas_xml.abs.Element adminXml) throws java.lang.Exception
thisPassword
- the component password.thisAdminKey
- the unique service key.adminXml
- the admin info or description of this service.java.lang.Exception
- any error.public void resetValues()
resetValues
in interface DataServiceDef
resetValues
in class DataService
protected MessageInfo behaviourAction(MessageInfo messageInfo) throws java.lang.Exception
Behaviour Mediator
service for viewing. The evaluation result is then returned as the method result.behaviourAction
in class Auto
messageInfo
- the message to evaluate. This service uses a DataQueryModel
-derived
object that is configured in the method before being evaluated. If a DataQuery object
is passed as the message object, then it is updated in the method. If not, then the
message object is ignored and a new DataQuery object is created internally.java.lang.Exception
- any error.protected java.lang.String getMessageState(java.lang.String communicationID, java.lang.Object message)
messageReply
method, for example.
This link service version checks if the message parameter is a MessageInfo
object.
If it is, it returns its getMessageState
method call. If it is not, then it
returns the AiConst
.ACTION
value.
communicationID
- the communication ID. This defines the communication
thread and therefore the conversation.message
- an object representing a result from the other service in the
conversation. This can represent the result of the last conversation task,
or can be null if no information is required.public java.util.ArrayList<?> addDynamicLink(org.licas_xml.abs.Element serviceUri) throws java.lang.Exception
serviceUri
- the full uri path for the service.java.lang.Exception
- any error.public java.util.ArrayList<?> addDynamicLinks(java.util.ArrayList<?> sourceList, java.util.ArrayList<java.lang.String> conceptList) throws java.lang.Exception
ServiceConst.LINKER
on this service.
This version no longer sends any information to a mediator.sourceList
- the list of source uris to add. This is the list of source
links to update.conceptList
- the list of concepts that would make up the linking path.java.lang.Exception
- any error.public void updateDynamicLinks(java.util.ArrayList<java.lang.String> conceptList, java.util.ArrayList<?> serviceGroups, boolean toPermanent, java.lang.String adminKey) throws java.lang.Exception
addDynamicLinks
on the linker utility service and also checks if
reliable links should be made permanent.conceptList
- the path concept list, of any description.serviceGroups
- the groups of services that are clustered together.
Each list element can be a service, where the value is a list of other services related to it,
as in ArrayList<String>
. The value is therefore a list of related service names.toPermanent
- if true, convert any dynamic links at the link level
into permanent links, or remove permanent links now moved down a level.adminKey
- the service admin key.java.lang.Exception
- any error.public void addPermanentLink(org.licas_xml.abs.Element serviceUri)
serviceUri
- the path to the service to add a permanent link to.public void removePermanentLink(java.lang.String serviceUuid)
serviceUuid
- the uuid of the service to remove the permanent link to.public void removeAllPermanentLinks()
public org.ai_heuristic.eval.metric.MetricDataset getDataRandomID() throws java.lang.Exception
resetServiceIDs
to reset to the full list of other services again.
This version calls getValue
that uses the EvaluateBase.valueFromString
method to try to parse a string-based representation of a value into a Java object,
which will only automatically work for simple types, or XML.java.lang.Exception
- and error.public org.licas_xml.abs.Element createProcessScript() throws java.lang.Exception
java.lang.Exception
- any error.