package net.floodlightcontroller.odin.master;

import java.io.IOException;
import java.net.InetAddress;
import java.util.HashMap;

import net.floodlightcontroller.util.MACAddress;

import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.restlet.resource.Post;
import org.restlet.resource.ServerResource;

public class LvapHandoffResource extends ServerResource {
	@SuppressWarnings("unchecked")
	@Post
    public void store(String flowmod) {
    	OdinMaster oc = (OdinMaster) getContext().getAttributes().
        					get(OdinMaster.class.getCanonicalName());
    	
    	ObjectMapper mapper = new ObjectMapper();

		HashMap<String, String> fmdata;
		try {
			fmdata = mapper.readValue(flowmod, HashMap.class);

			String staHwAddress = fmdata.get("clientHwAddress");
	        String apIpAddress= fmdata.get("apIpAddress");
	    
	        oc.handoffClientToAp(PoolManager.GLOBAL_POOL, MACAddress.valueOf(staHwAddress), InetAddress.getByName(apIpAddress));
		} catch (JsonParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (JsonMappingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    }
}

@@ -916,24 +916,75 @@
 pAddress%22);%0A
+%09        String poolName = fmdata.get(%22poolName%22);%0A
 %09    %0A%09     
@@ -1011,31 +1011,16 @@
 oAp(
-PoolManager.GLOBAL_POOL
+poolName
 , MA

Update REST API for LVAP handoffs