public abstract class ServiceMediator extends Service
InformationMediator
and you should use the DefaultSolverFactory.createMediator
method to return an instance of the service.Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
serverIP
Only the server ip address, for example, 'http://123.4.5.6:8888'
|
protected org.licas_xml.abs.Element |
serverUri
The server url address
|
protected ServiceSpec |
serviceSpec
The service specification
|
protected java.lang.Object |
syncOn
To synchronize on
|
canAccessMeta, canAccessNested, dm, finalised, isRemoteCall, messageStore, serviceAdmin, serviceGrade, serviceInitialise, serviceLinks, serviceState, sm, toLoadScript
shutDown
passwordHandler, service, serviceType
jarFile, uuid
Constructor and Description |
---|
ServiceMediator(PasswordHandler thePasswordHandler)
Create a new instance of ServiceMediator.
|
ServiceMediator(java.lang.String thisPassword,
java.lang.String thisAdminKey,
PasswordHandler thePasswordHandler)
Creates a new instance of ServiceMediator.
|
Modifier and Type | Method and Description |
---|---|
void |
createAssociationLinks(java.util.HashMap<java.lang.String,java.util.ArrayList<java.util.ArrayList<java.lang.String>>> serviceGroups)
Create association links between each key service and the list it is related to.
|
void |
createPermanentLinks(java.util.HashMap<java.lang.String,java.util.ArrayList<java.util.ArrayList<java.lang.String>>> serviceGroups)
Create permanent links between each key service and the list it is related to.
|
abstract void |
createServices(java.lang.String serviceType)
Create the services and initialise as defined by the script.
|
org.licas_xml.abs.Element |
dynamicLinksToXml()
Get the list of all dynamic links created on each service.
|
java.util.ArrayList<java.lang.String> |
getLinkedServiceUuids()
Get the list of uuids only of all services currently linked to through dynamic links,
with the
source uuid added only once, but the linked to uuid added the
number of times it occurs. |
void |
initialiseInfo(ServiceSpec theServiceSpec)
Initialise the information mediator with password details.
|
abstract boolean |
initialiseServerInfo(ServiceSpec serviceSpec)
Initialise the solver mediator with the server details.
|
abstract void |
initialiseServices(java.lang.String serviceType)
Initialise the services, primarily adding and initialising linking
structures if they are included.
|
void |
startServices(java.lang.String serviceType)
Start the threads of all services of the specified service type.
|
void |
updateDynamicLinks(java.util.HashMap<java.lang.String,java.util.ArrayList<java.util.ArrayList<java.lang.String>>> serviceGroups,
boolean toPermanent)
Update dynamic links for the services that are grouped together.
|
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, getServiceNames, getServiceNumber, getServiceOrWrapper, getServiceState, getServiceType, getServiceTypes, handshake, hasCommunicationID, hasLinkTo, hasServerPassword, hasService, hasServiceType, interrupt, isCorrectPassword, isPrivateMethod, isPublicMethod, isStarted, linksToXml, passwordsStateToXml, permanentLinksToXml, reflectionMethods, reflectionObject, 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
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, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getUUID, setJarFile, setUUID
protected java.lang.String serverIP
protected org.licas_xml.abs.Element serverUri
protected ServiceSpec serviceSpec
protected final java.lang.Object syncOn
public ServiceMediator(PasswordHandler thePasswordHandler) throws java.lang.Exception
thePasswordHandler
- the password handler.java.lang.Exception
- any error.public ServiceMediator(java.lang.String thisPassword, java.lang.String thisAdminKey, 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 abstract boolean initialiseServerInfo(ServiceSpec serviceSpec) throws java.lang.Exception
serviceSpec
- the service spec or test script, with all of the config details.java.lang.Exception
- any error.public abstract void createServices(java.lang.String serviceType) throws java.lang.Exception
serviceType
- the type to assign to each main or base service.java.lang.Exception
- any error.public abstract void initialiseServices(java.lang.String serviceType) throws java.lang.Exception
serviceType
- the type of service to initialise.java.lang.Exception
- any error.public void initialiseInfo(ServiceSpec theServiceSpec) throws java.lang.Exception
theServiceSpec
- the spec with all of the related config info.java.lang.Exception
- any error.public void startServices(java.lang.String serviceType) throws java.lang.Exception
serviceType
- the service type or unique id.java.lang.Exception
- any error.public void createPermanentLinks(java.util.HashMap<java.lang.String,java.util.ArrayList<java.util.ArrayList<java.lang.String>>> serviceGroups) throws java.lang.Exception
serviceGroups
- the groups of services that are clustered together.
The key would be a service ID and value a list of other services related to it.
The entries can be either IDs or String-based full URI descriptions.java.lang.Exception
- any error.public void createAssociationLinks(java.util.HashMap<java.lang.String,java.util.ArrayList<java.util.ArrayList<java.lang.String>>> serviceGroups) throws java.lang.Exception
serviceGroups
- the groups of services that are clustered together.
The key would be a service ID and value a list of other services related to it.java.lang.Exception
- any error.public void updateDynamicLinks(java.util.HashMap<java.lang.String,java.util.ArrayList<java.util.ArrayList<java.lang.String>>> serviceGroups, boolean toPermanent) throws java.lang.Exception
serviceGroups
- the groups of services that are clustered together.
The key would be a service ID and value a list of other services related to it.
This can either be a ArrayList
that includes more groups, or a list of 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.java.lang.Exception
- any error.public java.util.ArrayList<java.lang.String> getLinkedServiceUuids() throws java.lang.Exception
source
uuid added only once, but the linked to
uuid added the
number of times it occurs.java.lang.Exception
- any error.public org.licas_xml.abs.Element dynamicLinksToXml() throws java.lang.Exception
dynamicLinksToXml
in class Service
java.lang.Exception
- any error.