Commit 6e21a94c authored by ReemyHasan's avatar ReemyHasan

Code cleaning 4

parent 2c8cc537
package com.example.SnmpReciever.enitites;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.snmp4j.PDUv1;
import org.snmp4j.smi.VariableBinding;
import java.util.ArrayList;
import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class TrapData {
@JsonProperty("enterprise")
public String enterprise;
......@@ -26,16 +34,16 @@ public class TrapData {
@JsonProperty("variableBindings")
public List<VarBind> variableBindings = new ArrayList<VarBind>();
public TrapData(String enterprise, String agentAddress, int genericTrap, int specificTrap, long timestamp, List<VariableBinding> trapVariableBindings) {
this.enterprise = enterprise;
this.genericTrap = genericTrap;
this.specificTrap = specificTrap;
this.timestamp = timestamp;
this.agentAddress = agentAddress;
for (VariableBinding vb : trapVariableBindings) {
this.variableBindings.add(new VarBind(vb));
}
}
// public TrapData(String enterprise, String agentAddress, int genericTrap, int specificTrap, long timestamp, List<VariableBinding> trapVariableBindings) {
// this.enterprise = enterprise;
// this.genericTrap = genericTrap;
// this.specificTrap = specificTrap;
// this.timestamp = timestamp;
// this.agentAddress = agentAddress;
// for (VariableBinding vb : trapVariableBindings) {
// this.variableBindings.add(new VarBind(vb));
// }
// }
public TrapData(PDUv1 pdu){
this.enterprise = pdu.getEnterprise().toString();
......@@ -50,56 +58,56 @@ public class TrapData {
}
}
public TrapData() {
}
public String getEnterprise() {
return enterprise;
}
public void setEnterprise(String enterprise) {
this.enterprise = enterprise;
}
public int getGenericTrap() {
return genericTrap;
}
public void setGenericTrap(int genericTrap) {
this.genericTrap = genericTrap;
}
public int getSpecificTrap() {
return specificTrap;
}
public void setSpecificTrap(int specificTrap) {
this.specificTrap = specificTrap;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public List<VarBind> getVariableBindings() {
return variableBindings;
}
public void setVariableBindings(List<VarBind> variableBindings) {
this.variableBindings = variableBindings;
}
public String getAgentAddress() {
return agentAddress;
}
public void setAgentAddress(String agentAddress) {
this.agentAddress = agentAddress;
}
// public TrapData() {
// }
// public String getEnterprise() {
// return enterprise;
// }
//
// public void setEnterprise(String enterprise) {
// this.enterprise = enterprise;
// }
//
// public int getGenericTrap() {
// return genericTrap;
// }
//
// public void setGenericTrap(int genericTrap) {
// this.genericTrap = genericTrap;
// }
//
// public int getSpecificTrap() {
// return specificTrap;
// }
//
// public void setSpecificTrap(int specificTrap) {
// this.specificTrap = specificTrap;
// }
//
// public long getTimestamp() {
// return timestamp;
// }
//
// public void setTimestamp(long timestamp) {
// this.timestamp = timestamp;
// }
//
// public List<VarBind> getVariableBindings() {
// return variableBindings;
// }
//
// public void setVariableBindings(List<VarBind> variableBindings) {
// this.variableBindings = variableBindings;
// }
//
// public String getAgentAddress() {
// return agentAddress;
// }
//
// public void setAgentAddress(String agentAddress) {
// this.agentAddress = agentAddress;
// }
public void print(){
System.out.println("enterprise = " + this.getEnterprise());
System.out.println("enterprise = " + this.getAgentAddress());
......
package com.example.SnmpReciever.enitites;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.snmp4j.smi.VariableBinding;
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class VarBind {
@JsonProperty("oid")
public String oid;
@JsonProperty("value")
public String value;
public VarBind(String oid, String value) {
this.oid = oid;
this.value = value;
}
// public VarBind(String oid, String value) {
// this.oid = oid;
// this.value = value;
// }
public VarBind(VariableBinding vb){
this.oid = vb.getOid().toString();
this.value = vb.getVariable().toString();
}
public VarBind() {
}
public String getOid() {
return oid;
}
public void setOid(String oid) {
this.oid = oid;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
// public VarBind() {
// }
// public String getOid() {
// return oid;
// }
//
// public void setOid(String oid) {
// this.oid = oid;
// }
//
// public String getValue() {
// return value;
// }
//
// public void setValue(String value) {
// this.value = value;
// }
public void print(){
System.out.println("oid = "+ this.getOid() + "," + "value = "+ this.getValue());
}
......
package com.example.kafkaConsumerSNMP.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.snmp4j.PDUv1;
import org.snmp4j.smi.VariableBinding;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class TrapData {
@JsonProperty("enterprise")
public String enterprise;
......@@ -20,16 +28,16 @@ public class TrapData {
public long timestamp;
@JsonProperty("variableBindings")
public List<VarBind> variableBindings = new ArrayList<VarBind>();
public TrapData(String enterprise, String agentAddress, int genericTrap, int specificTrap, long timestamp, List<VariableBinding> trapVariableBindings) {
this.enterprise = enterprise;
this.genericTrap = genericTrap;
this.specificTrap = specificTrap;
this.timestamp = timestamp;
this.agentAddress = agentAddress;
for (VariableBinding vb : trapVariableBindings) {
this.variableBindings.add(new VarBind(vb));
}
}
// public TrapData(String enterprise, String agentAddress, int genericTrap, int specificTrap, long timestamp, List<VariableBinding> trapVariableBindings) {
// this.enterprise = enterprise;
// this.genericTrap = genericTrap;
// this.specificTrap = specificTrap;
// this.timestamp = timestamp;
// this.agentAddress = agentAddress;
// for (VariableBinding vb : trapVariableBindings) {
// this.variableBindings.add(new VarBind(vb));
// }
// }
public TrapData(PDUv1 pdu){
this.enterprise = pdu.getEnterprise().toString();
this.genericTrap = pdu.getGenericTrap();
......@@ -43,56 +51,56 @@ public class TrapData {
}
}
public TrapData() {
}
public String getEnterprise() {
return enterprise;
}
public void setEnterprise(String enterprise) {
this.enterprise = enterprise;
}
public int getGenericTrap() {
return genericTrap;
}
public void setGenericTrap(int genericTrap) {
this.genericTrap = genericTrap;
}
public int getSpecificTrap() {
return specificTrap;
}
public void setSpecificTrap(int specificTrap) {
this.specificTrap = specificTrap;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public List<VarBind> getVariableBindings() {
return variableBindings;
}
public void setVariableBindings(List<VarBind> variableBindings) {
this.variableBindings = variableBindings;
}
public String getAgentAddress() {
return agentAddress;
}
public void setAgentAddress(String agentAddress) {
this.agentAddress = agentAddress;
}
// public TrapData() {
// }
// public String getEnterprise() {
// return enterprise;
// }
//
// public void setEnterprise(String enterprise) {
// this.enterprise = enterprise;
// }
//
// public int getGenericTrap() {
// return genericTrap;
// }
//
// public void setGenericTrap(int genericTrap) {
// this.genericTrap = genericTrap;
// }
//
// public int getSpecificTrap() {
// return specificTrap;
// }
//
// public void setSpecificTrap(int specificTrap) {
// this.specificTrap = specificTrap;
// }
//
// public long getTimestamp() {
// return timestamp;
// }
//
// public void setTimestamp(long timestamp) {
// this.timestamp = timestamp;
// }
//
// public List<VarBind> getVariableBindings() {
// return variableBindings;
// }
//
// public void setVariableBindings(List<VarBind> variableBindings) {
// this.variableBindings = variableBindings;
// }
//
// public String getAgentAddress() {
// return agentAddress;
// }
//
// public void setAgentAddress(String agentAddress) {
// this.agentAddress = agentAddress;
// }
public void print(){
System.out.println("enterprise = " + this.getEnterprise());
System.out.println("enterprise = " + this.getAgentAddress());
......
package com.example.kafkaConsumerSNMP.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.snmp4j.smi.VariableBinding;
@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
public class VarBind {
@JsonProperty("oid")
public String oid;
@JsonProperty("value")
public String value;
public VarBind(String oid, String value) {
this.oid = oid;
this.value = value;
}
// public VarBind(String oid, String value) {
// this.oid = oid;
// this.value = value;
// }
public VarBind(VariableBinding vb){
this.oid = vb.getOid().toString();
this.value = vb.getVariable().toString();
}
public VarBind() {
}
public String getOid() {
return oid;
}
public void setOid(String oid) {
this.oid = oid;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
// public VarBind() {
// }
//
// public String getOid() {
// return oid;
// }
//
// public void setOid(String oid) {
// this.oid = oid;
// }
//
// public String getValue() {
// return value;
// }
//
// public void setValue(String value) {
// this.value = value;
// }
public void print(){
System.out.println("oid = "+ this.getOid() + "," + "value = "+ this.getValue());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment