public Argument createArgument(Argument.Direction direction, Expression value, Class<?> type, ProcedureParameter metadataReference) { return new Argument(direction, value, type, metadataReference); }
protected BinaryWSProcedureExecution executeDirect(String method, String uri, String payload, Map<String, List<String>> headers) throws TranslatorException { if (LogManager.isMessageToBeRecorded(LogConstants.CTX_ODATA, MessageLevel.DETAIL)) { try { LogManager.logDetail(LogConstants.CTX_ODATA, "Source-URL=", URLDecoder.decode(uri, "UTF-8")); //$NON-NLS-1$ //$NON-NLS-2$ } catch (UnsupportedEncodingException e) { } } List<Argument> parameters = new ArrayList<Argument>(); parameters.add(new Argument(Direction.IN, new Literal(method, TypeFacility.RUNTIME_TYPES.STRING), null)); parameters.add(new Argument(Direction.IN, new Literal(payload, TypeFacility.RUNTIME_TYPES.STRING), null)); parameters.add(new Argument(Direction.IN, new Literal(uri, TypeFacility.RUNTIME_TYPES.STRING), null)); parameters.add(new Argument(Direction.IN, new Literal(true, TypeFacility.RUNTIME_TYPES.BOOLEAN), null)); //the engine currently always associates out params at resolve time even if the values are not directly read by the call parameters.add(new Argument(Direction.OUT, TypeFacility.RUNTIME_TYPES.STRING, null)); Call call = this.translator.getLanguageFactory().createCall(ODataExecutionFactory.INVOKE_HTTP, parameters, null); BinaryWSProcedureExecution execution = new BinaryWSProcedureExecution(call, this.metadata, this.executionContext, null, this.connection); execution.setUseResponseContext(true); execution.setCustomHeaders(headers); execution.execute(); return execution; }
parameters.add(new Argument(Direction.IN, new Literal(method, TypeFacility.RUNTIME_TYPES.STRING), null)); parameters.add(new Argument(Direction.IN, new Literal(payload, TypeFacility.RUNTIME_TYPES.STRING), null)); parameters.add(new Argument(Direction.IN, new Literal(uri, TypeFacility.RUNTIME_TYPES.STRING), null)); parameters.add(new Argument(Direction.IN, new Literal(true, TypeFacility.RUNTIME_TYPES.BOOLEAN), null)); parameters.add(new Argument(Direction.OUT, TypeFacility.RUNTIME_TYPES.STRING, null));
public void visit(Function obj) { FunctionMethod f = obj.getMetadataObject(); if (f != null) { String nativeQuery = f.getProperty(TEIID_NATIVE_QUERY, false); if (nativeQuery != null) { List<Argument> args = new ArrayList<Argument>(obj.getParameters().size()); for (Expression p : obj.getParameters()) { args.add(new Argument(Direction.IN, p, p.getType(), null)); } parseNativeQueryParts(nativeQuery, args, buffer, this); return; } } super.visit(obj); }
parameters.add(new Argument(Direction.IN, new Literal(method, TypeFacility.RUNTIME_TYPES.STRING), null)); parameters.add(new Argument(Direction.IN, new Literal(payload, TypeFacility.RUNTIME_TYPES.STRING), null)); parameters.add(new Argument(Direction.IN, new Literal(uri, TypeFacility.RUNTIME_TYPES.STRING), null)); parameters.add(new Argument(Direction.IN, new Literal(true, TypeFacility.RUNTIME_TYPES.BOOLEAN), null)); parameters.add(new Argument(Direction.OUT, TypeFacility.RUNTIME_TYPES.STRING, null));
if (av != null) { for (Object obj : av.getValues()) { Argument arg = new Argument(direction, new Literal(obj, param.getClassType().getComponentType()), param.getClassType().getComponentType(), metadataParam); translatedParameters.add(arg); Argument arg = new Argument(direction, value, param.getClassType(), metadataParam); translatedParameters.add(arg);
if (av != null) { for (Object obj : av.getValues()) { Argument arg = new Argument(direction, new Literal(obj, param.getClassType().getComponentType()), param.getClassType().getComponentType(), metadataParam); translatedParameters.add(arg); Argument arg = new Argument(direction, value, param.getClassType(), metadataParam); translatedParameters.add(arg);
if (av != null) { for (Object obj : av.getValues()) { Argument arg = new Argument(direction, new Literal(obj, param.getClassType().getComponentType()), param.getClassType().getComponentType(), metadataParam); translatedParameters.add(arg); Argument arg = new Argument(direction, value, param.getClassType(), metadataParam); translatedParameters.add(arg);