Skip to content

Commit e536f4b

Browse files
author
Greg Meyer
authored
Merge pull request #2 from DirectProjectJavaRI/develop
Develop
2 parents 97f2651 + 23de881 commit e536f4b

4 files changed

Lines changed: 45 additions & 10 deletions

File tree

pom.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
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>
@@ -39,7 +39,7 @@
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 -->
@@ -99,7 +99,6 @@
9999
<dependency>
100100
<groupId>junit</groupId>
101101
<artifactId>junit</artifactId>
102-
<version>4.12</version>
103102
<scope>test</scope>
104103
</dependency>
105104
<dependency>
@@ -123,14 +122,12 @@
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>
@@ -150,7 +147,6 @@
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>

src/main/java/org/nhind/config/rest/impl/DefaultCertPolicyService.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.nhind.config.rest.CertPolicyService;
77
import org.nhind.config.rest.feign.CertificatePolicyClient;
88
import org.nhindirect.common.rest.exceptions.ServiceException;
9+
import org.nhindirect.common.rest.exceptions.ServiceMethodException;
910
import org.nhindirect.config.model.CertPolicy;
1011
import org.nhindirect.config.model.CertPolicyGroup;
1112
import 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

src/main/java/org/nhind/config/rest/impl/DefaultCertificateService.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.nhind.config.rest.CertificateService;
77
import org.nhind.config.rest.feign.CertificateClient;
88
import org.nhindirect.common.rest.exceptions.ServiceException;
9+
import org.nhindirect.common.rest.exceptions.ServiceMethodException;
910
import org.nhindirect.config.model.Certificate;
1011
import org.springframework.beans.factory.annotation.Autowired;
1112
import 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

src/main/java/org/nhind/config/rest/impl/DefaultTrustBundleService.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.nhind.config.rest.TrustBundleService;
88
import org.nhind.config.rest.feign.TrustBundleClient;
99
import org.nhindirect.common.rest.exceptions.ServiceException;
10+
import org.nhindirect.common.rest.exceptions.ServiceMethodException;
1011
import org.nhindirect.config.model.TrustBundle;
1112
import org.nhindirect.config.model.TrustBundleDomainReltn;
1213
import 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

0 commit comments

Comments
 (0)