/**
 * @Copyright to Hades.Yang 2015~2020.
 * @ClassName: ConfigMonitor.
 * @Project: Auto Config Server.
 * @Package: autoconfigserver.
 * @Description: The MonitorTool for AutoConfigServer.
 * @Author: Hades.Yang 
 * @Version: V1.0
 * @Date: 2015-08-12
 * @History: 
 *    1.2015-08-12 First version of ConfigMonitor was written.
 */

//package name.
package autoconfigserver;

/**
 * @ClassName: ConfigMonitor.
 * @Description: this class which monitor all the ConfigClient worked on the user application.
 */
public class ConfigMonitor
{
	/**
     * @FieldName: sub.
     * @Description: the subscriber instance for monitor fetch user application info.
     */
	private Subscriber sub;
	
    /**
     * @FieldName: pub.
     * @Description: the publisher instance for monitor send the config info to the ConfigClient.
     */
	private Publisher pub;
	
	/**
     * @Title: main.
     * @Description: main function of the config monitor.
     * @param args: input arguments of the main function. 
     * @return none.
     */
	public static void main(String[] args)
	{
		/**
		 * Subscriber is used to get monitor parameter from ConfigClient,which is running on the user application.
		 * For example:
		 * if ConfigMonitor want to monitor some parameter and the code should be written like below:
		 *
		 * CPU_LOAD = new Subscriber("10.1.1.178", "CPU_Load"); 
		 *
		 * if ConfigMonitor wand to config the ConfigClient,here should be a Publisher,code as below: 
		 * 
		 * Regist_Speed = new Publisher("10.1.1.178", "REGIST_SPEED");  //the ConfigClient will subscribe the channel.
		 *
		 * and if Administrator have a new config value to be sent to ConfigClient,code as below:
		 *
		 * Regist_Speed.sendConfig("500");  //Set regist speed to be 500/s. 
		 */
		sub = new Subscriber("10.1.1.41:6379", "10.1.1.41:6379", "10.1.1.41:6379", "TEST");
		pub = new Publisher("10.1.1.41:6379", "10.1.1.41:6379", "10.1.1.41:6379", "TEST");
		
		pub.sendConfig("this is a test!");
	}
}

@@ -535,17 +535,20 @@
 nitor%0A%7B%0A
-%09
+    
 /**%0A    
@@ -653,33 +653,36 @@
 n info.%0A     */%0A
-%09
+    
 private Subscrib
@@ -829,17 +829,20 @@
      */%0A
-%09
+    
 private 
@@ -858,17 +858,20 @@
  pub;%0A%09%0A
-%09
+    
 /**%0A    
@@ -1033,17 +1033,20 @@
      */%0A
-%09
+    
 public s
@@ -1080,18 +1080,19 @@
 gs)%0A
-%09
+    
 %7B%0A
-%09
 %09/**%0A
-%09
 %09 * 
@@ -1195,17 +1195,16 @@
 cation.%0A
-%09
 %09 * For 
@@ -1212,17 +1212,16 @@
 xample:%0A
-%09
 %09 * if C
@@ -1303,30 +1303,28 @@
 like below:%0A
-%09
 %09 *%0A
-%09
 %09 * CPU_LOAD
@@ -1369,22 +1369,20 @@
 oad%22); %0A
-%09
 %09 *%0A
-%09
 %09 * if C
@@ -1473,15 +1473,13 @@
 w: %0A
-%09
 %09 * %0A
-%09
 %09 * 
@@ -1586,22 +1586,20 @@
 hannel.%0A
-%09
 %09 *%0A
-%09
 %09 * and 
@@ -1685,14 +1685,12 @@
 ow:%0A
-%09
 %09 *%0A
-%09
 %09 * 
@@ -1759,15 +1759,13 @@
 s. %0A
-%09
 %09 */%0A
-%09
 %09sub
@@ -1845,17 +1845,16 @@
 TEST%22);%0A
-%09
 %09pub = n
@@ -1934,11 +1934,9 @@
 );%0A%09
-%09%0A%09
+%0A
 %09pub
@@ -1967,13 +1967,16 @@
 est!%22);%0A
-%09
+    
 %7D%0A%7D%0A

Update ConfigMonitor.java