Skip to content

Commit b8b4ba4

Browse files
author
Greg Meyer
authored
Merge pull request #6 from DirectProjectJavaRI/develop
Releasing 8.0.0
2 parents 8d38798 + 15dc49e commit b8b4ba4

22 files changed

+637
-276
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
hs_err_pid*
2424
/.classpath
2525
/.project
26+
/target/

pom.xml

Lines changed: 57 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<artifactId>dns</artifactId>
66
<name>Direct Project DNS services</name>
7-
<version>6.0.1</version>
7+
<version>8.0.0</version>
88
<description>Direct Project DNS services</description>
99
<inceptionYear>2010</inceptionYear>
1010
<url>https://github.com/DirectProjectJavaRI/dns</url>
@@ -27,14 +27,19 @@
2727
<connection>scm:git:https://github.com/DirectProjectJavaRI/dns.git</connection>
2828
</scm>
2929
<prerequisites>
30-
<maven>3.0.0</maven>
30+
<maven>3.5.0</maven>
3131
</prerequisites>
3232
<parent>
3333
<groupId>org.springframework.boot</groupId>
3434
<artifactId>spring-boot-starter-parent</artifactId>
35-
<version>2.1.6.RELEASE</version>
35+
<version>2.5.2</version>
3636
<relativePath />
37-
</parent>
37+
</parent>
38+
<properties>
39+
<dnsjava.version>3.3.1</dnsjava.version>
40+
<mina-core.version>2.1.4</mina-core.version>
41+
<bcprov-jdk15on.version>1.68</bcprov-jdk15on.version>
42+
</properties>
3843
<licenses>
3944
<license>
4045
<name>New BSD License</name>
@@ -46,116 +51,81 @@
4651
<dependency>
4752
<groupId>org.springframework.boot</groupId>
4853
<artifactId>spring-boot-dependencies</artifactId>
49-
<version>2.1.6.RELEASE</version>
54+
<version>2.5.2</version>
5055
<type>pom</type>
5156
<scope>import</scope>
52-
</dependency>
53-
<dependency>
54-
<groupId>io.pivotal.spring.cloud</groupId>
55-
<artifactId>spring-cloud-services-dependencies</artifactId>
56-
<version>2.1.1.RELEASE</version>
57-
<type>pom</type>
58-
<scope>import</scope>
59-
</dependency>
57+
</dependency>
6058
<dependency>
6159
<groupId>org.springframework.cloud</groupId>
6260
<artifactId>spring-cloud-starter-parent</artifactId>
63-
<version>Greenwich.SR1</version>
61+
<version>2020.0.3</version>
6462
<type>pom</type>
6563
<scope>import</scope>
6664
</dependency>
6765
</dependencies>
6866
</dependencyManagement>
6967
<dependencies>
70-
<dependency>
71-
<groupId>org.springframework.boot</groupId>
72-
<artifactId>spring-boot-configuration-processor</artifactId>
73-
</dependency>
7468
<dependency>
75-
<groupId>org.springframework.boot</groupId>
76-
<artifactId>spring-boot-starter-actuator</artifactId>
77-
</dependency>
78-
<dependency>
79-
<groupId>org.springframework.cloud</groupId>
80-
<artifactId>spring-cloud-starter-config</artifactId>
81-
</dependency>
82-
<dependency>
83-
<groupId>org.springframework.cloud</groupId>
84-
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
85-
</dependency>
86-
<dependency>
87-
<groupId>io.pivotal.spring.cloud</groupId>
88-
<artifactId>spring-cloud-services-starter-config-client</artifactId>
89-
<exclusions>
90-
<exclusion>
91-
<groupId>org.codehaus.jackson</groupId>
92-
<artifactId>jackson-mapper-asl</artifactId>
93-
</exclusion>
94-
</exclusions>
95-
</dependency>
69+
<groupId>org.springframework.cloud</groupId>
70+
<artifactId>spring-cloud-starter-bootstrap</artifactId>
71+
</dependency>
9672
<dependency>
9773
<groupId>org.bouncycastle</groupId>
9874
<artifactId>bcprov-jdk15on</artifactId>
99-
<version>1.60</version>
75+
<version>${bcprov-jdk15on.version}</version>
10076
</dependency>
10177
<dependency>
10278
<groupId>dnsjava</groupId>
10379
<artifactId>dnsjava</artifactId>
104-
<version>2.1.8</version>
80+
<version>${dnsjava.version}</version>
10581
</dependency>
10682
<dependency>
10783
<groupId>org.nhind</groupId>
10884
<artifactId>config-service-client</artifactId>
109-
<version>6.0</version>
85+
<version>8.0.0</version>
11086
</dependency>
87+
<dependency>
88+
<groupId>org.nhind</groupId>
89+
<artifactId>config-model</artifactId>
90+
<version>8.0.0</version>
91+
</dependency>
11192
<dependency>
11293
<groupId>org.nhind</groupId>
11394
<artifactId>direct-policy</artifactId>
114-
<version>6.0</version>
95+
<version>8.0.0</version>
11596
</dependency>
11697
<dependency>
11798
<groupId>org.nhind</groupId>
11899
<artifactId>direct-common</artifactId>
119-
<version>6.0.1</version>
100+
<version>8.0.0</version>
120101
</dependency>
121102
<dependency>
122103
<groupId>org.nhind</groupId>
123104
<artifactId>config-service-jar</artifactId>
124-
<version>6.0.3</version>
105+
<version>8.0.0</version>
125106
<scope>test</scope>
126107
</dependency>
127108
<dependency>
128109
<groupId>org.apache.mina</groupId>
129110
<artifactId>mina-core</artifactId>
130-
<version>1.0.2</version>
111+
<version>${mina-core.version}</version>
131112
<scope>test</scope>
132-
</dependency>
133-
<dependency>
134-
<groupId>org.mockito</groupId>
135-
<artifactId>mockito-core</artifactId>
136-
<scope>test</scope>
137-
</dependency>
138-
<dependency>
139-
<groupId>junit</groupId>
140-
<artifactId>junit</artifactId>
141-
<scope>test</scope>
142-
</dependency>
113+
</dependency>
143114
<dependency>
144115
<groupId>com.h2database</groupId>
145116
<artifactId>h2</artifactId>
146117
<scope>test</scope>
147118
</dependency>
148-
<dependency>
119+
<dependency>
120+
<groupId>io.r2dbc</groupId>
121+
<artifactId>r2dbc-h2</artifactId>
122+
<scope>test</scope>
123+
</dependency>
124+
<dependency>
149125
<groupId>org.springframework.boot</groupId>
150126
<artifactId>spring-boot-starter-test</artifactId>
151127
<scope>test</scope>
152-
</dependency>
153-
<dependency>
154-
<groupId>org.apache.camel</groupId>
155-
<artifactId>camel-spring-boot-starter</artifactId>
156-
<version>2.22.0</version>
157-
<scope>test</scope>
158-
</dependency>
128+
</dependency>
159129
</dependencies>
160130
<build>
161131
<extensions>
@@ -201,6 +171,7 @@
201171
<plugin>
202172
<groupId>org.apache.maven.plugins</groupId>
203173
<artifactId>maven-jxr-plugin</artifactId>
174+
<version>3.1.1</version>
204175
</plugin>
205176
<plugin>
206177
<groupId>org.apache.maven.plugins</groupId>
@@ -233,35 +204,28 @@
233204
</execution>
234205
</executions>
235206
</plugin>
236-
<plugin>
237-
<groupId>org.apache.maven.plugins</groupId>
238-
<artifactId>maven-jar-plugin</artifactId>
239-
<configuration>
240-
<archive>
241-
<index>true</index>
242-
<!--<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
243-
-->
244-
</archive>
245-
</configuration>
246-
</plugin>
247-
<plugin>
248-
<groupId>org.apache.maven.plugins</groupId>
249-
<artifactId>maven-jar-plugin</artifactId>
250-
<executions>
251-
<execution>
252-
<goals>
253-
<goal>test-jar</goal>
254-
</goals>
255-
</execution>
256-
</executions>
257-
</plugin>
207+
<plugin>
208+
<groupId>org.apache.maven.plugins</groupId>
209+
<artifactId>maven-jar-plugin</artifactId>
210+
<configuration>
211+
<archive>
212+
<index>true</index>
213+
</archive>
214+
</configuration>
215+
<executions>
216+
<execution>
217+
<goals>
218+
<goal>test-jar</goal>
219+
</goals>
220+
</execution>
221+
</executions>
222+
</plugin>
258223

259224
<plugin>
260225
<groupId>org.apache.maven.plugins</groupId>
261226
<artifactId>maven-javadoc-plugin</artifactId>
262-
<version>2.9.1</version>
263-
<configuration>
264-
<additionalparam>-Xdoclint:none</additionalparam>
227+
<configuration>
228+
<additionalJOption>-Xdoclint:none</additionalJOption>
265229
<charset>UTF-8</charset>
266230
<docencoding>UTF-8</docencoding>
267231
<docfilessubdirs>true</docfilessubdirs>
@@ -296,6 +260,7 @@
296260
</goals>
297261
</execution>
298262
</executions>
263+
<version>3.0.1</version>
299264
</plugin>
300265
-->
301266
</plugins>
@@ -305,14 +270,12 @@
305270
<plugin>
306271
<groupId>org.apache.maven.plugins</groupId>
307272
<artifactId>maven-project-info-reports-plugin</artifactId>
308-
<version>2.9</version>
309273
</plugin>
310274
<plugin>
311275
<groupId>org.apache.maven.plugins</groupId>
312276
<artifactId>maven-javadoc-plugin</artifactId>
313-
<version>2.9.1</version>
314-
<configuration>
315-
<additionalparam>-Xdoclint:none</additionalparam>
277+
<configuration>
278+
<additionalJOption>-Xdoclint:none</additionalJOption>
316279
<charset>UTF-8</charset>
317280
<docencoding>UTF-8</docencoding>
318281
<docfilessubdirs>true</docfilessubdirs>

src/main/java/org/nhindirect/dns/AbstractDNSStore.java

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
import org.nhindirect.policy.PolicyExpression;
1111
import org.nhindirect.policy.PolicyFilter;
12-
import org.slf4j.Logger;
13-
import org.slf4j.LoggerFactory;
1412
import org.xbill.DNS.DClass;
1513
import org.xbill.DNS.Flags;
1614
import org.xbill.DNS.Header;
@@ -24,9 +22,11 @@
2422
import org.xbill.DNS.Section;
2523
import org.xbill.DNS.Type;
2624

25+
import lombok.extern.slf4j.Slf4j;
26+
27+
@Slf4j
2728
public abstract class AbstractDNSStore implements DNSStore
2829
{
29-
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractDNSStore.class);
3030

3131
protected static final String DNS_CERT_POLICY_NAME_VAR = "org.nhindirect.dns.CertPolicyName";
3232

@@ -75,11 +75,10 @@ public static void setJCEProviderName(String name)
7575
/**
7676
* {@inheritDoc}
7777
*/
78-
@SuppressWarnings("unchecked")
7978
@Override
8079
public Message get(Message request) throws DNSException
8180
{
82-
LOGGER.trace("get(Message) Entered");
81+
log.trace("get(Message) Entered");
8382
/* for testing time out cases
8483
try
8584
{
@@ -115,16 +114,16 @@ public Message get(Message request) throws DNSException
115114
} catch(InvalidTypeException e) {
116115
}
117116

118-
if (LOGGER.isDebugEnabled())
117+
if (log.isDebugEnabled())
119118
{
120119
StringBuilder builder = new StringBuilder("Received Query Request:");
121120
builder.append("\r\n\tName: " + name.toString());
122121
builder.append("\r\n\tType: " + (typeString == null ? type : typeString));
123122
builder.append("\r\n\tDClass: " + queryRecord.getDClass());
124-
LOGGER.debug(builder.toString());
123+
log.debug(builder.toString());
125124
}
126125

127-
LOGGER.info("Process record for DNS request type " + (typeString == null ? type : typeString) + " and name " + name.toString());
126+
log.info("Process record for DNS request type " + (typeString == null ? type : typeString) + " and name " + name.toString());
128127

129128
Collection<Record> lookupRecords= null;
130129
switch (type)
@@ -144,10 +143,7 @@ public Message get(Message request) throws DNSException
144143

145144
if (set != null)
146145
{
147-
lookupRecords = new ArrayList<Record>();
148-
Iterator<Record> iter = set.rrs();
149-
while (iter.hasNext())
150-
lookupRecords.add(iter.next());
146+
lookupRecords = set.rrs();
151147
}
152148

153149
}
@@ -163,10 +159,7 @@ public Message get(Message request) throws DNSException
163159

164160
if (set != null)
165161
{
166-
lookupRecords = new ArrayList<Record>();
167-
Iterator<Record> iter = set.rrs();
168-
while (iter.hasNext())
169-
lookupRecords.add(iter.next());
162+
lookupRecords = set.rrs();
170163
}
171164

172165
break;
@@ -185,25 +178,23 @@ public Message get(Message request) throws DNSException
185178

186179
if (certRecs != null)
187180
{
188-
Iterator<Record> iter = certRecs.rrs();
189-
while (iter.hasNext())
190-
lookupRecords.add(iter.next());
181+
lookupRecords = certRecs.rrs();
191182
}
192183
}
193184

194185
break;
195186
}
196187
default:
197188
{
198-
LOGGER.debug("Query Type " + (typeString == null ? type : typeString) + " not implemented");
189+
log.debug("Query Type " + (typeString == null ? type : typeString) + " not implemented");
199190
throw new DNSException(DNSError.newError(Rcode.NOTIMP), "Query Type " + (typeString == null ? type : typeString) + " not implemented");
200191
}
201192
}
202193

203194

204195
if (lookupRecords == null || lookupRecords.size() == 0)
205196
{
206-
LOGGER.debug("No records found.");
197+
log.debug("No records found.");
207198
return null;
208199
}
209200

@@ -225,7 +216,7 @@ public Message get(Message request) throws DNSException
225216
if (soaRecord != null)
226217
response.addRecord(soaRecord, Section.AUTHORITY);
227218

228-
LOGGER.trace("get(Message) Exit");
219+
log.trace("get(Message) Exit");
229220

230221
return response;
231222
}
@@ -263,7 +254,7 @@ protected boolean isCertCompliantWithPolicy(X509Certificate cert)
263254
}
264255
catch (Exception e)
265256
{
266-
LOGGER.warn("Error testing certificate for policy compliance. Default to compliant.", e);
257+
log.warn("Error testing certificate for policy compliance. Default to compliant.", e);
267258
return true;
268259
}
269260
}

0 commit comments

Comments
 (0)