Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit ce3a917

Browse files
dfcoffinclaude
andcommitted
Move UpdateService and UpdateServiceImpl to OpenESPI-Common-java for proper architectural separation
- Moved UpdateService interface from DataCustodian to Common repository - Moved UpdateServiceImpl implementation to Common repository - Ensures all service implementations are centralized in OpenESPI-Common-java - Maintains clean separation of concerns per Spring Boot 3.5 architecture - Part of comprehensive architectural compliance improvements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent cc6b7a2 commit ce3a917

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
*
3+
* Copyright (c) 2018-2021 Green Button Alliance, Inc.
4+
*
5+
* Portions (c) 2013-2018 EnergyOS.org
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*
19+
*/
20+
21+
package org.greenbuttonalliance.espi.common.service;
22+
23+
import org.greenbuttonalliance.espi.common.domain.BatchList;
24+
import org.greenbuttonalliance.espi.common.domain.Subscription;
25+
26+
public interface UpdateService {
27+
BatchList updatedResources(Subscription subscription);
28+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*
2+
*
3+
* Copyright (c) 2018-2021 Green Button Alliance, Inc.
4+
*
5+
* Portions (c) 2013-2018 EnergyOS.org
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*
19+
*/
20+
21+
package org.greenbuttonalliance.espi.common.service.impl;
22+
23+
import org.greenbuttonalliance.espi.common.domain.BatchList;
24+
import org.greenbuttonalliance.espi.common.domain.Subscription;
25+
import org.greenbuttonalliance.espi.common.domain.UsagePoint;
26+
import org.greenbuttonalliance.espi.common.service.UsagePointService;
27+
import org.greenbuttonalliance.espi.common.service.UpdateService;
28+
import org.springframework.beans.factory.annotation.Autowired;
29+
import org.springframework.stereotype.Service;
30+
31+
import java.util.List;
32+
33+
@Service
34+
public class UpdateServiceImpl implements UpdateService {
35+
36+
@Autowired
37+
private UsagePointService usagePointService;
38+
39+
public BatchList updatedResources(Subscription subscription) {
40+
List<UsagePoint> usagePoints = usagePointService
41+
.findAllUpdatedFor(subscription);
42+
43+
BatchList batchList = new BatchList();
44+
45+
for (UsagePoint usagePoint : usagePoints) {
46+
batchList.getResources().add(usagePoint.getSelfHref());
47+
}
48+
49+
return batchList;
50+
}
51+
52+
public void setUsagePointService(UsagePointService usagePointService) {
53+
this.usagePointService = usagePointService;
54+
}
55+
56+
public UsagePointService getUsagePointService() {
57+
return this.usagePointService;
58+
}
59+
}

0 commit comments

Comments
 (0)