// Path: src/main/java/io/teknek/intravert/action/Action.java
// public interface Action {
//   void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application);
// }
// 
// Path: src/main/java/io/teknek/intravert/action/ActionFactory.java
// public class ActionFactory {
//   
//   public static final String CREATE_SESSION = "createsession";
//   public static final String LOAD_SESSION = "loadsession";
//   public static final String SET_KEYSPACE = "setkeyspace";
//   public static final String GET_KEYSPACE = "getkeyspace";
//   public static final String CREATE_FILTER = "createfilter";
//   public static final String UPSERT = "upsert";
//   public static final String CREATE_KEYSPACE = "createkeyspace";
//   public static final String CREATE_COLUMN_FAMILY ="createcolumnfamily";
//   public static final String SLICE ="slice";
//   private Map<String,Action> actions;
//   
//   public ActionFactory(){
//     actions = new HashMap<String,Action>();
//     actions.put(CREATE_SESSION, new SaveSessionAction());
//     actions.put(LOAD_SESSION, new LoadSessionAction());
//     actions.put(SET_KEYSPACE, new SetKeyspaceAction()); 
//     actions.put(GET_KEYSPACE, new GetKeyspaceAction());
//     actions.put(CREATE_FILTER, new CreateFilterAction());
//     actions.put(UPSERT, new UpsertAction());
//     actions.put(CREATE_KEYSPACE, new CreateKeyspaceAction());
//     actions.put(CREATE_COLUMN_FAMILY, new CreateColumnFamilyAction());
//     actions.put(SLICE, new SliceAction());
//   }
//   
//   public Action findAction(String operation){
//     Action a = actions.get(operation);
//     if (a == null)
//       throw new IllegalArgumentException("Do not know what to do with " + operation);
//     return a;
//   }
// }
// 
// Path: src/main/java/io/teknek/intravert/model/Operation.java
// public class Operation {
//   private String type;
//   private String id;
//   private Map<String,Object> arguments;
//   
//   public Operation(){
//     arguments = new HashMap<String,Object>();
//   }
// 
//   public String getType() {
//     return type;
//   }
// 
//   public void setType(String type) {
//     this.type = type;
//   }
// 
//   public Map<String, Object> getArguments() {
//     return arguments;
//   }
// 
//   public void setArguments(Map<String, Object> arguments) {
//     this.arguments = arguments;
//   }
// 
//   public String getId() {
//     return id;
//   }
// 
//   public void setId(String id) {
//     this.id = id;
//   }
//   
//   public Operation withId(String id){
//     setId(id);
//     return this;
//   }
//   
//   public Operation withType(String type){
//     setType(type);
//     return this;
//   }
//   
//   public Operation withArguments(Map<String,Object> arguments){
//     setArguments(arguments);
//     return this;
//   }
//   
//   public Map<String,Object> withArgument(String name, Object value){
//     arguments.put(name, value);
//     return arguments;
//   }
// }
// 
// Path: src/main/java/io/teknek/intravert/model/Request.java
// public class Request {
//   private List<Operation> operations;
//   
//   public Request(){
//     operations = new ArrayList<Operation>();
//   }
// 
//   public List<Operation> getOperations() {
//     return operations;
//   }
// 
//   public void setOperations(List<Operation> operations) {
//     this.operations = operations;
//   }
//   
// }
// 
// Path: src/main/java/io/teknek/intravert/model/Response.java
// public class Response {
//   private String exceptionMessage;
//   private String exceptionId;
//   private LinkedHashMap<String,Object> results;
//   private LinkedHashMap<String,Object> metaData;
//   
//   public Response(){
//     results = new LinkedHashMap<String,Object>();
//     metaData = new LinkedHashMap<String,Object>();
//   }
// 
//   public String getExceptionMessage() {
//     return exceptionMessage;
//   }
// 
//   public void setExceptionMessage(String exceptionMessage) {
//     this.exceptionMessage = exceptionMessage;
//   }
// 
//   public String getExceptionId() {
//     return exceptionId;
//   }
// 
//   public void setExceptionId(String exceptionId) {
//     this.exceptionId = exceptionId;
//   }
// 
//   public Map<String, Object> getResults() {
//     return results;
//   }
// 
//   public void setResults(LinkedHashMap<String, Object> results) {
//     this.results = results;
//   }
// 
//   public Map<String, Object> getMetaData() {
//     return metaData;
//   }
// 
//   public void setMetaData(LinkedHashMap<String, Object> metaData) {
//     this.metaData = metaData;
//   }
//   
// }


import io.teknek.intravert.action.Action;
import io.teknek.intravert.action.ActionFactory;
import io.teknek.intravert.model.Operation;
import io.teknek.intravert.model.Request;
import io.teknek.intravert.model.Response;
package io.teknek.intravert.service;


public class DefaultRequestProcessor implements RequestProcessor {

  private ActionFactory actionFatory = new ActionFactory();
  
  @Override
  public void process(Request request, Response response, RequestContext requestContext,
          ApplicationContext application) {
    for (int i = 0; i < request.getOperations().size(); i++) {
// Path: src/main/java/io/teknek/intravert/action/Action.java
// public interface Action {
//   void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application);
// }
// 
// Path: src/main/java/io/teknek/intravert/action/ActionFactory.java
// public class ActionFactory {
//   
//   public static final String CREATE_SESSION = "createsession";
//   public static final String LOAD_SESSION = "loadsession";
//   public static final String SET_KEYSPACE = "setkeyspace";
//   public static final String GET_KEYSPACE = "getkeyspace";
//   public static final String CREATE_FILTER = "createfilter";
//   public static final String UPSERT = "upsert";
//   public static final String CREATE_KEYSPACE = "createkeyspace";
//   public static final String CREATE_COLUMN_FAMILY ="createcolumnfamily";
//   public static final String SLICE ="slice";
//   private Map<String,Action> actions;
//   
//   public ActionFactory(){
//     actions = new HashMap<String,Action>();
//     actions.put(CREATE_SESSION, new SaveSessionAction());
//     actions.put(LOAD_SESSION, new LoadSessionAction());
//     actions.put(SET_KEYSPACE, new SetKeyspaceAction()); 
//     actions.put(GET_KEYSPACE, new GetKeyspaceAction());
//     actions.put(CREATE_FILTER, new CreateFilterAction());
//     actions.put(UPSERT, new UpsertAction());
//     actions.put(CREATE_KEYSPACE, new CreateKeyspaceAction());
//     actions.put(CREATE_COLUMN_FAMILY, new CreateColumnFamilyAction());
//     actions.put(SLICE, new SliceAction());
//   }
//   
//   public Action findAction(String operation){
//     Action a = actions.get(operation);
//     if (a == null)
//       throw new IllegalArgumentException("Do not know what to do with " + operation);
//     return a;
//   }
// }
// 
// Path: src/main/java/io/teknek/intravert/model/Operation.java
// public class Operation {
//   private String type;
//   private String id;
//   private Map<String,Object> arguments;
//   
//   public Operation(){
//     arguments = new HashMap<String,Object>();
//   }
// 
//   public String getType() {
//     return type;
//   }
// 
//   public void setType(String type) {
//     this.type = type;
//   }
// 
//   public Map<String, Object> getArguments() {
//     return arguments;
//   }
// 
//   public void setArguments(Map<String, Object> arguments) {
//     this.arguments = arguments;
//   }
// 
//   public String getId() {
//     return id;
//   }
// 
//   public void setId(String id) {
//     this.id = id;
//   }
//   
//   public Operation withId(String id){
//     setId(id);
//     return this;
//   }
//   
//   public Operation withType(String type){
//     setType(type);
//     return this;
//   }
//   
//   public Operation withArguments(Map<String,Object> arguments){
//     setArguments(arguments);
//     return this;
//   }
//   
//   public Map<String,Object> withArgument(String name, Object value){
//     arguments.put(name, value);
//     return arguments;
//   }
// }
// 
// Path: src/main/java/io/teknek/intravert/model/Request.java
// public class Request {
//   private List<Operation> operations;
//   
//   public Request(){
//     operations = new ArrayList<Operation>();
//   }
// 
//   public List<Operation> getOperations() {
//     return operations;
//   }
// 
//   public void setOperations(List<Operation> operations) {
//     this.operations = operations;
//   }
//   
// }
// 
// Path: src/main/java/io/teknek/intravert/model/Response.java
// public class Response {
//   private String exceptionMessage;
//   private String exceptionId;
//   private LinkedHashMap<String,Object> results;
//   private LinkedHashMap<String,Object> metaData;
//   
//   public Response(){
//     results = new LinkedHashMap<String,Object>();
//     metaData = new LinkedHashMap<String,Object>();
//   }
// 
//   public String getExceptionMessage() {
//     return exceptionMessage;
//   }
// 
//   public void setExceptionMessage(String exceptionMessage) {
//     this.exceptionMessage = exceptionMessage;
//   }
// 
//   public String getExceptionId() {
//     return exceptionId;
//   }
// 
//   public void setExceptionId(String exceptionId) {
//     this.exceptionId = exceptionId;
//   }
// 
//   public Map<String, Object> getResults() {
//     return results;
//   }
// 
//   public void setResults(LinkedHashMap<String, Object> results) {
//     this.results = results;
//   }
// 
//   public Map<String, Object> getMetaData() {
//     return metaData;
//   }
// 
//   public void setMetaData(LinkedHashMap<String, Object> metaData) {
//     this.metaData = metaData;
//   }
//   
// }


// Path: src/main/java/io/teknek/intravert/service/DefaultRequestProcessor.java
import io.teknek.intravert.action.Action;
import io.teknek.intravert.action.ActionFactory;
import io.teknek.intravert.model.Operation;
import io.teknek.intravert.model.Request;
import io.teknek.intravert.model.Response;

package io.teknek.intravert.service;


public class DefaultRequestProcessor implements RequestProcessor {

  private ActionFactory actionFatory = new ActionFactory();
  
  @Override
  public void process(Request request, Response response, RequestContext requestContext,
          ApplicationContext application) {
    for (int i = 0; i < request.getOperations().size(); i++) {
      Operation operation = null;