using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.Events;
namespace Umbraco.Cms.Core.Scoping;
///
/// Represents a scope.
///
public interface ICoreScope : IDisposable, IInstanceIdentifiable
{
///
/// Gets the distance from the root scope.
///
///
/// A zero represents a root scope, any value greater than zero represents a child scope.
///
public int Depth => -1;
public ILockingMechanism Locks { get; }
///
/// Gets the scope notification publisher
///
IScopedNotificationPublisher Notifications { get; }
///
/// Gets the repositories cache mode.
///
RepositoryCacheMode RepositoryCacheMode { get; }
///
/// Gets the scope isolated cache.
///
IsolatedCaches IsolatedCaches { get; }
///
/// Completes the scope.
///
/// A value indicating whether the scope has been successfully completed.
/// Can return false if any child scope has not completed.
bool Complete();
///
/// Read-locks some lock objects.
///
/// Array of lock object identifiers.
void ReadLock(params int[] lockIds);
///
/// Write-locks some lock objects.
///
/// Array of object identifiers.
void WriteLock(params int[] lockIds);
///
/// Write-locks some lock objects.
///
/// The database timeout in milliseconds
/// The lock object identifier.
void WriteLock(TimeSpan timeout, int lockId);
///
/// Read-locks some lock objects.
///
/// The database timeout in milliseconds
/// The lock object identifier.
void ReadLock(TimeSpan timeout, int lockId);
void EagerWriteLock(params int[] lockIds);
void EagerWriteLock(TimeSpan timeout, int lockId);
void EagerReadLock(TimeSpan timeout, int lockId);
void EagerReadLock(params int[] lockIds);
}