Interface IWatchableRepository

All Known Subinterfaces:
IBuildInformationRepository

public interface IWatchableRepository
Repository which can be watched by IWatchableRepositoryListeners.

Interface is created so as implementations can do as less work as possible:

  • changes made directly in underlying storage may be omitted (clients should treat such repositories as other repositories and do not make change detection themselves
  • multiple reporting of same change is permitted
  • reporting of changes out-of-order is permitted
  • changes to file resource which must be reported: creation, removal, content modification (change of any attribute which does not affect file content, like last modification time, can be omitted)
  • changes to folder resource which must be reported: creation, removal
  • changes to folder contents may or may not be reported as folder changes, but generally are not reported (= creation of file does not trigger change of its parent folder nor does it travel upwards)
  • reporting of changes which are not visible by clients are permitted (e.g. file owner is changed, but repository does not allow to retrieve such information)
There are only two rules which must be obeyed:
  • changes done through repository interface must be reported synchronously
  • listener will be notified only with locations which match locations and location patterns register for watching

Location patterns can be used: if location contains asterisk (*; COMPONENT_MATCH_ALL) instead of some path component, then it will match any file or folder (on that hierarchy level).

WARNING: In cluster setup listeners are notified only on the node where the changes are done.

Author:
Stepan Roh, Polarion Software