Skip to content

Commit 698e6b1

Browse files
committed
Renamed interface to prepare for adding GetPagedRollbackVersions
1 parent b96ec5a commit 698e6b1

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

src/Umbraco.Core/Composing/CompositionExtensions/Services.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static Composition ComposeServices(this Composition composition)
3434

3535
composition.RegisterUnique<ContentService>();
3636
composition.RegisterUnique<IContentService>(factory => factory.GetInstance<ContentService>());
37-
composition.RegisterUnique<IContentVersionCleanupService>(factory => factory.GetInstance<ContentService>());
37+
composition.RegisterUnique<IContentVersionService>(factory => factory.GetInstance<ContentService>());
3838
composition.RegisterUnique<IContentVersionCleanupPolicy, DefaultContentVersionCleanupPolicy>();
3939

4040
composition.RegisterUnique<IUserService, UserService>();

src/Umbraco.Core/Services/IContentVersionCleanupService.cs renamed to src/Umbraco.Core/Services/IContentVersionService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Umbraco.Core.Services
66
{
7-
public interface IContentVersionCleanupService
7+
public interface IContentVersionService
88
{
99
/// <summary>
1010
/// Removes historic content versions according to a policy.

src/Umbraco.Core/Services/Implement/ContentService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Umbraco.Core.Services.Implement
1919
/// <summary>
2020
/// Implements the content service.
2121
/// </summary>
22-
public class ContentService : RepositoryService, IContentService, IContentVersionCleanupService
22+
public class ContentService : RepositoryService, IContentService, IContentVersionService
2323
{
2424
private readonly IDocumentRepository _documentRepository;
2525
private readonly IEntityRepository _entityRepository;

src/Umbraco.Core/Umbraco.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
<Compile Include="PropertyEditors\EyeDropperColorPickerConfiguration.cs" />
200200
<Compile Include="PropertyEditors\ComplexPropertyEditorContentEventHandler.cs" />
201201
<Compile Include="Services\IContentVersionCleanupPolicy.cs" />
202-
<Compile Include="Services\IContentVersionCleanupService.cs" />
202+
<Compile Include="Services\IContentVersionService.cs" />
203203
<Compile Include="Services\IIconService.cs" />
204204
<Compile Include="Services\Implement\DefaultContentVersionCleanupPolicy.cs" />
205205
<Compile Include="Services\Implement\InstallationService.cs" />

src/Umbraco.Tests/Scheduling/ContentVersionCleanup_Tests_UnitTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ContentVersionCleanup_Tests_UnitTests
1818
public void ContentVersionCleanup_WhenNotEnabled_DoesNotCleanupWillRepeat(
1919
[Frozen] Mock<IContentVersionCleanupPolicyGlobalSettings> settings,
2020
[Frozen] Mock<IRuntimeState> state,
21-
[Frozen] Mock<IContentVersionCleanupService> cleanupService,
21+
[Frozen] Mock<IContentVersionService> cleanupService,
2222
ContentVersionCleanup sut)
2323
{
2424
settings.Setup(x => x.EnableCleanup).Returns(false);
@@ -40,7 +40,7 @@ public void ContentVersionCleanup_WhenNotEnabled_DoesNotCleanupWillRepeat(
4040
public void ContentVersionCleanup_RuntimeLevelNotRun_DoesNotCleanupWillRepeat(
4141
[Frozen] Mock<IContentVersionCleanupPolicyGlobalSettings> settings,
4242
[Frozen] Mock<IRuntimeState> state,
43-
[Frozen] Mock<IContentVersionCleanupService> cleanupService,
43+
[Frozen] Mock<IContentVersionService> cleanupService,
4444
ContentVersionCleanup sut)
4545
{
4646
settings.Setup(x => x.EnableCleanup).Returns(true);
@@ -62,7 +62,7 @@ public void ContentVersionCleanup_RuntimeLevelNotRun_DoesNotCleanupWillRepeat(
6262
public void ContentVersionCleanup_ServerRoleUnknown_DoesNotCleanupWillRepeat(
6363
[Frozen] Mock<IContentVersionCleanupPolicyGlobalSettings> settings,
6464
[Frozen] Mock<IRuntimeState> state,
65-
[Frozen] Mock<IContentVersionCleanupService> cleanupService,
65+
[Frozen] Mock<IContentVersionService> cleanupService,
6666
ContentVersionCleanup sut)
6767
{
6868
settings.Setup(x => x.EnableCleanup).Returns(true);
@@ -84,7 +84,7 @@ public void ContentVersionCleanup_ServerRoleUnknown_DoesNotCleanupWillRepeat(
8484
public void ContentVersionCleanup_NotMainDom_DoesNotCleanupWillNotRepeat(
8585
[Frozen] Mock<IContentVersionCleanupPolicyGlobalSettings> settings,
8686
[Frozen] Mock<IRuntimeState> state,
87-
[Frozen] Mock<IContentVersionCleanupService> cleanupService,
87+
[Frozen] Mock<IContentVersionService> cleanupService,
8888
ContentVersionCleanup sut)
8989
{
9090
settings.Setup(x => x.EnableCleanup).Returns(true);
@@ -106,7 +106,7 @@ public void ContentVersionCleanup_NotMainDom_DoesNotCleanupWillNotRepeat(
106106
public void ContentVersionCleanup_Enabled_DelegatesToCleanupService(
107107
[Frozen] Mock<IContentVersionCleanupPolicyGlobalSettings> settings,
108108
[Frozen] Mock<IRuntimeState> state,
109-
[Frozen] Mock<IContentVersionCleanupService> cleanupService,
109+
[Frozen] Mock<IContentVersionService> cleanupService,
110110
ContentVersionCleanup sut)
111111
{
112112
settings.Setup(x => x.EnableCleanup).Returns(true);

src/Umbraco.Tests/Services/ContentVersionCleanupService_Tests_Integration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void PerformContentVersionCleanup_WithNoKeepPeriods_DeletesEverythingExce
4747
// Kill all historic
4848
InsertCleanupPolicy(contentTypeA, 0, 0);
4949

50-
((IContentVersionCleanupService)ServiceContext.ContentService).PerformContentVersionCleanup(DateTime.Now.AddHours(1));
50+
((IContentVersionService)ServiceContext.ContentService).PerformContentVersionCleanup(DateTime.Now.AddHours(1));
5151

5252
var after = GetReport();
5353

src/Umbraco.Web/Scheduling/ContentVersionCleanup.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal class ContentVersionCleanup : RecurringTaskBase
1212
private readonly IRuntimeState _runtimeState;
1313
private readonly IProfilingLogger _logger;
1414
private readonly IContentVersionCleanupPolicyGlobalSettings _settings;
15-
private readonly IContentVersionCleanupService _cleanupService;
15+
private readonly IContentVersionService _service;
1616

1717
public ContentVersionCleanup(
1818
IBackgroundTaskRunner<RecurringTaskBase> runner,
@@ -21,13 +21,13 @@ public ContentVersionCleanup(
2121
IRuntimeState runtimeState,
2222
IProfilingLogger logger,
2323
IContentVersionCleanupPolicyGlobalSettings settings,
24-
IContentVersionCleanupService cleanupService)
24+
IContentVersionService service)
2525
: base(runner, delayMilliseconds, periodMilliseconds)
2626
{
2727
_runtimeState = runtimeState ?? throw new ArgumentNullException(nameof(runtimeState));
2828
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
2929
_settings = settings ?? throw new ArgumentNullException(nameof(settings));
30-
_cleanupService = cleanupService ?? throw new ArgumentNullException(nameof(cleanupService));
30+
_service = service ?? throw new ArgumentNullException(nameof(service));
3131
}
3232

3333
public override bool PerformRun()
@@ -65,7 +65,7 @@ public override bool PerformRun()
6565
return false; // do NOT repeat, going down
6666
}
6767

68-
var count = _cleanupService.PerformContentVersionCleanup(DateTime.Now).Count;
68+
var count = _service.PerformContentVersionCleanup(DateTime.Now).Count;
6969

7070
if (count > 0)
7171
{

src/Umbraco.Web/Scheduling/SchedulerComponent.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public sealed class SchedulerComponent : IComponent
2525

2626
private readonly IRuntimeState _runtime;
2727
private readonly IContentService _contentService;
28-
private readonly IContentVersionCleanupService _cleanupService;
28+
private readonly IContentVersionService _service;
2929
private readonly IAuditService _auditService;
3030
private readonly IProfilingLogger _logger;
3131
private readonly IScopeProvider _scopeProvider;
@@ -48,7 +48,7 @@ public sealed class SchedulerComponent : IComponent
4848
public SchedulerComponent(
4949
IRuntimeState runtime,
5050
IContentService contentService,
51-
IContentVersionCleanupService cleanupService,
51+
IContentVersionService service,
5252
IAuditService auditService,
5353
HealthCheckCollection healthChecks,
5454
HealthCheckNotificationMethodCollection notifications,
@@ -58,7 +58,7 @@ public SchedulerComponent(
5858
{
5959
_runtime = runtime;
6060
_contentService = contentService;
61-
_cleanupService = cleanupService;
61+
_service = service;
6262
_auditService = auditService;
6363
_scopeProvider = scopeProvider;
6464
_logger = logger;
@@ -203,7 +203,7 @@ private IBackgroundTask RegisterContentVersionCleanup(IUmbracoSettingsSection se
203203
_runtime,
204204
_logger,
205205
settings.Content.ContentVersionCleanupPolicyGlobalSettings,
206-
_cleanupService);
206+
_service);
207207

208208
_contentVersionCleanupRunner.TryAdd(task);
209209

0 commit comments

Comments
 (0)