public class ServiceSerialize
extends java.lang.Object
Constructor and Description |
---|
ServiceSerialize() |
Modifier and Type | Method and Description |
---|---|
org.licas_xml.abs.Element |
allLinksToXml(Service theService,
boolean allLevels,
boolean includeValues)
Return all linked sources in XML format - permanent, dynamic or association.
|
org.licas_xml.abs.Element |
associationLinksToXml(Service theService)
Return all association linked sources in XML format.
|
org.licas_xml.abs.Element |
childServiceMetaToXml(Service theService)
Return a list of child service uuids.
|
org.licas_xml.abs.Element |
dynamicLinkQuery(Service theService,
LinkQueryConfig queryConfig)
Perform a query over the link paths to return matching sources.
|
org.licas_xml.abs.Element |
dynamicLinksToXml(Service theService,
boolean allLevels,
boolean includeValues)
Return all dynamic linked sources in XML format.
|
protected void |
parseSerializeAdmin(Service theService,
java.util.ArrayList<java.lang.String> toSerialize,
java.util.ArrayList<java.lang.String> adminToRemove)
If an admin serialize variables section exists, then retrieve and parse.
|
org.licas_xml.abs.Element |
passwordsPlusStateToXml(Service theService)
Serialize the stored passwords list and return as an XML-based description.
|
org.licas_xml.abs.Element |
permanentLinksToXml(Service theService)
Return all permanent linked sources in XML format.
|
protected org.licas_xml.abs.Element |
serviceToXml(Service theService)
Serialize the service admin info and return as an XML-based description.
|
protected org.licas_xml.abs.Element |
serviceToXml(Service theService,
java.util.ArrayList<java.lang.String> adminToRemove,
java.util.ArrayList<java.lang.String> toSerialize)
Serialize the full service admin info, minus
adminToRemove and return as an XML-based description. |
protected void |
xmlToDynamicLinks(Service theService,
org.licas_xml.abs.Element linksXml)
Parse the dynamic links descriptions and add to the service.
|
protected java.lang.Object |
xmlToService(org.licas_xml.abs.Element serviceXml,
java.lang.String password)
Read the contents of the admin document and re-create the service from it.
|
protected org.licas_xml.abs.Element serviceToXml(Service theService) throws java.lang.Exception
theService
- the service to serialize.java.lang.Exception
- any error.protected org.licas_xml.abs.Element serviceToXml(Service theService, java.util.ArrayList<java.lang.String> adminToRemove, java.util.ArrayList<java.lang.String> toSerialize) throws java.lang.Exception
adminToRemove
and return as an XML-based description.
This will create a full admin description and then remove the elements specified
in the adminToRemove list. An empty list will serialize everything and therefore is less safe.
As well as this, local Service variables such as passwords, or comm IDs are serialized.
An additional list specified other service-local variables to serialize and store.theService
- the service to serialize.adminToRemove
- if any section is indicated here through the XML tag name, it is removed first.toSerialize
- list of variable names to serialize.java.lang.Exception
- any error.protected void parseSerializeAdmin(Service theService, java.util.ArrayList<java.lang.String> toSerialize, java.util.ArrayList<java.lang.String> adminToRemove)
theService
- the service to serialize.toSerialize
- to list the local variables to serialize. This must be
an empty initialised list, to be added to.adminToRemove
- to list the admin variables to remove. This must be
an empty initialised list, to be added to.protected java.lang.Object xmlToService(org.licas_xml.abs.Element serviceXml, java.lang.String password) throws java.lang.Exception
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 childServiceMetaToXml(Service theService)
theService
- the parent service.public org.licas_xml.abs.Element dynamicLinkQuery(Service theService, LinkQueryConfig queryConfig) throws java.lang.Exception
theService
- the parent service.queryConfig
- the query configuration.java.lang.Exception
- any error.public org.licas_xml.abs.Element allLinksToXml(Service theService, boolean allLevels, boolean includeValues) throws java.lang.Exception
theService
- the parent service.allLevels
- if true, return all 3 levels, if false only return the top link level
references.includeValues
- if false, return just the path and source info.
If true, include other values as well.java.lang.Exception
- any error.public org.licas_xml.abs.Element permanentLinksToXml(Service theService) throws java.lang.Exception
theService
- the parent service.java.lang.Exception
- any error.public org.licas_xml.abs.Element associationLinksToXml(Service theService) throws java.lang.Exception
theService
- the parent service.java.lang.Exception
- any error.public org.licas_xml.abs.Element dynamicLinksToXml(Service theService, boolean allLevels, boolean includeValues) throws java.lang.Exception
theService
- the parent service.allLevels
- if true, return all 3 levels, if false only return the top link level
references.includeValues
- if false, return just the path and source info.
If true, include other values as well.java.lang.Exception
- any error.protected void xmlToDynamicLinks(Service theService, org.licas_xml.abs.Element linksXml) throws java.lang.Exception
theService
- the parent service.linksXml
- a full set of dynamic links descriptions for the service.java.lang.Exception
- any error.public org.licas_xml.abs.Element passwordsPlusStateToXml(Service theService) throws java.lang.Exception
theService
- the service to parse.java.lang.Exception
- any error.