edu.UCL.xmiddle.framework.host
Interface LinkTable

All Known Implementing Classes:
XPathLinkTable

public interface LinkTable

LinkTable.java LinkTable provides a mechanism to manipulate the exports, linked by, and linked from tables that a host has. The exports table is a list of all nodes which are currently exported by the host. the linked by table contains tuples of all hosts linking information belonging to this host, along with the element that they are sharing (encoded as an xpath expression). The linked from table contains a list of tuples of remote hosts, application ID's and elements (again, encoded as xpath expressions) of elements which the local host is linking from. Each Host, including the LocalHost is expected to have a LinkTable. Created: Fri Jul 20 15:38:21 2001


Method Summary
 void addExport(org.w3c.dom.Element element, java.lang.Integer appID)
          Denotes that the given element is available for linking.
 void addExport(java.lang.String path, java.lang.Integer appID)
          Denotes that the given element is available for linking.
 void addLinkedBy(java.lang.Object primaryID, org.w3c.dom.Element element, java.lang.Integer localAppID)
          Adds another entry to the linked by table (a host has linked to an element)
 void addLinkedBy(java.lang.Object primaryID, java.lang.String path, java.lang.Integer localAppID)
          Add another entry to the linked By table (a host has linked to an element)
 void addLinkedFrom(java.lang.Object primaryID, java.lang.String src, org.w3c.dom.Element dest, java.lang.Integer remoteAppID, java.lang.Integer localAppID)
          Adds another entry to the linked from table (the local host has linked to a remote element)
 void addLinkedFrom(java.lang.Object primaryID, java.lang.String src, java.lang.String dest, java.lang.Integer remoteAppID, java.lang.Integer localAppID)
          Adds another entry to the linked from table (the local host has linked to a remote element)
 java.util.Enumeration getExportsList()
          Returns the exports table.
 java.util.Enumeration getLinkedByHostList(java.lang.Object primaryID)
          Returns data on all elements linked by the given host
 java.util.Enumeration getLinkedByList()
          Returns the linked by table.
 java.util.Enumeration getLinkedFromHostList(java.lang.Object primaryID)
          Returns data on all elements linked from the given host
 java.util.Enumeration getLinkedFromList()
          Returns the linked from table
 java.lang.String getLinkTableMessage()
          Gets a textual description of the linktable to be sent over the network.
 boolean isExported(org.w3c.dom.Element element, java.lang.Integer appID)
          Returns true if the given element is being exported
 boolean isExported(java.lang.String path, java.lang.Integer appID)
          Returns true if the given element is being exported
 boolean isLinkedBy(org.w3c.dom.Element element, java.lang.Integer appID)
          Returns true if the given local element is linked by another host
 boolean isLinkedBy(java.lang.Object primaryID, org.w3c.dom.Element element, java.lang.Integer appID)
          Returns true if the given local element is linked the given host.
 boolean isLinkedBy(java.lang.Object primaryID, java.lang.String path, java.lang.Integer appID)
          Returns true if the given local element is linked by the given host
 boolean isLinkedBy(java.lang.String path, java.lang.Integer appID)
          Returns true if the given local element is linked by another host
 boolean isLinkedFrom(org.w3c.dom.Element element, java.lang.Integer appID)
          Returns true if the given element is linked from a remote host
 boolean isLinkedFrom(java.lang.Object primaryID, org.w3c.dom.Element element, java.lang.Integer appID)
          Returns true if the given element is linked from the given host
 boolean isLinkedFrom(java.lang.Object primaryID, java.lang.String element, java.lang.Integer appID)
          Returns true if the given element is linked from the given host
 boolean isLinkedFrom(java.lang.String element, java.lang.Integer appID)
          Returns true if the given element is linked from a remote host
 boolean isShared(org.w3c.dom.Element element, java.lang.Integer appID)
          Returns true if the given element is either linked by someone, or linked from someone
 boolean isShared(java.lang.String element, java.lang.Integer appID)
          Returns true if the given element is either linked by someone, or linked from someone
 void removeExport(org.w3c.dom.Element element, java.lang.Integer appID)
          Denotes that the given element is no longer available for linking
 void removeExport(java.lang.String path, java.lang.Integer appID)
          Denotes that the given element is no longer available for linking
 void removeLinkedBy(java.lang.Object primaryID, org.w3c.dom.Element element, java.lang.Integer localAppID)
          Remove an entry from the linked By table (a host has stopped linking to an element)
 void removeLinkedBy(java.lang.Object primaryID, java.lang.String path, java.lang.Integer localAppID)
          Remove an entry from the linked By table (a host has stopped linking to an element)
 void removeLinkedFrom(org.w3c.dom.Element localElement, java.lang.Integer localAppID)
          Removes an entry from the linked From table (i.e.
 void setLinks(java.lang.Object links)
          Provides a quick way for giving the LinkTable new data.
 

Method Detail

getExportsList

public java.util.Enumeration getExportsList()
Returns the exports table.

Returns:
the exports table, encoded as an enumeration (the object types that the enumeration contains are left up to the implementor)

getLinkedByList

public java.util.Enumeration getLinkedByList()
Returns the linked by table.

Returns:
the linked by table, encoded as an enumeration (the object types that the enumeration contains are left up to the implementor)

getLinkedFromList

public java.util.Enumeration getLinkedFromList()
Returns the linked from table

Returns:
the linked from table, encoded as an enumeration (the object types that the enumeration contains are left up to the implementor)

getLinkedFromHostList

public java.util.Enumeration getLinkedFromHostList(java.lang.Object primaryID)
Returns data on all elements linked from the given host

Parameters:
primaryID - The primaryID of the host being checked
Returns:
Enumeration of the data for each linked element, or null if none. The contents of the Enumeration are left to the implementor

getLinkedByHostList

public java.util.Enumeration getLinkedByHostList(java.lang.Object primaryID)
Returns data on all elements linked by the given host

Parameters:
primaryID - The primaryID of the host being checked
Returns:
Enumeration of the data for each linked element, or null if none. The contents of the Enumeration are left to the implementor

setLinks

public void setLinks(java.lang.Object links)
Provides a quick way for giving the LinkTable new data.

Parameters:
links - The new data to be given to the LinkTable. The encoding of which is left to the implementor.

addExport

public void addExport(java.lang.String path,
                      java.lang.Integer appID)
Denotes that the given element is available for linking.

Parameters:
path - The element encoded as an xpath expression.
appID - The id of the application that owns that element

addExport

public void addExport(org.w3c.dom.Element element,
                      java.lang.Integer appID)
Denotes that the given element is available for linking.

Parameters:
element - The element
appID - The ID of the application that owns the element.

removeExport

public void removeExport(org.w3c.dom.Element element,
                         java.lang.Integer appID)
Denotes that the given element is no longer available for linking

Parameters:
element - The Element
appID - The ID of the application that owns the element

removeExport

public void removeExport(java.lang.String path,
                         java.lang.Integer appID)
Denotes that the given element is no longer available for linking

Parameters:
path - a The element encoded as an XPath expression
appID - The ID of the application that owns that element

addLinkedBy

public void addLinkedBy(java.lang.Object primaryID,
                        java.lang.String path,
                        java.lang.Integer localAppID)
Add another entry to the linked By table (a host has linked to an element)

Parameters:
primaryID - the primary ID of the host which linked to the element
path - The element (encoded as an XPath expression) to which it linked
localAppID - The ID of the application to which the element belongs

addLinkedBy

public void addLinkedBy(java.lang.Object primaryID,
                        org.w3c.dom.Element element,
                        java.lang.Integer localAppID)
Adds another entry to the linked by table (a host has linked to an element)

Parameters:
primaryID - The primary ID of the host which linked to the element
element - The element to which it linked
localAppID - The ID of the application to which the element belongs

removeLinkedBy

public void removeLinkedBy(java.lang.Object primaryID,
                           java.lang.String path,
                           java.lang.Integer localAppID)
Remove an entry from the linked By table (a host has stopped linking to an element)

Parameters:
primaryID - The primary ID of the remote host
path - The element (encoded as an xpath expression) to which the remote host stopped linking.
localAppID - The ID of the local application to which the element belonged

removeLinkedBy

public void removeLinkedBy(java.lang.Object primaryID,
                           org.w3c.dom.Element element,
                           java.lang.Integer localAppID)
Remove an entry from the linked By table (a host has stopped linking to an element)

Parameters:
primaryID - The primary ID of the remote host
element - The element to which the remote host stopped linking
localAppID - The ID of the local application to which the element belonged

addLinkedFrom

public void addLinkedFrom(java.lang.Object primaryID,
                          java.lang.String src,
                          org.w3c.dom.Element dest,
                          java.lang.Integer remoteAppID,
                          java.lang.Integer localAppID)
Adds another entry to the linked from table (the local host has linked to a remote element)

Parameters:
primaryID - The primary ID of the remote host
src - the remote element encoded as an xpath expression
dest - the Local element under which the remote element will be linked
remoteAppID - The ID of the remote application exporting the element src
localAppID - The ID of the local application linking to the remote element

addLinkedFrom

public void addLinkedFrom(java.lang.Object primaryID,
                          java.lang.String src,
                          java.lang.String dest,
                          java.lang.Integer remoteAppID,
                          java.lang.Integer localAppID)
Adds another entry to the linked from table (the local host has linked to a remote element)

Parameters:
primaryID - The primary ID of the remote host
src - the remote element encoded as an xpath expression
dest - the Local element under which the remote element will be linked (encoded as an XPath expression)
remoteAppID - The ID of the remote application exporting the element src
localAppID - The ID of the local application linking to the remote element

removeLinkedFrom

public void removeLinkedFrom(org.w3c.dom.Element localElement,
                             java.lang.Integer localAppID)
Removes an entry from the linked From table (i.e. the local host has stopped linking to an element)

Parameters:
localElement - the local element
localAppID - the ID of the application to which the element belongs

isLinkedBy

public boolean isLinkedBy(java.lang.String path,
                          java.lang.Integer appID)
Returns true if the given local element is linked by another host

Parameters:
path - The element encoded as an xpath expression
appID - The ID of the application to which this element belongs
Returns:
True if the element is being linked by another host or false otherwise

isLinkedBy

public boolean isLinkedBy(org.w3c.dom.Element element,
                          java.lang.Integer appID)
Returns true if the given local element is linked by another host

Parameters:
element - The element
appID - The ID of the application to which this element belongs
Returns:
True if the element is being linked by another host or false otherwise

isLinkedBy

public boolean isLinkedBy(java.lang.Object primaryID,
                          java.lang.String path,
                          java.lang.Integer appID)
Returns true if the given local element is linked by the given host

Parameters:
primaryID - The primary ID of the remote host
path - The element encoded as an xpath expression
appID - The ID of the application to which this element belongs
Returns:
True if the element is being linked by the host or false otherwise

isLinkedBy

public boolean isLinkedBy(java.lang.Object primaryID,
                          org.w3c.dom.Element element,
                          java.lang.Integer appID)
Returns true if the given local element is linked the given host.

Parameters:
primaryID - the primary ID of the remote host
element - The element
appID - The ID of the application to which this element belongs
Returns:
True if the element is being linked by the host or false otherwise

isExported

public boolean isExported(java.lang.String path,
                          java.lang.Integer appID)
Returns true if the given element is being exported

Parameters:
path - The element encoded as an xpath expression
appID - The ID of the application to which the element belongs
Returns:
True if the element is exported, false otherwise

isExported

public boolean isExported(org.w3c.dom.Element element,
                          java.lang.Integer appID)
Returns true if the given element is being exported

Parameters:
element - The element
appID - The ID of the application to which the element belongs
Returns:
True if the element is exported, false otherwise

isLinkedFrom

public boolean isLinkedFrom(java.lang.Object primaryID,
                            org.w3c.dom.Element element,
                            java.lang.Integer appID)
Returns true if the given element is linked from the given host

Parameters:
primaryID - The primary ID of the remote host
element - The element
appID - The ID of the local application to which this element belongs
Returns:
True if the given element is linked from the given host or false otherwise.

isLinkedFrom

public boolean isLinkedFrom(java.lang.Object primaryID,
                            java.lang.String element,
                            java.lang.Integer appID)
Returns true if the given element is linked from the given host

Parameters:
primaryID - The primary ID of the remote host
element - The element, encoded as an xpath expression
appID - The ID of the local application to which this element belongs
Returns:
True if the given element is linked from the given host or false otherwise.

isLinkedFrom

public boolean isLinkedFrom(org.w3c.dom.Element element,
                            java.lang.Integer appID)
Returns true if the given element is linked from a remote host

Parameters:
element - The element
appID - The ID of the local application to which this element belongs
Returns:
True if the given element is linked from a remote host

isLinkedFrom

public boolean isLinkedFrom(java.lang.String element,
                            java.lang.Integer appID)
Returns true if the given element is linked from a remote host

Parameters:
element - The element, encoded as an xpath expression
appID - The ID of the local application to which this element belongs
Returns:
True if the given element is linked from a remote host

isShared

public boolean isShared(org.w3c.dom.Element element,
                        java.lang.Integer appID)
Returns true if the given element is either linked by someone, or linked from someone

Parameters:
element - The element
appID - The ID of the application to which this element belongs
Returns:
True if the given element is shared or false otherwise

isShared

public boolean isShared(java.lang.String element,
                        java.lang.Integer appID)
Returns true if the given element is either linked by someone, or linked from someone

Parameters:
element - The element, encoded as an xpath expression
appID - The ID of the application to which this element belongs
Returns:
True if the given element is shared or false otherwise

getLinkTableMessage

public java.lang.String getLinkTableMessage()
Gets a textual description of the linktable to be sent over the network.

Returns:
The textual description of the linktable