public class ServiceHandler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object |
syncOn
To synchronize this service internally on
|
Constructor and Description |
---|
ServiceHandler()
Creates a new instance of ServiceHandler.
|
Modifier and Type | Method and Description |
---|---|
static ServiceMeta |
createMetaForRepos(java.lang.String theAdminKey,
Service service)
Create a metadata description of this service for the server repository.
|
static ServiceMeta |
createMetaFull(java.util.ArrayList<java.lang.String> jarFile,
java.lang.String theAdminKey,
Service service)
Create a full metadata description of this service.
|
static org.licas_xml.abs.Element |
dynamicLinkQuery(LinkQueryConfig queryConfig,
Service s)
Perform a query over the link paths to return matching sources.
|
static org.licas_xml.abs.Element |
dynamicLinksToXml(Service s)
Return all linked sources in XML format.
|
static org.licas_xml.abs.Element |
dynamicLinksToXml(java.lang.String adminKey,
Service s)
Return all linked sources in XML format, including all link levels and the
source weight values.
|
static org.licas_xml.abs.Element |
linksToXml(java.lang.String adminKey,
Service s)
Return all linked references in XML format.
|
static org.licas_xml.abs.Element |
passwordsStateToXml(java.lang.String adminKey,
Service toSerialize)
Serialize the stored passwords list and the service state, and return as an
XML-based description.
|
static org.licas_xml.abs.Element |
permanentLinksToXml(Service s)
Return all permanent linked-t0 services in XML format.
|
static org.licas_xml.abs.Element |
serviceToXml(java.lang.String adminKey,
java.util.ArrayList<java.lang.String> adminToRemove,
java.util.ArrayList<java.lang.String> partsToKeep,
Service toSerialize)
Serialize the service using the
ServiceSerialize class. |
static org.licas_xml.abs.Element |
serviceToXml(java.lang.String adminKey,
Service service)
Serialize the service using the
ServiceSerialize class. |
static boolean |
xmlToDynamicLinks(org.licas_xml.abs.Element linksXml,
java.lang.String adminKey,
Service s)
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. |
public static ServiceMeta createMetaFull(java.util.ArrayList<java.lang.String> jarFile, java.lang.String theAdminKey, Service service) throws java.lang.Exception
jarFile
- list of remote jar files if loaded remotely.theAdminKey
- the unique service key for admin purposes.service
- the service the operation is for.java.lang.Exception
- any error.public static ServiceMeta createMetaForRepos(java.lang.String theAdminKey, Service service) throws java.lang.Exception
theAdminKey
- the unique service key for admin purposes.service
- the service the operation is for.java.lang.Exception
- any error.public static org.licas_xml.abs.Element serviceToXml(java.lang.String adminKey, Service service) throws java.lang.Exception
ServiceSerialize
class.adminKey
- the service admin key.service
- the service the operation is for.java.lang.Exception
- any error.public static org.licas_xml.abs.Element serviceToXml(java.lang.String adminKey, java.util.ArrayList<java.lang.String> adminToRemove, java.util.ArrayList<java.lang.String> partsToKeep, Service 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.partsToKeep
- list of service-local variable names to serialize.toSerialize
- the service that is being serialized.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 static org.licas_xml.abs.Element passwordsStateToXml(java.lang.String adminKey, Service toSerialize) throws java.lang.Exception
PasswordHandler
.{code toXml} or
{code fromXml} to serialize just the passwords.adminKey
- the service admin key.toSerialize
- the service being serialized.java.lang.Exception
- any error.public static org.licas_xml.abs.Element dynamicLinkQuery(LinkQueryConfig queryConfig, Service s) throws java.lang.Exception
queryConfig
- the query configuration.s
- the service the operation is for.java.lang.Exception
- any error.public static org.licas_xml.abs.Element linksToXml(java.lang.String adminKey, Service s) throws java.lang.Exception
adminKey
- the service admin key.s
- the service the operation is for.java.lang.Exception
- any error.public static org.licas_xml.abs.Element permanentLinksToXml(Service s) throws java.lang.Exception
s
- the service the operation is for.java.lang.Exception
- any error.public static org.licas_xml.abs.Element dynamicLinksToXml(Service s) throws java.lang.Exception
dynamicLinksToXml(adminKey)
or use LinksParser
locally. Note that a linking service must be added first.s
- the service the operation is for.java.lang.Exception
- any error.public static org.licas_xml.abs.Element dynamicLinksToXml(java.lang.String adminKey, Service s) throws java.lang.Exception
adminKey
- the service admin key.s
- the service the operation is for.java.lang.Exception
- any error.public static boolean xmlToDynamicLinks(org.licas_xml.abs.Element linksXml, java.lang.String adminKey, Service s) throws java.lang.Exception
linksXml
- a full set of links descriptions for the service.adminKey
- the admin key.s
- the service the operation is for.java.lang.Exception
- any error.