private String hostname;
- public static long POLLING_PERIOD = 30 * 1000L;
+ public static final long POLLING_PERIOD = 30 * 1000L;
private String prevConfigMd5 = Md5Util.md5(null);
Thread.sleep(60000);
} catch (InterruptedException e1) {
log.info("Thread is still active.", e);
+ Thread.currentThread().interrupt();
}
} catch (Exception e) {
log.error("An error occurred while processing alarm. Sleep for 60 seconds to restart.", e);
Thread.sleep(60000);
} catch (InterruptedException e1) {
log.info("Thread is still active.", e);
+ Thread.currentThread().interrupt();
}
}
}
public String getSwaggerJson() {
URL url = SwaggerResource.class.getResource("/swagger.json");
String ret = "{}";
+ BufferedReader br = null;
try {
System.out.println(URLDecoder.decode(url.getPath(), "UTF-8"));
File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
- BufferedReader br = new BufferedReader(new FileReader(file));
+ br = new BufferedReader(new FileReader(file));
StringBuffer buffer = new StringBuffer();
String line = " ";
while ((line = br.readLine()) != null) {
log.warn("Failed to read the API description file.");
} catch (IOException e) {
log.warn("An error occurred while reading swagger.json.");
+ } finally {
+ if (br != null) {
+ try {
+ br.close();
+ } catch (IOException e) {
+ log.warn("Failed to close the file reader. This may cause memory leak.");
+ }
+ }
}
return ret;
}
<stringtemplate.version>3.2.1</stringtemplate.version>
<postgres.jdbc.driver.version>42.1.1</postgres.jdbc.driver.version>
- <dropwizard.version>0.8.0</dropwizard.version>
+ <dropwizard.version>0.9.3</dropwizard.version>
<swagger.version>1.5.3</swagger.version>
<lombok.version>1.16.8</lombok.version>
<jersey.version>2.22.2</jersey.version>
<dependency>
<groupId>org.onap.holmes.common</groupId>
<artifactId>holmes-actions</artifactId>
- <version>${project.version}</version>
+ <version>1.0.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>io.dropwizard</groupId>
+ <artifactId>dropwizard-db</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.dropwizard</groupId>
+ <artifactId>dropwizard-core</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.onap.holmes.dsa</groupId>