package rina.utils.apps.echo;

import rina.utils.apps.echo.client.CDAPEchoClient;
import eu.irati.librina.ApplicationProcessNamingInformation;

public class Echo{
	
	public static final String DATA = "data";
	public static final String CONTROL = "control";
	
//	private EchoServer echoServer = null;
	//private EchoClient echoClient = null;
	private CDAPEchoClient echoClient = null;
	
	public Echo(boolean server, ApplicationProcessNamingInformation serverNamingInfo, 
			ApplicationProcessNamingInformation clientNamingInfo, int numberOfSDUs, int sduSize, 
                    int timeout, int rate, int gap){
//		if (server){
//			echoServer = new EchoServer(serverNamingInfo);
//		}else{
			//echoClient = new EchoClient(numberOfSDUs, sduSize, serverNamingInfo, clientNamingInfo, timeout, rate, gap);
			//boolean q, long count, boolean registration, int w, int g, int dw)

			echoClient = new CDAPEchoClient("", serverNamingInfo, clientNamingInfo, false, numberOfSDUs, true, timeout, gap, 1);
//		}
	}
	
	public void execute(){
//		if (echoServer != null){
//			echoServer.execute();
//		}else{
			echoClient.execute();
//		}
	}
}

@@ -75,16 +75,67 @@
 Client;%0A
+import rina.utils.apps.echo.server.CDAPEchoServer;%0A
 import e
@@ -187,16 +187,16 @@
 mation;%0A
-
 %0Apublic 
@@ -303,18 +303,16 @@
 rol%22;%0A%09%0A
-//
 %09private
@@ -308,24 +308,28 @@
 %0A%09%0A%09private 
+CDAP
 EchoServer e
@@ -658,18 +658,16 @@
 t gap)%7B%0A
-//
 %09%09if (se
@@ -673,18 +673,16 @@
 erver)%7B%0A
-//
 %09%09%09echoS
@@ -689,24 +689,28 @@
 erver = new 
+CDAP
 EchoServer(s
@@ -708,16 +708,20 @@
 oServer(
+%22%22, 
 serverNa
@@ -731,18 +731,16 @@
 gInfo);%0A
-//
 %09%09%7Delse%7B
@@ -1046,18 +1046,16 @@
 ap, 1);%0A
-//
 %09%09%7D%0A%09%7D%0A%09

Align API