namespace OCP\Files\Notify;
+/**
+ * Represents a detected change in the storage
+ *
+ * @since 12.0.0
+ */
interface IChange {
const ADDED = 1;
const REMOVED = 2;
* Get the type of the change
*
* @return int IChange::ADDED, IChange::REMOVED, IChange::MODIFIED or IChange::RENAMED
+ *
+ * @since 12.0.0
*/
public function getType();
* Note, for rename changes this path is the old path for the file
*
* @return mixed
+ *
+ * @since 12.0.0
*/
public function getPath();
}
namespace OCP\Files\Notify;
+/**
+ * Provides access to detected changes in the storage by either actively listening
+ * or getting the list of changes that happened in the background
+ *
+ * @since 12.0.0
+ */
interface INotifyHandler {
/**
* Start listening for update notifications
* Note that this call is blocking and will not exit on it's own, to stop listening for notifications return `false` from the callback
*
* @param callable $callback
+ *
+ * @since 12.0.0
*/
public function listen(callable $callback);
* Get all changes detected since the start of the notify process or the last call to getChanges
*
* @return IChange[]
+ *
+ * @since 12.0.0
*/
public function getChanges();
* Stop listening for changes
*
* Note that any pending changes will be discarded
+ *
+ * @since 12.0.0
*/
public function stop();
}
namespace OCP\Files\Notify;
+/**
+ * Represents a detected rename change
+ *
+ * @since 12.0.0
+ */
interface IRenameChange extends IChange {
/**
* Get the new path of the renamed file relative to the storage root
*
* @return string
+ *
+ * @since 12.0.0
*/
public function getTargetPath();
}