protected static DigitalObject getSDefThreeB() { Set<ParamDomainMap> methodDefs = new HashSet<ParamDomainMap>(); ParamDomainMap methodOne = new ParamDomainMap("methodOne"); ParamDomain argOneDomain = new ParamDomain("argOne", false); methodOne.put("argOne", argOneDomain); methodDefs.add(methodOne); ParamDomainMap methodTwo = new ParamDomainMap("methodTwo"); methodTwo.put("argOne", argOneDomain); methodDefs.add(methodTwo); return getTestSDef("test:sdef3b", "sdef3b", methodDefs); }
/** * Get all permutations of the method. A "permutation" is a known runtime * method invocation, and is formatted as in the following examples: * <ul> * <li> methodName</li> * <li> methodName?parm1=val1&parm2=val1</li> * <li> methodName?parm1=val1&parm2=val2</li> * <li> methodName?parm1=val2&parm2=val1</li> * <li> methodName?parm1=val2&parm2=val2</li> * </ul> * * @return the set of invokable permutations for the method. */ public Set<String> getPermutations() { Set<String> set = new HashSet<String>(); addPermutations(_methodName, getValues(), 0, '?', set); return set; }
+ "ora.comm.nsdlib.org/service/methodmap\">\n"); for (ParamDomainMap methodDef : methodDefs) { String method = methodDef.getMethodName(); xml.append(" <Method operationName=\"" + method + "\""); if (forSDef) { for (String paramName : methodDef.keySet()) { ParamDomain domain = methodDef.get(paramName); xml.append(" <UserInputParm parmName=\"" + paramName + "\" passBy=\"VALUE\" defaultValue=\"\" required=\""
protected static DigitalObject getSDefOneB() { Set<ParamDomainMap> methodDefs = new HashSet<ParamDomainMap>(); ParamDomainMap methodOne = new ParamDomainMap("methodOne"); methodDefs.add(methodOne); ParamDomainMap methodTwo = new ParamDomainMap("methodTwo"); methodDefs.add(methodTwo); return getTestSDef("test:sdef1b", "sdef1b", methodDefs); }
for (String name : methodDef.keySet()) { if (addedTypes.add(name + "Type")) { addXSDType(name + "Type", xml); for (String key : inputKeys.get(methodDef.getMethodName())) { if (addedTypes.add(key + "Type")) { addXSDType(key + "Type", xml); String method = methodDef.getMethodName(); xml.append(" <message name=\"" + method + "Request\">\n"); for (String name : methodDef.keySet()) { xml.append(" <part name=\"" + name + "\" type=\"this:" + name + "Type\"/>\n"); String method = methodDef.getMethodName(); xml.append(" <operation name=\"" + method + "\">\n"); xml.append(" <input message=\"this:" + method xml.append(" <http:binding verb=\"GET\"/>\n"); for (ParamDomainMap methodDef : methodDefs) { String method = methodDef.getMethodName(); xml.append(" <operation name=\"" + method + "\">\n"); location.append(method + "?"); boolean first = true; for (String name : methodDef.keySet()) { if (!first) { location.append("&");
@Override public boolean equals(Object obj) { if (super.equals(obj)) { ParamDomainMap m = (ParamDomainMap) obj; return _methodName.equals(m.getMethodName()); } else { return false; } }
/** * Get an instance from an existing array of <code>MethodParmDef</code>s. * * @param methodName * the name of the method this map describes. * @param parmDefs * existing parameter definitions. * @param userInputOnly * if true, only USER_INPUT parameters from the given array will be * used. */ public ParamDomainMap(String methodName, MethodParmDef[] parmDefs, boolean userInputOnly) { _methodName = methodName; for (MethodParmDef element : parmDefs) { if (!userInputOnly || element.parmType.equals(MethodParmDef.USER_INPUT)) { ParamDomain domain = new ParamDomain(element.parmName, element.parmRequired, element.parmDomainValues); put(element.parmName, domain); } } }
/** * Recursively add permutations for all possible values of domains[index]. */ private static void addPermutations(String prefix, ParamDomain[] domains, int index, char delimiter, Set<String> set) { if (index + 1 > domains.length) { // no more parameters; prefix is a permutation set.add(prefix); return; } else { ParamDomain domain = domains[index]; if (domain.size() > 0) { // add permutations for each domain value of this parameter for (String domainValue : domain) { String newPrefix = prefix + delimiter + domain.getParameterName() + "=" + domainValue; addPermutations(newPrefix, domains, index + 1, '&', set); } } if (!domain.isRequired()) { // add permutations where this parameter is unspecified addPermutations(prefix, domains, index + 1, delimiter, set); } } }
protected static DigitalObject getSDefOne() { Set<ParamDomainMap> methodDefs = new HashSet<ParamDomainMap>(); ParamDomainMap methodOne = new ParamDomainMap("methodOne"); methodDefs.add(methodOne); return getTestSDef("test:sdef1", "sdef1", methodDefs); }
protected static DigitalObject getSDefThree() { Set<ParamDomainMap> methodDefs = new HashSet<ParamDomainMap>(); ParamDomainMap methodOne = new ParamDomainMap("methodOne"); ParamDomain argOneDomain = new ParamDomain("argOne", false); methodOne.put("argOne", argOneDomain); methodDefs.add(methodOne); return getTestSDef("test:sdef3", "sdef3", methodDefs); }
protected static DigitalObject getSDefOneC() { Set<ParamDomainMap> methodDefs = new HashSet<ParamDomainMap>(); ParamDomainMap methodOne = new ParamDomainMap("methodOne"); methodDefs.add(methodOne); return getTestSDef("test:sdef1c", "sdef1c", methodDefs); }
protected static DigitalObject getSDefTwoB() { Set<ParamDomainMap> methodDefs = new HashSet<ParamDomainMap>(); ParamDomainMap methodOne = new ParamDomainMap("methodOne"); ParamDomain argOneDomain = new ParamDomain("argOne", true); argOneDomain.add("val1"); argOneDomain.add("val2"); methodOne.put("argOne", argOneDomain); methodDefs.add(methodOne); ParamDomainMap methodTwo = new ParamDomainMap("methodTwo"); methodTwo.put("argOne", argOneDomain); methodDefs.add(methodTwo); return getTestSDef("test:sdef2b", "sdef2b", methodDefs); }
protected static DigitalObject getSDepOneB() { Set<ParamDomainMap> methodDefs = new HashSet<ParamDomainMap>(); ParamDomainMap methodOne = new ParamDomainMap("methodOne"); methodDefs.add(methodOne); ParamDomainMap methodTwo = new ParamDomainMap("methodTwo"); methodDefs.add(methodTwo); return getTestSDep("test:sdep1b", "sdep1b", "test:sdef1b", methodDefs, getMap("methodOne", new String[] {"KEY1"}, "methodTwo", new String[] {"KEY2"}), getMap("KEY1", new String[] {"text/xml"}, "KEY2", new String[] {"text/xml"}), getMap("methodOne", new String[] {"text/xml"}, "methodTwo", new String[] {"text/xml"})); }
protected static DigitalObject getSDefFour() { Set<ParamDomainMap> methodDefs = new HashSet<ParamDomainMap>(); ParamDomainMap methodOne = new ParamDomainMap("methodOne"); ParamDomain argOneDomain = new ParamDomain("argOne", true); argOneDomain.add("val1"); argOneDomain.add("val2"); methodOne.put("argOne", argOneDomain); methodDefs.add(methodOne); ParamDomainMap methodTwo = new ParamDomainMap("methodTwo"); argOneDomain = new ParamDomain("argOne", false); methodTwo.put("argOne", argOneDomain); methodDefs.add(methodTwo); return getTestSDef("test:sdef4", "sdef4", methodDefs); }
protected static DigitalObject getSDepOneC() { Set<ParamDomainMap> methodDefs = new HashSet<ParamDomainMap>(); ParamDomainMap methodOne = new ParamDomainMap("methodOne"); methodDefs.add(methodOne); return getTestSDep("test:sdep1c", "sdep1c", "test:sdef1c", methodDefs, getMap("methodOne", new String[] {"KEY1"}, null, null), getMap("KEY1", new String[] {"text/xml"}, null, null), getMap("methodOne", new String[] {"text/xml"}, null, null)); }
protected static DigitalObject getSDefTwo() { Set<ParamDomainMap> methodDefs = new HashSet<ParamDomainMap>(); ParamDomainMap methodOne = new ParamDomainMap("methodOne"); ParamDomain argOneDomain = new ParamDomain("argOne", true); argOneDomain.add("val1"); argOneDomain.add("val2"); methodOne.put("argOne", argOneDomain); methodDefs.add(methodOne); return getTestSDef("test:sdef2", "sdef2", methodDefs); }
protected static DigitalObject getSDepOne() { Set<ParamDomainMap> methodDefs = new HashSet<ParamDomainMap>(); ParamDomainMap methodOne = new ParamDomainMap("methodOne"); methodDefs.add(methodOne); return getTestSDep("test:sdep1", "sdep1", "test:sdef1", methodDefs, getMap("methodOne", new String[] {"KEY1"}, null, null), getMap("KEY1", new String[] {"text/xml"}, null, null), getMap("methodOne", new String[] {"text/xml"}, null, null)); }
protected static DigitalObject getSDepThreeB() { Set<ParamDomainMap> methodDefs = new HashSet<ParamDomainMap>(); ParamDomainMap methodOne = new ParamDomainMap("methodOne"); ParamDomain argOneDomain = new ParamDomain("argOne", false); methodOne.put("argOne", argOneDomain); methodDefs.add(methodOne); ParamDomainMap methodTwo = new ParamDomainMap("methodTwo"); methodTwo.put("argOne", argOneDomain); methodDefs.add(methodTwo); return getTestSDep("test:sdep3b", "sdep3b", "test:sdef3b", methodDefs, getMap("methodOne", new String[] {"KEY1"}, "methodTwo", new String[] {"KEY2"}), getMap("KEY1", new String[] {"text/xml"}, "KEY2", new String[] {"text/xml"}), getMap("methodOne", new String[] {"text/xml"}, "methodTwo", new String[] {"text/xml"})); }
protected static DigitalObject getSDepOneD() { Set<ParamDomainMap> methodDefs = new HashSet<ParamDomainMap>(); ParamDomainMap methodOne = new ParamDomainMap("methodOne"); methodDefs.add(methodOne); return getTestSDep("test:sdep1d", "sdep1d", "test:sdef1", methodDefs, getMap("methodOne", new String[] {"KEY1", "KEY2"}, null, null), getMap("KEY1", new String[] {"text/xml"}, "KEY2", new String[] {"text/xml"}), getMap("methodOne", new String[] {"text/xml"}, null, null)); }