package org.opennms.netmgt.correlation.drools;


public class FlapCount {
    Long m_nodeid;
    String m_ipAddr;
    String m_svcName;
    Integer m_locationMonitor;
    boolean m_alerted;

    Integer m_count;
    
    public FlapCount(Long nodeid, String ipAddr, String svcName, Integer locationMonitor) {
        m_nodeid = nodeid;
        m_ipAddr = ipAddr;
        m_svcName = svcName;
        m_locationMonitor = locationMonitor;
        m_count = 1;
        m_alerted = false;
    }
    
    public void increment() {
        m_count += 1;
    }
    
    public void decrement() {
        m_count -= 1;
    }

    public Integer getCount() {
        return m_count;
    }

    public void setCount(Integer count) {
        m_count = count;
    }

    public String getIpAddr() {
        return m_ipAddr;
    }

    public void setIpAddr(String ipAddr) {
        m_ipAddr = ipAddr;
    }

    public Long getNodeid() {
        return m_nodeid;
    }

    public void setNodeid(Long nodeid) {
        m_nodeid = nodeid;
    }

    public String getSvcName() {
        return m_svcName;
    }

    public void setSvcName(String svcName) {
        m_svcName = svcName;
    }

    public boolean isAlerted() {
        return m_alerted;
    }

    public void setAlerted(boolean alerted) {
        m_alerted = alerted;
    }

    public Integer getLocationMonitor() {
        return m_locationMonitor;
    }

    public void setLocationMonitor(Integer locationMonitor) {
        m_locationMonitor = locationMonitor;
    }

}

@@ -41,16 +41,96 @@
 rools;%0A%0A
+import java.util.Date;%0A%0Aimport org.springframework.core.style.ToStringCreator;%0A%0A
 %0Apublic 
@@ -566,128 +566,348 @@
     
-%7D%0A    %0A    public void increment() %7B%0A        m_count += 1;%0A    %7D%0A    %0A    public void decrement() %7B%0A        m_count -= 1
+    %0A        System.err.println(new Date()+%22 FlapCount.created : %22+this);%0A    %7D%0A    %0A    public void increment() %7B%0A        m_count += 1;%0A        System.err.println(new Date()+%22 FlapCount.increment : %22+this);%0A    %7D%0A    %0A    public void decrement() %7B%0A        m_count -= 1;%0A        System.err.println(new Date()+%22 FlapCount.decrement : %22+this)
 ;%0A  
@@ -1816,12 +1816,379 @@
 r;%0A    %7D
+%0A    %0A    public String toString() %7B%0A        ToStringCreator creator = new ToStringCreator(this);%0A        creator.append(%22nodeid%22, m_nodeid);%0A        creator.append(%22ipAddr%22, m_ipAddr);%0A        creator.append(%22svcName%22, m_svcName);%0A        creator.append(%22locMon%22, m_locationMonitor);%0A        creator.append(%22count%22, m_count);%0A        return creator.toString();%0A    %7D
 %0A%0A%7D%0A

add some diagnostic msgs