use of org.apache.knox.gateway.util.urltemplate.Scheme in project knox by apache.
the class ServiceSchemeFunctionProcessor method resolve.
@Override
public List<String> resolve(UrlRewriteContext context, List<String> parameters) throws Exception {
List<String> results = null;
if (parameters != null) {
results = new ArrayList<String>(parameters.size());
for (String parameter : parameters) {
String url = lookupServiceUrl(parameter);
if (url != null && !url.equals(parameter)) {
Template template = Parser.parseLiteral(url);
Scheme scheme = template.getScheme();
if (scheme != null) {
parameter = scheme.getFirstValue().getPattern();
}
}
results.add(parameter);
}
}
return results;
}