diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..449f8f5
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ae3c172
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/.project b/.project
new file mode 100644
index 0000000..89cd453
--- /dev/null
+++ b/.project
@@ -0,0 +1,17 @@
+
+
+ EQXTemplate
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/CustomLog/PreReleasedTest.log_1 b/CustomLog/PreReleasedTest.log_1
new file mode 100644
index 0000000..824b93c
--- /dev/null
+++ b/CustomLog/PreReleasedTest.log_1
@@ -0,0 +1,275 @@
+TRACE|09:28:16|Thread-0|testCustomLog|
+TRACE|09:29:16|Thread-0|testCustomLog|
+TRACE|09:29:17|Thread-0|testCustomLog|
+TRACE|09:30:16|Thread-0|testCustomLog|
+TRACE|09:30:17|Thread-0|testCustomLog|
+TRACE|09:31:16|Thread-0|testCustomLog|
+TRACE|09:32:16|Thread-0|testCustomLog|
+TRACE|09:33:16|Thread-0|testCustomLog|
+TRACE|09:34:16|Thread-0|testCustomLog|
+TRACE|09:34:22|Thread-0|testCustomLog|
+TRACE|09:35:16|Thread-0|testCustomLog|
+TRACE|09:35:22|Thread-0|testCustomLog|
+TRACE|09:35:26|Thread-0|testCustomLog|
+TRACE|09:35:58|Thread-0|testCustomLog|
+TRACE|09:36:16|Thread-0|testCustomLog|
+TRACE|09:36:22|Thread-0|testCustomLog|
+TRACE|09:36:26|Thread-0|testCustomLog|
+TRACE|09:36:58|Thread-0|testCustomLog|
+TRACE|09:37:16|Thread-0|testCustomLog|
+TRACE|09:37:26|Thread-0|testCustomLog|
+TRACE|09:37:58|Thread-0|testCustomLog|
+TRACE|09:38:16|Thread-0|testCustomLog|
+TRACE|09:38:26|Thread-0|testCustomLog|
+TRACE|09:38:58|Thread-0|testCustomLog|
+TRACE|09:39:16|Thread-0|testCustomLog|
+TRACE|09:39:26|Thread-0|testCustomLog|
+TRACE|09:39:58|Thread-0|testCustomLog|
+TRACE|09:40:16|Thread-0|testCustomLog|
+TRACE|09:40:26|Thread-0|testCustomLog|
+TRACE|09:40:58|Thread-0|testCustomLog|
+TRACE|09:41:16|Thread-0|testCustomLog|
+TRACE|09:41:26|Thread-0|testCustomLog|
+TRACE|09:41:56|Thread-0|testCustomLog|
+TRACE|09:41:58|Thread-0|testCustomLog|
+TRACE|09:42:16|Thread-0|testCustomLog|
+TRACE|09:42:26|Thread-0|testCustomLog|
+TRACE|09:42:58|Thread-0|testCustomLog|
+TRACE|09:43:16|Thread-0|testCustomLog|
+TRACE|09:43:26|Thread-0|testCustomLog|
+TRACE|09:43:58|Thread-0|testCustomLog|
+TRACE|09:44:16|Thread-0|testCustomLog|
+TRACE|09:44:26|Thread-0|testCustomLog|
+TRACE|09:44:37|Thread-0|testCustomLog|
+TRACE|09:44:58|Thread-0|testCustomLog|
+TRACE|09:45:16|Thread-0|testCustomLog|
+TRACE|09:45:26|Thread-0|testCustomLog|
+TRACE|09:45:37|Thread-0|testCustomLog|
+TRACE|09:45:58|Thread-0|testCustomLog|
+TRACE|09:46:16|Thread-0|testCustomLog|
+TRACE|09:46:26|Thread-0|testCustomLog|
+TRACE|09:46:37|Thread-0|testCustomLog|
+TRACE|09:46:58|Thread-0|testCustomLog|
+TRACE|09:47:16|Thread-0|testCustomLog|
+TRACE|09:47:26|Thread-0|testCustomLog|
+TRACE|09:47:37|Thread-0|testCustomLog|
+TRACE|09:47:58|Thread-0|testCustomLog|
+TRACE|09:48:16|Thread-0|testCustomLog|
+TRACE|09:48:26|Thread-0|testCustomLog|
+TRACE|09:48:58|Thread-0|testCustomLog|
+TRACE|09:49:16|Thread-0|testCustomLog|
+TRACE|09:49:26|Thread-0|testCustomLog|
+TRACE|09:49:58|Thread-0|testCustomLog|
+TRACE|09:50:16|Thread-0|testCustomLog|
+TRACE|09:50:26|Thread-0|testCustomLog|
+TRACE|09:50:58|Thread-0|testCustomLog|
+TRACE|09:51:16|Thread-0|testCustomLog|
+TRACE|09:51:26|Thread-0|testCustomLog|
+TRACE|09:51:58|Thread-0|testCustomLog|
+TRACE|09:52:16|Thread-0|testCustomLog|
+TRACE|09:52:26|Thread-0|testCustomLog|
+TRACE|09:52:58|Thread-0|testCustomLog|
+TRACE|09:53:16|Thread-0|testCustomLog|
+TRACE|09:53:26|Thread-0|testCustomLog|
+TRACE|09:53:58|Thread-0|testCustomLog|
+TRACE|09:54:16|Thread-0|testCustomLog|
+TRACE|09:54:26|Thread-0|testCustomLog|
+TRACE|09:54:58|Thread-0|testCustomLog|
+TRACE|09:55:16|Thread-0|testCustomLog|
+TRACE|09:55:26|Thread-0|testCustomLog|
+TRACE|09:55:58|Thread-0|testCustomLog|
+TRACE|09:56:16|Thread-0|testCustomLog|
+TRACE|09:56:26|Thread-0|testCustomLog|
+TRACE|09:56:58|Thread-0|testCustomLog|
+TRACE|09:57:16|Thread-0|testCustomLog|
+TRACE|09:57:26|Thread-0|testCustomLog|
+TRACE|09:57:33|Thread-0|testCustomLog|
+TRACE|09:57:58|Thread-0|testCustomLog|
+TRACE|09:58:16|Thread-0|testCustomLog|
+TRACE|09:58:25|Thread-0|testCustomLog|
+TRACE|09:58:26|Thread-0|testCustomLog|
+TRACE|09:58:29|Thread-0|testCustomLog|
+TRACE|09:58:33|Thread-0|testCustomLog|
+TRACE|09:58:58|Thread-0|testCustomLog|
+TRACE|09:59:16|Thread-0|testCustomLog|
+TRACE|09:59:25|Thread-0|testCustomLog|
+TRACE|09:59:26|Thread-0|testCustomLog|
+TRACE|09:59:29|Thread-0|testCustomLog|
+TRACE|09:59:33|Thread-0|testCustomLog|
+TRACE|09:59:58|Thread-0|testCustomLog|
+TRACE|10:00:16|Thread-0|testCustomLog|
+TRACE|10:00:25|Thread-0|testCustomLog|
+TRACE|10:00:26|Thread-0|testCustomLog|
+TRACE|10:00:29|Thread-0|testCustomLog|
+TRACE|10:00:33|Thread-0|testCustomLog|
+TRACE|10:00:58|Thread-0|testCustomLog|
+TRACE|10:01:16|Thread-0|testCustomLog|
+TRACE|10:01:25|Thread-0|testCustomLog|
+TRACE|10:01:26|Thread-0|testCustomLog|
+TRACE|10:01:29|Thread-0|testCustomLog|
+TRACE|10:01:33|Thread-0|testCustomLog|
+TRACE|10:01:58|Thread-0|testCustomLog|
+TRACE|10:02:16|Thread-0|testCustomLog|
+TRACE|10:02:25|Thread-0|testCustomLog|
+TRACE|10:02:26|Thread-0|testCustomLog|
+TRACE|10:02:29|Thread-0|testCustomLog|
+TRACE|10:02:33|Thread-0|testCustomLog|
+TRACE|10:02:58|Thread-0|testCustomLog|
+TRACE|10:03:16|Thread-0|testCustomLog|
+TRACE|10:03:25|Thread-0|testCustomLog|
+TRACE|10:03:26|Thread-0|testCustomLog|
+TRACE|10:03:29|Thread-0|testCustomLog|
+TRACE|10:03:33|Thread-0|testCustomLog|
+TRACE|10:03:58|Thread-0|testCustomLog|
+TRACE|10:04:08|Thread-0|testCustomLog|
+TRACE|10:04:16|Thread-0|testCustomLog|
+TRACE|10:04:25|Thread-0|testCustomLog|
+TRACE|10:04:26|Thread-0|testCustomLog|
+TRACE|10:04:29|Thread-0|testCustomLog|
+TRACE|10:04:33|Thread-0|testCustomLog|
+TRACE|10:04:58|Thread-0|testCustomLog|
+TRACE|10:05:08|Thread-0|testCustomLog|
+TRACE|10:05:16|Thread-0|testCustomLog|
+TRACE|10:05:25|Thread-0|testCustomLog|
+TRACE|10:05:26|Thread-0|testCustomLog|
+TRACE|10:05:29|Thread-0|testCustomLog|
+TRACE|10:05:33|Thread-0|testCustomLog|
+TRACE|10:05:58|Thread-0|testCustomLog|
+TRACE|10:06:08|Thread-0|testCustomLog|
+TRACE|10:06:16|Thread-0|testCustomLog|
+TRACE|10:06:25|Thread-0|testCustomLog|
+TRACE|10:06:26|Thread-0|testCustomLog|
+TRACE|10:06:29|Thread-0|testCustomLog|
+TRACE|10:06:33|Thread-0|testCustomLog|
+TRACE|10:06:58|Thread-0|testCustomLog|
+TRACE|10:07:08|Thread-0|testCustomLog|
+TRACE|10:07:16|Thread-0|testCustomLog|
+TRACE|10:07:25|Thread-0|testCustomLog|
+TRACE|10:07:26|Thread-0|testCustomLog|
+TRACE|10:07:29|Thread-0|testCustomLog|
+TRACE|10:07:33|Thread-0|testCustomLog|
+TRACE|10:07:58|Thread-0|testCustomLog|
+TRACE|10:08:08|Thread-0|testCustomLog|
+TRACE|10:08:16|Thread-0|testCustomLog|
+TRACE|10:08:25|Thread-0|testCustomLog|
+TRACE|10:08:26|Thread-0|testCustomLog|
+TRACE|10:08:29|Thread-0|testCustomLog|
+TRACE|10:08:33|Thread-0|testCustomLog|
+TRACE|10:08:58|Thread-0|testCustomLog|
+TRACE|10:09:08|Thread-0|testCustomLog|
+TRACE|10:09:16|Thread-0|testCustomLog|
+TRACE|10:09:25|Thread-0|testCustomLog|
+TRACE|10:09:26|Thread-0|testCustomLog|
+TRACE|10:09:29|Thread-0|testCustomLog|
+TRACE|10:09:33|Thread-0|testCustomLog|
+TRACE|10:09:58|Thread-0|testCustomLog|
+TRACE|10:10:16|Thread-0|testCustomLog|
+TRACE|10:10:25|Thread-0|testCustomLog|
+TRACE|10:10:26|Thread-0|testCustomLog|
+TRACE|10:10:29|Thread-0|testCustomLog|
+TRACE|10:10:33|Thread-0|testCustomLog|
+TRACE|10:10:58|Thread-0|testCustomLog|
+TRACE|10:11:16|Thread-0|testCustomLog|
+TRACE|10:11:24|Thread-0|testCustomLog|
+TRACE|10:11:25|Thread-0|testCustomLog|
+TRACE|10:11:26|Thread-0|testCustomLog|
+TRACE|10:11:29|Thread-0|testCustomLog|
+TRACE|10:11:33|Thread-0|testCustomLog|
+TRACE|10:11:58|Thread-0|testCustomLog|
+TRACE|10:12:16|Thread-0|testCustomLog|
+TRACE|10:12:24|Thread-0|testCustomLog|
+TRACE|10:12:25|Thread-0|testCustomLog|
+TRACE|10:12:26|Thread-0|testCustomLog|
+TRACE|10:12:29|Thread-0|testCustomLog|
+TRACE|10:12:34|Thread-0|testCustomLog|
+TRACE|10:12:58|Thread-0|testCustomLog|
+TRACE|10:13:16|Thread-0|testCustomLog|
+TRACE|10:13:24|Thread-0|testCustomLog|
+TRACE|10:13:25|Thread-0|testCustomLog|
+TRACE|10:13:26|Thread-0|testCustomLog|
+TRACE|10:13:29|Thread-0|testCustomLog|
+TRACE|10:13:34|Thread-0|testCustomLog|
+TRACE|10:13:58|Thread-0|testCustomLog|
+TRACE|10:14:16|Thread-0|testCustomLog|
+TRACE|10:14:24|Thread-0|testCustomLog|
+TRACE|10:14:25|Thread-0|testCustomLog|
+TRACE|10:14:26|Thread-0|testCustomLog|
+TRACE|10:14:29|Thread-0|testCustomLog|
+TRACE|10:14:34|Thread-0|testCustomLog|
+TRACE|10:14:58|Thread-0|testCustomLog|
+TRACE|10:15:04|Thread-0|testCustomLog|
+TRACE|10:15:16|Thread-0|testCustomLog|
+TRACE|10:15:24|Thread-0|testCustomLog|
+TRACE|10:15:25|Thread-0|testCustomLog|
+TRACE|10:15:26|Thread-0|testCustomLog|
+TRACE|10:15:29|Thread-0|testCustomLog|
+TRACE|10:15:34|Thread-0|testCustomLog|
+TRACE|10:15:37|Thread-0|testCustomLog|
+TRACE|10:15:58|Thread-0|testCustomLog|
+TRACE|10:16:04|Thread-0|testCustomLog|
+TRACE|10:16:16|Thread-0|testCustomLog|
+TRACE|10:16:24|Thread-0|testCustomLog|
+TRACE|10:16:25|Thread-0|testCustomLog|
+TRACE|10:16:26|Thread-0|testCustomLog|
+TRACE|10:16:29|Thread-0|testCustomLog|
+TRACE|10:16:34|Thread-0|testCustomLog|
+TRACE|10:16:37|Thread-0|testCustomLog|
+TRACE|10:16:58|Thread-0|testCustomLog|
+TRACE|10:17:04|Thread-0|testCustomLog|
+TRACE|10:17:16|Thread-0|testCustomLog|
+TRACE|10:17:24|Thread-0|testCustomLog|
+TRACE|10:17:25|Thread-0|testCustomLog|
+TRACE|10:17:26|Thread-0|testCustomLog|
+TRACE|10:17:29|Thread-0|testCustomLog|
+TRACE|10:17:34|Thread-0|testCustomLog|
+TRACE|10:17:58|Thread-0|testCustomLog|
+TRACE|10:18:04|Thread-0|testCustomLog|
+TRACE|10:18:16|Thread-0|testCustomLog|
+TRACE|10:18:24|Thread-0|testCustomLog|
+TRACE|10:18:25|Thread-0|testCustomLog|
+TRACE|10:18:26|Thread-0|testCustomLog|
+TRACE|10:18:29|Thread-0|testCustomLog|
+TRACE|10:18:29|Thread-0|testCustomLog|
+TRACE|10:18:34|Thread-0|testCustomLog|
+TRACE|10:18:58|Thread-0|testCustomLog|
+TRACE|10:19:04|Thread-0|testCustomLog|
+TRACE|10:19:16|Thread-0|testCustomLog|
+TRACE|10:19:24|Thread-0|testCustomLog|
+TRACE|10:19:25|Thread-0|testCustomLog|
+TRACE|10:19:26|Thread-0|testCustomLog|
+TRACE|10:19:29|Thread-0|testCustomLog|
+TRACE|10:19:34|Thread-0|testCustomLog|
+TRACE|10:19:58|Thread-0|testCustomLog|
+TRACE|10:20:04|Thread-0|testCustomLog|
+TRACE|10:20:16|Thread-0|testCustomLog|
+TRACE|10:20:24|Thread-0|testCustomLog|
+TRACE|10:20:25|Thread-0|testCustomLog|
+TRACE|10:20:26|Thread-0|testCustomLog|
+TRACE|10:20:28|Thread-0|testCustomLog|
+TRACE|10:20:29|Thread-0|testCustomLog|
+TRACE|10:20:34|Thread-0|testCustomLog|
+TRACE|10:20:59|Thread-0|testCustomLog|
+TRACE|10:21:04|Thread-0|testCustomLog|
+TRACE|10:21:16|Thread-0|testCustomLog|
+TRACE|10:21:24|Thread-0|testCustomLog|
+TRACE|10:21:25|Thread-0|testCustomLog|
+TRACE|10:21:26|Thread-0|testCustomLog|
+TRACE|10:21:29|Thread-0|testCustomLog|
+TRACE|10:21:34|Thread-0|testCustomLog|
+TRACE|10:21:59|Thread-0|testCustomLog|
+TRACE|10:22:04|Thread-0|testCustomLog|
+TRACE|10:22:16|Thread-0|testCustomLog|
+TRACE|10:22:24|Thread-0|testCustomLog|
+TRACE|10:22:25|Thread-0|testCustomLog|
+TRACE|10:22:26|Thread-0|testCustomLog|
+TRACE|10:22:29|Thread-0|testCustomLog|
+TRACE|10:22:34|Thread-0|testCustomLog|
+TRACE|10:22:59|Thread-0|testCustomLog|
+TRACE|10:23:04|Thread-0|testCustomLog|
+TRACE|10:23:16|Thread-0|testCustomLog|
+TRACE|10:23:20|Thread-0|testCustomLog|
+TRACE|10:23:24|Thread-0|testCustomLog|
+TRACE|10:23:25|Thread-0|testCustomLog|
+TRACE|10:23:26|Thread-0|testCustomLog|
+TRACE|10:23:29|Thread-0|testCustomLog|
+TRACE|10:23:34|Thread-0|testCustomLog|
diff --git a/CustomLog/PreReleasedTest.log_2 b/CustomLog/PreReleasedTest.log_2
new file mode 100644
index 0000000..7a672f0
--- /dev/null
+++ b/CustomLog/PreReleasedTest.log_2
@@ -0,0 +1,54 @@
+TRACE|10:53:57|Thread-0|testCustomLog|
+TRACE|10:54:57|Thread-0|testCustomLog|
+TRACE|10:55:18|Thread-0|testCustomLog|
+TRACE|10:55:57|Thread-0|testCustomLog|
+TRACE|10:56:18|Thread-0|testCustomLog|
+TRACE|10:56:57|Thread-0|testCustomLog|
+TRACE|10:57:09|Thread-0|testCustomLog|
+TRACE|10:57:18|Thread-0|testCustomLog|
+TRACE|10:57:57|Thread-0|testCustomLog|
+TRACE|10:58:03|Thread-0|testCustomLog|
+TRACE|10:58:09|Thread-0|testCustomLog|
+TRACE|10:58:17|Thread-0|testCustomLog|
+TRACE|10:58:18|Thread-0|testCustomLog|
+TRACE|10:58:57|Thread-0|testCustomLog|
+TRACE|10:59:03|Thread-0|testCustomLog|
+TRACE|10:59:09|Thread-0|testCustomLog|
+TRACE|10:59:17|Thread-0|testCustomLog|
+TRACE|10:59:18|Thread-0|testCustomLog|
+TRACE|10:59:57|Thread-0|testCustomLog|
+TRACE|11:00:03|Thread-0|testCustomLog|
+TRACE|11:00:09|Thread-0|testCustomLog|
+TRACE|11:00:18|Thread-0|testCustomLog|
+TRACE|11:00:57|Thread-0|testCustomLog|
+TRACE|11:01:03|Thread-0|testCustomLog|
+TRACE|11:01:09|Thread-0|testCustomLog|
+TRACE|11:01:18|Thread-0|testCustomLog|
+TRACE|11:01:57|Thread-0|testCustomLog|
+TRACE|11:02:03|Thread-0|testCustomLog|
+TRACE|11:02:09|Thread-0|testCustomLog|
+TRACE|11:02:18|Thread-0|testCustomLog|
+TRACE|11:02:57|Thread-0|testCustomLog|
+TRACE|11:03:03|Thread-0|testCustomLog|
+TRACE|11:03:09|Thread-0|testCustomLog|
+TRACE|11:03:18|Thread-0|testCustomLog|
+TRACE|11:03:57|Thread-0|testCustomLog|
+TRACE|11:04:03|Thread-0|testCustomLog|
+TRACE|11:04:09|Thread-0|testCustomLog|
+TRACE|11:04:18|Thread-0|testCustomLog|
+TRACE|11:04:57|Thread-0|testCustomLog|
+TRACE|11:05:03|Thread-0|testCustomLog|
+TRACE|11:05:09|Thread-0|testCustomLog|
+TRACE|11:05:18|Thread-0|testCustomLog|
+TRACE|11:05:57|Thread-0|testCustomLog|
+TRACE|11:06:03|Thread-0|testCustomLog|
+TRACE|11:06:09|Thread-0|testCustomLog|
+TRACE|11:06:18|Thread-0|testCustomLog|
+TRACE|11:06:57|Thread-0|testCustomLog|
+TRACE|11:07:03|Thread-0|testCustomLog|
+TRACE|11:07:09|Thread-0|testCustomLog|
+TRACE|11:07:18|Thread-0|testCustomLog|
+TRACE|11:07:57|Thread-0|testCustomLog|
+TRACE|11:08:03|Thread-0|testCustomLog|
+TRACE|11:08:09|Thread-0|testCustomLog|
+TRACE|11:08:18|Thread-0|testCustomLog|
diff --git a/README.md b/README.md
deleted file mode 100644
index e69de29..0000000
--- a/README.md
+++ /dev/null
diff --git a/conf/WS1.EC02.SERV.0 b/conf/WS1.EC02.SERV.0
new file mode 100644
index 0000000..376230b
--- /dev/null
+++ b/conf/WS1.EC02.SERV.0
@@ -0,0 +1,247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/example.msg/debug.diameter.xml b/example.msg/debug.diameter.xml
new file mode 100644
index 0000000..99e670e
--- /dev/null
+++ b/example.msg/debug.diameter.xml
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example.msg/debug.html-text-plain.xml b/example.msg/debug.html-text-plain.xml
new file mode 100644
index 0000000..e2d0da5
--- /dev/null
+++ b/example.msg/debug.html-text-plain.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example.msg/debug.html-text-xml-header.xml b/example.msg/debug.html-text-xml-header.xml
new file mode 100644
index 0000000..544ae43
--- /dev/null
+++ b/example.msg/debug.html-text-xml-header.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example.msg/debug.html-text-xml.xml b/example.msg/debug.html-text-xml.xml
new file mode 100644
index 0000000..63dd5dd
--- /dev/null
+++ b/example.msg/debug.html-text-xml.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example.msg/debug.ldap.xml b/example.msg/debug.ldap.xml
new file mode 100644
index 0000000..b91ecfb
--- /dev/null
+++ b/example.msg/debug.ldap.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/example.msg/debug.xml b/example.msg/debug.xml
new file mode 100644
index 0000000..4ee34e5
--- /dev/null
+++ b/example.msg/debug.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+ 1
+ 0
+ 2002
+ Operation successfully.
+
+
+ 7805693
+
+ C_MAIN_ACCOUNT
+ 2550007807518
+ MainAccount
+ 31183
+ 32183
+ 1049
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/commons-lang-2.6.jar b/lib/commons-lang-2.6.jar
new file mode 100644
index 0000000..98467d3
Binary files /dev/null and b/lib/commons-lang-2.6.jar differ
diff --git a/lib/commons-log-pack-1.1.2.jar b/lib/commons-log-pack-1.1.2.jar
new file mode 100644
index 0000000..dcc4633
Binary files /dev/null and b/lib/commons-log-pack-1.1.2.jar differ
diff --git a/lib/ec02_library.jar b/lib/ec02_library.jar
new file mode 100644
index 0000000..162cf89
Binary files /dev/null and b/lib/ec02_library.jar differ
diff --git a/lib/eqxmsg_3_3_2.jar b/lib/eqxmsg_3_3_2.jar
new file mode 100644
index 0000000..3611dff
Binary files /dev/null and b/lib/eqxmsg_3_3_2.jar differ
diff --git a/lib/gson-2.2.2.jar b/lib/gson-2.2.2.jar
new file mode 100644
index 0000000..f2108e0
Binary files /dev/null and b/lib/gson-2.2.2.jar differ
diff --git a/lib/org.json-20120521.jar b/lib/org.json-20120521.jar
new file mode 100644
index 0000000..f11fcd0
Binary files /dev/null and b/lib/org.json-20120521.jar differ
diff --git a/lib/simple-xml-2.7.1.jar b/lib/simple-xml-2.7.1.jar
new file mode 100644
index 0000000..913725d
Binary files /dev/null and b/lib/simple-xml-2.7.1.jar differ
diff --git a/src/th/co/ais/ssbsrfc/config/Constant.java b/src/th/co/ais/ssbsrfc/config/Constant.java
new file mode 100644
index 0000000..87183aa
--- /dev/null
+++ b/src/th/co/ais/ssbsrfc/config/Constant.java
@@ -0,0 +1,144 @@
+package th.co.ais.ssbsrfc.config;
+
+
+
+public class Constant {
+
+ /*
+ * [mSSB-SRFC] [Send|Received] [Bad] [Response|Request] [Timeout|Abort|Reject|Error]
+ */
+
+ public static final int TYPE_SEND = 0;
+ public static final int TYPE_RECEIVE = 1;
+
+ public static final int TYPE_RESPONSE = 2;
+ public static final int TYPE_REQUEST = 3;
+ public static final int TYPE_NOREPLY = 88;
+
+ public static final int TYPE_MISSING = 4;
+ public static final int TYPE_INVALID = 5;
+
+ public static final int TYPE_TIMEOUT = 6;
+ public static final int TYPE_ABORT = 7;
+ public static final int TYPE_REJECT = 8;
+ public static final int TYPE_ERROR = 9;
+
+
+ public static final int TYPE_SUCCESS = 10;
+ public static final int TYPE_UNKNOWN_ERROR = 12;
+ public static final int TYPE_MENU_UNIQUELDENTIFIER_DUPLICATE = 100;
+ public static final int TYPE_CHANNEL = 101;
+
+
+ public static final int TYPE_DATA_NOT_FOUND = 11;
+ public static final int TYPE_SUCCESS_WITH_CONDITION = 13;
+ public static final int TYPE_SUCCESS_WITH_CONDITION_STATUS_CHANGE = 14;
+ public static final int TYPE_REJECT_APPLICATION = 15;
+ public static final int TYPE_SUCCESS_WITH_CONDITION_STATUS_TERMINATED = 16;
+ public static final int TYPE_SUCCESS_WITH_CONDITION_STATUS_BORROWED = 17;
+ public static final int TYPE_SUCCESS_WITH_CONDITION_OUTSTANDING_NOT_ZERO = 18;
+ public static final int TYPE_SUCCESS_WITH_CONDITION_NOT_IN_SEVEN_DAYS = 19;
+ public static final int TYPE_USER_INACTIVE = 20;
+ public static final int TYPE_INVALID_CONTRACT_ID = 21;
+ public static final int TYPE_ACCESS_DENIED = 22;
+ public static final int TYPE_FILE_NOT_FOUND = 23;
+ public static final int TYPE_ALREADY_SENT_INVITATION = 24;
+ public static final int TYPE_ALREADY_SENT_ADD_BALANCE = 25;
+ public static final int TYPE_DATA_EXISTED = 26;
+ public static final int TYPE_DUPLICATE = 99;
+
+ public static final String SEND = "Send";
+ public static final String RECEIVE = "Receive";
+
+ public static final String BAD = "Bad";
+ public static final String DUPLICATE = "Duplicate";
+
+ public static final String RESPONSE = "Response";
+ public static final String REQUEST = "Request";
+
+ public static final String TIMEOUT = "Timeout";
+ public static final String ABORT = "Abort";
+ public static final String REJECT = "Reject";
+ public static final String ERROR = "Error";
+
+ public static final String ENCRYPTKEY = "82BDZsTKxvTJb9Bm";
+
+ public static final int FLOW_TEST_A = 1;
+ public static final int FLOW_Unexpected_Event_Handling = 19;
+
+ public static final int SUBSTATE_TYPE_W_REQUEST = 1;
+ public static final int SUBSTATE_TYPE_W_RESPONSE = 2;
+ public static final int SUBSTATE_TYPE_W_E01 = 3;
+ public static final int SUBSTATE_TYPE_UNKNOWN = -1;
+
+ public static String nodeLBSRFP = "LBSRFP";
+ public static String nodeE01 = "E01";
+ public static String nodeES12 = "ES12";
+
+ public static final int[] arrSingleFlow = {/*Constant.FLOW_Loan_Potential_Jobs_Tracking, Constant.FLOW_TEST_A, Constant.FLOW_Loan_Potential_Request_Handling, Constant.FLOW_Loan_UI, Constant.FLOW_Loan_Activation, Constant.FLOW_Loan_Customer_Registration*/};
+
+ public static enum DETAILLOG {
+ CLOSE(0),
+ OPENERROR(1),
+ OPEN(2),
+ ;
+
+ int num = 0;
+ DETAILLOG(int message){
+ this.num = message;
+ }
+ public int get(){
+ return this.num;
+ }
+
+ }
+
+ public static enum ValidateType {
+ STRING,
+ NUMBER,
+ CURRENCY,
+ MOBILE,
+ DATETIME,
+ BOOLEAN,
+ BOOLEANUPPERCASE,
+ FIX,
+// LANG,
+ YESNO,
+ DECIMAL,
+ OBJECT,
+ ARRAY,
+// SUBSCRIPTIONSTATE,
+// AEMFCHARACTERISTIC,
+// AEMFVALUETYPE,
+// AEMFALERTPOINT,
+// AMFLOANSTATE,
+ URL,
+ EMAIL,
+// DS3CUSTOMERCATEGORY,
+// DS3CUSTOMERSUBCATEGORY,
+// DS3CUSTOMERSEGMENT,
+// AEMFACHIEVE,
+// AEMFSTATUS,
+// AEMFSTATUS2,
+// ARMEDPARAM,
+// SDFGUPDATASERVLIFESTYLE,
+// SDFGUPAUTHENLEVEL,
+// MOBILESTATUS,
+// LANGUPPER,
+// DAAERRORCODE,
+ NOTCHECKINVALID,
+ TOROSUBSCRIPTIONIDTYPE,
+ BEARERTYPE,
+ OutbandChannel,
+ REESULTCODE,
+ WAITRESULTINDICATOR,
+ OUTBANDCHANNELOTP,
+ TOROLANGUAGEPREFERENCE,
+ INBANDINDICATOR
+ }
+
+ public static enum Parameter {
+ MANDATORY,
+ OPTIONAL
+ }
+}
diff --git a/src/th/co/ais/ssbsrfc/config/EventFilter.java b/src/th/co/ais/ssbsrfc/config/EventFilter.java
new file mode 100644
index 0000000..71ea2d9
--- /dev/null
+++ b/src/th/co/ais/ssbsrfc/config/EventFilter.java
@@ -0,0 +1,58 @@
+package th.co.ais.ssbsrfc.config;
+
+public class EventFilter {
+ public String eventType;
+ public String type;
+ public String ctype;
+ public String method;
+ public String getEventType() {
+ return eventType;
+ }
+
+ public void setEventType(String eventType) {
+ this.eventType = eventType;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getCtype() {
+ return ctype;
+ }
+
+ public void setCtype(String ctype) {
+ this.ctype = ctype;
+ }
+
+ public String getMethod() {
+ return method;
+ }
+
+ public void setMethod(String method) {
+ this.method = method;
+ }
+
+ public String getCmd() {
+ return cmd;
+ }
+
+ public void setCmd(String cmd) {
+ this.cmd = cmd;
+ }
+
+ public String cmd;
+
+ public EventFilter(String _eventType, String _type, String _ctype, String _method, String _cmd)
+ {
+ this.eventType = _eventType;
+ this.type = _type;
+ this.ctype = _ctype;
+ this.method = _method;
+ this.cmd = _cmd;
+ }
+}
diff --git a/src/th/co/ais/ssbsrfc/config/Invoke.java b/src/th/co/ais/ssbsrfc/config/Invoke.java
new file mode 100644
index 0000000..8d7729e
--- /dev/null
+++ b/src/th/co/ais/ssbsrfc/config/Invoke.java
@@ -0,0 +1,136 @@
+package th.co.ais.ssbsrfc.config;
+
+import java.util.UUID;
+
+import th.co.ais.ssbsrfc.utils.Global;
+
+public class Invoke {
+ public String nodeName; // UDC, SRFC, SDF
+ public String key; // 6681234567
+ public String cmd = null; // callBackUrl, getFile
+ public String eventType = null; // Incoming_UDC_Response
+ public String unique;
+ public Object dev = null; // for developer
+
+ private static final String DELIMITER = ".";
+
+ public String getNodeName() {
+ return nodeName;
+ }
+
+ public void setNodeName(String nodeName) {
+ this.nodeName = nodeName;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getCmd() {
+ return cmd;
+ }
+
+ public void setCmd(String cmd) {
+ this.cmd = cmd;
+ }
+
+ public String getUnique() {
+ return unique;
+ }
+
+ public String getEventType() {
+ return eventType;
+ }
+
+ public void setEventType(String eventType) {
+ this.eventType = eventType;
+ }
+
+ public void setUnique(String unique) {
+ this.unique = unique;
+ }
+
+ public static String genUniqueId()
+ {
+ UUID uuid = UUID.randomUUID();
+ return uuid.toString();
+ }
+
+ public Object getDev() {
+ return dev;
+ }
+
+ public void setDev(Object dev) {
+ this.dev = dev;
+ }
+
+ public Invoke() {}
+
+ public Invoke(String invokeString)
+ {
+ String[] strSplit = null;
+ if(invokeString != null)
+ {
+ strSplit = invokeString.split("[\\"+DELIMITER+"]");
+ if(strSplit.length == 5)
+ {
+ this.nodeName = strSplit[0];
+ this.key = strSplit[1];
+ this.cmd = strSplit[2];
+ this.eventType = strSplit[3];
+ this.unique = strSplit[4];
+ } else if (strSplit.length == 6) {
+ this.nodeName = strSplit[0];
+ this.key = strSplit[1];
+ this.cmd = strSplit[2];
+ this.eventType = strSplit[3];
+ this.unique = strSplit[4];
+ this.dev = strSplit[5];
+ }
+ }
+ }
+
+ public Invoke(String _key, String _eventType) {
+ super();
+ String _cmd = StateConfig.getCommandFromEventType(eventType);
+ String _node = Global.getNodeFromEventType(eventType);
+ this.nodeName = _node;
+ this.key = _key;
+ this.cmd = _cmd;
+ this.eventType = _eventType;
+ UUID uuid = UUID.randomUUID();
+ this.unique = uuid.toString();
+ }
+
+ public Invoke(String _nodeName, String _key, String _cmd, String _eventType, String _unique)
+ {
+ // TODO check . in all variable (if have)
+ this.nodeName = _nodeName;
+ this.key = _key;
+ this.cmd = _cmd;
+ this.eventType = _eventType;
+ if(_unique == null)
+ {
+ UUID uuid = UUID.randomUUID();
+ this.unique = uuid.toString();
+ }
+ else
+ {
+ this.unique = _unique;
+ }
+ }
+
+ public String toString()
+ {
+ String strInvoke ="";
+ strInvoke = this.nodeName + DELIMITER + this.key + DELIMITER + this.cmd + DELIMITER + this.eventType + DELIMITER + this.unique;
+ if(this.dev != null) {
+ strInvoke += DELIMITER + this.dev.toString();
+ }
+ return strInvoke;
+ }
+}
diff --git a/src/th/co/ais/ssbsrfc/config/State.java b/src/th/co/ais/ssbsrfc/config/State.java
new file mode 100644
index 0000000..8c3d9b2
--- /dev/null
+++ b/src/th/co/ais/ssbsrfc/config/State.java
@@ -0,0 +1,68 @@
+package th.co.ais.ssbsrfc.config;
+
+public class State {
+ public String name;
+ public String eventType;
+ public String nameReq; //Log, Alarm, Stat, Error
+ public String nameRes; //Log, Alarm, Stat, Error
+ public int msgType;
+ public int flow = -1;
+
+ public State(String _stateName, String _stateEventType, String _stateLASEName)
+ {
+ this.name = _stateName;
+ this.eventType = _stateEventType;
+ this.nameReq = _stateLASEName;
+ }
+
+ public State(String _stateName, String _stateEventType, String _nameReq, String _nameRes, int _msgType)
+ {
+ this.name = _stateName;
+ this.eventType = _stateEventType;
+ this.nameReq = _nameReq;
+ this.nameRes = _nameRes;
+ this.msgType = _msgType;
+ }
+
+ public State(String _stateName, String _stateEventType, String _nameReq, String _nameRes, int _msgType, int flow)
+ {
+ this.name = _stateName;
+ this.eventType = _stateEventType;
+ this.nameReq = _nameReq;
+ this.nameRes = _nameRes;
+ this.msgType = _msgType;
+ this.flow = flow;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getEventType() {
+ return eventType;
+ }
+
+ public void setEventType(String eventType) {
+ this.eventType = eventType;
+ }
+
+ public String getLASEName() {
+ return nameReq;
+ }
+
+ public void setLASEName(String lASEName) {
+ nameReq = lASEName;
+ }
+
+ public int getMsgType() {
+ return msgType;
+ }
+
+ public void setMsgType(int msgType) {
+ this.msgType = msgType;
+ }
+}
diff --git a/src/th/co/ais/ssbsrfc/config/StateConfig.java b/src/th/co/ais/ssbsrfc/config/StateConfig.java
new file mode 100644
index 0000000..d3fc409
--- /dev/null
+++ b/src/th/co/ais/ssbsrfc/config/StateConfig.java
@@ -0,0 +1,592 @@
+package th.co.ais.ssbsrfc.config;
+
+import th.co.ais.ssbsrfc.instance.CheckRequest;
+import th.co.ais.ssbsrfc.instance.EC02Instance;
+import th.co.ais.ssbsrfc.utils.Log;
+import ec02.af.abstracts.AbstractAF;
+import ec02.af.data.EquinoxRawData;
+import ec02.utils.AppLog;
+
+public class StateConfig {
+
+ //define project name
+ public static final String PROJECT_NAME = "LBCF";
+ public static String PROJECT_STAT_NAME = PROJECT_NAME;
+ public static final boolean isMultiFlow = false;
+
+ //define main state
+ public static final String STATE_IDLE = "IDLE";
+ public static final String STATE_ACTIVE = "ACTIVE";
+ public static final String STATE_E11_TIMEOUT = "E11_TIMEOUT";
+
+ //define sub state
+ public static final String SSTATE_UNKNOWN = "UNKNOWN";
+ public static final String SSTATE_REJECT = "REJECT";
+ public static final String SSTATE_ABORT = "ABORT";
+ public static final String SSTATE_BEGIN = "BEGIN";
+ public static final String SSTATE_END = "END";
+ public static final String SSTATE_W_A = "W_A";
+ public static final String SSTATE_W_CHARGEREQUEST = "W_CHARGEREQUEST";
+ public static final String SSTATE_W_CHARGEREPORT = "W_CHARGEREPORT";
+ public static final String SSTATE_W_ADJUSTMENT_CHARGEREQUEST = "W_ADJUSTMENTRESPONSE_CHARGEREQUEST";
+ public static final String SSTATE_W_ADJUSTMENT_CHARGEREPORT = "W_ADJUSTMENTRESPONSE_CHARGEREPORT";
+ //define event
+ public static final String Incoming_Unknown ="Incoming_Unknown";
+ public static final String Incoming_REJECT ="Incoming_REJECT";
+ public static final String Incoming_ABORT ="Incoming_ABORT";
+ public static final String Incoming_A_Request = "Incoming_A_Request";
+ public static final String Incoming_ChargeRequest_Request = "Incoming_ChargeRequest_Request";
+ public static final String Incoming_ChargeReport_Request = "Incoming_ChargeReport_Request";
+ public static final String Incoming_Adjustment_ChargeRequest_Response = "Incoming_Adjustment_ChargeRequest_Response";
+ public static final String Incoming_Adjustment_ChargeReport_Response = "Incoming_Adjustment_ChargeReport_Response";
+
+ //define LASE (Log, Alarm, Stat, Error)
+ public static final String LASE_Unknown = "Unknown Command";
+ public static final String LASE_Reject = "Unknown Reject";
+ public static final String LASE_Abort = "Unknown Abort";
+
+ // define frist state of each flow
+ public static final String[] arrFirstStateFlow = {
+ SSTATE_W_CHARGEREQUEST,SSTATE_W_CHARGEREPORT,
+
+ }; // SSTATE_UNKNOWN
+
+ //define sub state list and messages that relate to
+
+ public static State subStateList[] = {
+ new State(SSTATE_REJECT, Incoming_REJECT, LASE_Reject),
+ new State(SSTATE_ABORT, Incoming_ABORT, LASE_Abort),
+ new State(SSTATE_END, Incoming_Unknown, LASE_Unknown),
+
+ new State(SSTATE_W_CHARGEREQUEST, Incoming_ChargeRequest_Request, "Test A", "Test A", Constant.TYPE_REQUEST, Constant.FLOW_TEST_A),
+ new State(SSTATE_W_CHARGEREPORT, Incoming_ChargeReport_Request, "Test A", "Test A", Constant.TYPE_REQUEST, Constant.FLOW_TEST_A),
+ new State(SSTATE_W_ADJUSTMENT_CHARGEREQUEST, Incoming_Adjustment_ChargeRequest_Response, "Test A", "Test A", Constant.TYPE_REQUEST, Constant.FLOW_TEST_A),
+ new State(SSTATE_W_ADJUSTMENT_CHARGEREPORT, Incoming_Adjustment_ChargeReport_Response, "Test A", "Test A", Constant.TYPE_REQUEST, Constant.FLOW_TEST_A),
+// new State(SSTATE_W_A, Incoming_A_Request, "Test A", "Test A", Constant.TYPE_RESPONSE),
+ new State(SSTATE_END, Incoming_Unknown,"Unknown_Command"),
+ };
+
+ //define event type message filter
+ public static final EventFilter[] eventFilter = {
+ // Flow 0
+ new EventFilter(Incoming_ChargeRequest_Request, "request", "text/plain", null, null),
+ new EventFilter(Incoming_ChargeReport_Request, "request", "text/plain", null, null),
+ new EventFilter(Incoming_Adjustment_ChargeRequest_Response, "request", "text/plain", null, null),
+ new EventFilter(Incoming_Adjustment_ChargeReport_Response, "request", "text/plain", null, null),
+ };
+
+ public static String getSubStateFromEventType(String eventType)
+ {
+ String subState="";
+ try {
+ // find sub state to handler event type
+ for(int i=0; i < subStateList.length; i++)
+ {
+ State state = subStateList[i];
+ String ssName = state.name;
+ String ssEventType = state.eventType;
+
+ // if we found matching relation
+ if(eventType.equals(ssEventType))
+ {
+ subState = ssName;
+ break;
+ }
+ }
+ }
+ catch (Exception e) {
+ AppLog.e("ERROR: getSubStateFromEventType!! eventType:" + eventType + "desc: " + e);
+ }
+ return subState;
+ }
+
+ public static String getEventTypeFromSubState(String subState)
+ {
+ String eventType = "";
+ try {
+ // find sub state to handler event type
+ for(int i=0; i < subStateList.length; i++)
+ {
+ State state = subStateList[i];
+ String sstate = state.name;
+ String ssEventType = state.eventType;
+
+ // if we found matching relation
+ if(sstate.equals(subState))
+ {
+ eventType = ssEventType;
+ break;
+ }
+ }
+ }
+ catch (Exception e) {
+ AppLog.e("ERROR: getEventTypeFromSubState!! subState:" + subState + "desc: " + e);
+ }
+ return eventType;
+ }
+
+ public static String getCommandFromEventType(String eventType)
+ {
+ String command="";
+ try {
+ // find sub state to handler event type
+ for(int i=0; i < subStateList.length; i++)
+ {
+ State state = subStateList[i];
+ String ssCommand = state.nameReq;
+ String ssEventType = state.eventType;
+
+ // if we found matching relation
+ if(eventType.equals(ssEventType))
+ {
+ command = ssCommand;
+ break;
+ }
+ }
+ }
+ catch (Exception e) {
+ AppLog.e("ERROR: getSubStateFromEventType!! eventType:" + eventType + "desc: " + e);
+ }
+ return command;
+ }
+
+ public static void changeCommandFromEventType(String eventType, String command)
+ {
+ try {
+ // find sub state to handler event type
+ for(int i=0; i < subStateList.length; i++)
+ {
+ State state = subStateList[i];
+ String ssEventType = state.eventType;
+
+ // if we found matching relation
+ if(eventType.equals(ssEventType))
+ {
+ subStateList[i].setLASEName(command);
+ break;
+ }
+ }
+ }
+ catch (Exception e) {
+ AppLog.e("ERROR: changeCommangFromEventType!! eventType:" + eventType + " new command:" + command + " desc: " + e);
+ }
+ }
+
+ public static int getFlowFromEventType(String eventType)
+ {
+ int flow = -1;
+ try {
+ // find sub state to handler event type
+ for(int i=0; i < subStateList.length; i++)
+ {
+ State state = subStateList[i];
+ String ssEventType = state.eventType;
+ int ssFlow = state.flow;
+
+ // if we found matching relation
+ if(eventType.equals(ssEventType))
+ {
+ flow = ssFlow;
+ break;
+ }
+ }
+ }
+ catch (Exception e) {
+ AppLog.e("ERROR: getFlowFromEventType!! eventType:" + eventType + "desc: " + e);
+ }
+ return flow;
+ }
+
+ public static String getCommandFromState(String subState)
+ {
+ String command="";
+ try {
+ // find sub state to handler event type
+ for(int i=0; i < subStateList.length; i++)
+ {
+ State state = subStateList[i];
+ String ssCommand = state.nameReq;
+ String ssState = state.name;
+
+ // if we found matching relation
+ if(subState.equals(ssState))
+ {
+ command = ssCommand;
+ break;
+ }
+ }
+ }
+ catch (Exception e) {
+ AppLog.e("ERROR: getSubStateFromEventType!! eventType:" + subState + "desc: " + e);
+ }
+ return command;
+ }
+
+ public static String getCommandFromStateAndType(String subState, int type)
+ {
+ String command="";
+ try {
+ // find sub state to handler event type
+ for(int i=0; i < subStateList.length; i++)
+ {
+ State state = subStateList[i];
+ String ssCmdReq= state.nameReq;
+ String ssCmdRes= state.nameRes;
+ String ssState = state.name;
+
+ // if we found matching relation
+ if(subState.equals(ssState))
+ {
+ if (type == Constant.TYPE_REQUEST) {
+ command = ssCmdReq;
+ } else if (type == Constant.TYPE_RESPONSE) {
+ command = ssCmdRes;
+ }
+ break;
+ }
+ }
+ }
+ catch (Exception e) {
+ AppLog.e("ERROR: getSubStateFromEventType!! eventType:" + subState + "desc: " + e);
+ }
+ return command;
+ }
+
+ public static int getSubStateIndex(String currentState)
+ {
+ int idx=-1;
+ // find sub state to handler event type
+ for(int i=0; i < subStateList.length; i++)
+ {
+ State state = subStateList[i];
+ String ssName = state.name;
+
+ // if we found matching relation
+ if(currentState.equals(ssName))
+ {
+ idx = i;
+ }
+ }
+ return idx;
+ }
+
+ public static boolean isFirstState(String state)
+ {
+ boolean first = false;
+ for (String _state : arrFirstStateFlow) {
+ if (_state.contains(state)) {
+ first = true;
+ break;
+ }
+ }
+ return first;
+ }
+
+ public static void setNextSubState(EC02Instance ec02Instance)
+ {
+ // get current state
+ String currentState = ec02Instance.getAFInstance().getCurrentState();
+ String nextState = StateConfig.getNextSubState(currentState);
+ ec02Instance.getAFInstance().setCurrentState(nextState);
+ // end
+ }
+
+ public static String getNextSubState(String currentState)
+ {
+ if(currentState.equals(SSTATE_END))
+ {
+ return SSTATE_END;
+ }
+
+ int idx = getSubStateIndex(currentState);
+ if(idx != -1)
+ {
+ idx++;
+ State state = subStateList[idx];
+ String ssName = state.name;
+ return ssName;
+ }
+ else //if not found
+ {
+ return SSTATE_UNKNOWN;
+ }
+ }
+
+ public static String getEventTypeFromInvoke(String invokeMsg)
+ {
+ String eventType = null;
+ Invoke invoke = new Invoke(invokeMsg);
+ eventType = invoke.getEventType();
+ return eventType;
+ }
+
+ public static boolean isValidateEventType(String eventType)
+ {
+ boolean isValidate = false;
+
+ // find sub state to handler event type
+ for(int i=0; i < subStateList.length; i++)
+ {
+ State state = subStateList[i];
+ String ssEventType = state.eventType;
+
+ // if we found matching relation
+ if(ssEventType.equals(eventType))
+ {
+ isValidate = true;
+ }
+ }
+ return isValidate;
+ }
+
+ public static String getEventTypeFromEquinoxRawData(EC02Instance ec02Instance, EquinoxRawData rawData)
+ {
+ String eventType = null;
+ // 1.1.1. Extract type, ctype, method, invoke, ret attributes.
+ String type = rawData.getRawDataAttribute("type");
+ String ctype = rawData.getRawDataAttribute("ctype");
+ String method = rawData.getRawDataAttribute("method");
+ String invoke = rawData.getInvoke();
+ String cmd = "";
+ /*String ret = rawData.getRawDataAttribute("ret");
+ // 1.1.2. If ret in (1, 2, 3, 4) Then
+ if (ret.equals("2")) {
+ return StateConfig.Incoming_REJECT;
+ } else if (ret.equals("3")) {
+ return StateConfig.Incoming_ABORT;
+ }*/
+// if (type.equals("response")) {
+// ArrayList listTimeout = ec02Instance.getAFInstance().getListTimeout();
+// boolean isBool = false;
+// for (Timeout timeout : listTimeout) {
+// if (timeout.getName().equals(invoke)) {
+// isBool = true;
+// }
+// }
+// if (!isBool) {
+// return StateConfig.Incoming_Unknown;
+// }
+// }
+
+ // 1.1.3. Try to get event type from invoke
+ if(invoke != null && invoke.length() >0)
+ {
+ // 1.1.4. If valid event type Then
+ String event = getEventTypeFromInvoke(invoke);
+ if(event != null && isValidateEventType(event))
+ {
+ // 1.1.4.1. Set event type =
+ return event;
+ }
+ }
+
+ // 1.1.6. Get event type from type, ctype, method, cmd
+ int maxCount = 0;
+ for(int i=0; i < eventFilter.length; i++)
+ {
+ EventFilter ef = eventFilter[i];
+ boolean bMatch = false;
+ int count = 0; //use for count matched in each parameter
+
+ // try matching 1 by 1
+ // check type
+ if(ef.type != null)
+ {
+ if(type.equals(ef.type))
+ {
+ bMatch = true;
+ count++;
+ }
+ else
+ bMatch = false;
+ }
+
+ // check ctype
+ if(ef.ctype != null)
+ {
+ if(ctype.equals(ef.ctype))
+ {
+ bMatch = true;
+ count++;
+ }
+ else
+ bMatch = false;
+ }
+
+ // check method
+ if(ef.method != null)
+ {
+ if(method.equals(ef.method))
+ {
+ bMatch = true;
+ count++;
+ }
+ else
+ bMatch = false;
+ }
+
+ // check cmd
+ if(ef.cmd != null)
+ {
+ if(cmd.equals(ef.cmd))
+ {
+ bMatch = true;
+ count++;
+ }
+ else
+ bMatch = false;
+ }
+ //check and set maxCount for use to select event type
+ if(bMatch && count > maxCount)
+ {
+ maxCount = count;
+
+ //set return event type to this matched
+ eventType = ef.eventType;
+ }
+ AppLog.d("EVENT TYPE:"+eventType+"In If"+eventType.equals(StateConfig.Incoming_A_Request));
+ if (eventType.equals(StateConfig.Incoming_ChargeRequest_Request)) {
+ //String page = rawData.getRawDataMessage();
+ String page = rawData.getRawDataAttribute("val");
+ CheckRequest checkRequest = new CheckRequest();
+ checkRequest.setDn(page);
+ String [] dnList = checkRequest.getDn().split("&", -1);
+ page = dnList[0].substring("page=".length());
+ if (page.equals("chargeRequest")) {
+ eventType = StateConfig.Incoming_ChargeRequest_Request;
+ } else if (page.equals("chargeReport")) {
+ eventType = StateConfig.Incoming_ChargeReport_Request;
+ }
+ }
+ }
+ return eventType;
+ }
+
+ public static String getLASEName(String currentSubState, int sendOrReceive, int responseOrRequest, int missingOrInvalidOrTARE, String errMsg)
+ {
+ String name = StateConfig.getLASEName(currentSubState, sendOrReceive, responseOrRequest, missingOrInvalidOrTARE, errMsg, null);
+ return name;
+ }
+
+ public static String getLASEName(String currentSubState, int sendOrReceive, int responseOrRequest, int missingOrInvalidOrTARE, String errMsg, String command, int flow)
+ {
+ switch (flow) {
+ default:
+ StateConfig.PROJECT_STAT_NAME = StateConfig.PROJECT_NAME;
+ break;
+ }
+
+ String name = StateConfig.getLASEName(currentSubState, sendOrReceive, responseOrRequest, missingOrInvalidOrTARE, errMsg, command);
+ return name;
+ }
+
+ public static String getLASEName(String currentSubState, int sendOrReceive, int responseOrRequest, int missingOrInvalidOrTARE, String errMsg, String command)
+ {
+// AppLog.d("## [mSSB-SRFC] [Send|Received] [Bad] [Response|Request] [Timeout|Abort|Reject|Error] [errMsg]");
+// AppLog.d("## getLASEName :" + currentSubState + "/" + sendOrReceive + "/" + responseOrRequest + "/" + missingOrInvalidOrTARE + "/" + errMsg);
+ String stateName = null;
+// int idx = StateConfig.getSubStateIndex(currentSubState);
+// State state = StateConfig.subStateList[idx];
+ String LASEName = StateConfig.getCommandFromStateAndType(currentSubState, responseOrRequest);
+
+ /*
+ * [mSSB-SRFC] [Send|Received] [Bad] [Response|Request] [Timeout|Abort|Reject|Error]
+ */
+
+ String sr = "";
+
+ switch (sendOrReceive)
+ {
+ case Constant.TYPE_SEND:
+ sr = Constant.SEND;
+ break;
+ case Constant.TYPE_RECEIVE:
+ sr = Constant.RECEIVE;
+ break;
+ }
+
+ String rr = "";
+ switch (responseOrRequest)
+ {
+ case Constant.TYPE_RESPONSE:
+ rr = Constant.RESPONSE + " ";
+ break;
+ case Constant.TYPE_REQUEST:
+ rr = Constant.REQUEST + " ";
+ break;
+ }
+
+ //Timeout, Abort, Reject, Error
+ String tare = "";
+ String bad = "";
+ String cmd = "";
+ switch (missingOrInvalidOrTARE)
+ {
+ case Constant.TYPE_MISSING:
+ bad = Constant.BAD + " ";
+ break;
+ case Constant.TYPE_INVALID:
+ bad = Constant.BAD + " ";
+ break;
+ case Constant.TYPE_DUPLICATE:
+ bad = Constant.DUPLICATE + " ";
+ break;
+ case Constant.TYPE_TIMEOUT:
+ tare = Constant.TIMEOUT;
+ break;
+ case Constant.TYPE_ABORT:
+ tare = Constant.ABORT;
+ break;
+ case Constant.TYPE_REJECT:
+ tare = Constant.REJECT;
+ break;
+ case Constant.TYPE_ERROR:
+ case Constant.TYPE_UNKNOWN_ERROR:
+ tare = Constant.ERROR;
+ break;
+ }
+
+ if (command != null) {
+ cmd = command;
+ } else {
+ if (missingOrInvalidOrTARE == Constant.TYPE_REJECT_APPLICATION) {
+ cmd = "Unknown";
+ rr = Constant.REQUEST + " ";
+ } else {
+ cmd = LASEName;
+ }
+ }
+
+ stateName = StateConfig.PROJECT_STAT_NAME + " " + sr + " " + bad + cmd + " " + rr + tare;
+ stateName = stateName.trim();
+
+ return stateName;
+ }
+
+ public static String getTimeout(AbstractAF abstractAF, String event) {
+ String timeout = StateConfig.getTimeout(abstractAF, event, null);
+ return timeout;
+ }
+
+ public static String getTimeout(AbstractAF abstractAF, String event, String command) {
+ String time = "10";
+ String configName = "Default-timeout";
+ try {
+ if (event.equals(StateConfig.Incoming_Unknown)) {
+ configName = "Wait-Get-File-Timeout";
+ } else {
+ configName = "Default-timeout";
+ }
+
+ time = abstractAF.getUtils().getHmWarmConfig().get(configName).get(0);
+ AppLog.d("## SET TIMEOUT: " + configName + " " + time + " sec");
+ } catch (Exception e) {
+ if (Log.debug) {
+ AppLog.d("## CHECKCONFIG EC02 READDING...");
+ AppLog.d("## EXCEPTION : " + e.getMessage());
+ AppLog.d("## DATA EVENTTYPE OR INVOKE:" + event + " COMMAND:" + command);
+ }
+ }
+ return time;
+ }
+}
diff --git a/src/th/co/ais/ssbsrfc/control/FlowManager.java b/src/th/co/ais/ssbsrfc/control/FlowManager.java
new file mode 100644
index 0000000..62bae00
--- /dev/null
+++ b/src/th/co/ais/ssbsrfc/control/FlowManager.java
@@ -0,0 +1,470 @@
+package th.co.ais.ssbsrfc.control;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang.ArrayUtils;
+
+import th.co.ais.ssbsrfc.config.Constant;
+import th.co.ais.ssbsrfc.config.StateConfig;
+import th.co.ais.ssbsrfc.instance.AFInstance;
+import th.co.ais.ssbsrfc.instance.EC02Instance;
+import th.co.ais.ssbsrfc.instance.FMInstance;
+import th.co.ais.ssbsrfc.instance.ManageTime;
+import th.co.ais.ssbsrfc.instance.Timeout;
+import th.co.ais.ssbsrfc.interfaces.EQXMsg;
+import th.co.ais.ssbsrfc.message.MessageParser;
+import th.co.ais.ssbsrfc.utils.Global;
+import th.co.ais.ssbsrfc.utils.Log;
+import ec02.af.abstracts.AbstractAF;
+import ec02.af.data.EquinoxRawData;
+import ec02.utils.AppLog;
+
+public class FlowManager {
+ private AbstractAF abstractAF = null;
+ private EC02Instance ec02Instance = null;
+ private AFInstance afInstance = null;
+ private EquinoxRawData equinoxRawData = null;
+ private int flow = 0;
+ private String type = EQXMsg.EMPTY;
+// private int[] arrSingleFlow = {Constant.FLOW_Loan_Potential_Jobs_Tracking, Constant.FLOW_Loan_Potential_Registration, Constant.FLOW_Loan_Potential_Request_Handling, Constant.FLOW_Loan_UI, Constant.FLOW_Loan_Activation, Constant.FLOW_Loan_Customer_Registration};
+ private FMInstance ins = null;
+ private ArrayList listFlow = new ArrayList();
+ private Map dicInvoke = new LinkedHashMap();
+ private ArrayList listTimeout = new ArrayList();
+ private ArrayList globalListTimeout = new ArrayList();
+ private int globalDialogueId = -1;
+ private boolean debug = false;
+
+ public FlowManager(AbstractAF abstractAF, EC02Instance ec02Instance) {
+ super();
+ this.abstractAF = abstractAF;
+ this.ec02Instance = ec02Instance;
+ this.afInstance = ec02Instance.getAFInstance();
+ }
+ public void start(EquinoxRawData equinoxRawData)
+ {
+ this.equinoxRawData = equinoxRawData;
+ this.listFlow = this.afInstance.getListFlow();
+ this.dicInvoke = this.afInstance.getDicInvoke();
+ this.globalDialogueId = this.afInstance.getGlobalDialogueId();
+ this.listTimeout = this.afInstance.getListTimeout();
+ this.globalListTimeout = this.afInstance.getGlobalListTimeout();
+
+ if (this.debug) {
+ AppLog.d("####### TABLE LISTFLOW #######");
+ AppLog.d("## SIZE:" + this.ec02Instance.getAFInstance().getListFlow().size());
+ AppLog.d("## INPUT TIMESTAMP:" + this.ec02Instance.getAFInstance().getStartFlowTimeStamp());
+ AppLog.d("------------------------------");
+ for (FMInstance i : this.ec02Instance.getAFInstance().getListFlow()) {
+ AppLog.d(i.toString());
+ }
+ AppLog.d("############# END ############");
+ }
+ if (this.listFlow.size() != 0) {
+// try {
+ // case e01
+ if (this.abstractAF.getUtils().getGlobalData().isRecieve()) {
+ String invoke = equinoxRawData.getInvoke();
+ this.setInstanceForInvoke(invoke);
+ if (this.debug) {
+ AppLog.d("## CASE EO1 GET INVOKE:" + invoke);
+ }
+ }
+ else {
+ String ret = equinoxRawData.getRet();
+ if (ret.equals("4")) { // Timeout
+ String unique = equinoxRawData.getRawDataAttribute("unique");
+ this.setInstanceForUnique(unique);
+ if (this.debug) {
+ AppLog.d("## CASE TIMEOUT GET UNIQUE:" + unique);
+ }
+ } else {
+ String type = equinoxRawData.getType();
+ if ((type.toLowerCase().equals("request") || type.toLowerCase().equals("noreply")) && !ret.equals("1") && !ret.equals("2") && !ret.equals("3")) {
+ String eventType = equinoxRawData.getRawEventType();
+ String ssName = StateConfig.getSubStateFromEventType(eventType);
+ int flow = StateConfig.getFlowFromEventType(eventType);
+// if (flow == -1 && type.toLowerCase().equals("noreply")) {
+// String invoke = equinoxRawData.getInvoke();
+// if (invoke != null && invoke.contains(".")) {
+// Object code = new Invoke(invoke).dev;
+// String strCode = (String)code;
+// if (strCode != null && strCode.equals("16")) {
+// flow = Constant.FLOW_Loan_Potential_Request_Handling;
+// }
+// }
+// }
+ if (this.debug) {
+ AppLog.d("## CASE REQUEST MESSAGE GET FLOW:" + flow);
+ AppLog.d("## EVENTTYPE:" + eventType);
+ AppLog.d("## SUBSTATE FOR EVENTTYPE:" + ssName);
+ }
+ if (flow != -1) {
+ this.flow = flow;
+ String firstState = StateConfig.arrFirstStateFlow[flow-1];
+ if (this.debug) {
+ AppLog.d("## FLOW:" + this.flow);
+ AppLog.d("## FIRST STATE:" + firstState);
+ }
+ if (ssName.equals(firstState) && !ArrayUtils.contains(Constant.arrSingleFlow, this.flow)) {
+ this.setInstance(new AFInstance());
+ if (this.debug) {
+ AppLog.d("## CASE START STATE FOR MULTI FLOW::NEW INSTANCE");
+ }
+ } else if (/*ssName.equals(firstState) && */ArrayUtils.contains(Constant.arrSingleFlow, this.flow)) {
+ this.setInstanceForFlow(flow);
+ if (this.debug) {
+ AppLog.d("## CASE SINGLE FLOW::GET INSTANCE FOR FLOW:" + this.flow);
+ }
+ } else { // not first state
+ this.setInstanceForFlow(flow);
+ if (this.debug) {
+ AppLog.d("## CASE NOT FIRST STATE::GET INSTANCE FOR FLOW:" + this.flow);
+ }
+ }
+ } else { //
+// if (eventType.equals(StateConfig.Incoming_DRR_Request) || eventType.equals(StateConfig.Incoming_DUR_Request)) {
+// String key = "Dialogue-Id";
+// String dialogueId = this.equinoxRawData.getRawDataAttribute(key);
+// this.equinoxRawData.getRawDataAttributes().remove(key);
+// // SET FLOW from Dialogue-Id
+// this.setInstanceForDialogueId(dialogueId);
+// if (this.debug) {
+// AppLog.d("## CASE DRR/DUR REQUEST::GET INSTANCE FOR DIALOGUE_ID:" + dialogueId);
+// }
+// } else { // impossible.
+ int index = this.listFlow.size() - 1;
+ FMInstance ins = this.listFlow.get(index);
+ this.listFlow.remove(index);
+ AFInstance data = (AFInstance) MessageParser.fromJson(ins.getData(), AFInstance.class);
+ this.setInstance(data);
+ if (this.debug) {
+ AppLog.d("## CASE IMPOSSIBLE::GET INSTANCE FOR INDEX:" + index);
+ }
+// }
+ }
+// } else if (type.toLowerCase().equals("response") && (ret.equals("1") || ret.equals("2") || ret.equals("3"))) {
+// int index = this.listFlow.size() - 1;
+// FMInstance ins = this.listFlow.get(index);
+// this.listFlow.remove(index);
+// AFInstance data = (AFInstance) MessageParser.fromJson(ins.getData(), AFInstance.class);
+// this.setInstance(data);
+// if (this.debug) {
+// AppLog.d("## CASE IMPOSSIBLE::GET INSTANCE FOR INDEX:" + index);
+// }
+ } else {
+ String invoke = equinoxRawData.getInvoke();
+ this.setInstanceForInvoke(invoke);
+ if (this.debug) {
+ AppLog.d("## CASE RESPONE MESSAGE::GET INSTANCE FOR INVOKE:" + invoke);
+ }
+ }
+ }
+ }
+// } catch (Exception e) {
+// if (this.debug) {
+// AppLog.d("## EXCEPTION(GET START MULTI FLOW):" + e);
+// }
+// int index = this.listFlow.size() - 1;
+// FMInstance ins = this.listFlow.get(index);
+// this.listFlow.remove(index);
+// AFInstance data = (AFInstance) MessageParser.fromJson(ins.getData(), AFInstance.class);
+// this.setInstance(data);
+// }
+ } else {
+ if (this.debug) {
+ AppLog.d("## FLOWMANAGER START");
+ AppLog.d("## 1.START FLOW TIMESTAMP:" + this.ec02Instance.getAFInstance().getStartFlowTimeStamp());
+ AppLog.d("## 2.INPUT TIMESTAMP:" + Global.inputTimeStamp);
+ AppLog.d("## 3.CURRENT START:" + this.ec02Instance.getAFInstance().getCurrentState());
+ }
+ }
+ if (this.debug) {
+ AppLog.d("## GET INSTANCE START FLOW TIMESTAMP:" + this.ec02Instance.getAFInstance().getStartFlowTimeStamp());
+ }
+ }
+ public void end(String curState, String nxtState, List eqxRawDataListInput, List eqxRawDataListOutput)
+ {
+ Log.detailLog(this.ec02Instance, this.abstractAF, curState, nxtState, eqxRawDataListInput, eqxRawDataListOutput);
+ Log.summaryLog(this.ec02Instance, this.abstractAF);
+ this.listFlow = this.ec02Instance.getAFInstance().getListFlow();
+ this.dicInvoke = this.ec02Instance.getAFInstance().getDicInvoke();
+ this.globalDialogueId = this.ec02Instance.getAFInstance().getGlobalDialogueId();
+ this.globalListTimeout = this.ec02Instance.getAFInstance().getGlobalListTimeout();
+ // clear
+ this.ec02Instance.getAFInstance().setListFlow(null);
+ this.ec02Instance.getAFInstance().setDicInvoke(null);
+ this.ec02Instance.getAFInstance().setGlobalListTimeout(null);
+ if (!nxtState.equals(StateConfig.STATE_IDLE)) {
+// Gson gsonBuilder = new GsonBuilder().create();
+ AFInstance af = this.ec02Instance.getAFInstance();
+ String data = Global.encodeInstance(af);
+ int flow = af.getFlow();
+ String date = af.getStartFlowTimeStamp();
+ String dialogueId = af.getDialogueIdForMultiFlow();
+ String unique = Global.getUnique();
+ FMInstance newIns = new FMInstance(flow, date, data, dialogueId);
+ newIns.setUnique(unique);
+ if (this.debug) {
+ AppLog.d("## FLOWMANAGER END");
+ AppLog.d("## FLOW:" + flow);
+ AppLog.d("## DATE:" + date);
+ AppLog.d("## DIALOGUE_ID:" + dialogueId);
+ AppLog.d("## UNIQUE:" + unique);
+ }
+ ManageTime mTimeout = new ManageTime(this.ec02Instance);
+ Timeout ins = mTimeout.getInsTime();
+ if (ins != null) {
+ ManageTime mt = new ManageTime();
+ mt.setListTimeout(this.ec02Instance.getAFInstance().getGlobalListTimeout());
+ mt.setTimeout(newIns.getUnique(), "" + ins.getTimeout(), ins.getDate());
+ this.ec02Instance.getAFInstance().setGlobalListTimeout(mt.getListTimeout());
+ }
+// this.ec02Instance.getAFInstance().putListFlow(newIns);
+ this.listFlow = this.listFlow == null ? new ArrayList() : this.listFlow;
+ this.listFlow.add(newIns);
+ if (this.debug) {
+ AppLog.d("## LIST FLOW COUNT:" + this.listFlow.size());
+ }
+ }
+// this.ec02Instance.getAFInstance().setStartFlowTimeStamp("");
+ if (this.debug) {
+ AppLog.d("####### TABLE LISTFLOW #######");
+ AppLog.d("## SIZE:" + this.listFlow.size());
+ AppLog.d("------------------------------");
+ for (FMInstance i : this.listFlow) {
+ AppLog.d(i.toString());
+ }
+ AppLog.d("############# END ############");
+ AppLog.d("####### TABLE DIC INVOKE #######");
+ AppLog.d("## SIZE:" + this.dicInvoke.size());
+ AppLog.d("------------------------------");
+ if (this.dicInvoke != null) {
+ Iterator> it = this.ec02Instance.getAFInstance().getDicInvoke().entrySet().iterator();
+ while (it.hasNext()) {
+ @SuppressWarnings("rawtypes")
+ Map.Entry pair = (Map.Entry)it.next();
+ AppLog.d(pair.getKey()+ ":" + pair.getValue().toString());
+ }
+ }
+ AppLog.d("############# END ############");
+ }
+
+ this.setInstance(new AFInstance());
+ }
+
+ public FMInstance find(FMInstance ins)
+ {
+ if (this.debug) {
+ AppLog.d("####### TABLE LISTFLOW #######");
+ AppLog.d("## SIZE:" + this.listFlow.size());
+ AppLog.d("------------------------------");
+ for (FMInstance i : this.listFlow) {
+ AppLog.d(i.toString());
+ }
+ AppLog.d("############# END ############");
+ AppLog.d("FMInstance find:" + ins.toString());
+ }
+
+ FMInstance newIns = null;
+ for (FMInstance i : this.listFlow) {
+ if (ins.getUnique() != null && i.getUnique().equals(ins.getUnique())) {
+// AppLog.d("## unique");
+// AppLog.d("unique:" + ins.getUnique());
+ newIns = i;
+ break;
+ } else if (ins.getDialogueId() != null) {
+// AppLog.d("## dialogueId");
+ if (i.getDialogueId().equals(ins.getDialogueId())) {
+// AppLog.d("getDialogueId:" + ins.getDialogueId());
+ newIns = i;
+ break;
+ }
+ } else if (ins.getDate() != null) {
+// AppLog.d("## date");
+ if (i.getFlow() == ins.getFlow() && i.getDate().equals(ins.getDate())) {
+// AppLog.d("flow:" + i.getFlow() + " date:" + i.getDate());
+ newIns = i;
+ break;
+ }
+ } else {
+// AppLog.d("## flow");
+ if (i.getFlow() == ins.getFlow()) {
+// AppLog.d("flow:" + i.getFlow() );
+ newIns = i;
+ break;
+ }
+ }
+ }
+ // remove
+ if (newIns != null) {
+ this.listFlow.remove(newIns);
+ if (this.debug) {
+ AppLog.d("## REMOVE:" +newIns.getFlow() + " " + newIns.getDate() + " " + newIns.getUnique());
+ AppLog.d("## globalListTimeout:" + this.globalListTimeout.size());
+ }
+ // remove globalListTimeout
+ try {
+ Timeout mIns = null;
+ for (Timeout mt : this.globalListTimeout) {
+ if (newIns.getUnique() != null && mt.getName() != null && mt.getName().equals(newIns.getUnique())){
+ mIns = mt;
+ break;
+ }
+ }
+ // check remove
+ if (mIns != null) {
+ this.globalListTimeout.remove(mIns);
+ }
+ if (this.debug) {
+ AppLog.d("## REMOVE GLOBAL_LIST_TIMEOUT COUNT:" + this.globalListTimeout.size());
+ }
+ } catch (Exception e) {
+ if (this.debug) {
+ AppLog.e("## Exception(remove globalListTimeout:" + this.globalListTimeout.size() + "):" + e.getMessage());
+ }
+ }
+ }
+ return newIns;
+ }
+ public void setInstance(AFInstance ins)
+ {
+ ins.setListFlow(this.listFlow);
+ ins.setDicInvoke(this.dicInvoke);
+ ins.setGlobalDialogueId(this.globalDialogueId);
+ ins.setGlobalListTimeout(this.globalListTimeout);
+ if (ins.getStartFlowTimeStamp() == null && this.ec02Instance.getAFInstance().getStartFlowTimeStamp() != null) {
+ ins.setStartFlowTimeStamp(this.ec02Instance.getAFInstance().getStartFlowTimeStamp());
+ }
+ // set instance
+ this.ec02Instance.setAFInstance(ins);
+ if (this.debug) {
+ AppLog.d("## FUNCTION SET INSTANCE");
+ AppLog.d("## 1.START FLOW TIMESTAMP:" + ins.getStartFlowTimeStamp());
+ AppLog.d("## 2.INPUT TIMESTAMP:" + this.ec02Instance.getAFInstance().getStartFlowTimeStamp());
+ }
+ }
+ public void setInstanceForInvoke(String invoke)
+ {
+// AppLog.d("#d# invoke :" + invoke);
+ FMInstance ins = this.dicInvoke.get(invoke);
+// AppLog.d("setInstanceForInvoke:" + ins.getFlow() + " " + ins.getDate());
+ this.dicInvoke.remove(invoke);
+ this.setInstance(ins);
+ }
+ public void setInstanceForFlow(int flow)
+ {
+ FMInstance ins = new FMInstance(flow);
+// AppLog.d(ins.toString());
+ this.setInstance(ins);
+ }
+ public void setInstanceForDialogueId(String dialogueId)
+ {
+ FMInstance ins = new FMInstance(flow, null, null, dialogueId);
+ this.setInstance(ins);
+
+ }
+ public void setInstanceForUnique(String unique)
+ {
+ FMInstance ins = new FMInstance();
+ ins.setUnique(unique);
+ ArrayList listTimeout = this.ec02Instance.getAFInstance().getListTimeout();
+ for (Timeout timeout : listTimeout) {
+ this.dicInvoke.remove(timeout.getName());
+ }
+ this.setInstance(ins);
+ }
+ public void setInstance(FMInstance ins)
+ {
+ if (this.debug) {
+ AppLog.d("## FIND AF_INSTANCE");
+ AppLog.d(ins.toString());
+ }
+ try {
+ ins = this.find(ins);
+ if (ins == null) {
+ this.setInstance(new AFInstance());
+ if (this.debug) {
+ AppLog.d("## NOSUCH OBJECT::NEW AF_INSTANCE");
+ }
+ } else {
+// AFInstance data = (AFInstance) MessageParser.fromJson(ins.getData(), AFInstance.class);
+ AFInstance data = Global.decodeInstance(ins.getData());
+ this.setInstance(data);
+ if (this.debug) {
+ AppLog.d("## OBJECT DATA");
+ AppLog.d("## 1.FLOW:" + data.getFlow());
+ AppLog.d("## 2.START FLOW TIMESTAMP:" + data.getStartFlowTimeStamp());
+ }
+ }
+ } catch (Exception e) {
+ if (this.debug) {
+ AppLog.e("## EXCEPTION:" + e.getMessage());
+ }
+ }
+ }
+ public AbstractAF getAbstractAF() {
+ return abstractAF;
+ }
+ public void setAbstractAF(AbstractAF abstractAF) {
+ this.abstractAF = abstractAF;
+ }
+ public EC02Instance getEc02Instance() {
+ return ec02Instance;
+ }
+ public void setEc02Instance(EC02Instance ec02Instance) {
+ this.ec02Instance = ec02Instance;
+ }
+ public int getFlow() {
+ return flow;
+ }
+ public void setFlow(int flow) {
+ this.flow = flow;
+ }
+ public String getType() {
+ return type;
+ }
+ public void setType(String type) {
+ this.type = type;
+ }
+ public FMInstance getIns() {
+ return ins;
+ }
+ public void setIns(FMInstance ins) {
+ this.ins = ins;
+ }
+ public ArrayList getListFlow() {
+ return listFlow;
+ }
+ public void setListFlow(ArrayList listFlow) {
+ this.listFlow = listFlow;
+ }
+ public Map getDicInvoke() {
+ return dicInvoke;
+ }
+ public void setDicInvoke(Map dicInvoke) {
+ this.dicInvoke = dicInvoke;
+ }
+ public AFInstance getAfInstance() {
+ return afInstance;
+ }
+ public void setAfInstance(AFInstance afInstance) {
+ this.afInstance = afInstance;
+ }
+ public ArrayList getListTimeout() {
+ return listTimeout;
+ }
+ public void setListTimeout(ArrayList listTimeout) {
+ this.listTimeout = listTimeout;
+ }
+ public EquinoxRawData getEquinoxRawData() {
+ return equinoxRawData;
+ }
+ public void setEquinoxRawData(EquinoxRawData equinoxRawData) {
+ this.equinoxRawData = equinoxRawData;
+ }
+}
diff --git a/src/th/co/ais/ssbsrfc/control/StateManager.java b/src/th/co/ais/ssbsrfc/control/StateManager.java
new file mode 100644
index 0000000..de10c45
--- /dev/null
+++ b/src/th/co/ais/ssbsrfc/control/StateManager.java
@@ -0,0 +1,20 @@
+package th.co.ais.ssbsrfc.control;
+
+import th.co.ais.ssbsrfc.config.StateConfig;
+import th.co.ais.ssbsrfc.state.StateIdle;
+import th.co.ais.ssbsrfc.state.StateWaitActive;
+import th.co.ais.ssbsrfc.state.StateWaitE11Timeout;
+import ec02.af.abstracts.AbstractAFStateManager;
+
+public class StateManager extends AbstractAFStateManager {
+ public StateManager(String state) {
+ this.afState = null;
+ if (state.equals(StateConfig.STATE_IDLE)) {
+ this.afState = new StateIdle();
+ } else if (state.equals(StateConfig.STATE_ACTIVE)) {
+ this.afState = new StateWaitActive();
+ } else if (state.equals(StateConfig.STATE_E11_TIMEOUT)) {
+ this.afState = new StateWaitE11Timeout();
+ }
+ }
+}
diff --git a/src/th/co/ais/ssbsrfc/control/SubStateManager.java b/src/th/co/ais/ssbsrfc/control/SubStateManager.java
new file mode 100644
index 0000000..fd47420
--- /dev/null
+++ b/src/th/co/ais/ssbsrfc/control/SubStateManager.java
@@ -0,0 +1,31 @@
+package th.co.ais.ssbsrfc.control;
+
+import th.co.ais.ssbsrfc.config.StateConfig;
+import th.co.ais.ssbsrfc.interfaces.AbstractAFSubStateManager;
+import th.co.ais.ssbsrfc.substate.SubWaitA;
+import th.co.ais.ssbsrfc.substate.SubWaitAdjustmentChargeReportResponse;
+import th.co.ais.ssbsrfc.substate.SubWaitAdjustmentChargeRequestResponse;
+import th.co.ais.ssbsrfc.substate.SubWaitChargeReport;
+import th.co.ais.ssbsrfc.substate.SubWaitChargeRequest;
+import ec02.utils.Log;
+
+public class SubStateManager extends AbstractAFSubStateManager {
+
+ public SubStateManager(String subState) {
+ Log.i("[Sub State ] : " + subState);
+ this.subStateManager = null;
+
+ if (subState.equals(StateConfig.SSTATE_W_CHARGEREQUEST)) {
+ this.subStateManager = new SubWaitChargeRequest();
+ }
+ else if (subState.equals(StateConfig.SSTATE_W_CHARGEREPORT)) {
+ this.subStateManager = new SubWaitChargeReport();
+ }
+ else if (subState.equals(StateConfig.SSTATE_W_ADJUSTMENT_CHARGEREPORT)) {
+ this.subStateManager = new SubWaitAdjustmentChargeReportResponse();
+ }
+ else if (subState.equals(StateConfig.SSTATE_W_ADJUSTMENT_CHARGEREQUEST)) {
+ this.subStateManager = new SubWaitAdjustmentChargeRequestResponse();
+ }
+ }
+}
diff --git a/src/th/co/ais/ssbsrfc/control/TestDebugMsg.java b/src/th/co/ais/ssbsrfc/control/TestDebugMsg.java
new file mode 100644
index 0000000..4af93c2
--- /dev/null
+++ b/src/th/co/ais/ssbsrfc/control/TestDebugMsg.java
@@ -0,0 +1,106 @@
+package th.co.ais.ssbsrfc.control;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.xpath.XPathExpressionException;
+
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import ec02.exception.MessageParserException;
+import ec02.server.EC02Handler;
+import ec02.server.EC02Server;
+
+public class TestDebugMsg {
+ public static void main(String[] args) throws IOException,
+ TransformerException, XPathExpressionException,
+ ParserConfigurationException, SAXException, MessageParserException {
+
+ BufferedReader in = new BufferedReader(new FileReader(
+ "./example.msg/" +
+// "debug.html-text-plain.xml"
+// "debug.html-text-xml.xml"
+// "debug.html-text-xml-header.xml"
+// "debug.ldap.xml"
+// "debug.diameter.xml"
+ "debug.xml"
+ ));
+
+ String str, reqMessage = "";
+ String conf = "";
+ String temp = "";
+ while ((str = in.readLine()) != null) {
+ reqMessage += str;
+ }
+ in.close();
+ in = new BufferedReader(new FileReader("./conf/WS1.EC02.SERV.0"));
+ while ((temp = in.readLine()) != null) {
+ conf += temp;
+ }
+ in.close();
+ String[] a = { "WS1", "SERV", "0", conf };
+
+ EC02Server.main(a);
+ EC02Handler handler = new EC02Handler();
+ System.out.println(handler.verifyAFConfig(conf));
+ System.out.println(TestDebugMsg.formatXml(handler.handle(reqMessage,
+ 100000)));
+
+ // int max=100;
+ // for(int i=0; i<=max; i++)
+ // {
+ // ProcessingThread pt = new ProcessingThread(conf, reqMessage);
+ // Thread t = new Thread(pt, "t"+String.valueOf(i));
+ // t.start();
+ // }
+ }
+
+ public static String formatXml(String xml) {
+ try {
+ Transformer serializer = TransformerFactory.newInstance()
+ .newTransformer();
+ serializer.setOutputProperty(OutputKeys.INDENT, "yes");
+ serializer.setOutputProperty(
+ "{http://xml.apache.org/xslt}indent-amount", "4");
+ Source xmlSource = new SAXSource(new InputSource(
+ new ByteArrayInputStream(xml.getBytes())));
+ StreamResult res = new StreamResult(new ByteArrayOutputStream());
+ serializer.transform(xmlSource, res);
+ return new String(
+ ((ByteArrayOutputStream) res.getOutputStream())
+ .toByteArray());
+ } catch (Exception e) {
+ return xml;
+ }
+ }
+}
+
+class ProcessingThread1 implements Runnable {
+ private String conf;
+ private String reqMessage;
+
+ public ProcessingThread1(String _conf, String _msg) {
+ this.conf = _conf;
+ this.reqMessage = _msg;
+ }
+
+ @Override
+ public void run() {
+ EC02Handler handler = new EC02Handler();
+ System.out.println(handler.verifyAFConfig(conf));
+ System.out.println(TestDebugMsg.formatXml(handler.handle(reqMessage,
+ 100000)));
+ }
+}
diff --git a/src/th/co/ais/ssbsrfc/control/TestMain.java b/src/th/co/ais/ssbsrfc/control/TestMain.java
new file mode 100644
index 0000000..312144a
--- /dev/null
+++ b/src/th/co/ais/ssbsrfc/control/TestMain.java
@@ -0,0 +1,142 @@
+package th.co.ais.ssbsrfc.control;
+
+import java.util.List;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.transform.stream.StreamSource;
+
+
+@XmlAccessorType(XmlAccessType.FIELD)
+class Customer {
+
+ @XmlElement(name="Version",namespace="http://www.huawei.com/bme/cbsinterface/cbscommon")
+ String Version;
+ @XmlElement(name="ResultCode",namespace="http://www.huawei.com/bme/cbsinterface/cbscommon")
+ String ResultCode;
+ @XmlElement(name="MsgLanguageCode",namespace="http://www.huawei.com/bme/cbsinterface/cbscommon")
+ String MsgLanguageCode;
+ @XmlElement(name="ResultDesc",namespace="http://www.huawei.com/bme/cbsinterface/cbscommon")
+ String ResultDesc;
+ @XmlElement(name="AcctKey",namespace="http://www.huawei.com/bme/cbsinterface/arservices")
+ String AcctKey;
+
+ @XmlElement(name="AdjustmentInfo",namespace="http://www.huawei.com/bme/cbsinterface/arservices")
+ List AdjustmentInfo;
+}
+class AdjustmentInfo{
+
+ String BalanceType;
+ String BalanceID;
+ String BalanceTypeName;
+ String OldBalanceAmt;
+ String NewBalanceAmt;
+ String CurrencyID;
+
+ @XmlElement(name="BalanceID",namespace="http://cbs.huawei.com/ar/wsservice/arcommon")
+ public String getBalanceID() {
+ return BalanceID;
+ }
+
+ public void setBalanceID(String balanceID) {
+ BalanceID = balanceID;
+ }
+
+ @XmlElement(name="BalanceTypeName",namespace="http://cbs.huawei.com/ar/wsservice/arcommon")
+ public String getBalanceTypeName() {
+ return BalanceTypeName;
+ }
+
+ public void setBalanceTypeName(String balanceTypeName) {
+ BalanceTypeName = balanceTypeName;
+ }
+
+ @XmlElement(name="OldBalanceAmt",namespace="http://cbs.huawei.com/ar/wsservice/arcommon")
+ public String getOldBalanceAmt() {
+ return OldBalanceAmt;
+ }
+
+ public void setOldBalanceAmt(String oldBalanceAmt) {
+ OldBalanceAmt = oldBalanceAmt;
+ }
+
+ @XmlElement(name="NewBalanceAmt",namespace="http://cbs.huawei.com/ar/wsservice/arcommon")
+ public String getNewBalanceAmt() {
+ return NewBalanceAmt;
+ }
+
+ public void setNewBalanceAmt(String newBalanceAmt) {
+ NewBalanceAmt = newBalanceAmt;
+ }
+
+ @XmlElement(name="CurrencyID",namespace="http://cbs.huawei.com/ar/wsservice/arcommon")
+ public String getCurrencyID() {
+ return CurrencyID;
+ }
+
+ public void setCurrencyID(String currencyID) {
+ CurrencyID = currencyID;
+ }
+
+ @XmlElement(name="BalanceType",namespace="http://cbs.huawei.com/ar/wsservice/arcommon")
+ public String getBalanceType() {
+ return BalanceType;
+ }
+
+ public void setBalanceType(String BalanceType) {
+ this.BalanceType = BalanceType;
+ }
+
+
+}
+
+
+public class TestMain {
+
+ public static void main(String[] args) throws Exception {
+
+ XMLInputFactory xif = XMLInputFactory.newFactory();
+ StreamSource xml = new StreamSource("D:\\car.xml");
+ XMLStreamReader xsr = xif.createXMLStreamReader(xml);
+ xsr.nextTag();
+ while(!xsr.getLocalName().equals("ResultHeader")) {
+ xsr.nextTag();
+ System.out.println(xsr.getLocalName());
+ System.out.println(xsr.hasNext());
+ }
+ System.out.println(xsr.hasNext());
+ xsr.next();
+ /*while(!xsr.getLocalName().equals("AdjustmentResult")) {
+ xsr.nextTag();
+ }*/
+
+ JAXBContext jc = JAXBContext.newInstance(Customer.class);
+ Unmarshaller unmarshaller = jc.createUnmarshaller();
+ JAXBElement jb = unmarshaller.unmarshal(xsr, Customer.class);
+ xsr.close();
+
+ Customer customer = jb.getValue();
+ System.out.println("Version:"+customer.Version);
+ System.out.println("ResultCode:"+customer.ResultCode);
+ System.out.println("MsgLanguageCode:"+customer.MsgLanguageCode);
+ System.out.println("ResultDesc:"+customer.ResultDesc);
+ /*System.out.println("AcctKey:"+customer.AcctKey);
+ System.out.println("BalanceID:"+customer.AdjustmentInfo.get(0).getBalanceID());
+ System.out.println("BalanceType:"+customer.AdjustmentInfo.get(0).getBalanceType());
+ System.out.println("BalanceTypeName:"+customer.AdjustmentInfo.get(0).getBalanceTypeName());
+ System.out.println("CurrencyID:"+customer.AdjustmentInfo.get(0).CurrencyID);
+ System.out.println("NewBalanceAmt:"+customer.AdjustmentInfo.get(0).NewBalanceAmt);
+ System.out.println("OldBalanceAmt:"+customer.AdjustmentInfo.get(0).OldBalanceAmt);*/
+
+
+ }
+}
+
diff --git a/src/th/co/ais/ssbsrfc/control/mainAF.java b/src/th/co/ais/ssbsrfc/control/mainAF.java
new file mode 100644
index 0000000..e4ccc51
--- /dev/null
+++ b/src/th/co/ais/ssbsrfc/control/mainAF.java
@@ -0,0 +1,129 @@
+package th.co.ais.ssbsrfc.control;
+
+import java.util.ArrayList;
+
+import th.co.ais.ssbsrfc.config.StateConfig;
+import th.co.ais.ssbsrfc.instance.AFInstance;
+import th.co.ais.ssbsrfc.instance.EC02Instance;
+import th.co.ais.ssbsrfc.utils.Global;
+import ec02.af.abstracts.AbstractAF;
+import ec02.af.data.ECDialogue;
+import ec02.af.data.EquinoxProperties;
+import ec02.af.data.EquinoxRawData;
+import ec02.af.exception.ActionProcessException;
+import ec02.af.exception.ComposeInstanceException;
+import ec02.af.exception.ConstructRawDataException;
+import ec02.af.exception.ExtractInstanceException;
+import ec02.af.exception.ExtractRawDataException;
+import ec02.interfaces.IEC02;
+import ec02.utils.AppLog;
+
+public class mainAF extends AbstractAF implements IEC02 {
+
+ @Override
+ public ECDialogue actionProcess(EquinoxProperties eqxProp,
+ ArrayList eqxRawDataList, Object instance)
+ throws ActionProcessException {
+ AppLog.d("[CURRENT STATE] : " + eqxProp.getState());
+ EC02Instance ec02Ins = (EC02Instance) instance;
+ ec02Ins.setEquinoxProperties(eqxProp);
+ ec02Ins.setAbstractAF((AbstractAF) this);
+ ec02Ins.getAFInstance().setStartFlowTimeStampForEmpty();
+
+ String currentState = eqxProp.getState();
+
+ StateManager sm = new StateManager(currentState);
+ String eqxState = sm.doAction((AbstractAF) this, ec02Ins, eqxRawDataList);
+ EquinoxProperties newEqxProp = new EquinoxProperties();
+ newEqxProp.setState(eqxState);
+ // TODO must be have function to calculate timeout
+ newEqxProp.setTimeout(ec02Ins.getTimeout());
+ ECDialogue ecDialogue = new ECDialogue(newEqxProp, ec02Ins);
+ return ecDialogue;
+ }
+
+ @Override
+ public boolean verifyAFConfiguration(String arg0) {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+ /*
+ * 5.4 ComposeInstance Module
+ */
+ @Override
+ public String composeInstance(Object instance) throws ComposeInstanceException {
+ // 1. Read instance into variable
+ EC02Instance ec02Instance = (EC02Instance) instance;
+ AFInstance afInstance = ec02Instance.getAFInstance();
+ String encodeString = "";
+ // 2. try to encode instanceData bean object into string format
+ try {
+ encodeString = Global.encodeInstance(afInstance);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ // 3. return instanceData in string format
+ return encodeString;
+ }
+
+ /*
+ * 5.3 ConstructRawData Module
+ */
+ @Override
+ public ArrayList constructRawData(Object instance)
+ throws ConstructRawDataException {
+ // 1. Read instance into variable
+ EC02Instance ins = (EC02Instance) instance;
+ ArrayList list = ins.getEqxRawDataList();
+ // 2. Return equinox raw data
+ return list;
+ }
+
+ /*
+ * 5.1 ExtractInstance Module
+ */
+ @Override
+ public Object extractInstance(String instance) throws ExtractInstanceException {
+
+ EC02Instance ec02Instance = new EC02Instance();
+ AFInstance afInstance = null;
+
+ // 1. Check instance data from equinox is null or not
+ if ((instance == null) || instance.isEmpty()) {
+ // 1.1. If instance data is null, create new instanceData bean object
+ afInstance = new AFInstance();
+ }
+ else {
+ // 1.2. If instance data is not null, try to decode instance to instanceData bean object
+ try {
+ afInstance = Global.decodeInstance(instance);
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ ec02Instance.setAFInstance(afInstance);
+ // 2. return instanceData bean object
+ return (Object) ec02Instance;
+ }
+
+ /*
+ * 5.2 ExtractRawData Module
+ */
+ @Override
+ public void extractRawData(Object instanceData, ArrayList rawDatas)
+ throws ExtractRawDataException {
+ EC02Instance ec02Instance = (EC02Instance) instanceData;
+ // 1. Loop RawData
+ for (EquinoxRawData r : rawDatas) {
+ // 1.1. Get event type from equinox raw data
+ String eventType = StateConfig.getEventTypeFromEquinoxRawData(ec02Instance, r);
+ // 1.1.7. Set raw event type = event type
+ r.setRawEventType(eventType);
+ ec02Instance.getAFInstance().listTimeoutRemove(r.getInvoke());
+ AppLog.d("[eventType] : " + eventType);
+ }
+ }
+}
diff --git a/src/th/co/ais/ssbsrfc/instance/AFInstance.java b/src/th/co/ais/ssbsrfc/instance/AFInstance.java
new file mode 100644
index 0000000..e0f1ff6
--- /dev/null
+++ b/src/th/co/ais/ssbsrfc/instance/AFInstance.java
@@ -0,0 +1,424 @@
+package th.co.ais.ssbsrfc.instance;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import th.co.ais.ssbsrfc.config.Invoke;
+import th.co.ais.ssbsrfc.config.StateConfig;
+import th.co.ais.ssbsrfc.interfaces.EQXMsg;
+import th.co.ais.ssbsrfc.utils.Global;
+import th.co.ais.ssbsrfc.utils.Log;
+import ais.mmt.sand.comlog.DetailsLogPrototype;
+import ais.mmt.sand.comlog.SummaryLogPrototype;
+import ec02.utils.AppLog;
+
+public class AFInstance {
+
+ private int gDialogueId = -1;
+ private ArrayList listFlow;
+ private Map dicInvoke;
+ private ArrayList globalListTimeout;
+ // managetimeout
+ private ArrayList listTimeout;
+ private int flow = 0;
+ private ArrayList