- if (!(wsp instanceof JabaWsParamSet))
- {
- throw new Error("Implementation error: JabaWsParamSets can only be handled by JabaParamStore");
- }
- writer.write(ParameterUtils.writeParameterSet(((JabaWsParamSet)wsp).getjabaArguments(), " ")
- .toString());
- return true;
+ if (!involves(urls))
+ {
+ throw new IOException(
+ "Implementation error: Cannot find service url in the given url set!");
+
+ }
+ JabaWsParamSet wsp = new JabaWsParamSet();
+ wsp.setName(name);
+ wsp.setDescription(descr);
+ wsp.setApplicableUrls(urls.clone());
+
+ List<String> lines = new ArrayList<String>();
+ StringTokenizer st = new StringTokenizer(parameterfile, "\n");
+ while (st.hasMoreTokens())
+ {
+ lines.add(st.nextToken());
+ }
+ wsp.setjabaArguments(ParameterUtils.processParameters(lines,
+ serviceOptions, " "));
+ return wsp;
+ }
+
+ @Override
+ public String generateServiceParameterFile(WsParamSetI pset)
+ throws IOException
+ {
+ if (!involves(pset.getApplicableUrls()))
+ {
+ throw new IOException(
+ "Implementation error: Cannot find service url in the given url set for this service parameter store ("
+ + service.getUri() + ") !");
+
+ }
+ if (!(pset instanceof JabaWsParamSet))
+ {
+ throw new Error(
+ "Implementation error: JabaWsParamSets can only be handled by JabaParamStore");
+ }
+
+ StringBuffer rslt = new StringBuffer();
+ for (String ln : ParameterUtils.writeParameterSet(
+ ((JabaWsParamSet) pset).getjabaArguments(), " "))
+ {
+ rslt.append(ln);
+ rslt.append("\n");
+ }
+ ;
+ return rslt.toString();