public class ServiceLinks
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.ArrayList<java.lang.String> |
childServices
The child service ids.
|
protected PasswordHandler |
passwordHandler
The parent service's password handler
|
protected PermanentLink |
permanentLinks
This stores references to other local services that are permanently linked
to this one.
|
protected java.util.HashMap<java.lang.String,java.lang.Object> |
serviceAssociations
This stores references to other, probably remote, services that
this service knows about.
|
protected org.licas_xml.abs.Element |
serviceRef
The parent service reference
|
protected java.lang.String |
uuid
This is the ID of the parent component
|
Constructor and Description |
---|
ServiceLinks(java.lang.String theUuid,
org.licas_xml.abs.Element theServiceRef,
PasswordHandler ph)
Create a new instance of ServiceLinks.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addChildService(java.lang.String serviceID)
Add the service id as a nested child 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 boolean |
addServiceAssociation(java.lang.String serviceKey,
java.lang.Object servicePath)
Add a new uri for a link to a (probably remote) service.
|
protected void |
clearLinks(java.util.ArrayList<?> serviceIDs,
java.lang.String adminKey)
Reset the linking structures, by removing links for the specified services.
|
protected void |
clearLinks(java.lang.String adminKey)
Reset the linking structures.
|
boolean |
createPermanentLinkTo(java.lang.String serviceTo,
java.lang.String servicePassword,
org.licas_xml.abs.Element servicePath)
Create a permanent link from this service to another service.
|
protected java.util.ArrayList<java.lang.Object> |
getAllLinkToService()
Get all source references for a links to another service.
|
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.
|
PermanentLink |
getPermanentLinks()
Get the list of permanent links.
|
java.util.ArrayList<org.licas_xml.abs.Element> |
getServiceAssociations()
Get the list of (probably remote) service links to other known about services.
|
void |
removeChildService(java.lang.String serviceID)
Remove the child service id from the metadata.
|
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 serviceTo,
java.lang.String servicePassword,
org.licas_xml.abs.Element servicePath)
Remove a permanent link from this service to another service.
|
protected void |
removeServiceAssociation(java.lang.String serviceKey)
Remove a uri for a link to a (probably remote) service association.
|
protected java.lang.String uuid
protected org.licas_xml.abs.Element serviceRef
protected PasswordHandler passwordHandler
public java.util.ArrayList<java.lang.String> childServices
protected PermanentLink permanentLinks
protected java.util.HashMap<java.lang.String,java.lang.Object> serviceAssociations
public ServiceLinks(java.lang.String theUuid, org.licas_xml.abs.Element theServiceRef, PasswordHandler ph)
theUuid
- the uuid of the parent service.theServiceRef
- the parent service reference.ph
- the parent service password handler.protected void clearLinks(java.lang.String adminKey)
adminKey
- the parent service's admin key to allow access.protected void clearLinks(java.util.ArrayList<?> serviceIDs, java.lang.String adminKey) throws java.lang.Exception
serviceIDs
- list of services to remove linking info for.adminKey
- the parent service's admin key to allow access.java.lang.Exception
- any error.protected boolean addServiceAssociation(java.lang.String serviceKey, java.lang.Object servicePath) throws java.lang.Exception
serviceKey
- the key value that the service association is stored under.servicePath
- the service association reference. It might not contain the key value.java.lang.Exception
- any other error.protected void removeServiceAssociation(java.lang.String serviceKey) throws java.lang.Exception
serviceKey
- the key value that the service association is stored under.java.lang.Exception
- any other error.public java.util.ArrayList<org.licas_xml.abs.Element> getServiceAssociations() throws java.lang.Exception
java.lang.Exception
- any error.public boolean createPermanentLinkTo(java.lang.String serviceTo, java.lang.String servicePassword, org.licas_xml.abs.Element servicePath) throws java.lang.Exception
serviceTo
- the unique ID of the service to create a link to.servicePassword
- the password to call the other service.servicePath
- the path to the other service.java.lang.Exception
- any error.public boolean removePermanentLinkTo(java.lang.String serviceTo, java.lang.String servicePassword, org.licas_xml.abs.Element servicePath) throws java.lang.Exception
serviceTo
- the unique ID of the service to remove a link to.servicePassword
- the password to call the other service.servicePath
- the path to the other service.java.lang.Exception
- any error.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 PermanentLink getPermanentLinks()
public boolean addChildService(java.lang.String serviceID)
serviceID
- the service id for a nested child service.public void removeChildService(java.lang.String serviceID)
serviceID
- the service id to remove.