edu.UCL.xmiddle.framework.appRegistry
Interface AccessPolicy

All Known Implementing Classes:
XMLAccessPolicy

public interface AccessPolicy

AccessPolicy.java AccessPolicy represents the access policy that an application's data tree has and it defines an interface for allowing an application to get, set or change the access policy that an element in its document has. The implementation must not allow changing the policy for an element which does not belong to the local application. Created: Thu Jul 19 14:38:26 2001


Field Summary
static short DENY
          No access at all to this element
static short FULL
          Full access: The host can read and write the data, and share it with other hosts (giving them any sort of access)
static short READ
          Only read access is allowed
static short READ_SHARE
          The given host can read the data and further share it with other hosts (giving them read access only)
static short WRITE
          Read and write access is allowed
 
Method Summary
 short getPolicy(org.w3c.dom.Element element, java.lang.Object primaryID)
          gets the policy for the given element and host
 boolean setPolicy(org.w3c.dom.Element element, short access, java.lang.Object hosts)
          Sets a policy for the specific element
 java.lang.String toString()
          Returns a String representation of the access policy for transfering over the network
 

Field Detail

DENY

public static final short DENY
No access at all to this element

See Also:
Constant Field Values

READ

public static final short READ
Only read access is allowed

See Also:
Constant Field Values

WRITE

public static final short WRITE
Read and write access is allowed

See Also:
Constant Field Values

READ_SHARE

public static final short READ_SHARE
The given host can read the data and further share it with other hosts (giving them read access only)

See Also:
Constant Field Values

FULL

public static final short FULL
Full access: The host can read and write the data, and share it with other hosts (giving them any sort of access)

See Also:
Constant Field Values
Method Detail

setPolicy

public boolean setPolicy(org.w3c.dom.Element element,
                         short access,
                         java.lang.Object hosts)
Sets a policy for the specific element

Parameters:
element - the element for which the policy is set
access - The access that is given to this element
hosts - the remote hosts for which this policy holds
Returns:
a TRUE if the method succeeded (i.e. the element is local) or FALSE otherwise

getPolicy

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

Parameters:
element - The element for which the policy is requested
primaryID - The primaryID of the host for which the policy requested is set
Returns:
the policy given

toString

public java.lang.String toString()
Returns a String representation of the access policy for transfering over the network

Overrides:
toString in class java.lang.Object
Returns:
a String value