Package io.lumify.core.exception

Examples of io.lumify.core.exception.LumifyException


                        .add(Restrictions.eq("vertexId", update.getVertexId()))
                        .add(Restrictions.eq("workspace.workspaceId", workspace.getWorkspaceId()))
                        .list();
                SqlWorkspaceVertex sqlWorkspaceVertex;
                if (vertices.size() > 1) {
                    throw new LumifyException("more than one vertex was returned");
                } else if (vertices.size() == 0) {
                    sqlWorkspaceVertex = new SqlWorkspaceVertex();
                    sqlWorkspaceVertex.setVertexId(update.getVertexId());
                    sqlWorkspaceVertex.setWorkspace((SqlWorkspace) workspace);
                    ((SqlWorkspace) workspace).getSqlWorkspaceVertices().add(sqlWorkspaceVertex);
View Full Code Here


                double latitude = Double.parseDouble(line.get(3));
                double longitude = Double.parseDouble(line.get(4));
                zipCodesByZipCode.put(zipCode, new ZipCodeEntry(zipCode, city, state, latitude, longitude));
            }
        } catch (IOException ex) {
            throw new LumifyException("Could not read zipcode.csv", ex);
        }
    }
View Full Code Here

    }

    public void prepareIris(TermMentionFilterPrepareData termMentionFilterPrepareData) {
        zipCodeIri = (String) termMentionFilterPrepareData.getStormConf().get(CONFIG_ZIP_CODE_IRI);
        if (zipCodeIri == null || zipCodeIri.length() == 0) {
            throw new LumifyException("Could not find config: " + CONFIG_ZIP_CODE_IRI);
        }

        geoLocationIri = (String) termMentionFilterPrepareData.getStormConf().get(CONFIG_GEO_LOCATION_IRI);
        if (geoLocationIri == null || geoLocationIri.length() == 0) {
            throw new LumifyException("Could not find config: " + CONFIG_GEO_LOCATION_IRI);
        }

        this.artifactHasEntityIri = getConfiguration().get(Configuration.ONTOLOGY_IRI_ARTIFACT_HAS_ENTITY);
        if (this.artifactHasEntityIri == null) {
            throw new LumifyException("Could not find configuration for " + Configuration.ONTOLOGY_IRI_ARTIFACT_HAS_ENTITY);
        }
    }
View Full Code Here

            connection.setDoOutput(true);
            connection.setRequestProperty("Authorization", "Bearer " + accessToken);
            String translatedText = IOUtils.toString(connection.getInputStream(), "UTF-8");
            return translatedText;
        } catch (Exception ex) {
            throw new LumifyException("Could not translate text", ex);
        }
    }
View Full Code Here

            Calendar calendar = Calendar.getInstance();
            calendar.add(Calendar.SECOND, expiresIn);
            tokenExpiresDate = calendar.getTime();
        } catch (Exception ex) {
            throw new LumifyException("Could not refresh the token", ex);
        }
    }
View Full Code Here

            defaultRegionCode = DEFAULT_DEFAULT_REGION_CODE;
        }

        entityType = (String) workerPrepareData.getStormConf().get(CONFIG_PHONE_NUMBER_IRI);
        if (entityType == null || entityType.length() == 0) {
            throw new LumifyException("Could not find config: " + CONFIG_PHONE_NUMBER_IRI);
        }
    }
View Full Code Here

                    return new InMemoryLongRunningProcessMessage(message);
                }
                try {
                    longRunningProcessMessageQueue.wait();
                } catch (InterruptedException ex) {
                    throw new LumifyException("Could not get next long running process message", ex);
                }
            }
        }
    }
View Full Code Here

    @Override
    protected void processRow(PtObject row) {
        PtObjectType ptObjectType = getDataImporter().getObjectTypes().get(row.getType());
        if (ptObjectType == null) {
            throw new LumifyException("Could not find object type: " + row.getType());
        }
        String conceptTypeUri = getConceptTypeUri(ptObjectType.getUri());

        VertexBuilder v = getDataImporter().getGraph().prepareVertex(getObjectId(row), getDataImporter().getVisibility());
        LumifyProperties.CONCEPT_TYPE.setProperty(v, conceptTypeUri, getDataImporter().getVisibility());
View Full Code Here

            this.uri = parseUriFromXml(doc);

            Element displayElement = XmlUtil.getChildByTagName(doc.getDocumentElement(), "display");
            this.displayFormula = new DisplayFormula(displayElement);
        } catch (Exception e) {
            throw new LumifyException("Could not parse config: " + config, e);
        }
    }
View Full Code Here

    }

    private String parseUriFromXml(Document doc) {
        Element uriElement = XmlUtil.getChildByTagName(doc.getDocumentElement(), "uri");
        if (uriElement == null) {
            throw new LumifyException("Could not find uri");
        }

        return uriElement.getTextContent();
    }
View Full Code Here

TOP

Related Classes of io.lumify.core.exception.LumifyException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.