org.dvb.io.persistent
Class FileAccessPermissions

java.lang.Object
  extended by org.dvb.io.persistent.FileAccessPermissions

public class FileAccessPermissions
extends java.lang.Object

This class encapsulates file access permissions, world, Organisation and owner. World means all applications authorised to access persistent storage. Owner means the application which created the file. Organisation is defined as applications with the same organisation id as defined elsewhere in the present document.


Constructor Summary
FileAccessPermissions(boolean readWorldAccessRight, boolean writeWorldAccessRight, boolean readOrganisationAccessRight, boolean writeOrganisationAccessRight, boolean readApplicationAccessRight, boolean writeApplicationAccessRight)
          This constructor encodes all the file access permissions as a set of booleans.
 
Method Summary
 boolean hasReadApplicationAccessRight()
          Query whether this permission includes read access for the owning application
 boolean hasReadOrganisationAccessRight()
          Query whether this permission includes read access for the organisation
 boolean hasReadWorldAccessRight()
          Query whether this permission includes read access for the world.
 boolean hasWriteApplicationAccessRight()
          Query whether this permission includes write access for the owning application
 boolean hasWriteOrganisationAccessRight()
          Query whether this permission includes write access for the organisation
 boolean hasWriteWorldAccessRight()
          Query whether this permission includes write access for the world.
 void setPermissions(boolean ReadWorldAccessRight, boolean WriteWorldAccessRight, boolean ReadOrganisationAccessRight, boolean WriteOrganisationAccessRight, boolean ReadApplicationAccessRight, boolean WriteApplicationAccessRight)
          This method allows to modify the permissions on this instance of the FileAccessPermission class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileAccessPermissions

public FileAccessPermissions(boolean readWorldAccessRight,
                             boolean writeWorldAccessRight,
                             boolean readOrganisationAccessRight,
                             boolean writeOrganisationAccessRight,
                             boolean readApplicationAccessRight,
                             boolean writeApplicationAccessRight)
This constructor encodes all the file access permissions as a set of booleans.

Parameters:
readWorldAccessRight - read access for all applications
writeWorldAccessRight - write access for all applications
readOrganisationAccessRight - read access for organisation
writeOrganisationAccessRight - write access for organisation
readApplicationAccessRight - read access for the owner
writeApplicationAccessRight - write access for the owner
Method Detail

hasReadWorldAccessRight

public boolean hasReadWorldAccessRight()
Query whether this permission includes read access for the world.

Returns:
true if all applications can have read access, otherwise false.

hasWriteWorldAccessRight

public boolean hasWriteWorldAccessRight()
Query whether this permission includes write access for the world.

Returns:
true if all applications can have write access, otherwise false.

hasReadOrganisationAccessRight

public boolean hasReadOrganisationAccessRight()
Query whether this permission includes read access for the organisation

Returns:
true if applications in this organisation can have read access, otherwise false.

hasWriteOrganisationAccessRight

public boolean hasWriteOrganisationAccessRight()
Query whether this permission includes write access for the organisation

Returns:
true if applications in this organisation can have read access, otherwise false.

hasReadApplicationAccessRight

public boolean hasReadApplicationAccessRight()
Query whether this permission includes read access for the owning application

Returns:
true if the owning application can have read access, otherwise false.

hasWriteApplicationAccessRight

public boolean hasWriteApplicationAccessRight()
Query whether this permission includes write access for the owning application

Returns:
true if the owning application can have write access, otherwise false.

setPermissions

public void setPermissions(boolean ReadWorldAccessRight,
                           boolean WriteWorldAccessRight,
                           boolean ReadOrganisationAccessRight,
                           boolean WriteOrganisationAccessRight,
                           boolean ReadApplicationAccessRight,
                           boolean WriteApplicationAccessRight)
This method allows to modify the permissions on this instance of the FileAccessPermission class.

Parameters:
ReadWorldAccessRight - read access for all applications
WriteWorldAccessRight - write access for all applications
ReadOrganisationAccessRight - read access for organisation
WriteOrganisationAccessRight - write access for organisation
ReadApplicationAccessRight - read access for the owner
WriteApplicationAccessRight - write access for the owner