Removed Lombok from Java bind9 plugin
authorTomas Kirnak <tomas@unimus.net>
Mon, 10 Oct 2016 15:49:26 +0000 (17:49 +0200)
committerTomas Kirnak <tomas@unimus.net>
Mon, 10 Oct 2016 15:49:26 +0000 (17:49 +0200)
src/agent/subagents/bind9/pom.xml
src/agent/subagents/bind9/src/main/java/com/github/tomaskir/netxms/subagents/bind9/Bind9Plugin.java
src/agent/subagents/bind9/src/main/java/com/github/tomaskir/netxms/subagents/bind9/Parameters.java
src/agent/subagents/bind9/src/main/java/com/github/tomaskir/netxms/subagents/bind9/collection/CollectionResult.java
src/agent/subagents/bind9/src/main/java/com/github/tomaskir/netxms/subagents/bind9/collection/Collector.java

index e777ddc..83a063e 100644 (file)
 
     <properties>
         <java.version>1.7</java.version>
-        <lombok.version>1.16.10</lombok.version>
     </properties>
 
     <dependencies>
         <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
-            <version>${lombok.version}</version>
-        </dependency>
-
-        <dependency>
             <groupId>org.netxms</groupId>
             <artifactId>netxms-agent</artifactId>
             <version>${project.version}</version>
index 2681bf8..d88b40b 100644 (file)
@@ -49,13 +49,13 @@ public final class Bind9Plugin extends Plugin {
                     "in 'bind9' section of Agent configuration");
         }
 
-        this.collector = Collector.builder()
-                .statsFile(Paths.get(statsFile))
-                .collectionInterval(collectionInterval)
-                .supportedParameters(supportedParameters)
-                .result(collectionResult)
-                .dataCollectionLock(dataCollectionLock)
-                .build();
+        this.collector = new Collector(
+                collectionInterval,
+                Paths.get(statsFile),
+                supportedParameters,
+                collectionResult,
+                dataCollectionLock
+        );
 
         this.collectionThread = new Thread(collector);
     }
index b23dd76..3089e9b 100644 (file)
@@ -1,7 +1,5 @@
 package com.github.tomaskir.netxms.subagents.bind9;
 
-import lombok.Getter;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -17,9 +15,13 @@ import java.util.List;
  */
 public final class Parameters {
 
-    @Getter
     private final List<String[]> list = new ArrayList<>();
 
+    // getter
+    public List<String[]> getList() {
+        return list;
+    }
+
     // constructor
     Parameters() {
         list.add(new String[]{
index 0496e66..ca671e9 100644 (file)
@@ -1,8 +1,5 @@
 package com.github.tomaskir.netxms.subagents.bind9.collection;
 
-import lombok.Getter;
-import lombok.Setter;
-
 import java.util.HashMap;
 import java.util.Map;
 
@@ -12,11 +9,23 @@ import java.util.Map;
  */
 public final class CollectionResult {
 
-    @Getter
-    @Setter
     private boolean collectionError = true;
 
-    @Getter
     private final Map<String, String> result = new HashMap<>();
 
+    // getter
+    public boolean isCollectionError() {
+        return collectionError;
+    }
+
+    // setter
+    public void setCollectionError(boolean collectionError) {
+        this.collectionError = collectionError;
+    }
+
+    // getter
+    public Map<String, String> getResult() {
+        return result;
+    }
+
 }
index a924962..65449ee 100644 (file)
@@ -2,7 +2,6 @@ package com.github.tomaskir.netxms.subagents.bind9.collection;
 
 import com.github.tomaskir.netxms.subagents.bind9.Parameters;
 import com.github.tomaskir.netxms.subagents.bind9.exceptions.StatsFileRemovalException;
-import lombok.Builder;
 import org.netxms.agent.SubAgent;
 
 import java.io.IOException;
@@ -29,7 +28,6 @@ public final class Collector implements Runnable {
     private boolean threadRunning = true;
 
     // constructor
-    @Builder
     public Collector(long collectionInterval, Path statsFile, Parameters supportedParameters,
                      CollectionResult result, ReadWriteLock dataCollectionLock) {
         this.collectionInterval = collectionInterval;