public class InformationService extends LinkService
This class can be used to retrieve information from a Resource
source.
The resource is initialised in the service through the admin XML Data
element,
which is now configurable for different dat2a types and even nested lists or containers.
Information may typically be used as part of a Publish-Subscribe
process and not
a data calculation one. The behaviour loop has therefore been set to 1 whole day, instead
of the AI value of ServiceConst
.BEHAVIOURSLEEP
of a few milliseconds.
You can change this value to whatever in your code via sleepTime = milliseconds;
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 |
---|
InformationService()
Create a new instance of InformationService.
|
InformationService(java.lang.String thisPassword,
java.lang.String thisAdminKey)
Creates a new instance of InformationService.
|
InformationService(java.lang.String thisPassword,
java.lang.String thisAdminKey,
org.licas_xml.abs.Element adminXml)
Creates a new instance of InformationService.
|
Modifier and Type | Method and Description |
---|---|
protected MessageInfo |
behaviourAction(MessageInfo messageInfo)
This behaviour retrieves the resource information and publishes it on the server.
|
java.lang.String |
GET()
This is a method to be invoked by something like a RESTFul or HTTP Server call.
|
org.licas_xml.abs.Element |
getInfoElement()
Get the currently loaded source information as an XML element.
|
org.licas_xml.abs.Element |
getInfoElement(org.licas_xml.abs.Element infoDescr)
Get the currently loaded source information as an XML element.
|
java.lang.String |
getSourceInfo(org.licas_xml.abs.Element infoDescr)
Deprecated.
this method is inefficient because it codes and decodes too many times,
so use
getInfoElement instead. |
void |
loadDataContents(java.lang.String dataType,
java.lang.String urlPath)
Load data contents onto the service, so store the information directly on the
service.
|
void |
loadDataDetails(java.lang.String dataType,
java.lang.String urlPath)
Load data details onto the service, which is a description of the external source and
the information is retrieved from the external source each time.
|
void |
loadDataScript(org.licas_xml.abs.Element adminDataXml)
Create a new resource object from a new admin document.
|
void |
setGenData(java.lang.String adminKey)
Set the random data value, created using the installed data generator.
|
addDynamicLink, addDynamicLinks, addPermanentLink, createProcessScript, getDataRandomID, getMessageState, removeAllPermanentLinks, removePermanentLink, resetValues, updateDynamicLinks
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, 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, 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 InformationService() throws java.lang.Exception
java.lang.Exception
- any error.public InformationService(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 InformationService(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. This can include
a resource to load, so do not pass to parent class, but initialise separately.java.lang.Exception
- any error.public java.lang.String GET() throws java.lang.Exception
getValue(...)
value of
the information service. Note that the value Const
.SEPCHARS
can be
used to parse the String reply.public void setGenData(java.lang.String adminKey) throws java.lang.Exception
setGenData
in class DataService
adminKey
- the admin key for this service.java.lang.Exception
- any error.protected MessageInfo behaviourAction(MessageInfo messageInfo) throws java.lang.Exception
Behaviour Mediator
service for viewing, but that is probably optional.
The evaluation result is then returned as the method result.behaviourAction
in class LinkService
messageInfo
- the message to evaluate. This behaviour works internally only, and so the
external message can be null
.java.lang.Exception
- any error.public java.lang.String getSourceInfo(org.licas_xml.abs.Element infoDescr) throws java.lang.Exception
getInfoElement
instead.infoDescr
- a description of the info resource value that should be retrieved.
This can be null if there is no query description.infoResource
as a coded string. This is a string in XML
format that is consistent with the Data
format in the admin document. It is
automatically decoded when received by the client-side methods and can then be
parsed back into XML using the XmlHandler.stringToElement
method.java.lang.Exception
- any error.public org.licas_xml.abs.Element getInfoElement() throws java.lang.Exception
<Data><Value>Info value here</Value><Value_Type>Info value type</Value_Type></Data>
.infoResource
as an XML element.java.lang.Exception
- any error.public org.licas_xml.abs.Element getInfoElement(org.licas_xml.abs.Element infoDescr) throws java.lang.Exception
<Data><Value>Info value here</Value><Value_Type>Info value type</Value_Type></Data>
.infoDescr
- a description of the info resource value that should be retrieved,
or can be null
.infoResource
as an XML element.java.lang.Exception
- any error.public void loadDataContents(java.lang.String dataType, java.lang.String urlPath) throws java.lang.Exception
Data
element.dataType
- the type of data to load.urlPath
- the file path as a local or remote url.java.lang.Exception
- any error.public void loadDataDetails(java.lang.String dataType, java.lang.String urlPath) throws java.lang.Exception
Data
element. The external source an be local or remote.dataType
- the type of data to load.urlPath
- the file path as a local or remote url.java.lang.Exception
- any error.public void loadDataScript(org.licas_xml.abs.Element adminDataXml) throws java.lang.Exception
adminDataXml
- the new admin data section. Replaces the existing data
section completely.java.lang.Exception
- any error.