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

Commit 6eec323

Browse files
committed
Moved to Spring 4.0.6
Added SFTP to the Notification Service
1 parent ced3630 commit 6eec323

File tree

3 files changed

+36
-17
lines changed

3 files changed

+36
-17
lines changed

pom.xml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,29 @@
1212
<name>Common</name>
1313

1414
<profiles>
15+
16+
<!-- <profile> -->
17+
<!-- <id>dev</id> -->
18+
<!-- <activation> -->
19+
<!-- <activeByDefault>true</activeByDefault> -->
20+
<!-- </activation> -->
21+
<!-- <properties> -->
22+
<!-- <profile>dev</profile> -->
23+
<!-- <database>hsql</database> -->
24+
<!-- </properties> -->
25+
<!-- </profile> -->
26+
1527
<profile>
16-
<id>dev</id>
28+
<id>devmysql</id>
1729
<activation>
1830
<activeByDefault>true</activeByDefault>
1931
</activation>
20-
<properties>
21-
<profile>dev</profile>
22-
<database>hsql</database>
23-
</properties>
24-
</profile>
25-
<profile>
26-
<id>devmysql</id>
2732
<properties>
2833
<profile>devmysql</profile>
2934
<database>mysql</database>
3035
</properties>
3136
</profile>
3237

33-
<profile>
34-
<id>devmysql-regeneratedatabase</id>
35-
<properties>
36-
<profile>devmysql-regeneratedatabase</profile>
37-
<database>mysql</database>
38-
</properties>
39-
</profile>
40-
4138
<profile>
4239
<id>greenbuttondata</id>
4340
<properties>
@@ -50,7 +47,7 @@
5047

5148
<properties>
5249
<!-- Spring -->
53-
<spring.version>4.0.3.RELEASE</spring.version>
50+
<spring.version>4.0.6.RELEASE</spring.version>
5451
<spring.security.version>3.2.3.RELEASE</spring.security.version>
5552
<spring-security-oauth.version>2.0.2.RELEASE</spring-security-oauth.version>
5653

src/main/java/org/energyos/espi/common/service/NotificationService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import javax.xml.datatype.XMLGregorianCalendar;
44

5+
import org.energyos.espi.common.domain.ApplicationInformation;
56
import org.energyos.espi.common.domain.RetailCustomer;
67
import org.energyos.espi.common.domain.Subscription;
78
import org.springframework.stereotype.Service;
@@ -14,4 +15,6 @@ public interface NotificationService {
1415

1516
void notifyAllNeed();
1617

18+
void notify(ApplicationInformation applicationInformation, Long bulkId);
19+
1720
}

src/main/java/org/energyos/espi/common/service/impl/NotificationServiceImpl.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121

2222
import javax.xml.datatype.XMLGregorianCalendar;
2323

24+
import org.energyos.espi.common.domain.ApplicationInformation;
2425
import org.energyos.espi.common.domain.Authorization;
2526
import org.energyos.espi.common.domain.BatchList;
2627
import org.energyos.espi.common.domain.RetailCustomer;
2728
import org.energyos.espi.common.domain.Subscription;
29+
import org.energyos.espi.common.service.ApplicationInformationService;
2830
import org.energyos.espi.common.service.AuthorizationService;
2931
import org.energyos.espi.common.service.NotificationService;
3032
import org.energyos.espi.common.service.ResourceService;
@@ -34,6 +36,10 @@
3436
import org.springframework.stereotype.Service;
3537
import org.springframework.web.client.RestTemplate;
3638

39+
/**
40+
* @author steph
41+
*
42+
*/
3743
@Service
3844
public class NotificationServiceImpl implements NotificationService {
3945
@Autowired
@@ -134,6 +140,18 @@ public void setRestTemplate(RestTemplate restTemplate) {
134140
this.restTemplate = restTemplate;
135141
}
136142

143+
144+
@Override
145+
public void notify(ApplicationInformation applicationInformation, Long bulkId) {
146+
String bulkRequestUri = applicationInformation.getDataCustodianBulkRequestURI() + "/" + bulkId;
147+
String thirdPartyNotificationURI = applicationInformation.getThirdPartyNotifyUri();
148+
BatchList batchList = new BatchList();
149+
batchList.getResources().add(bulkRequestUri);
150+
151+
notifyInternal(thirdPartyNotificationURI, batchList);
152+
153+
}
154+
137155
public RestTemplate getRestTemplate () {
138156
return this.restTemplate;
139157
}
@@ -144,6 +162,7 @@ public void setResourceService(ResourceService resourceService) {
144162
public ResourceService getResourceService () {
145163
return this.resourceService;
146164
}
165+
147166
public void setAuthorizationService(AuthorizationService authorizationService) {
148167
this.authorizationService = authorizationService;
149168
}

0 commit comments

Comments
 (0)