Class DASThriftTestServer


  • public class DASThriftTestServer
    extends Object
    This class is used to start a test thrift server to simulate DAS event receiver. It used to test APIM stat publishing to DAS
    • Constructor Detail

      • DASThriftTestServer

        public DASThriftTestServer()
    • Method Detail

      • setTenantId

        public void setTenantId​(int tenantId)
      • setTenantDomain

        public void setTenantDomain​(String tenantDomain)
      • clearTables

        public void clearTables()
      • getDataTables

        public Map<String,​List<org.wso2.carbon.databridge.commons.Event>> getDataTables()
      • resetTables

        public void resetTables()
      • addStreamDefinition

        public void addStreamDefinition​(org.wso2.carbon.databridge.commons.StreamDefinition streamDefinition,
                                        int tenantId)
                                 throws org.wso2.carbon.databridge.core.exception.StreamDefinitionStoreException
        Throws:
        org.wso2.carbon.databridge.core.exception.StreamDefinitionStoreException
      • addStreamDefinition

        public void addStreamDefinition​(String streamDefinitionStr,
                                        int tenantId)
                                 throws org.wso2.carbon.databridge.core.exception.StreamDefinitionStoreException,
                                        org.wso2.carbon.databridge.commons.exception.MalformedStreamDefinitionException
        Throws:
        org.wso2.carbon.databridge.core.exception.StreamDefinitionStoreException
        org.wso2.carbon.databridge.commons.exception.MalformedStreamDefinitionException
      • start

        public void start​(int receiverPort)
                   throws org.wso2.carbon.databridge.core.exception.DataBridgeException
        Throws:
        org.wso2.carbon.databridge.core.exception.DataBridgeException
      • getNumberOfEventsReceived

        public int getNumberOfEventsReceived()
      • resetReceivedEvents

        public void resetReceivedEvents()
      • stop

        public void stop()
      • stopAndStartDuration

        public void stopAndStartDuration​(int port,
                                         long stopAfterTimeMilliSeconds,
                                         long startAfterTimeMS)
                                  throws SocketException,
                                         org.wso2.carbon.databridge.core.exception.DataBridgeException
        Throws:
        SocketException
        org.wso2.carbon.databridge.core.exception.DataBridgeException
      • getEventsReceivedBeforeLastRestart

        public int getEventsReceivedBeforeLastRestart()