@Override public Connection getConnection(DataSource ds) throws TranslatorException { try { return ds.getConnection(); } catch (SQLException e) { throw new TranslatorException(e); } }
@Override public QueryResponse query(SolrQuery params) throws TranslatorException { try { return server.query(params); } catch (SolrServerException e) { throw new TranslatorException(e); } catch (IOException e) { throw new TranslatorException(e); } }
public byte[] getBinaryVDBResource(String resourcePath) throws TranslatorException { try { return metadata.getBinaryVDBResource(resourcePath); } catch (QueryMetadataException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30470, e); } catch (TeiidComponentException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30471, e); } }
public String getCharacterVDBResource(String resourcePath) throws TranslatorException { try { return metadata.getCharacterVDBResource(resourcePath); } catch (QueryMetadataException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30472, e); } catch (TeiidComponentException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30473, e); } }
@Override public Table getTable(String fullName) throws TranslatorException { try { Object groupId = metadata.getGroupID(fullName); return getGroup(groupId); } catch (QueryMetadataException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30466, e); } catch (TeiidComponentException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30467, e); } }
public GetDeletedExecutionImpl( ProcedureExecutionParent procedureExecutionParent) throws TranslatorException { this.parent = procedureExecutionParent; try { factory = DatatypeFactory.newInstance(); } catch (DatatypeConfigurationException e) { throw new TranslatorException(e.getMessage()); } }
static Date formDate(String value) throws TranslatorException { try { DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); return new Date(formatter.parse(value).getTime()); } catch (ParseException e) { throw new TranslatorException(e, SwaggerPlugin.Util.gs(SwaggerPlugin.Event.TEIID28012)); } }
private OlapConnection unwrap(Connection conn) throws TranslatorException { try { OlapWrapper wrapper = conn.unwrap(OlapWrapper.class); OlapConnection olapConn = wrapper.unwrap(OlapConnection.class); return olapConn; } catch(SQLException e) { throw new TranslatorException(e); } }
private String getDN(StringTokenizer st) throws TranslatorException { if (!st.hasMoreTokens()) { throw new TranslatorException(LDAPPlugin.Util.gs(LDAPPlugin.Event.TEIID12010)); } return st.nextToken(); }
@Override public Procedure getProcedure(String fullName) throws TranslatorException { try { StoredProcedureInfo sp = metadata.getStoredProcedureInfoForProcedure(fullName); return getProcedure(sp); } catch (QueryMetadataException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30468, e); } catch (TeiidComponentException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30469, e); } }
@Override public Procedure getProcedure(String fullName) throws TranslatorException { try { StoredProcedureInfo sp = metadata.getStoredProcedureInfoForProcedure(fullName); return getProcedure(sp); } catch (QueryMetadataException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30468, e); } catch (TeiidComponentException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30469, e); } }
private void validateFunction( List<Expression> expressions ) throws TranslatorException { if (expressions.size() != 2) { throw new TranslatorException(SalesForcePlugin.Util.getString("CriteriaVisitor.invalid.arg.count")); //$NON-NLS-1$ } if (!(expressions.get(0) instanceof ColumnReference)) { throw new TranslatorException(SalesForcePlugin.Util.getString("CriteriaVisitor.function.not.column.arg")); //$NON-NLS-1$ } if (!(expressions.get(1) instanceof Literal)) { throw new TranslatorException(SalesForcePlugin.Util.getString("CriteriaVisitor.function.not.literal.arg")); //$NON-NLS-1$ } }
public Object getId() throws TranslatorException { if (this.id == null) { return null; } if (this.id.pk.keySet().size() != this.columns.size()) { throw new TranslatorException(MongoDBPlugin.Util.gs(MongoDBPlugin.Event.TEIID18014)); } return this.id.getValue(); }
@Override public UpdateResponse update(UpdateRequest request) throws TranslatorException { try { request.setCommitWithin(-1); request.setAction(UpdateRequest.ACTION.COMMIT, false, false ); return request.process(this.server); } catch (SolrServerException e) { throw new TranslatorException(e); } catch (IOException e) { throw new TranslatorException(e); } }
@Override public UpdateExecution createUpdateExecution(Command command, ExecutionContext executionContext, RuntimeMetadata metadata, WSConnection connection) throws TranslatorException { if (supportsUpdates()) { return new ODataUpdateExecution(command, this, executionContext,metadata, connection); } else { throw new TranslatorException(ODataPlugin.Util.gs(ODataPlugin.Event.TEIID17030)); } }
private void writeXLSFile() throws TranslatorException { try (OutputStream fos = (writeTo==null?getCurrentXLSFile():writeTo).openOutputStream(true)) { workbook.write(fos); } catch (IOException e) { throw new TranslatorException(e); } }
@Override public ProcedureExecution createProcedureExecution(Call command, ExecutionContext executionContext, RuntimeMetadata metadata, GoogleSpreadsheetConnection connection) throws TranslatorException { String nativeQuery = command.getMetadataObject().getProperty(SQLStringVisitor.TEIID_NATIVE_QUERY, false); if (nativeQuery != null) { return new DirectSpreadsheetQueryExecution(nativeQuery, command.getArguments(), executionContext, connection, false); } throw new TranslatorException("Missing native-query extension metadata."); //$NON-NLS-1$ }
@Override public void visit(Function obj) { if (!this.mongoDoc.isMerged() || this.mongoDoc.isMerged() && this.mongoDoc.getMergeAssociation() != Association.MANY) { super.visit(obj); return; } this.pullException = new TranslatorException(MongoDBPlugin.Event.TEIID18028, MongoDBPlugin.Util.gs(MongoDBPlugin.Event.TEIID18028)); }
@Override public void visit(Delete obj) { if (obj.getParameterValues() != null) { this.exceptions.add(new TranslatorException(SimpleDBPlugin.Event.TEIID24007, SimpleDBPlugin.Util.gs(SimpleDBPlugin.Event.TEIID24007))); } visitNode(obj.getTable()); if (obj.getWhere() != null) { this.criteria = SimpleDBSQLVisitor.getSQLString(obj.getWhere()); } } }
void checkHeaders(String worksheetTitle) throws TranslatorException{ SpreadsheetInfo info=connection.getSpreadsheetInfo(); Worksheet worksheet=info.getWorksheetByName(worksheetTitle); if(worksheet==null){ throw new SpreadsheetOperationException(SpreadsheetExecutionFactory.UTIL.gs("missing_worksheet", worksheetTitle)); //$NON-NLS-1$ } if(!worksheet.isHeaderEnabled()){ throw new TranslatorException(SpreadsheetExecutionFactory.UTIL.gs("headers_required")); //$NON-NLS-1$ } }