public abstract class Service extends ServiceModule implements java.lang.AutoCloseable
This is the base class that can be used to create a licas service. This class provides the default functionality
for storing service details, such as admin and metadata (ServiceAdmin
), or links (ServiceLinks
),
and provides the communication framework for invoking service methods. The system is now more modular
and services that are stored can be either FrameworkModule
modules or full Service
services.
The modules would be for local actions only, inside of this service, and two default ones are the service
behaviour sm
and data dm
modules. Any other ones can be stored as child services (@code addService},
but would not be accessible externally.
This base class also has a built-in security mechanism through using wrappers and passwords, to protect the method invocation.
The Auto
class then extends this class with more agent-based or autonomous functionality.
When a service is created, it passes some metadata to the ESB
server, to be stored in a ServiceRepository
.
This is used for query retrieval where only limited metadata allowing for the service to be found and described is stored.
This is returned as a ServiceMeta
object, that has a number of metadata fields, including other external values,
notably in the Const
.OTHERMETA
, or DATA
sections. The Data
section
is transferred to the DataModule
as a Resource
object that can store static data
or reference online data, for example.
A service can also be initialised with specific metadata through an admin script. The script can
include the metadata fields and also an INSTANCEVALUES
section that can be used to
initialise any internal service variable or field. If complex objects are declared, then the Parsers
object needs to have a related parser. There is also PARAMETERS
section in the script that will set
constructor parameters, as part of more advanced and dynamic programming. For this initialisation to work,
the service need to include some methods directly in its class code, as described in the documentation.
This can mostly be ignored however. See also the code section that needs to be added to use this advanced metadata.
Any Service-derived
class that is loaded, is added to the server with a ServiceWrapper
wrapper.
If the object is not a licas service (legacy code
) then a ServiceWrapperLegacy
wrapper is
used instead. Any service that is added to another service should probably be considered as a utility service
to that one and is added with one of these wrappers. A base Auto
-derived service however gets wrapped with
an AutonomicManager
, which by default is empty. The service wrapper is still useful however because it can
add the licas-framework functionality to a wrapped legacy object and gives some added protection.
Three types of link are available: Permanent links are static and made only between services on the same server.
Each one can be created through a single call to the createPermanentLinkTo
method. The permanent links are
stored as a list of references in the ServiceLinks
.permanentLinks
structure. Dynamic links can
then span across servers and are reference-only. They can be created through a novel linking mechanism that can
be added to any service, as a module. In particular, there are two implementations called Link
or Link_M
.
These would typically be added with the uuid of ServiceConst
.LINKER
. Dynamic links then build
up over time through reinforcement, where they can be created and also destroyed. There are also simply service
associations, or references to any service from any other service. These are added or removed in one go, can be
used for anything and are stored again as a list of references in ServiceLinks
.serviceAssociations
.
Any communication IDs saved in the service that are older than 3 days are automatically removed.
This is checked in addCommunicationID
.
This class also extends Thread
, but that is only used first in the Auto
class.
Modifier and Type | Field and Description |
---|---|
protected boolean |
canAccessMeta
True if allow to return the service metadata, false if force to hide the metadata.
|
protected boolean |
canAccessNested
True if allow access to nested services, false otherwise.
|
protected DataModule |
dm
Module to manage the service's data object.
|
protected boolean |
finalised
True if
finaliseInitialisation already called, in case construction is different |
protected boolean |
isRemoteCall
True if the current call to the object being invoked is remote.
|
protected MessageStore |
messageStore
Communication IDs to identify the calling components and replies
for stored method results.
|
protected ServiceAdmin |
serviceAdmin
Lookup facility for this service
|
protected java.lang.String |
serviceGrade
The service grade, for example
ServiceConst .{code BASE} or UTILITY |
protected ServiceInitialiseDef |
serviceInitialise
To perform some final automatic initialisations
|
protected ServiceLinks |
serviceLinks
Permanent links between services
|
protected java.lang.String |
serviceState
The current state of the service if known
|
protected SM_Service |
sm
Module to manage the service behaviour, allows for a more flexible plugin system.
|
protected org.licas_xml.abs.Element |
toLoadScript
The last script part used to load a service, through the initialisation process
|
shutDown
passwordHandler, service, serviceType
jarFile, syncOn, uuid
Constructor and Description |
---|
Service()
Creates a new instance of Service.
|
Service(java.lang.String thisPassword,
java.lang.String thisAdminKey)
Creates a new instance of Service.
|
Service(java.lang.String thisPassword,
java.lang.String thisAdminKey,
org.licas_xml.abs.Element adminXml)
Creates a new instance of Service.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
addCommunicationID(java.lang.String commID,
java.lang.Object clientURI)
Store the commID with the related client URI, stored as
MessageInfo objects
with timestamps. |
boolean |
addDefaultService(java.lang.String serviceType,
java.lang.String adminKey)
Add a default service to this service.
|
boolean |
addDefaultService(java.lang.String serviceUuid,
java.lang.String serviceType,
java.util.ArrayList<?> params,
org.licas_xml.abs.Element adminXml,
java.lang.String adminKey)
Add a default service to this service.
|
boolean |
addDefaultService(java.lang.String serviceUuid,
java.lang.String serviceType,
java.util.ArrayList<?> params,
java.lang.String adminKey)
Add a default service to this service.
|
boolean |
addDefaultService(java.lang.String serviceUuid,
java.lang.String serviceType,
java.lang.String adminKey)
Add a default service to this service.
|
boolean |
addLinkFromService(java.lang.String serviceID,
java.lang.Object theReference)
Add a link from another service locally in this service.
|
protected boolean |
addLinkToService(java.lang.String serviceID,
java.lang.Object theReference)
Add a link reference to another service locally in this service.
|
protected void |
addMessageMetrics(MethodInfo messageInfo,
java.lang.String thePassword)
Add metric or stat values for the message object.
|
boolean |
addService(java.lang.String thePassword,
java.lang.String serviceName,
java.lang.String serviceType,
java.util.ArrayList<java.lang.String> jarFile,
java.lang.Object theService,
boolean startService)
Add the service Object to this one.
|
boolean |
addService(java.lang.String thePassword,
java.lang.String serviceName,
java.lang.String serviceType,
java.util.ArrayList<java.lang.String> jarFile,
java.lang.String className,
java.util.ArrayList<java.lang.Object> params)
Load the service class and add as a service, but do not start its thread.
|
boolean |
addService(java.lang.String thePassword,
java.lang.String serviceName,
java.lang.String serviceType,
java.util.ArrayList<java.lang.String> jarFile,
java.lang.String className,
boolean startService,
java.util.ArrayList<java.lang.Object> params)
Load the service class and add as a service.
|
boolean |
addService(java.lang.String thePassword,
java.lang.String serviceName,
java.lang.String serviceType,
java.lang.Object theService)
Add the service Object to this one.
|
boolean |
addServiceAssociation(java.lang.String adminKey,
org.licas_xml.abs.Element serviceUri,
java.lang.String servicePassword)
Add a new URI for a link to a (probably remote) service.
|
void |
addServicePassword(java.lang.String serviceUuid,
java.lang.String servicePassword,
java.lang.String adminKey)
Add a new service password to this service.
|
protected java.lang.String |
addTempPassword(boolean addPassword)
Add a new temporary password to the temp passwords list.
|
boolean |
allowAddService(java.lang.String adminKey,
boolean allow)
Set the
allowAddService variable to allow services to be added. |
boolean |
canAccess(java.lang.String thePassword,
java.util.ArrayList<java.lang.reflect.Method> theMethods)
Return true if the password allows the calling component to access this component.
|
boolean |
canAccess(java.lang.String thePassword,
java.lang.reflect.Method theMethod)
Return true if the password allows the calling component to access this component.
|
boolean |
canAccess(java.lang.String thePassword,
java.lang.String methodName)
Return true if the password allows the calling component to access this component.
|
protected boolean |
canAccess(java.lang.String thePassword,
java.lang.String methodName,
java.lang.reflect.Method theMethod)
Return true if the password allows the calling component to access this component.
|
boolean |
canAccessMeta()
Return true if the service allows you to access its metadata, or false if
access is not allowed.
|
boolean |
canAccessNested()
Return true if the service allows you to access any of its nested services.
|
boolean |
canAccessTemp(java.lang.String thePassword)
Return true if the password allows the calling component
to access this component by a temporary password.
|
boolean |
canRun()
Return the thread value indicating if the thread can be run.
|
protected boolean |
classNameOK(java.lang.String className)
Check that the class name path is not illegal.
|
protected void |
clearServiceLinks(java.util.ArrayList<?> serviceIDs,
java.lang.String adminKey)
Clear the links for the named services.
|
boolean |
clearServices(java.util.ArrayList<?> serviceIDs,
java.lang.String adminKey)
Clear all existing services or service modules, with names on the list.
|
boolean |
clearServices(java.lang.String adminKey)
Clear all existing services and service modules.
|
void |
close()
Clean-up before shutting down the service.
|
ServiceMeta |
createMetaForRepos(java.lang.String theAdminKey)
Create a metadata description of this service for the server repository.
|
ServiceMeta |
createMetaFull(java.util.ArrayList<java.lang.String> jarFile,
java.lang.String theAdminKey)
Create a full metadata description of this service.
|
boolean |
createPermanentLinkTo(java.lang.String adminKey,
java.lang.String serviceTo,
java.lang.String servicePassword,
org.licas_xml.abs.Element serviceUri)
Create a permanent link from this service to another service.
|
protected ServiceWrapperDef |
createServiceWrapper(java.lang.Object serviceObj,
java.lang.String serviceName,
java.lang.String serviceType,
java.util.ArrayList<java.lang.String> jarFiles,
org.licas_xml.abs.Element adminXml)
Create a service wrapper for storing the service object.
|
static java.util.ArrayList<java.lang.String> |
defaultAdminToRemove()
Create and return a list of admin info that should probably not be
returned to a user for display purposes.
|
org.licas_xml.abs.Element |
dynamicLinkQuery(LinkQueryConfig queryConfig)
Perform a query over the link paths to return matching sources.
|
void |
dynamicLinksToPermanent(java.lang.String adminKey)
Convert any dynamic links to permanent ones, or remove any permanent links
that do not now exist as dynamic ones.
|
org.licas_xml.abs.Element |
dynamicLinksToXml()
Return all linked sources in XML format.
|
org.licas_xml.abs.Element |
dynamicLinksToXml(java.lang.String adminKey)
Return all linked sources in XML format, including all link levels and the
source weight values.
|
java.lang.Object |
execute(MethodInfo methodInfo,
boolean addTempPassword)
Execute the specified method and return the result.
|
protected void |
finaliseInitialisation()
Finalise the initialisation of this service.
|
protected void |
finaliseInitialisation(org.licas_xml.abs.Element servicesXml)
Finalise the initialisation of this service.
|
protected void |
finaliseModule(ServiceDef module)
Finalise the module initialisation.
|
protected void |
finaliseThisConfig()
Finalise the configuration of this service, for specific variable values.
|
java.lang.String |
GET()
This is a method to be invoked by something like a RESTFul or HTTP Server call.
|
protected java.util.ArrayList<java.lang.Object> |
getAllLinkToService()
Get all source references for a links to another service.
|
boolean |
getAllowAddService()
Return the value indicating if a service can be added to this one.
|
org.licas_xml.abs.Element |
getAutonomicManagerConfig(java.lang.String theAdminKey)
If the service has an admin document, check it for an autonomic manager section.
|
protected java.lang.Object |
getCommunicationClientURI(java.lang.String commID)
Get the client URI stored in the message info for a communication ID.
|
java.lang.Object |
getData()
Get the data value only, as a java object.
|
java.lang.Object |
getData(org.licas_xml.abs.Element dataDescr)
Get the data value only, not converted into XML, based on some condition.
|
org.licas_xml.abs.Element |
getDescription()
Get the description value.
|
org.licas_xml.abs.Element |
getFullPath()
Get the fully qualified uuid path back to the first parent object and server.
|
protected java.lang.Object |
getInstanceValue(java.lang.String varName)
Get the value of the specified variable if it exists.
|
boolean |
getIsRemoteCall()
Return a value indicating if current call is remote.
|
java.lang.Object |
getLinkFromService(java.lang.String serviceID)
Get the source reference for a link from another service.
|
java.lang.Object |
getLinkToService(java.lang.String serviceID)
Get the source reference for a link to another service.
|
protected java.lang.String |
getLocalRemoteID(org.licas_xml.abs.Element serviceUri)
If the Handle-style URI is for a local service running on the same server,
then just return its ID, otherwise convert the whole URI to a string.
|
protected Service |
getParent()
Get the parent component representation.
|
Service |
getParent(java.lang.String adminKey)
Get the parent component representation.
|
java.lang.String |
getPassword(java.lang.String theAdminKey)
Get the password for this service.
|
java.lang.String |
getPassword(java.lang.String clientID,
Contract clientContract)
Get this service's password, depending on the calling component's contract description.
|
java.lang.String |
getPassword(java.lang.String serviceUuid,
java.lang.String theAdminKey)
Get the password for the specified service.
|
protected PasswordHandler |
getPasswordHandler()
Get the password handler.
|
protected java.util.ArrayList<java.lang.String> |
getPrivateMethods()
Get the list of public-level methods that should not be invoked externally, maybe from an interface.
|
java.util.ArrayList<java.lang.String> |
getPublicMethods()
Get the list of methods that can be freely called on a Service in general,
without even requiring a password.
|
java.lang.String |
getPublicServiceClassname(java.lang.String serviceType)
Get the class type for a standard default service, known by the service factory
or this service.
|
protected java.lang.String |
getServerPassword()
Get the local server password if it is stored.
|
ServiceWrapperDef |
getService(java.lang.String serviceName,
java.lang.String thePassword)
Return the service or module for the related service name.
|
java.lang.Object |
getService(java.lang.String serviceName,
java.lang.String thePassword,
java.lang.String adminKey)
Return the service or module for the related service name.
|
ServiceAdmin |
getServiceAdmin(java.lang.String adminKey)
Get this service's service admin, including its metadata info.
|
java.util.HashMap<java.lang.String,java.lang.String> |
getServiceClasses(java.lang.String theAdminKey)
Get the class types for all services that are stored.
|
java.lang.String |
getServiceGrade()
Get the grade for this service.
|
ServiceLinks |
getServiceLinks(java.lang.String adminKey)
Get this service's linking structure.
|
java.util.ArrayList<java.lang.String> |
getServiceNames()
Get all child service and module names.
|
java.util.ArrayList<java.lang.String> |
getServiceNames(java.util.ArrayList<java.lang.String> thisServiceTypes)
Return all child or module service names for a list of service types.
|
java.util.ArrayList<java.lang.String> |
getServiceNames(java.util.ArrayList<java.lang.String> thisServiceTypes,
boolean reciprocal)
Return all child or module service names for a list of service types.
|
int |
getServiceNumber(java.lang.String serviceType)
Return a count of how many services of the specified type are on this service.
|
FrameworkModule |
getServiceOrWrapper(java.lang.String serviceName,
java.lang.String thePassword,
java.lang.String adminKey)
Return the service, module or its wrapper for the related service name.
|
java.lang.String |
getServiceState(java.lang.String adminKey)
This method returns a value indicating the what current service state is.
|
java.lang.String |
getServiceType(java.lang.String serviceName)
Get the service type for the named child service if it exists.
|
java.util.ArrayList<java.lang.String> |
getServiceTypes()
Return all service types for all stored services and modules.
|
boolean |
handshake(org.licas_xml.abs.Element serverURI,
java.lang.String serverPassword,
java.lang.String serviceID,
java.lang.String servicePassword)
Checks if the calling client exists and can connect with it.
|
boolean |
hasCommunicationID(java.lang.String commID)
Return true if this service currently stores a conversation with the specified communication ID.
|
boolean |
hasLinkTo(java.lang.String serviceID)
Return true if this service has a permanent local link (
PermanentLink only)
to the service with the specified service ID. |
protected boolean |
hasServerPassword()
Return true if the local server password is stored.
|
boolean |
hasService(java.lang.String serviceID)
Return true if a service with the specified id is running on this one.
|
boolean |
hasServiceType(java.lang.String serviceType)
Return true if a service with the specified type is running on this one.
|
boolean |
interrupt(java.lang.String adminKey)
You must call this method to interrupt the thread.
|
boolean |
isCorrectPassword(java.lang.String methodName,
java.lang.String thePassword)
Return true if the password is the correct one to call the method.
|
protected boolean |
isPrivateMethod(java.lang.String methodName)
Return true if the method is a public-level method that should not be accessed externally.
|
boolean |
isPublicMethod(java.lang.String methodName)
Return true if the method is a public method that can be freely called,
without a password even.
|
boolean |
isStarted()
Return the thread value indicating if the thread is currently running.
|
org.licas_xml.abs.Element |
linksToXml(java.lang.String adminKey)
Return all linked references in XML format.
|
org.licas_xml.abs.Element |
passwordsStateToXml(java.lang.String adminKey)
Serialize the stored passwords list and the service state, and return as an
XML-based description.
|
org.licas_xml.abs.Element |
permanentLinksToXml()
Return all permanent linked-t0 services in XML format.
|
java.util.ArrayList<java.lang.reflect.Method> |
reflectionMethods()
Get a list of public methods that can be accessed through the service.
|
protected java.lang.Object |
reflectionObject(java.lang.reflect.Method method)
Get which object in the service is able to execute the method.
|
boolean |
removeAllLinksTo(java.lang.String serviceID,
java.lang.String adminKey)
Remove all non-dynamic links to the specified service from all other services.
|
void |
removeAllServices(java.util.ArrayList<?> serviceIDs,
java.lang.String adminKey)
Remove all child services and modules on the service list from this service
and terminate their threads.
|
protected void |
removeAllServices(java.lang.String adminKey)
Remove all child services and modules from this service and terminate their threads.
|
protected void |
removeCommunicationID(java.lang.String communicationID)
Remove the communication ID reference.
|
void |
removeLinkFromService(java.lang.String serviceID)
Remove the local link from the specified service if it exists.
|
protected void |
removeLinkToService(java.lang.String serviceID)
Remove the local link to the specified service if it exists.
|
boolean |
removePermanentLinkTo(java.lang.String adminKey,
java.lang.String serviceTo,
java.lang.String servicePassword,
org.licas_xml.abs.Element serviceUri)
Remove a permanent link from this service to another service.
|
void |
removeServiceAssociation(org.licas_xml.abs.Element serviceUri)
Remove a URI for a link to a (probably remote) service.
|
boolean |
removeServiceID(java.lang.String serviceUuid,
java.lang.String adminKey)
Remove the service or module with the indicated ID from the list and terminate it.
|
boolean |
removeServicePath(org.licas_xml.abs.Element servicePath,
java.lang.String adminKey)
Remove the service or module with the indicated path from the list and terminate it.
|
boolean |
removeServicePath(org.licas_xml.abs.Element servicePath,
java.lang.String adminKey,
boolean stopThread)
Remove the service or module with the indicated path from the list.
|
protected void |
removeTempPassword(java.lang.String tempPassword)
Remove the temporary password from the list if it exists.
|
Contract |
serviceNegotiate(java.lang.String id,
Contract clientContract)
Allow a client to negotiate with this service about a contract agreement.
|
org.licas_xml.abs.Element |
serviceToXml(java.lang.String adminKey)
Serialize the service using the
ServiceSerialize class. |
org.licas_xml.abs.Element |
serviceToXml(java.lang.String adminKey,
java.util.ArrayList<java.lang.String> adminToRemove,
java.util.ArrayList<java.lang.String> toSerialize)
Serialize the service using the
ServiceSerialize class. |
void |
setAdminInfo(org.licas_xml.abs.Element adminXml,
java.lang.String adminKey)
Set a full admin info description for the service.
|
void |
setCanAccessMeta(boolean thisCanAccessMeta,
java.lang.String adminKey)
Set the variable indicating if the service metadata can be accessed.
|
void |
setCanAccessNested(boolean thisCanAccessNested,
java.lang.String adminKey)
Set the variable indicating if nested child services can be directly accessed.
|
boolean |
setData(org.licas_xml.abs.Element dataXml,
java.lang.String adminKey)
Set the value that this service will use as its data source.
|
protected void |
setDataModule()
Set the data module to process a
Resource , as described in the admin document. |
boolean |
setDataModule(java.lang.String adminKey)
Set the data module to process a
Resource , as described in the admin document. |
boolean |
setDescription(org.licas_xml.abs.Element descriptionXml,
java.lang.String adminKey)
Set the service description value only.
|
protected void |
setInstanceValues(org.licas_xml.abs.Element instanceValues)
Set actual values for variable instances if they are defined.
|
void |
setIsRemoteCall(boolean thisIsRemoteCall)
Set the value indicating a remote call.
|
boolean |
setOtherMeta(org.licas_xml.abs.Element otherMetaXml,
java.lang.String adminKey)
Set the additional metadata value.
|
protected boolean |
setParent(Service thisParent)
Set the parent component value.
|
boolean |
setParent(Service thisParent,
java.lang.String adminKey)
Set the parent component value.
|
protected void |
setSerializeValues(org.licas_xml.abs.Element serializeXml)
Set actual values for serialized variable instances if they are defined.
|
protected void |
setServerPassword(java.lang.String thePassword)
Set the password that will allow this service to access the server it runs on.
|
protected void |
setServiceGrade(java.lang.String thisServiceGrade)
Set the service grade or function class.
|
protected void |
setServiceModule()
Set the outer-most module that provides the essential service methods.
|
void |
setServiceState(java.lang.String theServiceState,
java.lang.String adminKey)
This sets a value indicating the current service state.
|
boolean |
startAllThreads(java.lang.String serviceType,
java.lang.String adminKey)
Start the threads for all child services of the specified component type.
|
boolean |
startThread(java.lang.String adminKey)
Start this service's thread running.
|
boolean |
stopAllThreads(java.lang.String serviceType,
java.lang.String adminKey)
Stop the threads for all child services of the specified component type.
|
void |
syncToAsync(MethodInfo methodInfo)
This method can be invoked by a client that maybe does not have constant access to
the server.
|
MessageInfo |
syncToAsyncReply(java.lang.String replyID)
Retrieve a stored method reply.
|
boolean |
syncToAsyncTransit(java.lang.String replyID)
Return true if a reply id for a method invocation has been registered
and the method execution is still on-going.
|
boolean |
xmlToDynamicLinks(org.licas_xml.abs.Element linksXml,
java.lang.String adminKey)
Parse the links descriptions and add to the service.
|
static java.lang.Object |
xmlToService(org.licas_xml.abs.Element serviceXml,
java.lang.String password)
Create the service from the description using the
ServiceSerialize class. |
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 boolean canAccessMeta
protected boolean canAccessNested
protected boolean finalised
finaliseInitialisation
already called, in case construction is differentprotected java.lang.String serviceGrade
ServiceConst
.{code BASE} or UTILITY
protected java.lang.String serviceState
protected org.licas_xml.abs.Element toLoadScript
protected SM_Service sm
protected DataModule dm
Resource
to some local or remote data.protected ServiceAdmin serviceAdmin
protected ServiceLinks serviceLinks
protected ServiceInitialiseDef serviceInitialise
protected MessageStore messageStore
protected boolean isRemoteCall
public Service() throws java.lang.Exception
java.lang.Exception
- any error.public Service(java.lang.String thisPassword, java.lang.String thisAdminKey) throws java.lang.Exception
thisPassword
- password to invoke this service.thisAdminKey
- admin key for protected access.java.lang.Exception
- any error.public Service(java.lang.String thisPassword, java.lang.String thisAdminKey, org.licas_xml.abs.Element adminXml) throws java.lang.Exception
thisPassword
- password to invoke this service.thisAdminKey
- admin key for this service.adminXml
- the admin info or description of this service.java.lang.Exception
- any error.protected void setServiceModule() throws java.lang.Exception
SM_Service
for Service or SM_Auto
for Auto
.java.lang.Exception
- any error.public boolean setDataModule(java.lang.String adminKey) throws java.lang.Exception
Resource
, as described in the admin document.
If there is no data processing then set the module to null
.adminKey
- the service admin key.java.lang.Exception
- any error.protected void setDataModule() throws java.lang.Exception
Resource
, as described in the admin document.
If there is no data processing then set the module to null
.java.lang.Exception
- any error.protected void finaliseInitialisation() throws java.lang.Exception
addService
methods. It uses an implementation of the ServiceInitialise
class to finalise
the initialisation process. To override, reset the serviceInitialise
variable
in your derived class (see LinkService
, for example) to your new version
and implement the default method as required.java.lang.Exception
- any error.protected void finaliseInitialisation(org.licas_xml.abs.Element servicesXml) throws java.lang.Exception
addService
methods. It uses an implementation of the ServiceInitialise
class to finalise
the initialisation process. To override, reset the serviceInitialise
variable
in your derived class (see LinkService
, for example) to your new version
and implement the default method as required.servicesXml
- services to load XML section. This is so that initialisation
can be done from somewhere other than the exact registration place, for other
loaded objects, for example.java.lang.Exception
- any error.protected void finaliseThisConfig() throws java.lang.Exception
java.lang.Exception
- any error.protected void finaliseModule(ServiceDef module) throws java.lang.Exception
module
- the module to check.java.lang.Exception
- any error.protected void setInstanceValues(org.licas_xml.abs.Element instanceValues) throws java.lang.Exception
NOTE:
you must add this method to your own derived class if you use it,
so that the private variables in that class can be accessed.
instanceValues
- the admin script part that defines instance values.java.lang.Exception
- any error.protected java.lang.Object getInstanceValue(java.lang.String varName) throws java.lang.Exception
NOTE:
you must add this method to your own derived class if you use it,
so that the private variables in that class can be accessed. It is ignored
unless it gets called through the script initialisation process.
varName
- the name of the variable to check for.java.lang.Exception
- any error.protected void setSerializeValues(org.licas_xml.abs.Element serializeXml) throws java.lang.Exception
NOTE:
you must add this method to your own derived class if you
use it, so that the private variables in that class can be accessed.
serializeXml
- the admin script part that defines serialize instance
values.java.lang.Exception
- any error.public java.lang.String GET() throws java.lang.Exception
InformationService
, for example, should have a specific implementation.java.lang.Exception
- any error.protected void addMessageMetrics(MethodInfo messageInfo, java.lang.String thePassword) throws java.lang.Exception
messageInfo
- the message info with the message object.thePassword
- the password for this service.java.lang.Exception
- any error.public boolean isStarted()
public boolean canRun()
public boolean isCorrectPassword(java.lang.String methodName, java.lang.String thePassword) throws java.lang.Exception
methodName
- the name of the method.thePassword
- the password used to call the method.java.lang.Exception
- any error.public boolean isPublicMethod(java.lang.String methodName)
methodName
- the name of the method.protected boolean isPrivateMethod(java.lang.String methodName)
methodName
- the name of the method.public boolean hasService(java.lang.String serviceID)
serviceID
- the service uuid to check for.public boolean hasServiceType(java.lang.String serviceType)
serviceType
- the service type to check for.public boolean hasCommunicationID(java.lang.String commID)
commID
- the communication ID to check for.public ServiceAdmin getServiceAdmin(java.lang.String adminKey)
adminKey
- the admin key for this service.public ServiceLinks getServiceLinks(java.lang.String adminKey)
adminKey
- the admin key for this service.public org.licas_xml.abs.Element getAutonomicManagerConfig(java.lang.String theAdminKey)
theAdminKey
- the service key for this service.public boolean startThread(java.lang.String adminKey)
adminKey
- the admin key for this service.public boolean startAllThreads(java.lang.String serviceType, java.lang.String adminKey) throws java.lang.Exception
Const
.ALLSERVICES
, then any child service can be started.serviceType
- the service type. Can be general or a specific uuid.adminKey
- the service key for this service.java.lang.Exception
- any error.public boolean stopAllThreads(java.lang.String serviceType, java.lang.String adminKey) throws java.lang.Exception
Const
.ALLSERVICES
, then any child service can be stopped.serviceType
- the service type. Can be general or a specific uuid.adminKey
- the service key for this service.java.lang.Exception
- any error.public boolean getAllowAddService()
public boolean allowAddService(java.lang.String adminKey, boolean allow)
allowAddService
variable to allow services to be added.adminKey
- the admin key for this service.allow
- true if reset to allow adding of services, false to reset
to block of adding services.public void setCanAccessMeta(boolean thisCanAccessMeta, java.lang.String adminKey) throws java.lang.Exception
thisCanAccessMeta
- true if can access metadata, false if cannot.adminKey
- the service key for this service.java.lang.Exception
- any error.public boolean canAccessMeta()
public void setCanAccessNested(boolean thisCanAccessNested, java.lang.String adminKey) throws java.lang.Exception
thisCanAccessNested
- true if can access nested services, false if cannot.adminKey
- the service key for this service.java.lang.Exception
- any error.public boolean canAccessNested()
public java.lang.String getPassword(java.lang.String theAdminKey)
theAdminKey
- the service key.public java.lang.String getPassword(java.lang.String serviceUuid, java.lang.String theAdminKey) throws java.lang.Exception
serviceUuid
- the id of the service to ask the password for.theAdminKey
- the service key.java.lang.Exception
- any error.public java.lang.String getPassword(java.lang.String clientID, Contract clientContract) throws java.lang.Exception
clientID
- the clientID of the calling component.clientContract
- the description of the calling component's contract proposal.
Note that the default Contract
.getYesContract()
can often be used.java.lang.Exception
- any error.protected void setServerPassword(java.lang.String thePassword) throws java.lang.Exception
thePassword
- the server password.java.lang.Exception
- any error.protected boolean hasServerPassword() throws java.lang.Exception
java.lang.Exception
- any error.protected java.lang.String getServerPassword() throws java.lang.Exception
getServerPassword
in class FrameworkModule
java.lang.Exception
- any error.public boolean canAccess(java.lang.String thePassword, java.lang.String methodName) throws java.lang.Exception
thePassword
- the password to use.methodName
- the method name that needs to be called.java.lang.Exception
- any error.public boolean canAccess(java.lang.String thePassword, java.lang.reflect.Method theMethod) throws java.lang.Exception
thePassword
- the password to use.theMethod
- the method that needs to be called.java.lang.Exception
- any error.public boolean canAccess(java.lang.String thePassword, java.util.ArrayList<java.lang.reflect.Method> theMethods) throws java.lang.Exception
thePassword
- the password to use.theMethods
- a list of possible legal methods to call.java.lang.Exception
- any error.protected boolean canAccess(java.lang.String thePassword, java.lang.String methodName, java.lang.reflect.Method theMethod) throws java.lang.Exception
execute
method is always allowed because it will invoke another method.thePassword
- the password to use.methodName
- the method name that needs to be called.theMethod
- the method that needs to be called.java.lang.Exception
- any error.public boolean canAccessTemp(java.lang.String thePassword)
canAccessTemp
in interface ServiceDef
canAccessTemp
in class FrameworkModule
thePassword
- the password to use.public Contract serviceNegotiate(java.lang.String id, Contract clientContract) throws java.lang.Exception
id
- the id of the calling component.clientContract
- the description of the calling component's contract proposal.getPassword
method as the agreed contract, to retrieve
the service password.java.lang.Exception
- any error.public void addServicePassword(java.lang.String serviceUuid, java.lang.String servicePassword, java.lang.String adminKey)
serviceUuid
- the full uuid description of the service the password is for.servicePassword
- the service password.adminKey
- the admin key for this service.protected java.lang.String addTempPassword(boolean addPassword) throws java.lang.Exception
addPassword
- true if add a password.java.lang.Exception
- any error.protected void removeTempPassword(java.lang.String tempPassword)
tempPassword
- the temporary password.public org.licas_xml.abs.Element getFullPath() throws java.lang.Exception
java.lang.Exception
- any error.public final boolean addDefaultService(java.lang.String serviceType, java.lang.String adminKey) throws java.lang.Exception
canAccessNested
to false however, can block access from an external
service to any nested service no matter what password is used.serviceType
- the type of service to create. This is also used as the service uuid.adminKey
- the admin key for this service.java.lang.Exception
- any error.public final boolean addDefaultService(java.lang.String serviceUuid, java.lang.String serviceType, java.lang.String adminKey) throws java.lang.Exception
canAccessNested
to false however, can block access from an external
service to any nested service no matter what password is used.serviceUuid
- the uuid for the new default service to add. This is not
used for a linking service, which is assigned the 'LINKER' uuid name.serviceType
- the type of service to create.adminKey
- the admin key for this service.java.lang.Exception
- any error.public final boolean addDefaultService(java.lang.String serviceUuid, java.lang.String serviceType, java.util.ArrayList<?> params, java.lang.String adminKey) throws java.lang.Exception
serviceUuid
- the uuid for the new default service to add. This is not
used for a linking service, which is assigned the ServiceConst
.LINKER
uuid name.serviceType
- the type of service to create.params
- list of constructor parameters - should be password and admin key.adminKey
- the admin key for this service.java.lang.Exception
- any error.public final boolean addDefaultService(java.lang.String serviceUuid, java.lang.String serviceType, java.util.ArrayList<?> params, org.licas_xml.abs.Element adminXml, java.lang.String adminKey) throws java.lang.Exception
canAccessNested
to false however, can block access from an external
service to any nested service no matter what password is used.serviceUuid
- the uuid for the new default service to add. This is not
used for a linking service, which is assigned the ServiceConst
.LINKER
uuid name.serviceType
- the type of service to create.params
- list of constructor parameters - should be password and admin key.adminXml
- the admin info or description of the new service.adminKey
- the admin key for this service.java.lang.Exception
- any error.public final boolean addService(java.lang.String thePassword, java.lang.String serviceName, java.lang.String serviceType, java.util.ArrayList<java.lang.String> jarFile, java.lang.String className, java.util.ArrayList<java.lang.Object> params) throws java.lang.Exception
thePassword
- the password to protect access to this component.serviceName
- the name of the service.serviceType
- the type of the service.jarFile
- the jar files for a remote loading. Values are jar paths
of type String.className
- the name of the service class.params
- a list of initialisation parameters.java.lang.Exception
- any error.public final boolean addService(java.lang.String thePassword, java.lang.String serviceName, java.lang.String serviceType, java.util.ArrayList<java.lang.String> jarFile, java.lang.String className, boolean startService, java.util.ArrayList<java.lang.Object> params) throws java.lang.Exception
thePassword
- the password to protect access to this component.serviceName
- the name of the service.serviceType
- the type of the service.jarFile
- the jar files for a remote loading. Values are jar paths
of type String.className
- the name of the service class.startService
- true if start the service thread or false if do not.params
- a list of initialisation parameters.java.lang.Exception
- any error.public final boolean addService(java.lang.String thePassword, java.lang.String serviceName, java.lang.String serviceType, java.lang.Object theService) throws java.lang.Exception
Service
class. If it is a different object, then it can be accessed through the
wrapper using Java Reflection. Do not start its thread.thePassword
- the password to protect access to this component.serviceName
- the name of the service.serviceType
- the type of the service.theService
- the service to add.java.lang.Exception
- any error.public final boolean addService(java.lang.String thePassword, java.lang.String serviceName, java.lang.String serviceType, java.util.ArrayList<java.lang.String> jarFile, java.lang.Object theService, boolean startService) throws ServiceException, java.lang.Exception
Service
class. If it is a different object, then it can be accessed through the
wrapper using Java Reflection. Do not start its thread.
Also, if it is a Service
, then after it is added and initialised, its finaliseInitialisation
method gets called from this method.
Note services cannot be added to the HttpServer
, apart from the ESB
service that is added only once and with the name of Const
.HTTPSERVER
.thePassword
- the password to protect access to this component.serviceName
- the name of the service.serviceType
- the type of the service.jarFile
- the jar files for a remote loading. Values are jar paths
of type String.theService
- the service to add.startService
- true if start the service thread or false if do not.ServiceException
- if the service should not be added.java.lang.Exception
- any other error.protected ServiceWrapperDef createServiceWrapper(java.lang.Object serviceObj, java.lang.String serviceName, java.lang.String serviceType, java.util.ArrayList<java.lang.String> jarFiles, org.licas_xml.abs.Element adminXml) throws java.lang.Exception
ServiceWrapper
if the object is a licas Service
, or a ServiceWrapperLegacy
if the object is not a licas service. An autonomic manager is not added here, only
at the ESB level.serviceObj
- the service object that is wrapped and managed.serviceName
- the name of the service.serviceType
- the type of the service.jarFiles
- the jar files for a remote loading. Values are jar paths
of type String.adminXml
- the admin document describing the service wrapper.java.lang.Exception
- any error.protected boolean classNameOK(java.lang.String className)
className
- full class name of service to load.public ServiceMeta createMetaFull(java.util.ArrayList<java.lang.String> jarFile, java.lang.String theAdminKey) throws java.lang.Exception
jarFile
- list of remote jar files if loaded remotely.theAdminKey
- the unique service key for admin purposes.java.lang.Exception
- any error.public ServiceMeta createMetaForRepos(java.lang.String theAdminKey) throws java.lang.Exception
theAdminKey
- the unique service key for admin purposes.java.lang.Exception
- any error.public ServiceWrapperDef getService(java.lang.String serviceName, java.lang.String thePassword) throws ServiceException, java.lang.Exception
serviceName
- the name of the service you want to retrieve.thePassword
- the password for the service you want to retrieve.ServiceException
- for service specific error.java.lang.Exception
- any other error.public FrameworkModule getServiceOrWrapper(java.lang.String serviceName, java.lang.String thePassword, java.lang.String adminKey) throws ServiceException, java.lang.Exception
Service
, then the
wrapper is returned. If it is derived from Service, then a direct reference is returned.serviceName
- the name of the service you want to retrieve.thePassword
- the password for the service you want to retrieve.adminKey
- the admin key for the service you want to retrieve.ServiceException
- for service specific error.java.lang.Exception
- any other error.public java.lang.Object getService(java.lang.String serviceName, java.lang.String thePassword, java.lang.String adminKey) throws ServiceException, java.lang.Exception
serviceName
- the name of the service you want to retrieve.thePassword
- the password for the service you want to retrieve.adminKey
- the admin key for the service you want to retrieve.ServiceException
- for service specific error.java.lang.Exception
- any other error.public boolean clearServices(java.lang.String adminKey) throws java.lang.Exception
adminKey
- this service's admin key.java.lang.Exception
- any error.public boolean clearServices(java.util.ArrayList<?> serviceIDs, java.lang.String adminKey) throws java.lang.Exception
serviceIDs
- list of IDs for services to remove. Should be String key or Element path.adminKey
- this service's admin key.java.lang.Exception
- any error.protected void clearServiceLinks(java.util.ArrayList<?> serviceIDs, java.lang.String adminKey) throws java.lang.Exception
serviceIDs
- List of IDs for services to clear. Should be String key or Element path,
Null
for all services.adminKey
- this service's admin key.java.lang.Exception
- any error.protected void removeAllServices(java.lang.String adminKey) throws PasswordException, java.lang.Exception
adminKey
- this service's admin key.PasswordException
- incorrect admin key.java.lang.Exception
- any error.public void removeAllServices(java.util.ArrayList<?> serviceIDs, java.lang.String adminKey) throws PasswordException, java.lang.Exception
serviceIDs
- id list for service passwords to remove. Should be String key or Element path.adminKey
- this service's admin key.PasswordException
- incorrect admin key.java.lang.Exception
- any error.public boolean removeServiceID(java.lang.String serviceUuid, java.lang.String adminKey) throws java.lang.Exception
serviceUuid
- the uuid of the stored service to remove.adminKey
- this service's admin key.java.lang.Exception
- any error.public boolean removeServicePath(org.licas_xml.abs.Element servicePath, java.lang.String adminKey) throws java.lang.Exception
servicePath
- the path to the service.adminKey
- this service's admin key.java.lang.Exception
- any error.public boolean removeServicePath(org.licas_xml.abs.Element servicePath, java.lang.String adminKey, boolean stopThread) throws java.lang.Exception
servicePath
- the path to the service.adminKey
- this service's admin key.stopThread
- true if stop the thread running.java.lang.Exception
- any error.public java.util.ArrayList<java.lang.String> getServiceNames()
public java.util.ArrayList<java.lang.String> getServiceNames(java.util.ArrayList<java.lang.String> thisServiceTypes) throws LicasException
thisServiceTypes
- the service types list.LicasException
- if the service types input is null
.public java.util.ArrayList<java.lang.String> getServiceNames(java.util.ArrayList<java.lang.String> thisServiceTypes, boolean reciprocal) throws LicasException
thisServiceTypes
- the service types list.reciprocal
- is false return all service names of the service types,
if true return all service names of all other types.LicasException
- if the service types input is null
.public java.util.ArrayList<java.lang.String> getServiceTypes()
public java.lang.String getServiceType(java.lang.String serviceName)
serviceName
- the name of the service to look for.public int getServiceNumber(java.lang.String serviceType) throws LicasException
serviceType
- the service type. Can be Const
.ALLSERVICES} for all services.LicasException
- if the service types input is null
.public java.lang.String getPublicServiceClassname(java.lang.String serviceType)
serviceType
- the service type.public java.util.HashMap<java.lang.String,java.lang.String> getServiceClasses(java.lang.String theAdminKey)
theAdminKey
- the unique admin service key of this service.public boolean createPermanentLinkTo(java.lang.String adminKey, java.lang.String serviceTo, java.lang.String servicePassword, org.licas_xml.abs.Element serviceUri) throws LicasException, java.lang.Exception
adminKey
- the unique admin key of this service.serviceTo
- the unique ID of the service to create a link to.servicePassword
- the password to call the other service.serviceUri
- the path to the other service.LicasException
- if the link is to a remote service.java.lang.Exception
- any error.public boolean removePermanentLinkTo(java.lang.String adminKey, java.lang.String serviceTo, java.lang.String servicePassword, org.licas_xml.abs.Element serviceUri) throws java.lang.Exception
adminKey
- the unique admin key of this service.serviceTo
- the unique ID of the service to remove a link to.servicePassword
- the password to call the other service.serviceUri
- the path to the other service.java.lang.Exception
- any error.public void dynamicLinksToPermanent(java.lang.String adminKey) throws java.lang.Exception
adminKey
- the unique admin key of this service.java.lang.Exception
- any error.public boolean hasLinkTo(java.lang.String serviceID)
PermanentLink
only)
to the service with the specified service ID.serviceID
- the ID of the local service to check for a link with.protected boolean addLinkToService(java.lang.String serviceID, java.lang.Object theReference)
serviceID
- a unique id to identify the service.theReference
- the source reference (Object or XML URI).protected void removeLinkToService(java.lang.String serviceID)
removePermanentLinkTo
method.serviceID
- the id of the service being linked to.protected java.util.ArrayList<java.lang.Object> getAllLinkToService()
public java.lang.Object getLinkToService(java.lang.String serviceID)
serviceID
- the id of the service linked to.public boolean addLinkFromService(java.lang.String serviceID, java.lang.Object theReference)
createPermanentLinkTo
method on the remote service creating the link.serviceID
- a unique id to identify the service.theReference
- the source reference (Object or XML URI).public void removeLinkFromService(java.lang.String serviceID)
removePermanentLinkTo
method on the remote service removing the link.serviceID
- the id of the service being linked to.public java.lang.Object getLinkFromService(java.lang.String serviceID)
serviceID
- the id of the service linked to.public org.licas_xml.abs.Element serviceToXml(java.lang.String adminKey) throws java.lang.Exception
ServiceSerialize
class.adminKey
- the service admin key.java.lang.Exception
- any error.public org.licas_xml.abs.Element serviceToXml(java.lang.String adminKey, java.util.ArrayList<java.lang.String> adminToRemove, java.util.ArrayList<java.lang.String> toSerialize) throws java.lang.Exception
ServiceSerialize
class.adminKey
- the service admin key.adminToRemove
- if any section is indicated here through the XML tag name, it is removed first.toSerialize
- list of service-local variable names to serialize.java.lang.Exception
- any error.public static java.lang.Object xmlToService(org.licas_xml.abs.Element serviceXml, java.lang.String password) throws java.lang.Exception
ServiceSerialize
class.serviceXml
- a full XML description of the service.password
- parent password, probably the server currently running. Need to
use this instead of the stored value if a server.Service
, but it
might be a wrapped object.java.lang.Exception
- any error.public org.licas_xml.abs.Element passwordsStateToXml(java.lang.String adminKey) throws java.lang.Exception
PasswordHandler
.{code toXml} or
{code fromXml} to serialize just the passwords.adminKey
- the service admin key.java.lang.Exception
- any error.public org.licas_xml.abs.Element dynamicLinkQuery(LinkQueryConfig queryConfig) throws java.lang.Exception
queryConfig
- the query configuration.java.lang.Exception
- any error.public org.licas_xml.abs.Element linksToXml(java.lang.String adminKey) throws java.lang.Exception
adminKey
- the service admin key.java.lang.Exception
- any error.public org.licas_xml.abs.Element permanentLinksToXml() throws java.lang.Exception
java.lang.Exception
- any error.public org.licas_xml.abs.Element dynamicLinksToXml() throws java.lang.Exception
dynamicLinksToXml(adminKey)
or use LinksParser
locally. Note that a linking service must be added first.java.lang.Exception
- any error.public org.licas_xml.abs.Element dynamicLinksToXml(java.lang.String adminKey) throws java.lang.Exception
adminKey
- the service admin key.java.lang.Exception
- any error.public boolean xmlToDynamicLinks(org.licas_xml.abs.Element linksXml, java.lang.String adminKey) throws java.lang.Exception
linksXml
- a full set of links descriptions for the service.adminKey
- the admin key.java.lang.Exception
- any error.public boolean addServiceAssociation(java.lang.String adminKey, org.licas_xml.abs.Element serviceUri, java.lang.String servicePassword) throws java.lang.Exception
adminKey
- the unique admin key of this service.serviceUri
- the URI of the service to link to, as a Handle Element.servicePassword
- the password for the service being linked to, so that
it can be invoked.java.lang.Exception
- any other error.public void removeServiceAssociation(org.licas_xml.abs.Element serviceUri) throws java.lang.Exception
serviceUri
- the URI of the service to remove the link to, as a Handle
Element.java.lang.Exception
- any other error.public boolean removeAllLinksTo(java.lang.String serviceID, java.lang.String adminKey) throws java.lang.Exception
serviceID
- the id of the service to remove links to.adminKey
- the admin key for the service to change.java.lang.Exception
- any error.protected java.lang.Object getCommunicationClientURI(java.lang.String commID)
commID
- the communication ID.null
if not exists.protected boolean addCommunicationID(java.lang.String commID, java.lang.Object clientURI) throws java.lang.Exception
MessageInfo
objects
with timestamps. The method now also checks the timestamps and removes any
communicationIDs that are older than 3 days.commID
- the communication id.clientURI
- the URI/reference for the calling client. If null
or a server URI,
then it is set to Const
.ANON
and only the commID is subsequently checked for.java.lang.Exception
- any error.protected void removeCommunicationID(java.lang.String communicationID)
communicationID
- the communication ID.public void syncToAsync(MethodInfo methodInfo) throws java.lang.Exception
MethodInfo
description of the
method that you want to call on the service. This gets processed as normal and
if allowed, the method is invoked, but the reply is then saved in a store instead
of being returned. You therefore need to include a unique communicationID
in
the method info, to reference the stored object. After completion, you can call
messageRetrieve
to get and remove the method reply from the store.methodInfo
- full description of the method to invoke. So this is the
parameter to the MethodInfo that is actually executed on the service. It is
then passed through this service's execution process as normal.java.lang.Exception
- any error.public boolean syncToAsyncTransit(java.lang.String replyID)
replyID
- id for the method reply.public MessageInfo syncToAsyncReply(java.lang.String replyID)
replyID
- id for the method reply. Similar to a comm id.public void setIsRemoteCall(boolean thisIsRemoteCall)
thisIsRemoteCall
- true if current call is remote.public boolean getIsRemoteCall()
public java.lang.Object execute(MethodInfo methodInfo, boolean addTempPassword) throws java.lang.Exception
methodInfo
- the method call description with all of the required information.addTempPassword
- if true add a temporary password to allow traversal
through this service. If the service is referenced directly as an object
then set this to false so that the caller must know this service's password.java.lang.Exception
- any error.public boolean interrupt(java.lang.String adminKey)
interrupt
in class ServiceModule
adminKey
- the key to identify unique loading of the service.protected PasswordHandler getPasswordHandler()
getPasswordHandler
in class FrameworkModule
public void setAdminInfo(org.licas_xml.abs.Element adminXml, java.lang.String adminKey) throws java.lang.Exception
adminXml
- the full admin description.adminKey
- the service key for this service.java.lang.Exception
- any error.protected void setServiceGrade(java.lang.String thisServiceGrade)
thisServiceGrade
- the service grade.public java.lang.String getServiceGrade()
public void setServiceState(java.lang.String theServiceState, java.lang.String adminKey)
theServiceState
- the service state.adminKey
- the admin key for this service..public java.lang.String getServiceState(java.lang.String adminKey)
Const
.READY
or 'Ready',
meaning that it is ready for use. Any derived class can change this evaluation
and set it to a value reflecting the current service state.adminKey
- the admin key for this service.public boolean setDescription(org.licas_xml.abs.Element descriptionXml, java.lang.String adminKey) throws java.lang.Exception
descriptionXml
- the description. This is only the service description
and is not the full set of admin info values.adminKey
- the service key for this service.java.lang.Exception
- any error.public org.licas_xml.abs.Element getDescription()
public boolean setOtherMeta(org.licas_xml.abs.Element otherMetaXml, java.lang.String adminKey)
otherMetaXml
- the additional metadata not included as default.adminKey
- the service key for this service.public boolean setData(org.licas_xml.abs.Element dataXml, java.lang.String adminKey) throws java.lang.Exception
Resource
in the DataModule
.dataXml
- the data description to parse.adminKey
- the admin key for the service.java.lang.Exception
- any error.public java.lang.Object getData() throws java.lang.Exception
java.lang.Exception
- any error.public java.lang.Object getData(org.licas_xml.abs.Element dataDescr) throws java.lang.Exception
dataDescr
- a description of the data part that should be retrieved,
but can be null and needs to be implemented in the resource.java.lang.Exception
- any error.public boolean setParent(Service thisParent, java.lang.String adminKey)
thisParent
- the parent component representation.adminKey
- the admin key for this service.protected boolean setParent(Service thisParent)
thisParent
- the parent component representation.public Service getParent(java.lang.String adminKey)
adminKey
- the admin key to access this information.protected Service getParent()
protected java.lang.String getLocalRemoteID(org.licas_xml.abs.Element serviceUri) throws java.lang.Exception
serviceUri
- the full service URI path.java.lang.Exception
- any error.public boolean handshake(org.licas_xml.abs.Element serverURI, java.lang.String serverPassword, java.lang.String serviceID, java.lang.String servicePassword)
serverURI
- uri of remote server to contact.serverPassword
- server password.serviceID
- uuid of service running on the server.servicePassword
- service password.public java.util.ArrayList<java.lang.reflect.Method> reflectionMethods()
protected java.lang.Object reflectionObject(java.lang.reflect.Method method)
method
- reflection description of the method.public java.util.ArrayList<java.lang.String> getPublicMethods()
protected java.util.ArrayList<java.lang.String> getPrivateMethods()
public static java.util.ArrayList<java.lang.String> defaultAdminToRemove()
public void close()
close
in interface java.lang.AutoCloseable