package com.ociweb.oe.greenlightning.api;


import com.ociweb.gl.api.Builder;
import com.ociweb.gl.api.GreenApp;
import com.ociweb.gl.api.GreenRuntime;
import com.ociweb.gl.api.ClientHostPortInstance;

public class HTTPClient implements GreenApp
{

    @Override
    public void declareConfiguration(Builder c) {
    	//c.useInsecureNetClient();
    	c.useNetClient();

    }

    @Override
    public void declareBehavior(GreenRuntime runtime) {       
    	
    	ClientHostPortInstance session = new ClientHostPortInstance(
    			//"javanut.com",80,0);
    			"127.0.0.1",8088,0);
    	
    	HTTPGetBehaviorSingle temp = new HTTPGetBehaviorSingle(runtime, session);
		runtime.addStartupListener(temp).addSubscription("next");
			   	
		//HTTPSession session = new HTTPSession("127.0.0.1",8088,0);
    	//runtime.addResponseListener(new HTTPResponse()).includeHTTPSession(session);    	
    	//runtime.addStartupListener(new HTTPGetBehaviorChained(runtime, session));
    	    	
    	
    	runtime.addPubSubListener(new ShutdownBehavior(runtime)).addSubscription("shutdown");
    	
    }
          
}

@@ -240,16 +240,52 @@
 eenApp%0A%7B
+%0A    ClientHostPortInstance session;
 %0A%0A    @O
@@ -379,17 +379,30 @@
 ();%0A    
-%09
+    session = 
 c.useNet
@@ -409,18 +409,64 @@
 Client()
+.createHTTP1xClient(%22127.0.0.1%22, 8088).finish()
 ;
-%0A
 %0A    %7D%0A%0A
@@ -538,145 +538,8 @@
 e) %7B
-       %0A    %09%0A    %09ClientHostPortInstance session = new ClientHostPortInstance(%0A    %09%09%09//%22javanut.com%22,80,0);%0A    %09%09%09%22127.0.0.1%22,8088,0);
 %0A   

use new client builder