changeset 684:2f43e5c1f20d

com.passus.st.reader.nc.block package deleted
author Devel 2
date Thu, 23 Nov 2017 14:39:08 +0100
parents 4440624b0c6d
children 25d4e7b3722e
files stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlock.java stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockReader.java stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockWriter.java stress-tester/src/main/java/com/passus/st/reader/nc/NcHttpDataReader.java stress-tester/src/main/java/com/passus/st/reader/nc/NcSegmentBlock.java stress-tester/src/main/java/com/passus/st/reader/nc/NcSessionBlock.java stress-tester/src/main/java/com/passus/st/reader/nc/NcSessionInfoBlock.java stress-tester/src/main/java/com/passus/st/reader/nc/NcSessionPayloadBlock.java stress-tester/src/main/java/com/passus/st/reader/nc/NcSessionStatusBlock.java stress-tester/src/main/java/com/passus/st/reader/nc/block/NcDataBlock.java stress-tester/src/main/java/com/passus/st/reader/nc/block/NcSegmentBlock.java stress-tester/src/main/java/com/passus/st/reader/nc/block/NcSessionBlock.java stress-tester/src/main/java/com/passus/st/reader/nc/block/NcSessionInfoBlock.java stress-tester/src/main/java/com/passus/st/reader/nc/block/NcSessionPayloadBlock.java stress-tester/src/main/java/com/passus/st/reader/nc/block/NcSessionStatusBlock.java stress-tester/src/main/java/com/passus/st/source/NcEventDestination.java stress-tester/src/test/java/com/passus/st/reader/nc/NcDataBlockReaderTest.java stress-tester/src/test/java/com/passus/st/reader/nc/NcDataBlockWriterTest.java
diffstat 18 files changed, 317 insertions(+), 331 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlock.java	Thu Nov 23 14:39:08 2017 +0100
@@ -0,0 +1,11 @@
+package com.passus.st.reader.nc;
+
+/**
+ *
+ * @author Mirosław Hawrot
+ */
+public interface NcDataBlock {
+
+    public byte type();
+
+}
--- a/stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockReader.java	Thu Nov 23 13:54:46 2017 +0100
+++ b/stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockReader.java	Thu Nov 23 14:39:08 2017 +0100
@@ -8,11 +8,6 @@
 import com.passus.net.session.SessionBean;
 import com.passus.st.emitter.SessionInfo;
 import com.passus.st.reader.DataBlockReader;
-import com.passus.st.reader.nc.block.NcDataBlock;
-import com.passus.st.reader.nc.block.NcSegmentBlock;
-import com.passus.st.reader.nc.block.NcSessionInfoBlock;
-import com.passus.st.reader.nc.block.NcSessionPayloadBlock;
-import com.passus.st.reader.nc.block.NcSessionStatusBlock;
 import java.io.File;
 import java.io.IOException;
 import java.nio.ByteBuffer;
--- a/stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockWriter.java	Thu Nov 23 13:54:46 2017 +0100
+++ b/stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockWriter.java	Thu Nov 23 14:39:08 2017 +0100
@@ -6,11 +6,6 @@
 import com.passus.data.DataSource;
 import com.passus.st.emitter.SessionInfo;
 import com.passus.st.reader.DataBlockWriter;
-import com.passus.st.reader.nc.block.NcDataBlock;
-import com.passus.st.reader.nc.block.NcSegmentBlock;
-import com.passus.st.reader.nc.block.NcSessionInfoBlock;
-import com.passus.st.reader.nc.block.NcSessionPayloadBlock;
-import com.passus.st.reader.nc.block.NcSessionStatusBlock;
 import java.io.File;
 import java.io.IOException;
 import java.nio.ByteBuffer;
--- a/stress-tester/src/main/java/com/passus/st/reader/nc/NcHttpDataReader.java	Thu Nov 23 13:54:46 2017 +0100
+++ b/stress-tester/src/main/java/com/passus/st/reader/nc/NcHttpDataReader.java	Thu Nov 23 14:39:08 2017 +0100
@@ -2,7 +2,6 @@
 
 import com.passus.net.http.HttpMessage;
 import com.passus.st.reader.DataBlockReader;
-import com.passus.st.reader.nc.block.NcDataBlock;
 import java.io.IOException;
 
 /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stress-tester/src/main/java/com/passus/st/reader/nc/NcSegmentBlock.java	Thu Nov 23 14:39:08 2017 +0100
@@ -0,0 +1,57 @@
+package com.passus.st.reader.nc;
+
+/**
+ *
+ * @author Mirosław Hawrot
+ */
+public class NcSegmentBlock implements NcDataBlock {
+
+    public static final byte TYPE = 1;
+
+    public static final int HEADER_SIZE = 10;
+
+    private long totalSize;
+
+    private long prevTotalSize;
+
+    private int blocksNum;
+
+    public NcSegmentBlock() {
+    }
+
+    public NcSegmentBlock(long totalSize, long prevTotalSize, int blocksNum) {
+        this.totalSize = totalSize;
+        this.prevTotalSize = prevTotalSize;
+        this.blocksNum = blocksNum;
+    }
+
+    @Override
+    public byte type() {
+        return TYPE;
+    }
+
+    public long totalSize() {
+        return totalSize;
+    }
+
+    public void totalSize(long totalSize) {
+        this.totalSize = totalSize;
+    }
+
+    public long prevTotalSize() {
+        return prevTotalSize;
+    }
+
+    public void prevTotalSize(long prevTotalSize) {
+        this.prevTotalSize = prevTotalSize;
+    }
+
+    public int blocksNum() {
+        return blocksNum;
+    }
+
+    public void blocksNum(int blocksNum) {
+        this.blocksNum = blocksNum;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stress-tester/src/main/java/com/passus/st/reader/nc/NcSessionBlock.java	Thu Nov 23 14:39:08 2017 +0100
@@ -0,0 +1,52 @@
+package com.passus.st.reader.nc;
+
+import com.passus.st.emitter.SessionInfo;
+
+/**
+ *
+ * @author Mirosław Hawrot
+ */
+public abstract class NcSessionBlock implements NcDataBlock {
+
+    public static final int HEADER_SIZE = 12;
+
+    private long timestamp;
+
+    private int sessionId;
+
+    private SessionInfo sessionInfo;
+
+    public NcSessionBlock() {
+    }
+
+    public NcSessionBlock(long timestamp, int sessionId, SessionInfo sessionInfo) {
+        this.timestamp = timestamp;
+        this.sessionId = sessionId;
+        this.sessionInfo = sessionInfo;
+    }
+
+    public long timestamp() {
+        return timestamp;
+    }
+
+    public void timestamp(long timestamp) {
+        this.timestamp = timestamp;
+    }
+
+    public int sessionId() {
+        return sessionId;
+    }
+
+    public void sessionId(int sessionId) {
+        this.sessionId = sessionId;
+    }
+
+    public SessionInfo sessionInfo() {
+        return sessionInfo;
+    }
+
+    public void sessionInfo(SessionInfo sessionInfo) {
+        this.sessionInfo = sessionInfo;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stress-tester/src/main/java/com/passus/st/reader/nc/NcSessionInfoBlock.java	Thu Nov 23 14:39:08 2017 +0100
@@ -0,0 +1,60 @@
+package com.passus.st.reader.nc;
+
+import com.passus.net.IpAddress;
+import com.passus.st.emitter.SessionInfo;
+
+/**
+ *
+ * @author Mirosław Hawrot
+ */
+public class NcSessionInfoBlock implements NcDataBlock {
+
+    public static final byte TYPE = 2;
+
+    public static final int MAX_SIZE = 338;
+
+    private int totalSize;
+
+    private int sessionId;
+
+    private SessionInfo sessionInfo;
+
+    public NcSessionInfoBlock() {
+    }
+
+    public NcSessionInfoBlock(int totalSize, int sessionId, SessionInfo sessionInfo) {
+        this.totalSize = totalSize;
+        this.sessionId = sessionId;
+        this.sessionInfo = sessionInfo;
+    }
+
+    @Override
+    public byte type() {
+        return TYPE;
+    }
+
+    public int totalSize() {
+        return totalSize;
+    }
+
+    public void totalSize(int totalSize) {
+        this.totalSize = totalSize;
+    }
+
+    public int sessionId() {
+        return sessionId;
+    }
+
+    public void sessionId(int sessionId) {
+        this.sessionId = sessionId;
+    }
+
+    public SessionInfo sessionInfo() {
+        return sessionInfo;
+    }
+
+    public void sessionInfo(SessionInfo sessionInfo) {
+        this.sessionInfo = sessionInfo;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stress-tester/src/main/java/com/passus/st/reader/nc/NcSessionPayloadBlock.java	Thu Nov 23 14:39:08 2017 +0100
@@ -0,0 +1,96 @@
+package com.passus.st.reader.nc;
+
+import com.passus.st.emitter.SessionInfo;
+import java.util.Map;
+
+/**
+ *
+ * @author Mirosław Hawrot
+ */
+public class NcSessionPayloadBlock extends NcSessionBlock {
+
+    public static final byte TYPE = 3;
+
+    public static final int MAX_HEADER_SIZE = NcSessionBlock.HEADER_SIZE + 29;
+
+    private long totalSize;
+
+    private int proto;
+
+    private long dataLength;
+
+    private long optionsLength = 0;
+
+    private Object data;
+
+    private Map<String, Object> options;
+
+    public NcSessionPayloadBlock() {
+    }
+
+    public NcSessionPayloadBlock(long timestamp, int sessionId, SessionInfo sessionInfo,
+            long totalSize, int proto, long dataLength, long optionsLength,
+            Object data, Map<String, Object> options) {
+        super(timestamp, sessionId, sessionInfo);
+        this.totalSize = totalSize;
+        this.proto = proto;
+        this.dataLength = dataLength;
+        this.optionsLength = optionsLength;
+        this.options = options;
+        this.data = data;
+    }
+
+    @Override
+    public byte type() {
+        return TYPE;
+    }
+
+    public long totalSize() {
+        return totalSize;
+    }
+
+    public void totalSize(long totalSize) {
+        this.totalSize = totalSize;
+    }
+
+    public int proto() {
+        return proto;
+    }
+
+    public void proto(int proto) {
+        this.proto = proto;
+    }
+
+    public long dataLength() {
+        return dataLength;
+    }
+
+    public void dataLength(long dataLength) {
+        this.dataLength = dataLength;
+    }
+
+    public long optionsLength() {
+        return optionsLength;
+    }
+
+    public void optionsLength(long optionsLength) {
+        this.optionsLength = optionsLength;
+    }
+
+    public Object data() {
+        return data;
+    }
+
+    public void data(Object data) {
+        this.data = data;
+    }
+
+    public Map<String, Object> options() {
+        return options;
+    }
+
+    public void options(Map<String, Object> options) {
+        this.options = options;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stress-tester/src/main/java/com/passus/st/reader/nc/NcSessionStatusBlock.java	Thu Nov 23 14:39:08 2017 +0100
@@ -0,0 +1,38 @@
+package com.passus.st.reader.nc;
+
+import com.passus.st.emitter.SessionInfo;
+
+/**
+ *
+ * @author Mirosław Hawrot
+ */
+public class NcSessionStatusBlock extends NcSessionBlock {
+    
+    public static final byte TYPE = 4;
+    
+    public static final int HEADER_SIZE = NcSessionBlock.HEADER_SIZE + 2;
+    
+    private byte status;
+    
+    public NcSessionStatusBlock() {
+    }
+    
+    public NcSessionStatusBlock(long timestamp, int sessionId, SessionInfo sessionInfo, byte status) {
+        super(timestamp, sessionId, sessionInfo);
+        this.status = status;
+    }
+    
+    @Override
+    public byte type() {
+        return TYPE;
+    }
+    
+    public byte status() {
+        return status;
+    }
+    
+    public void status(byte status) {
+        this.status = status;
+    }
+    
+}
--- a/stress-tester/src/main/java/com/passus/st/reader/nc/block/NcDataBlock.java	Thu Nov 23 13:54:46 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-package com.passus.st.reader.nc.block;
-
-/**
- *
- * @author Mirosław Hawrot
- */
-public interface NcDataBlock {
-
-    public byte type();
-
-}
--- a/stress-tester/src/main/java/com/passus/st/reader/nc/block/NcSegmentBlock.java	Thu Nov 23 13:54:46 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-package com.passus.st.reader.nc.block;
-
-/**
- *
- * @author Mirosław Hawrot
- */
-public class NcSegmentBlock implements NcDataBlock {
-
-    public static final byte TYPE = 1;
-
-    public static final int HEADER_SIZE = 10;
-
-    private long totalSize;
-
-    private long prevTotalSize;
-
-    private int blocksNum;
-
-    public NcSegmentBlock() {
-    }
-
-    public NcSegmentBlock(long totalSize, long prevTotalSize, int blocksNum) {
-        this.totalSize = totalSize;
-        this.prevTotalSize = prevTotalSize;
-        this.blocksNum = blocksNum;
-    }
-
-    @Override
-    public byte type() {
-        return TYPE;
-    }
-
-    public long totalSize() {
-        return totalSize;
-    }
-
-    public void totalSize(long totalSize) {
-        this.totalSize = totalSize;
-    }
-
-    public long prevTotalSize() {
-        return prevTotalSize;
-    }
-
-    public void prevTotalSize(long prevTotalSize) {
-        this.prevTotalSize = prevTotalSize;
-    }
-
-    public int blocksNum() {
-        return blocksNum;
-    }
-
-    public void blocksNum(int blocksNum) {
-        this.blocksNum = blocksNum;
-    }
-
-}
--- a/stress-tester/src/main/java/com/passus/st/reader/nc/block/NcSessionBlock.java	Thu Nov 23 13:54:46 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-package com.passus.st.reader.nc.block;
-
-import com.passus.st.emitter.SessionInfo;
-
-/**
- *
- * @author Mirosław Hawrot
- */
-public abstract class NcSessionBlock implements NcDataBlock {
-
-    public static final int HEADER_SIZE = 12;
-
-    private long timestamp;
-
-    private int sessionId;
-
-    private SessionInfo sessionInfo;
-
-    public NcSessionBlock() {
-    }
-
-    public NcSessionBlock(long timestamp, int sessionId, SessionInfo sessionInfo) {
-        this.timestamp = timestamp;
-        this.sessionId = sessionId;
-        this.sessionInfo = sessionInfo;
-    }
-
-    public long timestamp() {
-        return timestamp;
-    }
-
-    public void timestamp(long timestamp) {
-        this.timestamp = timestamp;
-    }
-
-    public int sessionId() {
-        return sessionId;
-    }
-
-    public void sessionId(int sessionId) {
-        this.sessionId = sessionId;
-    }
-
-    public SessionInfo sessionInfo() {
-        return sessionInfo;
-    }
-
-    public void sessionInfo(SessionInfo sessionInfo) {
-        this.sessionInfo = sessionInfo;
-    }
-
-}
--- a/stress-tester/src/main/java/com/passus/st/reader/nc/block/NcSessionInfoBlock.java	Thu Nov 23 13:54:46 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-package com.passus.st.reader.nc.block;
-
-import com.passus.net.IpAddress;
-import com.passus.st.emitter.SessionInfo;
-
-/**
- *
- * @author Mirosław Hawrot
- */
-public class NcSessionInfoBlock implements NcDataBlock {
-
-    public static final byte TYPE = 2;
-
-    public static final int MAX_SIZE = 338;
-
-    private int totalSize;
-
-    private int sessionId;
-
-    private SessionInfo sessionInfo;
-
-    public NcSessionInfoBlock() {
-    }
-
-    public NcSessionInfoBlock(int totalSize, int sessionId, SessionInfo sessionInfo) {
-        this.totalSize = totalSize;
-        this.sessionId = sessionId;
-        this.sessionInfo = sessionInfo;
-    }
-
-    @Override
-    public byte type() {
-        return TYPE;
-    }
-
-    public int totalSize() {
-        return totalSize;
-    }
-
-    public void totalSize(int totalSize) {
-        this.totalSize = totalSize;
-    }
-
-    public int sessionId() {
-        return sessionId;
-    }
-
-    public void sessionId(int sessionId) {
-        this.sessionId = sessionId;
-    }
-
-    public SessionInfo sessionInfo() {
-        return sessionInfo;
-    }
-
-    public void sessionInfo(SessionInfo sessionInfo) {
-        this.sessionInfo = sessionInfo;
-    }
-
-}
--- a/stress-tester/src/main/java/com/passus/st/reader/nc/block/NcSessionPayloadBlock.java	Thu Nov 23 13:54:46 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-package com.passus.st.reader.nc.block;
-
-import com.passus.st.emitter.SessionInfo;
-import java.util.Map;
-
-/**
- *
- * @author Mirosław Hawrot
- */
-public class NcSessionPayloadBlock extends NcSessionBlock {
-
-    public static final byte TYPE = 3;
-
-    public static final int MAX_HEADER_SIZE = NcSessionBlock.HEADER_SIZE + 29;
-
-    private long totalSize;
-
-    private int proto;
-
-    private long dataLength;
-
-    private long optionsLength = 0;
-
-    private Object data;
-
-    private Map<String, Object> options;
-
-    public NcSessionPayloadBlock() {
-    }
-
-    public NcSessionPayloadBlock(long timestamp, int sessionId, SessionInfo sessionInfo,
-            long totalSize, int proto, long dataLength, long optionsLength,
-            Object data, Map<String, Object> options) {
-        super(timestamp, sessionId, sessionInfo);
-        this.totalSize = totalSize;
-        this.proto = proto;
-        this.dataLength = dataLength;
-        this.optionsLength = optionsLength;
-        this.options = options;
-        this.data = data;
-    }
-
-    @Override
-    public byte type() {
-        return TYPE;
-    }
-
-    public long totalSize() {
-        return totalSize;
-    }
-
-    public void totalSize(long totalSize) {
-        this.totalSize = totalSize;
-    }
-
-    public int proto() {
-        return proto;
-    }
-
-    public void proto(int proto) {
-        this.proto = proto;
-    }
-
-    public long dataLength() {
-        return dataLength;
-    }
-
-    public void dataLength(long dataLength) {
-        this.dataLength = dataLength;
-    }
-
-    public long optionsLength() {
-        return optionsLength;
-    }
-
-    public void optionsLength(long optionsLength) {
-        this.optionsLength = optionsLength;
-    }
-
-    public Object data() {
-        return data;
-    }
-
-    public void data(Object data) {
-        this.data = data;
-    }
-
-    public Map<String, Object> options() {
-        return options;
-    }
-
-    public void options(Map<String, Object> options) {
-        this.options = options;
-    }
-
-}
--- a/stress-tester/src/main/java/com/passus/st/reader/nc/block/NcSessionStatusBlock.java	Thu Nov 23 13:54:46 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-package com.passus.st.reader.nc.block;
-
-import com.passus.st.emitter.SessionInfo;
-
-/**
- *
- * @author Mirosław Hawrot
- */
-public class NcSessionStatusBlock extends NcSessionBlock {
-    
-    public static final byte TYPE = 4;
-    
-    public static final int HEADER_SIZE = NcSessionBlock.HEADER_SIZE + 2;
-    
-    private byte status;
-    
-    public NcSessionStatusBlock() {
-    }
-    
-    public NcSessionStatusBlock(long timestamp, int sessionId, SessionInfo sessionInfo, byte status) {
-        super(timestamp, sessionId, sessionInfo);
-        this.status = status;
-    }
-    
-    @Override
-    public byte type() {
-        return TYPE;
-    }
-    
-    public byte status() {
-        return status;
-    }
-    
-    public void status(byte status) {
-        this.status = status;
-    }
-    
-}
--- a/stress-tester/src/main/java/com/passus/st/source/NcEventDestination.java	Thu Nov 23 13:54:46 2017 +0100
+++ b/stress-tester/src/main/java/com/passus/st/source/NcEventDestination.java	Thu Nov 23 14:39:08 2017 +0100
@@ -10,6 +10,7 @@
 import com.passus.st.client.Event;
 import com.passus.st.client.SessionStatusEvent;
 import com.passus.st.client.http.HttpSessionPayloadEvent;
+import com.passus.st.reader.nc.HttpSessionPayloadEventDataWriter;
 import com.passus.st.reader.nc.NcDataBlockWriter;
 
 /**
@@ -28,6 +29,8 @@
 
     private final HttpResponseEncoder responseEncoder = HttpResponseEncoder.getInstance();
 
+    private HttpSessionPayloadEventDataWriter httpPayloadWriter = new HttpSessionPayloadEventDataWriter();
+    
     @Override
     public boolean isStarted() {
         return started;
--- a/stress-tester/src/test/java/com/passus/st/reader/nc/NcDataBlockReaderTest.java	Thu Nov 23 13:54:46 2017 +0100
+++ b/stress-tester/src/test/java/com/passus/st/reader/nc/NcDataBlockReaderTest.java	Thu Nov 23 14:39:08 2017 +0100
@@ -2,10 +2,6 @@
 
 import com.passus.data.ByteBuff;
 import com.passus.st.emitter.SessionInfo;
-import com.passus.st.reader.nc.block.NcDataBlock;
-import com.passus.st.reader.nc.block.NcSegmentBlock;
-import com.passus.st.reader.nc.block.NcSessionInfoBlock;
-import com.passus.st.reader.nc.block.NcSessionPayloadBlock;
 import java.io.File;
 import java.io.IOException;
 import java.text.ParseException;
--- a/stress-tester/src/test/java/com/passus/st/reader/nc/NcDataBlockWriterTest.java	Thu Nov 23 13:54:46 2017 +0100
+++ b/stress-tester/src/test/java/com/passus/st/reader/nc/NcDataBlockWriterTest.java	Thu Nov 23 14:39:08 2017 +0100
@@ -2,8 +2,6 @@
 
 import com.passus.data.DataHelper;
 import com.passus.st.emitter.SessionInfo;
-import com.passus.st.reader.nc.block.NcSegmentBlock;
-import com.passus.st.reader.nc.block.NcSessionInfoBlock;
 import java.io.File;
 import java.io.IOException;
 import java.util.UUID;