1 16 package org.apache.cocoon.portal.wsrp.consumer; 17 18 import java.util.ArrayList ; 19 import java.util.HashMap ; 20 import java.util.Iterator ; 21 import java.util.Map ; 22 23 import oasis.names.tc.wsrp.v1.types.NamedString; 24 25 34 public class RequestImpl implements Request { 35 36 37 protected Map formParameters; 38 39 40 protected String interactionState; 41 42 45 public RequestImpl() { 46 this.formParameters = new HashMap (); 47 } 48 49 56 public void addFormParameter(String name, String value) { 57 this.formParameters.put(name, value); 58 } 59 60 67 public NamedString[] getFormParameters() { 68 ArrayList paramList = new ArrayList (); 69 Iterator params = this.formParameters.keySet().iterator(); 70 while (params.hasNext()) { 71 String name = (String )params.next(); 72 73 NamedString parameter = new NamedString(); 74 parameter.setName(name); 75 parameter.setValue((String )this.formParameters.get(name)); 76 paramList.add(parameter); 77 } 78 79 NamedString[] formParams = new NamedString[paramList.size()]; 80 paramList.toArray(formParams); 81 82 return formParams; 83 } 84 85 91 public void setInteractionState(String state) { 92 this.interactionState = state; 93 } 94 95 100 public String getInteractionState() { 101 return this.interactionState; 102 } 103 } 104 | Popular Tags |