public class ServiceAdmin
extends java.lang.Object
AdminInfo
object. Other information includes details of the child services,
keywords list and service contract. Any related metadata in the server's ServiceRepository
is not automatically updated, but would require an update method call from the service itself.
This object however creates its metadata dynamically upon request and so it should be up
to date, but not automatically synced with the server's.Modifier and Type | Field and Description |
---|---|
protected AdminInfo |
adminInfo
The service admin information
|
protected ContractManager |
contractManager
Stores the contracts for each service level
|
protected KeywordHandler |
keywordHandler
For processing any service-general keyword lists
|
protected Service |
service
The parent service
|
protected java.lang.String |
serviceAdminKey
The admin key of the parent service
|
protected java.util.HashMap<java.lang.String,ServiceInfo> |
services
A list of services that are child services of this one.
|
protected java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> |
serviceTypes
A list of service types that are stored under this service.
|
protected WorkInfo |
workInfo
Type of work protocol for the service - point-to-point, subscribe, or both.
|
Constructor and Description |
---|
ServiceAdmin(Service theService,
java.lang.String theAdminKey,
org.licas_xml.abs.Element adminXml)
Create a new instance of ServiceAdmin.
|
Modifier and Type | Method and Description |
---|---|
void |
clearInstanceValues()
After parsing the instance values, call this to set it to
null . |
protected ServiceMeta |
createFullServiceMeta(java.util.ArrayList<java.lang.String> jarFile,
java.lang.String adminKey)
Create a full metadata description of this service.
|
protected ServiceMeta |
createMetaForRepos()
Create a metadata description of the parent service for the server repository.
|
protected ServiceMeta |
createServiceMeta(java.util.ArrayList<java.lang.String> jarFile,
java.lang.String adminKey)
Create a full metadata description of this service.
|
AdminInfo |
getAdminInfo()
Get the admin info object itself.
|
ContractManager |
getContractManager()
Get the contract manager.
|
org.licas_xml.abs.Element |
getInstanceValues()
Get the script part describing actual variable instance values, if one was included.
|
KeywordHandler |
getKeywordHandler()
Get the keyword handler that processes keywords.
|
protected 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.
|
java.util.HashMap<java.lang.String,java.lang.String> |
getServiceClasses()
Get the class types for all services that are stored.
|
java.util.ArrayList<java.lang.String> |
getServiceNames()
Get all child service or module names.
|
java.util.ArrayList<java.lang.String> |
getServiceNames(java.util.ArrayList<java.lang.String> thisServiceTypes,
boolean reciprocal)
Return all child service or module names for a list of service types.
|
java.util.ArrayList<java.lang.String> |
getServiceNames(java.lang.String serviceType)
Return all child service or module names for the specified service type.
|
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 |
getServiceType(java.lang.String serviceName)
Get the service type for the named service if it exists.
|
java.util.ArrayList<java.lang.String> |
getServiceTypes()
Return all service types for all stored services.
|
protected void |
removeAllServices(java.util.ArrayList<?> serviceIDs,
java.lang.String adminKey)
Remove all child services and modules 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 boolean |
removeService(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 boolean |
removeService(java.lang.String serviceUuid,
java.lang.String adminKey,
boolean stopThread)
Remove the service or module with the indicated ID from the list.
|
protected void |
setAdminInfo(org.licas_xml.abs.Element adminXml)
Set a full admin info description for the service.
|
void |
setWorkInfo(WorkInfo theWorkInfo)
Set the work info description for the message bus.
|
protected java.lang.String serviceAdminKey
protected Service service
protected java.util.HashMap<java.lang.String,ServiceInfo> services
ServiceInfo
objects.protected java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> serviceTypes
protected AdminInfo adminInfo
protected KeywordHandler keywordHandler
protected ContractManager contractManager
protected WorkInfo workInfo
null
, when it is assumed that the service has no additional conditions
and is accessed point-to-point, or by calling its ID only.public ServiceAdmin(Service theService, java.lang.String theAdminKey, org.licas_xml.abs.Element adminXml) throws java.lang.Exception
theService
- the parent service.theAdminKey
- the parent service admin key.adminXml
- the admin xml document. Can be null.java.lang.Exception
- any error.protected ServiceMeta createServiceMeta(java.util.ArrayList<java.lang.String> jarFile, java.lang.String adminKey) throws java.lang.Exception
Service
then create a new one so
that the settings are the most recent.
The description describes only this service and no nested services.jarFile
- list of remote jar files if loaded remotely.adminKey
- the unique service key for admin purposes.java.lang.Exception
- any error.protected ServiceMeta createFullServiceMeta(java.util.ArrayList<java.lang.String> jarFile, java.lang.String adminKey) throws java.lang.Exception
jarFile
- list of remote jar files if loaded remotely.adminKey
- the unique service key for admin purposes.java.lang.Exception
- any error.protected ServiceMeta createMetaForRepos() throws java.lang.Exception
java.lang.Exception
- any error.protected 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.protected void removeAllServices(java.lang.String adminKey) throws PasswordException, java.lang.Exception
adminKey
- the unique key to protect this service.PasswordException
- incorrect admin key.java.lang.Exception
- any other error.protected 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
- the unique key to protect this service.PasswordException
- incorrect admin key.java.lang.Exception
- any other error.protected boolean removeService(java.lang.String serviceUuid, java.lang.String adminKey, boolean stopThread) throws java.lang.Exception
serviceUuid
- the uuid of the child service to remove.adminKey
- the unique key to protect the service.stopThread
- true if stop the thread running.java.lang.Exception
- any error.protected boolean removeService(org.licas_xml.abs.Element servicePath, java.lang.String adminKey, boolean stopThread) throws java.lang.Exception
servicePath
- the path to the service.adminKey
- the unique key to protect the service.stopThread
- true if stop the thread running.java.lang.Exception
- any error.public void setWorkInfo(WorkInfo theWorkInfo)
theWorkInfo
- the work info description.public java.util.ArrayList<java.lang.String> getServiceNames()
public java.util.ArrayList<java.lang.String> getServiceNames(java.lang.String serviceType) throws LicasException
serviceType
- the service type.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
- if 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 java.util.HashMap<java.lang.String,java.lang.String> getServiceClasses()
protected void setAdminInfo(org.licas_xml.abs.Element adminXml) throws java.lang.Exception
adminXml
- the full admin description.java.lang.Exception
- any error.public AdminInfo getAdminInfo()
public ContractManager getContractManager()
public KeywordHandler getKeywordHandler()
public void clearInstanceValues()
null
.public org.licas_xml.abs.Element getInstanceValues()