edu.UCL.xmiddle.appRegistry
Class XMLAccessPolicy

java.lang.Object
  |
  +--edu.UCL.xmiddle.appRegistry.XMLAccessPolicy
All Implemented Interfaces:
AccessPolicy

public class XMLAccessPolicy
extends java.lang.Object
implements AccessPolicy

XMLAccessPolicy.java AccessPolicy API. This is used to change the access rights to a Document. It dissallows changing access to elements that we do not know. Created: Thu Jul 26 13:16:37 2001


Field Summary
 
Fields inherited from interface edu.UCL.xmiddle.framework.appRegistry.AccessPolicy
DENY, FULL, READ, READ_SHARE, WRITE
 
Constructor Summary
XMLAccessPolicy(org.w3c.dom.Document document, java.lang.Object appID)
          Creates a new XMLAccessPolicy instance.
 
Method Summary
 short getPolicy(org.w3c.dom.Element element, java.lang.Object primaryID)
          Returns the policy set for the given element and the given host
static void setLinkTable(LinkTable links)
          Gives a reference to the local LinkTable This is used to find out if an element is local or not
 boolean setPolicy(org.w3c.dom.Element element, short policy, java.lang.Object primaryID)
          Sets the policy for the given element, for the given host.
 java.lang.String toString()
          Returns the access policy data as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLAccessPolicy

public XMLAccessPolicy(org.w3c.dom.Document document,
                       java.lang.Object appID)
Creates a new XMLAccessPolicy instance.

Parameters:
document - The initial policy document
appID - The id of the application that owns this policy
Method Detail

toString

public java.lang.String toString()
Returns the access policy data as a String. Simply walks through the tree printing all nodes, and returns the result as a String

Specified by:
toString in interface AccessPolicy
Overrides:
toString in class java.lang.Object
Returns:

getPolicy

public short getPolicy(org.w3c.dom.Element element,
                       java.lang.Object primaryID)
Returns the policy set for the given element and the given host

Specified by:
getPolicy in interface AccessPolicy
Parameters:
element - The element for which we're searching the policy
primaryID - The primary ID of the host for which the policy is requested. This is expected to be a string.
Returns:
The policy

setPolicy

public boolean setPolicy(org.w3c.dom.Element element,
                         short policy,
                         java.lang.Object primaryID)
Sets the policy for the given element, for the given host. It will be denied if the local host does not own the given element

Specified by:
setPolicy in interface AccessPolicy
Parameters:
element - The element for which we wish to set a policy
policy - The actual policy
primaryID - The primaryID of the host for which we wish to set this policy. This is expected to be a String
Returns:
TRUE if the operation succeeded or false otherwise (for exmample the element does not belong to the local host)

setLinkTable

public static void setLinkTable(LinkTable links)
Gives a reference to the local LinkTable This is used to find out if an element is local or not

Parameters:
links - a LinkTable value