g-Eclipse
Release 1.0.0

eu.geclipse.core.accesscontrol
Interface IACL


public interface IACL

A generic Access Control List (ACL) for any kind of resource or object. An ACL consists of a list of entries, each defining an access rule.


Method Summary
 void addEntry(IACLEntry entry, IProgressMonitor monitor)
          Registers an additional entry in this ACL.
 boolean canSaveWholeACL()
          Returns if the implementation is able to save changes to an ACL as a whole or single IACLEntry's must be stored independently.
 IACLEntry getEmptyEntry()
          Returns an empty ACL entry corresponding to this ACL implementation, which can then be added with addEntry(...)
 IACLEntry[] getEntries(IProgressMonitor monitor)
          Returns the list of access control entries contained in this ACL.
 void removeEntry(IACLEntry entry, IProgressMonitor monitor)
          Removes an entry from this ACL.
 void save(IProgressMonitor monitor)
          Saves the changes made to this ACL, if canSaveWholeACL() returns true.
 void saveEntry(IACLEntry entry, IProgressMonitor monitor)
          Saves the changes made to the given entry of the ACL, if canSaveWholeACL() returns false.
 

Method Detail

getEntries

IACLEntry[] getEntries(IProgressMonitor monitor)
                       throws ProblemException
Returns the list of access control entries contained in this ACL.

Parameters:
monitor - used to monitor progress, can be null.
Returns:
an array of IACLEntrys.
Throws:
ProblemException - if an error occurs while fetching the entries.

getEmptyEntry

IACLEntry getEmptyEntry()
Returns an empty ACL entry corresponding to this ACL implementation, which can then be added with addEntry(...).

Returns:
an array of IACLEntrys.

addEntry

void addEntry(IACLEntry entry,
              IProgressMonitor monitor)
              throws ProblemException
Registers an additional entry in this ACL. If canSaveWholeACL() returns false the changes are stored immediately, i.e., online if the IProtectable object is remote.

Parameters:
entry - the ACL entry to set.
monitor - used to monitor progress, can be null.
Throws:
ProblemException - if the provided entry is not compatible with the specific ACL implementation, or an error occurs while adding the entry.

removeEntry

void removeEntry(IACLEntry entry,
                 IProgressMonitor monitor)
                 throws ProblemException
Removes an entry from this ACL. If canSaveWholeACL() returns false the changes are stored immediately, i.e., online if the IProtectable object is remote.

Parameters:
entry - the entry to remove.
monitor - used to monitor progress, can be null.
Throws:
ProblemException - if the entry can not be removed, for instance because such entry was not present in this ACL, or an error occurs while removing it.

saveEntry

void saveEntry(IACLEntry entry,
               IProgressMonitor monitor)
               throws ProblemException
Saves the changes made to the given entry of the ACL, if canSaveWholeACL() returns false. Does nothing otherwise, as save(IProgressMonitor) must be used in that case for saving the changes of the ACL as a whole. For remote objects this is an online operation.

Parameters:
entry - the entry to save.
monitor - used to monitor progress, can be null.
Throws:
ProblemException - if an error occurs while saving the entry.

save

void save(IProgressMonitor monitor)
          throws ProblemException
Saves the changes made to this ACL, if canSaveWholeACL() returns true. Does nothing otherwise, as each IACLEntry must be saved separately. For remote objects this is an online operation.

Parameters:
monitor - used to monitor progress, can be null.
Throws:
ProblemException - if an error occurs while saving the ACL.

canSaveWholeACL

boolean canSaveWholeACL()
Returns if the implementation is able to save changes to an ACL as a whole or single IACLEntry's must be stored independently. Depending on the value returned by this method either save(IProgressMonitor) (canSaveWholeACL = true) or saveEntry(IACLEntry, IProgressMonitor) (canSaveWholeACL = false) must be used for saving the ACL changes.

Returns:
true if the implementation allows to store the whole ACL, false otherwise.

g-Eclipse
Release 1.0.0