File tree Expand file tree Collapse file tree
src/main/java/org/nhind/config/rest/impl Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 <parent >
1212 <groupId >org.springframework.boot</groupId >
1313 <artifactId >spring-boot-dependencies</artifactId >
14- <version >2.1.1 .RELEASE</version >
14+ <version >2.1.2 .RELEASE</version >
1515 </parent >
1616 <scm >
1717 <url >scm:git:https://github.com/DirectProject/nhin-d.git</url >
3939
4040 <properties >
4141 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
42- <spring-cloud-dependencies .version>Greenwich.M3 </spring-cloud-dependencies .version>
42+ <spring-cloud-dependencies .version>Greenwich.RC1 </spring-cloud-dependencies .version>
4343 </properties >
4444 <repositories >
4545 <!-- Temp repository for Spring Boot Milestone -->
9999 <dependency >
100100 <groupId >junit</groupId >
101101 <artifactId >junit</artifactId >
102- <version >4.12</version >
103102 <scope >test</scope >
104103 </dependency >
105104 <dependency >
123122 <dependency >
124123 <groupId >org.mockito</groupId >
125124 <artifactId >mockito-core</artifactId >
126- <version >2.21.0</version >
127125 <scope >test</scope >
128126 </dependency >
129127 <dependency >
130128 <groupId >com.h2database</groupId >
131129 <artifactId >h2</artifactId >
132130 <scope >test</scope >
133- <version >1.4.194</version >
134131 </dependency >
135132 </dependencies >
136133 <build >
150147 <plugin >
151148 <groupId >org.apache.maven.plugins</groupId >
152149 <artifactId >maven-source-plugin</artifactId >
153- <version >2.0.3</version >
154150 <executions >
155151 <execution >
156152 <goals >
Original file line number Diff line number Diff line change 66import org .nhind .config .rest .CertPolicyService ;
77import org .nhind .config .rest .feign .CertificatePolicyClient ;
88import org .nhindirect .common .rest .exceptions .ServiceException ;
9+ import org .nhindirect .common .rest .exceptions .ServiceMethodException ;
910import org .nhindirect .config .model .CertPolicy ;
1011import org .nhindirect .config .model .CertPolicyGroup ;
1112import org .nhindirect .config .model .CertPolicyGroupDomainReltn ;
@@ -39,7 +40,16 @@ public Collection<CertPolicy> getPolicies() throws ServiceException
3940 @ Override
4041 public CertPolicy getPolicyByName (String policyName ) throws ServiceException
4142 {
42- return certPolClient .getPolicyByName (policyName );
43+ try
44+ {
45+ return certPolClient .getPolicyByName (policyName );
46+ }
47+ catch (ServiceMethodException e )
48+ {
49+ if (e .getResponseCode () == 404 )
50+ return null ;
51+ throw e ;
52+ }
4353 }
4454
4555 @ Override
@@ -70,7 +80,16 @@ public Collection<CertPolicyGroup> getPolicyGroups() throws ServiceException
7080 @ Override
7181 public CertPolicyGroup getPolicyGroup (String groupName ) throws ServiceException
7282 {
73- return certPolClient .getPolicyGroupByName (groupName );
83+ try
84+ {
85+ return certPolClient .getPolicyGroupByName (groupName );
86+ }
87+ catch (ServiceMethodException e )
88+ {
89+ if (e .getResponseCode () == 404 )
90+ return null ;
91+ throw e ;
92+ }
7493 }
7594
7695 @ Override
Original file line number Diff line number Diff line change 66import org .nhind .config .rest .CertificateService ;
77import org .nhind .config .rest .feign .CertificateClient ;
88import org .nhindirect .common .rest .exceptions .ServiceException ;
9+ import org .nhindirect .common .rest .exceptions .ServiceMethodException ;
910import org .nhindirect .config .model .Certificate ;
1011import org .springframework .beans .factory .annotation .Autowired ;
1112import org .springframework .stereotype .Component ;
@@ -44,7 +45,16 @@ public Collection<Certificate> getCertificatesByOwner(String owner) throws Servi
4445 public Certificate getCertificatesByOwnerAndThumbprint (
4546 String owner , String thumbprint ) throws ServiceException
4647 {
47- return certClient .getCertificatesByOwnerAndThumbprint (owner , thumbprint );
48+ try
49+ {
50+ return certClient .getCertificatesByOwnerAndThumbprint (owner , thumbprint );
51+ }
52+ catch (ServiceMethodException e )
53+ {
54+ if (e .getResponseCode () == 404 )
55+ return null ;
56+ throw e ;
57+ }
4858 }
4959
5060 @ Override
Original file line number Diff line number Diff line change 77import org .nhind .config .rest .TrustBundleService ;
88import org .nhind .config .rest .feign .TrustBundleClient ;
99import org .nhindirect .common .rest .exceptions .ServiceException ;
10+ import org .nhindirect .common .rest .exceptions .ServiceMethodException ;
1011import org .nhindirect .config .model .TrustBundle ;
1112import org .nhindirect .config .model .TrustBundleDomainReltn ;
1213import org .springframework .beans .factory .annotation .Autowired ;
@@ -52,7 +53,16 @@ public Collection<TrustBundleDomainReltn> getAllTrustBundleDomainReltns(boolean
5253 @ Override
5354 public TrustBundle getTrustBundle (String bundleName ) throws ServiceException
5455 {
55- return bundleClient .getTrustBundleByName (bundleName );
56+ try
57+ {
58+ return bundleClient .getTrustBundleByName (bundleName );
59+ }
60+ catch (ServiceMethodException e )
61+ {
62+ if (e .getResponseCode () == 404 )
63+ return null ;
64+ throw e ;
65+ }
5666 }
5767
5868 @ Override
You can’t perform that action at this time.
0 commit comments