3737 noRollbackFor = {javax .persistence .NoResultException .class , org .springframework .dao .EmptyResultDataAccessException .class })
3838
3939public class ApplicationInformationServiceImpl implements ApplicationInformationService {
40-
41- // the cached operational object for this service
42- //
43- private ApplicationInformation applicationInformation ;
4440
4541 @ Autowired
4642 private ApplicationInformationRepository applicationInformationRepository ;
@@ -50,48 +46,11 @@ public class ApplicationInformationServiceImpl implements ApplicationInformation
5046
5147 @ Autowired
5248 private ImportService importService ;
53-
54- @ Override
55- public String getDataCustodianResourceEndpoint () {
56- if (this .applicationInformation == null ) {
57- // default it to the seed value
58- this .setApplicationInformation (this .findById (1L ));
59- }
60- return applicationInformation .getDataCustodianResourceEndpoint ();
61- // return "http://localhost:8080/DataCustodian/espi/1_1/resource";
62- }
63-
64- @ Override
65- public String getAuthorizationServerTokenEndpoint () {
66- if (this .applicationInformation == null ) {
67- // default it to the seed value
68- this .setApplicationInformation (this .findById (1L ));
69- }
70- return applicationInformation .getAuthorizationServerTokenEndpoint ();
71- // return "http://localhost:8080/DataCustodian/oauth/token";
72- }
73-
49+
7450 @ Override
7551 public List <ApplicationInformation > findByKind (String kind ) {
7652 return applicationInformationRepository .findByKind (kind );
7753 }
78-
79-
80- @ Override
81- public List <ApplicationInformation > findAll () {
82- return applicationInformationRepository .findAll ();
83- }
84-
85- @ Override
86- public ApplicationInformation findById (Long id ) {
87- return applicationInformationRepository .findById (id );
88- }
89-
90-
91- @ Override
92- public void persist (ApplicationInformation applicationInformation ) {
93- applicationInformationRepository .persist (applicationInformation );
94- }
9554
9655 @ Override
9756 public ApplicationInformation findByClientId (String clientId ) {
@@ -103,86 +62,6 @@ public ApplicationInformation findByDataCustodianClientId(String dataCustodianCl
10362 return applicationInformationRepository .findByDataCustodianClientId (dataCustodianClientId );
10463 }
10564
106- @ Override
107- public ApplicationInformation findByUUID (UUID uuid ) {
108- return applicationInformationRepository .findByUUID (uuid );
109- }
110-
111- // @Override
112- // public ClientDetails loadClientByClientId(String clientId) {
113- // return findByClientId(clientId);
114- // }
115-
116- @ Override
117- public String feedFor (List <ApplicationInformation > applicationInformations ) {
118- // TODO Auto-generated method stub
119- return null ;
120- }
121-
122- @ Override
123- public String entryFor (ApplicationInformation applicationInformation ) {
124- // TODO Auto-generated method stub
125- return null ;
126- }
127-
128- @ Override
129- public void add (ApplicationInformation applicationInformation ) {
130- // TODO Auto-generated method stub
131-
132- }
133-
134- @ Override
135- public void delete (ApplicationInformation applicationInformation ) {
136- applicationInformationRepository .deleteById (applicationInformation .getId ());
137-
138- }
139-
140- @ Override
141- public void merge (ApplicationInformation applicationInformation ) {
142- // TODO Auto-generated method stub
143-
144- }
145-
146- @ Override
147- public ApplicationInformation findByURI (String uri ) {
148- // TODO Auto-generated method stub
149- return null ;
150- }
151-
152- @ Override
153- public EntryType findEntryType (Long applicationInformationId ) {
154- EntryType result = null ;
155- try {
156- // TODO - this is sub-optimal (but defers the need to understand creation of an EntryType
157- List <Long > temp = new ArrayList <Long >();
158- ApplicationInformation applicationInformation = applicationInformationRepository .findById (applicationInformationId );
159- temp .add (applicationInformation .getId ());
160- result = (new EntryTypeIterator (resourceService , temp , ApplicationInformation .class )).nextEntry (ApplicationInformation .class );
161- } catch (Exception e ) {
162- // TODO need a log file entry as we are going to return a null if
163- // it's not found
164- result = null ;
165- }
166- return result ; // TODO Auto-generated method stub
167-
168- }
169-
170- @ Override
171- public EntryTypeIterator findEntryTypeIterator () {
172- EntryTypeIterator result = null ;
173- try {
174- // TODO - this is sub-optimal (but defers the need to understand creation of an EntryType
175- List <Long > temp = new ArrayList <Long >();
176- temp = applicationInformationRepository .findAllIds ();
177- result = (new EntryTypeIterator (resourceService , temp , ApplicationInformation .class ));
178- } catch (Exception e ) {
179- // TODO need a log file entry as we are going to return a null if
180- // it's not found
181- result = null ;
182- }
183- return result ;
184- }
185-
18665 @ Override
18766 public ApplicationInformation importResource (InputStream stream ) {
18867
@@ -196,21 +75,6 @@ public ApplicationInformation importResource(InputStream stream) {
19675 return applicationInformation ;
19776 }
19877
199- @ Override
200- public String getThirdPartyNotifyURI () {
201- ApplicationInformation applicationInformation ;
202- // TODO note the assumption on the first (seed) entry
203- applicationInformation = resourceService .findById (1L , ApplicationInformation .class );
204- return applicationInformation .getThirdPartyNotifyUri ();
205- }
206-
207- public void setApplicationInformation (ApplicationInformation applicationInformation ) {
208- this .applicationInformation = applicationInformation ;
209- }
210-
211- public ApplicationInformation getApplicationInformation () {
212- return this .applicationInformation ;
213- }
21478 public void setApplicationInformationRepository (ApplicationInformationRepository applicationInformationRepository ) {
21579 this .applicationInformationRepository = applicationInformationRepository ;
21680 }
@@ -223,8 +87,9 @@ public void setResourceService(ResourceService resourceService) {
22387 }
22488
22589 public ResourceService getResourceService () {
226- return this .resourceService ;
227- }
90+ return this .resourceService ;
91+ }
92+
22893 public void setImportService (ImportService importService ) {
22994 this .importService = importService ;
23095 }
0 commit comments