use of org.apache.knox.gateway.descriptor.ResourceParamDescriptor in project knox by apache.
the class GatewayFactory method createParams.
private static Map<String, String> createParams(FilterDescriptor filter) {
Map<String, String> paramMap = new HashMap<>();
ResourceDescriptor resource = filter.up();
GatewayDescriptor gateway = resource.up();
for (GatewayParamDescriptor param : gateway.params()) {
paramMap.put(param.name(), param.value());
}
for (ResourceParamDescriptor param : resource.params()) {
paramMap.put(param.name(), param.value());
}
// TODO: Should all elements of the resource and gateway descriptor somehow be added to the filter params?
// TODO: Should we use some composite params object instead of copying all these name value pairs?
paramMap.put("pattern", resource.pattern());
List<FilterParamDescriptor> paramList = filter.params();
for (FilterParamDescriptor param : paramList) {
paramMap.put(param.name(), param.value());
}
return paramMap;
}
use of org.apache.knox.gateway.descriptor.ResourceParamDescriptor in project knox by apache.
the class ResourceDescriptorImpl method addParam.
@Override
public ResourceParamDescriptor addParam() {
ResourceParamDescriptor param = createParam();
addParam(param);
return param;
}
Aggregations