2 new revisions:

Revision: ee121a371675
Author:   Sergey Vetyutnev <[email protected]>
Date:     Thu Aug 15 09:47:44 2013
Log:      TCAP counters implementing - part 2
http://code.google.com/p/jss7/source/detail?r=ee121a371675

Revision: 182ca47a6d99
Author:   Sergey Vetyutnev <[email protected]>
Date:     Thu Aug 15 09:49:12 2013
Log:      Merge remote-tracking branch 'origin/cap42'
http://code.google.com/p/jss7/source/detail?r=182ca47a6d99

==============================================================================
Revision: ee121a371675
Author:   Sergey Vetyutnev <[email protected]>
Date:     Thu Aug 15 09:47:44 2013
Log:      TCAP counters implementing - part 2
http://code.google.com/p/jss7/source/detail?r=ee121a371675

Modified:
/tcap-ansi/tcap-ansi-impl/src/main/java/org/mobicents/protocols/ss7/tcapAnsi/TCAPProviderImpl.java /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/api/TCAPCounterProvider.java /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/api/TCAPStack.java
 /tcap/tcap-impl/pom.xml
/tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/DialogImpl.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPCounterProviderImpl.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPProviderImpl.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPStackImpl.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/ApplicationContextNameImpl.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/ErrorCodeImpl.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/OperationCodeImpl.java /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/ProblemImpl.java

=======================================
--- /tcap-ansi/tcap-ansi-impl/src/main/java/org/mobicents/protocols/ss7/tcapAnsi/TCAPProviderImpl.java Mon Aug 5 11:53:50 2013 +++ /tcap-ansi/tcap-ansi-impl/src/main/java/org/mobicents/protocols/ss7/tcapAnsi/TCAPProviderImpl.java Thu Aug 15 09:47:44 2013
@@ -661,7 +661,7 @@
this.sendRejectAsProviderAbort(PAbortCause.ResourceUnavailable, tcb.getOriginatingTransactionId(), remoteAddress, localAddress,
                                 message.getSls());
                     }
- logger.error("Too many registered current dialogs when receiving TCQueryMessage"); + logger.error("Can not add a new dialog when receiving TCBeginMessage: " + e.getMessage(), e);
                     return;
                 }

=======================================
--- /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/api/TCAPCounterProvider.java Thu Aug 8 05:31:27 2013 +++ /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/api/TCAPCounterProvider.java Thu Aug 15 09:47:44 2013
@@ -42,7 +42,7 @@
     /**
      * return a count of received since Stack restart TC-UNI messages
      */
-    long getTcUniRecievedCount();
+    long getTcUniReceivedCount();

     /**
      * return a count of sent since Stack restart TC-UNI messages
@@ -52,7 +52,7 @@
     /**
      * return a count of received since Stack restart TC-BEGIN messages
      */
-    long getTcBeginRecievedCount();
+    long getTcBeginReceivedCount();

     /**
      * return a count of sent since Stack restart TC-BEGIN messages
@@ -62,7 +62,7 @@
     /**
      * return a count of received since Stack restart TC-CONTINUE messages
      */
-    long getTcContinueRecievedCount();
+    long getTcContinueReceivedCount();

     /**
      * return a count of sent since Stack restart TC-CONTINUE messages
@@ -72,7 +72,7 @@
     /**
      * return a count of received since Stack restart TC-END messages
      */
-    long getTcEndRecievedCount();
+    long getTcEndReceivedCount();

     /**
      * return a count of sent since Stack restart TC-END messages
@@ -82,7 +82,7 @@
     /**
* return a count of received since Stack restart TC-PROVIDER-ABORT messages
      */
-    long getTcPAbortRecievedCount();
+    long getTcPAbortReceivedCount();

     /**
* return a count of sent since Stack restart TC-PROVIDER-ABORT messages
@@ -92,7 +92,7 @@
     /**
* return a count of received since Stack restart TC-USER-ABORT messages
      */
-    long getTcUserAbortRecievedCount();
+    long getTcUserAbortReceivedCount();

     /**
      * return a count of sent since Stack restart TC-USER-ABORT messages
@@ -102,7 +102,7 @@
     /**
      * return a count of received since Stack restart Invoke components
      */
-    long getInvokeRecievedCount();
+    long getInvokeReceivedCount();

     /**
      * return a count of sent since Stack restart Invoke components
@@ -112,7 +112,7 @@
     /**
* return a count of received since Stack restart ReturtResult components
      */
-    long getReturnResultRecievedCount();
+    long getReturnResultReceivedCount();

     /**
      * return a count of sent since Stack restart ReturtResult components
@@ -122,7 +122,7 @@
     /**
* return a count of received since Stack restart ReturtResultLast components
      */
-    long getReturnResultLastRecievedCount();
+    long getReturnResultLastReceivedCount();

     /**
* return a count of sent since Stack restart ReturtResultLast components
@@ -132,7 +132,7 @@
     /**
* return a count of received since Stack restart ReturnError components
      */
-    long getReturnErrorRecievedCount();
+    long getReturnErrorReceivedCount();

     /**
      * return a count of sent since Stack restart ReturnError components
@@ -142,18 +142,13 @@
     /**
      * return a count of received since Stack restart Reject components
      */
-    long getRejectRecievedCount();
+    long getRejectReceivedCount();

     /**
      * return a count of sent since Stack restart Reject components
      */
     long getRejectSentCount();

-    /**
-     * return a count of received since Stack restart DialogRequests
-     */
-    long getDialogRequestCount();
-
     /**
      * return a count of received since Stack restart DialogTimeouts
      */
@@ -173,7 +168,17 @@
     /**
      * return a count of all established Dialogs since stack start
      */
-    long getAllDialogsCount();
+    long getAllEstablishedDialogsCount();
+
+    /**
+ * return a count of all established local originated Dialogs since stack start
+     */
+    long getAllLocalEstablishedDialogsCount();
+
+    /**
+ * return a count of all established remote originated Dialogs since stack start
+     */
+    long getAllRemoteEstablishedDialogsCount();

     /**
      * return a min count of established Dialogs
=======================================
--- /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/api/TCAPStack.java Thu Aug 8 05:31:27 2013 +++ /tcap/tcap-api/src/main/java/org/mobicents/protocols/ss7/tcap/api/TCAPStack.java Thu Aug 15 09:47:44 2013
@@ -129,4 +129,8 @@

     boolean getDoNotSendProtocolVersion();

+    void setStatisticsEnabled(boolean val);
+
+    boolean getStatisticsEnabled();
+
 }
=======================================
--- /tcap/tcap-impl/pom.xml     Thu Jun 20 08:10:49 2013
+++ /tcap/tcap-impl/pom.xml     Thu Aug 15 09:47:44 2013
@@ -21,6 +21,10 @@
                        <artifactId>asn</artifactId>
                </dependency>
                <dependency>
+                       
<groupId>org.mobicents.protocols.ss7.statistics</groupId>
+                       <artifactId>statistics</artifactId>
+               </dependency>
+               <dependency>
                        <groupId>org.mobicents.protocols.ss7.sccp</groupId>
                        <artifactId>sccp-api</artifactId>
                </dependency>
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/DialogImpl.java Thu Aug 8 05:31:27 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/DialogImpl.java Thu Aug 15 09:47:44 2013
@@ -23,6 +23,7 @@
 package org.mobicents.protocols.ss7.tcap;

 import java.util.ArrayList;
+import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -51,6 +52,7 @@
 import org.mobicents.protocols.ss7.tcap.asn.AbortSource;
 import org.mobicents.protocols.ss7.tcap.asn.AbortSourceType;
 import org.mobicents.protocols.ss7.tcap.asn.ApplicationContextName;
+import org.mobicents.protocols.ss7.tcap.asn.ApplicationContextNameImpl;
 import org.mobicents.protocols.ss7.tcap.asn.DialogAPDU;
 import org.mobicents.protocols.ss7.tcap.asn.DialogAPDUType;
 import org.mobicents.protocols.ss7.tcap.asn.DialogAbortAPDU;
@@ -61,7 +63,9 @@
 import org.mobicents.protocols.ss7.tcap.asn.DialogServiceUserType;
 import org.mobicents.protocols.ss7.tcap.asn.DialogUniAPDU;
 import org.mobicents.protocols.ss7.tcap.asn.EncodeException;
+import org.mobicents.protocols.ss7.tcap.asn.ErrorCodeImpl;
 import org.mobicents.protocols.ss7.tcap.asn.InvokeImpl;
+import org.mobicents.protocols.ss7.tcap.asn.OperationCodeImpl;
 import org.mobicents.protocols.ss7.tcap.asn.ProblemImpl;
 import org.mobicents.protocols.ss7.tcap.asn.Result;
 import org.mobicents.protocols.ss7.tcap.asn.ResultSourceDiagnostic;
@@ -78,11 +82,13 @@
 import org.mobicents.protocols.ss7.tcap.asn.Utils;
 import org.mobicents.protocols.ss7.tcap.asn.comp.Component;
 import org.mobicents.protocols.ss7.tcap.asn.comp.ComponentType;
+import org.mobicents.protocols.ss7.tcap.asn.comp.Invoke;
 import org.mobicents.protocols.ss7.tcap.asn.comp.InvokeProblemType;
 import org.mobicents.protocols.ss7.tcap.asn.comp.PAbortCauseType;
 import org.mobicents.protocols.ss7.tcap.asn.comp.Problem;
 import org.mobicents.protocols.ss7.tcap.asn.comp.ProblemType;
 import org.mobicents.protocols.ss7.tcap.asn.comp.Reject;
+import org.mobicents.protocols.ss7.tcap.asn.comp.ReturnError;
 import org.mobicents.protocols.ss7.tcap.asn.comp.ReturnErrorProblemType;
 import org.mobicents.protocols.ss7.tcap.asn.comp.ReturnResultProblemType;
 import org.mobicents.protocols.ss7.tcap.asn.comp.TCAbortMessage;
@@ -164,6 +170,7 @@

     private boolean previewMode = false;
     protected PrevewDialogData prevewDialogData;
+    private Date startDialogTime = null;

     private static int getIndexFromInvokeId(Long l) {
         int tmp = l.intValue();
@@ -206,6 +213,8 @@
         TCAPStack stack = this.provider.getStack();
         this.idleTaskTimeout = stack.getDialogIdleTimeout();

+        startDialogTime = new Date();
+
         // start
         startIdleTimer();
     }
@@ -270,6 +279,11 @@
                 }
             }
         }
+
+        if (this.provider.getStack().getStatisticsEnabled()) {
+ long lg = (new Date()).getTime() - this.startDialogTime.getTime(); + this.provider.getStack().getCounterProviderImpl().updateAllDialogsDuration(lg);
+        }

         this.setState(TRPseudoState.Expunged);
     }
@@ -511,6 +525,15 @@
                     this.lastUI = event.getUserInformation();
                 }
                 tcbm.setDialogPortion(dp);
+
+                if (this.provider.getStack().getStatisticsEnabled()) {
+ String acn = ((ApplicationContextNameImpl) event.getApplicationContextName()).getStringValue(); + this.provider.getStack().getCounterProviderImpl().updateOutgoingDialogsPerApplicatioContextName(acn);
+                }
+            } else {
+                if (this.provider.getStack().getStatisticsEnabled()) {
+ this.provider.getStack().getCounterProviderImpl().updateOutgoingDialogsPerApplicatioContextName("");
+                }
             }

             // now comps
@@ -525,7 +548,9 @@
             try {
                 tcbm.encode(aos);
                 this.setState(TRPseudoState.InitialSent);
- this.provider.getStack().getCounterProviderImpl().addTcBeginSentCount();
+                if (this.provider.getStack().getStatisticsEnabled()) {
+ this.provider.getStack().getCounterProviderImpl().updateTcBeginSentCount();
+                }
this.provider.send(aos.toByteArray(), event.getReturnMessageOnError(), this.remoteAddress, this.localAddress,
                         this.seqControl);
                 this.scheduledComponentList.clear();
@@ -603,7 +628,9 @@
                 AsnOutputStream aos = new AsnOutputStream();
                 try {
                     tcbm.encode(aos);
- this.provider.getStack().getCounterProviderImpl().addTcContinueSentCount();
+                    if (this.provider.getStack().getStatisticsEnabled()) {
+ this.provider.getStack().getCounterProviderImpl().updateTcContinueSentCount();
+                    }
this.provider.send(aos.toByteArray(), event.getReturnMessageOnError(), this.remoteAddress,
                             this.localAddress, this.seqControl);
                     this.setState(TRPseudoState.Active);
@@ -634,7 +661,7 @@
                 AsnOutputStream aos = new AsnOutputStream();
                 try {
                     tcbm.encode(aos);
- this.provider.getStack().getCounterProviderImpl().addTcContinueSentCount(); + this.provider.getStack().getCounterProviderImpl().updateTcContinueSentCount(); this.provider.send(aos.toByteArray(), event.getReturnMessageOnError(), this.remoteAddress,
                             this.localAddress, this.seqControl);
                     this.scheduledComponentList.clear();
@@ -755,7 +782,9 @@
             AsnOutputStream aos = new AsnOutputStream();
             try {
                 tcbm.encode(aos);
- this.provider.getStack().getCounterProviderImpl().addTcEndSentCount();
+                if (this.provider.getStack().getStatisticsEnabled()) {
+ this.provider.getStack().getCounterProviderImpl().updateTcEndSentCount();
+                }
this.provider.send(aos.toByteArray(), event.getReturnMessageOnError(), this.remoteAddress, this.localAddress,
                         this.seqControl);

@@ -818,7 +847,9 @@
             AsnOutputStream aos = new AsnOutputStream();
             try {
                 msg.encode(aos);
- this.provider.getStack().getCounterProviderImpl().addTcUniSentCount();
+                if (this.provider.getStack().getStatisticsEnabled()) {
+ this.provider.getStack().getCounterProviderImpl().updateTcUniSentCount();
+                }
this.provider.send(aos.toByteArray(), event.getReturnMessageOnError(), this.remoteAddress, this.localAddress,
                         this.seqControl);
                 this.scheduledComponentList.clear();
@@ -915,7 +946,9 @@
                 AsnOutputStream aos = new AsnOutputStream();
                 try {
                     msg.encode(aos);
- this.provider.getStack().getCounterProviderImpl().addTcUserAbortSentCount();
+                    if (this.provider.getStack().getStatisticsEnabled()) {
+ this.provider.getStack().getCounterProviderImpl().updateTcUserAbortSentCount();
+                    }
this.provider.send(aos.toByteArray(), event.getReturnMessageOnError(), this.remoteAddress,
                             this.localAddress, this.seqControl);

@@ -947,6 +980,44 @@
         if (this.previewMode)
             return;

+        if (this.provider.getStack().getStatisticsEnabled()) {
+            switch (componentRequest.getType()) {
+            case Invoke:
+ this.provider.getStack().getCounterProviderImpl().updateInvokeSentCount();
+
+                Invoke inv = (Invoke) componentRequest;
+ OperationCodeImpl oc = (OperationCodeImpl) inv.getOperationCode();
+                if (oc != null) {
+ this.provider.getStack().getCounterProviderImpl().updateOutgoingInvokesPerOperationCode(oc.getStringValue());
+                }
+                break;
+            case ReturnResult:
+ this.provider.getStack().getCounterProviderImpl().updateReturnResultSentCount();
+                break;
+            case ReturnResultLast:
+ this.provider.getStack().getCounterProviderImpl().updateReturnResultLastSentCount();
+                break;
+            case ReturnError:
+ this.provider.getStack().getCounterProviderImpl().updateReturnErrorSentCount();
+
+                ReturnError re = (ReturnError) componentRequest;
+                ErrorCodeImpl ec = (ErrorCodeImpl) re.getErrorCode();
+                if (ec != null) {
+ this.provider.getStack().getCounterProviderImpl().updateOutgoingErrorsPerErrorCode(ec.getStringValue());
+                }
+                break;
+            case Reject:
+ this.provider.getStack().getCounterProviderImpl().updateRejectSentCount();
+
+                Reject rej = (Reject) componentRequest;
+                ProblemImpl prob = (ProblemImpl) rej.getProblem();
+                if (prob != null) {
+ this.provider.getStack().getCounterProviderImpl().updateOutgoingRejectPerProblem(prob.getStringValue());
+                }
+                break;
+            }
+        }
+
         try {
             this.dialogLock.lock();
             if (componentRequest.getType() == ComponentType.Invoke) {
@@ -1309,12 +1380,23 @@
                 this.lastUI = requestAPDU.getUserInformation();
                 tcBeginIndication.setApplicationContextName(this.lastACN);
                 tcBeginIndication.setUserInformation(this.lastUI);
+
+                if (this.provider.getStack().getStatisticsEnabled()) {
+ String acn = ((ApplicationContextNameImpl) tcBeginIndication.getApplicationContextName()).getStringValue(); + this.provider.getStack().getCounterProviderImpl().updateIncomingDialogsPerApplicatioContextName(acn);
+                }
+            } else {
+                if (this.provider.getStack().getStatisticsEnabled()) {
+ this.provider.getStack().getCounterProviderImpl().updateIncomingDialogsPerApplicatioContextName("");
+                }
             }
+
tcBeginIndication.setComponents(processOperationsState(msg.getComponent()));
             if (!this.previewMode) {
                 // change state - before we deliver
                 this.setState(TRPseudoState.InitialReceived);
             }
+
             // lets deliver to provider
             this.provider.deliver(this, tcBeginIndication);

@@ -1647,7 +1729,9 @@
                 AsnOutputStream aos = new AsnOutputStream();
                 try {
                     msg.encode(aos);
- this.provider.getStack().getCounterProviderImpl().addTcPAbortSentCount();
+                    if (this.provider.getStack().getStatisticsEnabled()) {
+ this.provider.getStack().getCounterProviderImpl().updateTcPAbortSentCount();
+                    }
this.provider.send(aos.toByteArray(), false, this.remoteAddress, this.localAddress, this.seqControl);
                 } catch (Exception e) {
                     if (logger.isEnabledFor(Level.ERROR)) {
@@ -1670,36 +1754,6 @@
             this.dialogLock.unlock();
         }
     }
-
-    // protected void sendProviderAbort(PAbortCauseType pAbortCause) {
-    //
-    // if (this.previewMode)
-    // return;
-    //
-    // TCPAbortIndicationImpl tcAbortIndication = null;
-    // try {
-    // this.dialogLock.lock();
-    //
-    // try {
-    // // sending to the remote side
- // this.provider.sendProviderAbort(pAbortCause, this.remoteTransactionId, this.remoteAddress,
-    // this.localAddress, this.seqControl);
-    //
-    // // sending to the local side
- // tcAbortIndication = (TCPAbortIndicationImpl) ((DialogPrimitiveFactoryImpl) this.provider
-    // .getDialogPrimitiveFactory()).createPAbortIndication(this);
-    // tcAbortIndication.setPAbortCause(pAbortCause);
-    // tcAbortIndication.setLocalProviderOriginated(true);
-    //
-    // this.provider.deliver(this, tcAbortIndication);
-    // } finally {
-    // this.release();
-    // // this.scheduledComponentList.clear();
-    // }
-    // } finally {
-    // this.dialogLock.unlock();
-    // }
-    // }

     protected Component[] processOperationsState(Component[] components) {
         if (components == null) {
@@ -1848,13 +1902,54 @@
                     resultingIndications.add(ci);
                     break;
             }
-
         }

         components = new Component[resultingIndications.size()];
         components = resultingIndications.toArray(components);
-        return components;

+        if (this.provider.getStack().getStatisticsEnabled()) {
+            for (Component comp : components) {
+                switch (comp.getType()) {
+                case Invoke:
+ this.provider.getStack().getCounterProviderImpl().updateInvokeReceivedCount();
+
+                    Invoke inv = (Invoke) comp;
+ OperationCodeImpl oc = (OperationCodeImpl) inv.getOperationCode();
+                    if (oc != null) {
+ this.provider.getStack().getCounterProviderImpl().updateIncomingInvokesPerOperationCode(oc.getStringValue());
+                    }
+                    break;
+                case ReturnResult:
+ this.provider.getStack().getCounterProviderImpl().updateReturnResultReceivedCount();
+                    break;
+                case ReturnResultLast:
+ this.provider.getStack().getCounterProviderImpl().updateReturnResultLastReceivedCount();
+                    break;
+                case ReturnError:
+ this.provider.getStack().getCounterProviderImpl().updateReturnErrorReceivedCount();
+
+                    ReturnError re = (ReturnError) comp;
+                    ErrorCodeImpl ec = (ErrorCodeImpl) re.getErrorCode();
+                    if (ec != null) {
+ this.provider.getStack().getCounterProviderImpl().updateIncomingErrorsPerErrorCode(ec.getStringValue());
+                    }
+                    break;
+                case Reject:
+                    Reject rej = (Reject) comp;
+                    if (!rej.isLocalOriginated()) {
+ this.provider.getStack().getCounterProviderImpl().updateRejectReceivedCount();
+
+                        ProblemImpl prob = (ProblemImpl) rej.getProblem();
+                        if (prob != null) {
+ this.provider.getStack().getCounterProviderImpl().updateIncomingRejectPerProblem(prob.getStringValue());
+                        }
+                    }
+                    break;
+                }
+            }
+        }
+
+        return components;
     }

private void addReject(List<Component> resultingIndications, Long invokeId, Problem p) {
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPCounterProviderImpl.java Thu Aug 8 05:31:27 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPCounterProviderImpl.java Thu Aug 15 09:47:44 2013
@@ -25,28 +25,73 @@
 import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicLong;
-
+import org.mobicents.protocols.ss7.statistics.StatDataCollection;
+import org.mobicents.protocols.ss7.statistics.StatDataCollectorType;
+import org.mobicents.protocols.ss7.statistics.StringLongMap;
 import org.mobicents.protocols.ss7.tcap.api.TCAPCounterProvider;

+/**
+ *
+ * @author sergey vetyutnev
+ *
+ */
 public class TCAPCounterProviderImpl implements TCAPCounterProvider {

     private UUID sessionId = UUID.randomUUID();

-    private AtomicLong tcUniRecievedCount = new AtomicLong();
+    private TCAPProviderImpl provider;
+ private StatDataCollection statDataCollection = new StatDataCollection();
+
+    private AtomicLong tcUniReceivedCount = new AtomicLong();
     private AtomicLong tcUniSentCount = new AtomicLong();
-    private AtomicLong tcBeginRecievedCount = new AtomicLong();
+    private AtomicLong tcBeginReceivedCount = new AtomicLong();
     private AtomicLong tcBeginSentCount = new AtomicLong();
-    private AtomicLong tcContinueRecievedCount = new AtomicLong();
+    private AtomicLong tcContinueReceivedCount = new AtomicLong();
     private AtomicLong tcContinueSentCount = new AtomicLong();
-    private AtomicLong tcEndRecievedCount = new AtomicLong();
+    private AtomicLong tcEndReceivedCount = new AtomicLong();
     private AtomicLong tcEndSentCount = new AtomicLong();
-    private AtomicLong tcPAbortRecievedCount = new AtomicLong();
+    private AtomicLong tcPAbortReceivedCount = new AtomicLong();
     private AtomicLong tcPAbortSentCount = new AtomicLong();
-    private AtomicLong tcUserAbortRecievedCount = new AtomicLong();
+    private AtomicLong tcUserAbortReceivedCount = new AtomicLong();
     private AtomicLong tcUserAbortSentCount = new AtomicLong();

+    private AtomicLong invokeReceivedCount = new AtomicLong();
+    private AtomicLong invokeSentCount = new AtomicLong();
+    private AtomicLong returnResultReceivedCount = new AtomicLong();
+    private AtomicLong returnResultSentCount = new AtomicLong();
+    private AtomicLong returnResultLastReceivedCount = new AtomicLong();
+    private AtomicLong returnResultLastSentCount = new AtomicLong();
+    private AtomicLong returnErrorReceivedCount = new AtomicLong();
+    private AtomicLong returnErrorSentCount = new AtomicLong();
+    private AtomicLong rejectReceivedCount = new AtomicLong();
+    private AtomicLong rejectSentCount = new AtomicLong();

-    public TCAPCounterProviderImpl() {
+    private AtomicLong dialogTimeoutCount = new AtomicLong();
+    private AtomicLong dialogReleaseCount = new AtomicLong();
+
+    private AtomicLong allEstablishedDialogsCount = new AtomicLong();
+    private AtomicLong allLocalEstablishedDialogsCount = new AtomicLong();
+    private AtomicLong allRemoteEstablishedDialogsCount = new AtomicLong();
+
+    private Double allDialogsDuration = 0.0;
+
+ private StringLongMap outgoingDialogsPerApplicatioContextName = new StringLongMap(); + private StringLongMap incomingDialogsPerApplicatioContextName = new StringLongMap(); + private StringLongMap outgoingInvokesPerOperationCode = new StringLongMap(); + private StringLongMap incomingInvokesPerOperationCode = new StringLongMap();
+    private StringLongMap outgoingErrorsPerErrorCode = new StringLongMap();
+    private StringLongMap incomingErrorsPerErrorCode = new StringLongMap();
+    private StringLongMap outgoingRejectPerProblem = new StringLongMap();
+    private StringLongMap incomingRejectPerProblem = new StringLongMap();
+
+    private static String MIN_DIALOGS_COUNT = "MinDialogsCount";
+    private static String MAX_DIALOGS_COUNT = "MaxDialogsCount";
+
+    public TCAPCounterProviderImpl(TCAPProviderImpl provider) {
+        this.provider = provider;
+
+ this.statDataCollection.registerStatCounterCollector(MIN_DIALOGS_COUNT, StatDataCollectorType.MIN); + this.statDataCollection.registerStatCounterCollector(MAX_DIALOGS_COUNT, StatDataCollectorType.MAX);
     }


@@ -57,12 +102,12 @@


     @Override
-    public long getTcUniRecievedCount() {
-        return tcUniRecievedCount.get();
+    public long getTcUniReceivedCount() {
+        return tcUniReceivedCount.get();
     }

-    public void addTcUniRecievedCount() {
-        tcUniRecievedCount.addAndGet(1);
+    public void updateTcUniReceivedCount() {
+        tcUniReceivedCount.addAndGet(1);
     }

     @Override
@@ -70,17 +115,17 @@
         return tcUniSentCount.get();
     }

-    public void addTcUniSentCount() {
+    public void updateTcUniSentCount() {
         tcUniSentCount.addAndGet(1);
     }

     @Override
-    public long getTcBeginRecievedCount() {
-        return tcBeginRecievedCount.get();
+    public long getTcBeginReceivedCount() {
+        return tcBeginReceivedCount.get();
     }

-    public void addTcBeginRecievedCount() {
-        tcBeginRecievedCount.addAndGet(1);
+    public void updateTcBeginReceivedCount() {
+        tcBeginReceivedCount.addAndGet(1);
     }

     @Override
@@ -88,17 +133,17 @@
         return tcBeginSentCount.get();
     }

-    public void addTcBeginSentCount() {
+    public void updateTcBeginSentCount() {
         tcBeginSentCount.addAndGet(1);
     }

     @Override
-    public long getTcContinueRecievedCount() {
-        return tcContinueRecievedCount.get();
+    public long getTcContinueReceivedCount() {
+        return tcContinueReceivedCount.get();
     }

-    public void addTcContinueRecievedCount() {
-        tcContinueRecievedCount.addAndGet(1);
+    public void updateTcContinueReceivedCount() {
+        tcContinueReceivedCount.addAndGet(1);
     }

     @Override
@@ -106,17 +151,17 @@
         return tcContinueSentCount.get();
     }

-    public void addTcContinueSentCount() {
+    public void updateTcContinueSentCount() {
         tcContinueSentCount.addAndGet(1);
     }

     @Override
-    public long getTcEndRecievedCount() {
-        return tcEndRecievedCount.get();
+    public long getTcEndReceivedCount() {
+        return tcEndReceivedCount.get();
     }

-    public void addTcEndRecievedCount() {
-        tcEndRecievedCount.addAndGet(1);
+    public void updateTcEndReceivedCount() {
+        tcEndReceivedCount.addAndGet(1);
     }

     @Override
@@ -124,17 +169,17 @@
         return tcEndSentCount.get();
     }

-    public void addTcEndSentCount() {
+    public void updateTcEndSentCount() {
         tcEndSentCount.addAndGet(1);
     }

     @Override
-    public long getTcPAbortRecievedCount() {
-        return tcPAbortRecievedCount.get();
+    public long getTcPAbortReceivedCount() {
+        return tcPAbortReceivedCount.get();
     }

-    public void addTcPAbortRecievedCount() {
-        tcPAbortRecievedCount.addAndGet(1);
+    public void updateTcPAbortReceivedCount() {
+        tcPAbortReceivedCount.addAndGet(1);
     }

     @Override
@@ -142,17 +187,17 @@
         return tcPAbortSentCount.get();
     }

-    public void addTcPAbortSentCount() {
+    public void updateTcPAbortSentCount() {
         tcPAbortSentCount.addAndGet(1);
     }

     @Override
-    public long getTcUserAbortRecievedCount() {
-        return tcUserAbortRecievedCount.get();
+    public long getTcUserAbortReceivedCount() {
+        return tcUserAbortReceivedCount.get();
     }

-    public void addTcUserAbortRecievedCount() {
-        tcUserAbortRecievedCount.addAndGet(1);
+    public void updateTcUserAbortReceivedCount() {
+        tcUserAbortReceivedCount.addAndGet(1);
     }

     @Override
@@ -160,168 +205,258 @@
         return tcUserAbortSentCount.get();
     }

-    public void addTcUserAbortSentCount() {
+    public void updateTcUserAbortSentCount() {
         tcUserAbortSentCount.addAndGet(1);
     }
-
-
-
-    //.............................

     @Override
-    public long getInvokeRecievedCount() {
-        // TODO Auto-generated method stub
-        return 0;
+    public long getInvokeReceivedCount() {
+        return invokeReceivedCount.get();
+    }
+
+    public void updateInvokeReceivedCount() {
+        invokeReceivedCount.addAndGet(1);
     }

     @Override
     public long getInvokeSentCount() {
-        // TODO Auto-generated method stub
-        return 0;
+        return invokeSentCount.get();
+    }
+
+    public void updateInvokeSentCount() {
+        invokeSentCount.addAndGet(1);
     }

     @Override
-    public long getReturnResultRecievedCount() {
-        // TODO Auto-generated method stub
-        return 0;
+    public long getReturnResultReceivedCount() {
+        return returnResultReceivedCount.get();
+    }
+
+    public void updateReturnResultReceivedCount() {
+        returnResultReceivedCount.addAndGet(1);
     }

     @Override
     public long getReturnResultSentCount() {
-        // TODO Auto-generated method stub
-        return 0;
+        return returnResultSentCount.get();
+    }
+
+    public void updateReturnResultSentCount() {
+        returnResultSentCount.addAndGet(1);
     }

     @Override
-    public long getReturnResultLastRecievedCount() {
-        // TODO Auto-generated method stub
-        return 0;
+    public long getReturnResultLastReceivedCount() {
+        return returnResultLastReceivedCount.get();
+    }
+
+    public void updateReturnResultLastReceivedCount() {
+        returnResultLastReceivedCount.addAndGet(1);
     }

     @Override
     public long getReturnResultLastSentCount() {
-        // TODO Auto-generated method stub
-        return 0;
+        return returnResultLastSentCount.get();
+    }
+
+    public void updateReturnResultLastSentCount() {
+        returnResultLastSentCount.addAndGet(1);
     }

     @Override
-    public long getReturnErrorRecievedCount() {
-        // TODO Auto-generated method stub
-        return 0;
+    public long getReturnErrorReceivedCount() {
+        return returnErrorReceivedCount.get();
+    }
+
+    public void updateReturnErrorReceivedCount() {
+        returnErrorReceivedCount.addAndGet(1);
     }

     @Override
     public long getReturnErrorSentCount() {
-        // TODO Auto-generated method stub
-        return 0;
+        return returnErrorSentCount.get();
+    }
+
+    public void updateReturnErrorSentCount() {
+        returnErrorSentCount.addAndGet(1);
     }

     @Override
-    public long getRejectRecievedCount() {
-        // TODO Auto-generated method stub
-        return 0;
+    public long getRejectReceivedCount() {
+        return rejectReceivedCount.get();
+    }
+
+    public void updateRejectReceivedCount() {
+        rejectReceivedCount.addAndGet(1);
     }

     @Override
     public long getRejectSentCount() {
-        // TODO Auto-generated method stub
-        return 0;
+        return rejectSentCount.get();
     }

-    @Override
-    public long getDialogRequestCount() {
-        // TODO Auto-generated method stub
-        return 0;
+    public void updateRejectSentCount() {
+        rejectSentCount.addAndGet(1);
     }

     @Override
     public long getDialogTimeoutCount() {
-        // TODO Auto-generated method stub
-        return 0;
+        return dialogTimeoutCount.get();
+    }
+
+    public void updateDialogTimeoutCount() {
+        dialogTimeoutCount.addAndGet(1);
     }

     @Override
     public long getDialogReleaseCount() {
-        // TODO Auto-generated method stub
-        return 0;
+        return dialogReleaseCount.get();
+    }
+
+    public void updateDialogReleaseCount() {
+        dialogReleaseCount.addAndGet(1);
     }
+

     @Override
     public long getCurrentDialogsCount() {
-        // TODO Auto-generated method stub
-        return 0;
+        return provider.getCurrentDialogsCount();
+    }
+
+    @Override
+    public long getAllEstablishedDialogsCount() {
+        return allEstablishedDialogsCount.get();
+    }
+
+    public void updateAllEstablishedDialogsCount() {
+        allEstablishedDialogsCount.addAndGet(1);
+    }
+
+    @Override
+    public long getAllLocalEstablishedDialogsCount() {
+        return allLocalEstablishedDialogsCount.get();
+    }
+
+    public void updateAllLocalEstablishedDialogsCount() {
+        allLocalEstablishedDialogsCount.addAndGet(1);
     }

     @Override
-    public long getAllDialogsCount() {
-        // TODO Auto-generated method stub
-        return 0;
+    public long getAllRemoteEstablishedDialogsCount() {
+        return allRemoteEstablishedDialogsCount.get();
+    }
+
+    public void updateAllRemoteEstablishedDialogsCount() {
+        allRemoteEstablishedDialogsCount.addAndGet(1);
     }

     @Override
     public Long getMinDialogsCount(String compainName) {
-        // TODO Auto-generated method stub
-        return null;
+ return this.statDataCollection.restartAndGet(MIN_DIALOGS_COUNT, compainName, provider.getCurrentDialogsCount());
+    }
+
+    public void updateMinDialogsCount(long newVal) {
+        this.statDataCollection.updateData(MIN_DIALOGS_COUNT, newVal);
     }

     @Override
     public Long getMaxDialogsCount(String compainName) {
-        // TODO Auto-generated method stub
-        return null;
+ return this.statDataCollection.restartAndGet(MAX_DIALOGS_COUNT, compainName, provider.getCurrentDialogsCount());
+    }
+
+    public void updateMaxDialogsCount(long newVal) {
+        this.statDataCollection.updateData(MAX_DIALOGS_COUNT, newVal);
     }

     @Override
     public double getAllDialogsDuration() {
-        // TODO Auto-generated method stub
-        return 0;
+        return allDialogsDuration;
+    }
+
+    public void updateAllDialogsDuration(double diff) {
+        synchronized (allDialogsDuration) {
+            allDialogsDuration += diff;
+        }
     }

     @Override
     public Map<String, Long> getOutgoingDialogsPerApplicatioContextName() {
-        // TODO Auto-generated method stub
-        return null;
+ Map<String, Long> res = outgoingDialogsPerApplicatioContextName.restartAndGet();
+        return res;
+    }
+
+ public void updateOutgoingDialogsPerApplicatioContextName(String name) {
+        outgoingDialogsPerApplicatioContextName.updateData(name);
     }

     @Override
     public Map<String, Long> getIncomingDialogsPerApplicatioContextName() {
-        // TODO Auto-generated method stub
-        return null;
+ Map<String, Long> res = incomingDialogsPerApplicatioContextName.restartAndGet();
+        return res;
+    }
+
+ public void updateIncomingDialogsPerApplicatioContextName(String name) {
+        incomingDialogsPerApplicatioContextName.updateData(name);
     }

     @Override
     public Map<String, Long> getOutgoingInvokesPerOperationCode() {
-        // TODO Auto-generated method stub
-        return null;
+ Map<String, Long> res = outgoingInvokesPerOperationCode.restartAndGet();
+        return res;
+    }
+
+    public void updateOutgoingInvokesPerOperationCode(String name) {
+        outgoingInvokesPerOperationCode.updateData(name);
     }

     @Override
     public Map<String, Long> getIncomingInvokesPerOperationCode() {
-        // TODO Auto-generated method stub
-        return null;
+ Map<String, Long> res = incomingInvokesPerOperationCode.restartAndGet();
+        return res;
+    }
+
+    public void updateIncomingInvokesPerOperationCode(String name) {
+        incomingInvokesPerOperationCode.updateData(name);
     }

     @Override
     public Map<String, Long> getOutgoingErrorsPerErrorCode() {
-        // TODO Auto-generated method stub
-        return null;
+        Map<String, Long> res = outgoingErrorsPerErrorCode.restartAndGet();
+        return res;
+    }
+
+    public void updateOutgoingErrorsPerErrorCode(String name) {
+        outgoingErrorsPerErrorCode.updateData(name);
     }

     @Override
     public Map<String, Long> getIncomingErrorsPerErrorCode() {
-        // TODO Auto-generated method stub
-        return null;
+        Map<String, Long> res = incomingErrorsPerErrorCode.restartAndGet();
+        return res;
+    }
+
+    public void updateIncomingErrorsPerErrorCode(String name) {
+        incomingErrorsPerErrorCode.updateData(name);
     }

     @Override
     public Map<String, Long> getOutgoingRejectPerProblem() {
-        // TODO Auto-generated method stub
-        return null;
+        Map<String, Long> res = outgoingRejectPerProblem.restartAndGet();
+        return res;
+    }
+
+    public void updateOutgoingRejectPerProblem(String name) {
+        outgoingRejectPerProblem.updateData(name);
     }

     @Override
     public Map<String, Long> getIncomingRejectPerProblem() {
-        // TODO Auto-generated method stub
-        return null;
+        Map<String, Long> res = incomingRejectPerProblem.restartAndGet();
+        return res;
+    }
+
+    public void updateIncomingRejectPerProblem(String name) {
+        incomingRejectPerProblem.updateData(name);
     }

 }
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPProviderImpl.java Thu Aug 8 05:31:27 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPProviderImpl.java Thu Aug 15 09:47:44 2013
@@ -215,7 +215,12 @@
* .protocols.ss7.sccp.parameter.SccpAddress, org.mobicents.protocols.ss7.sccp.parameter.SccpAddress)
      */
public Dialog getNewDialog(SccpAddress localAddress, SccpAddress remoteAddress) throws TCAPException { - return getNewDialog(localAddress, remoteAddress, getNextSeqControl(), null); + Dialog res = getNewDialog(localAddress, remoteAddress, getNextSeqControl(), null);
+        if (this.stack.getStatisticsEnabled()) {
+ this.stack.getCounterProviderImpl().updateAllLocalEstablishedDialogsCount(); + this.stack.getCounterProviderImpl().updateAllEstablishedDialogsCount();
+        }
+        return res;
     }

     /*
@@ -225,7 +230,12 @@
* .protocols.ss7.sccp.parameter.SccpAddress, org.mobicents.protocols.ss7.sccp.parameter.SccpAddress, Long id)
      */
public Dialog getNewDialog(SccpAddress localAddress, SccpAddress remoteAddress, Long id) throws TCAPException { - return getNewDialog(localAddress, remoteAddress, getNextSeqControl(), id); + Dialog res = getNewDialog(localAddress, remoteAddress, getNextSeqControl(), id);
+        if (this.stack.getStatisticsEnabled()) {
+ this.stack.getCounterProviderImpl().updateAllLocalEstablishedDialogsCount(); + this.stack.getCounterProviderImpl().updateAllEstablishedDialogsCount();
+        }
+        return res;
     }

     /*
@@ -265,6 +275,10 @@
DialogImpl di = new DialogImpl(localAddress, remoteAddress, id, structured, this._EXECUTOR, this, seqControl, this.stack.getPreviewMode());

                 this.dialogs.put(id, di);
+                if (this.stack.getStatisticsEnabled()) {
+ this.stack.getCounterProviderImpl().updateMinDialogsCount(this.dialogs.size()); + this.stack.getCounterProviderImpl().updateMaxDialogsCount(this.dialogs.size());
+                }

                 return di;
             } else {
@@ -273,6 +287,10 @@
             }
         }
     }
+
+    protected long getCurrentDialogsCount() {
+        return this.dialogs.size();
+    }

public void send(byte[] data, boolean returnMessageOnError, SccpAddress destinationAddress, SccpAddress originatingAddress,
             int seqControl) throws IOException {
@@ -290,7 +308,9 @@

     public void deliver(DialogImpl dialogImpl, TCBeginIndicationImpl msg) {

-        this.stack.getCounterProviderImpl().addTcBeginRecievedCount();
+        if (this.stack.getStatisticsEnabled()) {
+ this.stack.getCounterProviderImpl().updateTcBeginReceivedCount();
+        }
         try {
             for (TCListener lst : this.tcListeners) {
                 lst.onTCBegin(msg);
@@ -305,7 +325,9 @@

public void deliver(DialogImpl dialogImpl, TCContinueIndicationImpl tcContinueIndication) {

-        this.stack.getCounterProviderImpl().addTcContinueRecievedCount();
+        if (this.stack.getStatisticsEnabled()) {
+ this.stack.getCounterProviderImpl().updateTcContinueReceivedCount();
+        }
         try {
             for (TCListener lst : this.tcListeners) {
                 lst.onTCContinue(tcContinueIndication);
@@ -320,7 +342,9 @@

public void deliver(DialogImpl dialogImpl, TCEndIndicationImpl tcEndIndication) {

-        this.stack.getCounterProviderImpl().addTcEndRecievedCount();
+        if (this.stack.getStatisticsEnabled()) {
+            this.stack.getCounterProviderImpl().updateTcEndReceivedCount();
+        }
         try {
             for (TCListener lst : this.tcListeners) {
                 lst.onTCEnd(tcEndIndication);
@@ -334,7 +358,9 @@

public void deliver(DialogImpl dialogImpl, TCPAbortIndicationImpl tcAbortIndication) {

-        this.stack.getCounterProviderImpl().addTcPAbortRecievedCount();
+        if (this.stack.getStatisticsEnabled()) {
+ this.stack.getCounterProviderImpl().updateTcPAbortReceivedCount();
+        }
         try {
             for (TCListener lst : this.tcListeners) {
                 lst.onTCPAbort(tcAbortIndication);
@@ -349,7 +375,9 @@

public void deliver(DialogImpl dialogImpl, TCUserAbortIndicationImpl tcAbortIndication) {

-        this.stack.getCounterProviderImpl().addTcUserAbortRecievedCount();
+        if (this.stack.getStatisticsEnabled()) {
+ this.stack.getCounterProviderImpl().updateTcUserAbortReceivedCount();
+        }
         try {
             for (TCListener lst : this.tcListeners) {
                 lst.onTCUserAbort(tcAbortIndication);
@@ -364,7 +392,9 @@

public void deliver(DialogImpl dialogImpl, TCUniIndicationImpl tcUniIndication) {

-        this.stack.getCounterProviderImpl().addTcUniRecievedCount();
+        if (this.stack.getStatisticsEnabled()) {
+            this.stack.getCounterProviderImpl().updateTcUniReceivedCount();
+        }
         try {
             for (TCListener lst : this.tcListeners) {
                 lst.onTCUni(tcUniIndication);
@@ -394,6 +424,10 @@
         if (!d.getPreviewMode()) {
             synchronized (this.dialogs) {
                 this.dialogs.remove(did);
+                if (this.stack.getStatisticsEnabled()) {
+ this.stack.getCounterProviderImpl().updateMinDialogsCount(this.dialogs.size()); + this.stack.getCounterProviderImpl().updateMaxDialogsCount(this.dialogs.size());
+                }
             }

             this.doRelease(d);
@@ -401,6 +435,10 @@
     }

     private void doRelease(DialogImpl d) {
+
+        if (this.stack.getStatisticsEnabled()) {
+            this.stack.getCounterProviderImpl().updateDialogReleaseCount();
+        }
         try {
             for (TCListener lst : this.tcListeners) {
                 lst.onDialogReleased(d);
@@ -416,6 +454,10 @@
      * @param d
      */
     public void timeout(DialogImpl d) {
+
+        if (this.stack.getStatisticsEnabled()) {
+            this.stack.getCounterProviderImpl().updateDialogTimeoutCount();
+        }
         try {
             for (TCListener lst : this.tcListeners) {
                 lst.onDialogTimeout(d);
@@ -479,7 +521,9 @@
         AsnOutputStream aos = new AsnOutputStream();
         try {
             msg.encode(aos);
-            this.stack.getCounterProviderImpl().addTcPAbortSentCount();
+            if (this.stack.getStatisticsEnabled()) {
+ this.stack.getCounterProviderImpl().updateTcPAbortSentCount();
+            }
this.send(aos.toByteArray(), false, remoteAddress, localAddress, seqControl);
         } catch (Exception e) {
             if (logger.isEnabledFor(Level.ERROR)) {
@@ -515,7 +559,9 @@
         AsnOutputStream aos = new AsnOutputStream();
         try {
             msg.encode(aos);
-            this.stack.getCounterProviderImpl().addTcPAbortSentCount();
+            if (this.stack.getStatisticsEnabled()) {
+ this.stack.getCounterProviderImpl().updateTcPAbortSentCount();
+            }
this.send(aos.toByteArray(), false, remoteAddress, localAddress, seqControl);
         } catch (Exception e) {
             if (logger.isEnabledFor(Level.ERROR)) {
@@ -652,9 +698,14 @@

                 } catch (TCAPException e) {
this.sendProviderAbort(PAbortCauseType.ResourceLimitation, tcb.getOriginatingTransactionId(), remoteAddress, localAddress, message.getSls()); - logger.error("Too many registered current dialogs when receiving TCBeginMessage: " + e.getMessage(), e); + logger.error("Can not add a new dialog when receiving TCBeginMessage: " + e.getMessage(), e);
                     return;
                 }
+
+                if (this.stack.getStatisticsEnabled()) {
+ this.stack.getCounterProviderImpl().updateAllRemoteEstablishedDialogsCount(); + this.stack.getCounterProviderImpl().updateAllEstablishedDialogsCount();
+                }
                 di.processBegin(tcb, localAddress, remoteAddress);

                 if (this.stack.getPreviewMode()) {
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPStackImpl.java Thu Aug 8 05:31:27 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/TCAPStackImpl.java Thu Aug 15 09:47:44 2013
@@ -61,6 +61,7 @@
     private long dialogIdRangeEnd = Integer.MAX_VALUE;
     private boolean previewMode = false;
     private boolean doNotSendProtocolVersion = false;
+    private boolean statisticsEnabled = false;

     public TCAPStackImpl() {
         super();
@@ -70,7 +71,7 @@
     public TCAPStackImpl(SccpProvider sccpProvider, int ssn) {
         this.sccpProvider = sccpProvider;
         this.tcapProvider = new TCAPProviderImpl(sccpProvider, this, ssn);
-        this.tcapCounterProvider = new TCAPCounterProviderImpl();
+ this.tcapCounterProvider = new TCAPCounterProviderImpl(this.tcapProvider);
     }

     public void start() throws Exception {
@@ -99,7 +100,7 @@
throw new IllegalArgumentException("InvokeTimeout value must be greater or equal to zero.");
         }

-        this.tcapCounterProvider = new TCAPCounterProviderImpl();
+ this.tcapCounterProvider = new TCAPCounterProviderImpl(this.tcapProvider);
         tcapProvider.start();

         this.started = true;
@@ -236,5 +237,18 @@
     public boolean getDoNotSendProtocolVersion() {
         return doNotSendProtocolVersion;
     }
+
+    @Override
+    public void setStatisticsEnabled(boolean val) {
+        if (started) {
+ this.tcapCounterProvider = new TCAPCounterProviderImpl(this.tcapProvider);
+        }
+        statisticsEnabled = val;
+    }
+
+    @Override
+    public boolean getStatisticsEnabled() {
+        return statisticsEnabled;
+    }

 }
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/ApplicationContextNameImpl.java Mon May 20 13:09:00 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/ApplicationContextNameImpl.java Thu Aug 15 09:47:44 2013
@@ -104,6 +104,10 @@
     public void setOid(long[] oid) {
         this.oid = oid;
     }
+
+    public String getStringValue() {
+        return Arrays.toString(oid);
+    }

     public String toString() {
         return "ApplicationContextName[oid=" + Arrays.toString(oid) + "]";
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/ErrorCodeImpl.java Mon May 20 13:09:00 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/ErrorCodeImpl.java Thu Aug 15 09:47:44 2013
@@ -69,6 +69,15 @@
     public ErrorCodeType getErrorType() {
         return type;
     }
+
+    public String getStringValue() {
+        if (this.localErrorCode != null)
+            return this.localErrorCode.toString();
+        else if (this.globalErrorCode != null)
+            return Arrays.toString(this.globalErrorCode);
+        else
+            return "empty";
+    }

     public String toString() {
         if (this.localErrorCode != null)
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/OperationCodeImpl.java Mon May 20 13:09:00 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/OperationCodeImpl.java Thu Aug 15 09:47:44 2013
@@ -80,6 +80,15 @@
     public long[] getGlobalOperationCode() {
         return this.globalOperationCode;
     }
+
+    public String getStringValue() {
+        if (this.localOperationCode != null)
+            return this.localOperationCode.toString();
+        else if (this.globalOperationCode != null)
+            return Arrays.toString(this.globalOperationCode);
+        else
+            return "empty";
+    }

     public String toString() {
         if (this.localOperationCode != null)
=======================================
--- /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/ProblemImpl.java Mon May 20 13:09:00 2013 +++ /tcap/tcap-impl/src/main/java/org/mobicents/protocols/ss7/tcap/asn/ProblemImpl.java Thu Aug 15 09:47:44 2013
@@ -122,6 +122,29 @@
         this.returnResultProblemType = returnResultProblemType;
         this.setType(ProblemType.ReturnResult);
     }
+
+    public String getStringValue() {
+        StringBuilder sb = new StringBuilder();
+        switch (type) {
+        case General:
+            sb.append("generalProblemType=");
+            sb.append(this.generalProblemType);
+            break;
+        case Invoke:
+            sb.append("invokeProblemType=");
+            sb.append(this.invokeProblemType);
+            break;
+        case ReturnResult:
+            sb.append("returnResultProblemType=");
+            sb.append(this.returnResultProblemType);
+            break;
+        case ReturnError:
+            sb.append("returnErrorProblemType=");
+            sb.append(this.returnErrorProblemType);
+            break;
+        }
+        return sb.toString();
+    }

     public String toString() {
         StringBuilder sb = new StringBuilder();

==============================================================================
Revision: 182ca47a6d99
Author:   Sergey Vetyutnev <[email protected]>
Date:     Thu Aug 15 09:49:12 2013
Log:      Merge remote-tracking branch 'origin/cap42'
http://code.google.com/p/jss7/source/detail?r=182ca47a6d99


--

--- You received this message because you are subscribed to the Google Groups "mobicents-commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to