Package org.apache.stanbol.entityhub.servicesapi.yard

Examples of org.apache.stanbol.entityhub.servicesapi.yard.YardException


            update.process(server);
            if (immediateCommit) {
                server.commit();
            }
        } catch (SolrServerException e) {
            throw new YardException("Exception while adding Documents to the Solr Server!", e);
        } catch (IOException e) {
            throw new YardException("Unable to access Solr server", e);
        }
        long ready = System.currentTimeMillis();
        log.debug(String.format(
            "Processed store request for %d documents in %dms (created %dms| stored%dms)", inputDocs.size(),
            ready - start, created - start, ready - created));
View Full Code Here


        FieldMapper fieldMapper = getFieldMapper();
        int numDocs = ids.size(); // for debuging
        try {
            ids = checkRepresentations(server, fieldMapper,ids); // returns the ids found in the solrIndex
        } catch (SolrServerException e) {
            throw new YardException(
                    "Error while searching for alredy present documents before executing the actual update for the parsed Representations",
                    e);
        } catch (IOException e) {
            throw new YardException("Unable to access SolrServer", e);
        }
        long checked = System.currentTimeMillis();
        List<SolrInputDocument> inputDocs = new ArrayList<SolrInputDocument>(ids.size());
        List<Representation> updated = new ArrayList<Representation>();
        for (Representation representation : representations) {
            if (representation != null && ids.contains(representation.getId())) { // null parsed or not
                                                                                  // already present
                inputDocs.add(createSolrInputDocument(fieldMapper,representation));
                updated.add(representation);
            }
        }
        long created = System.currentTimeMillis();
        if (!inputDocs.isEmpty()) {
            try {
                UpdateRequest update = new UpdateRequest();
                if (!immediateCommit) {
                    update.setCommitWithin(commitWithin);
                }
                update.add(inputDocs);
                update.process(server);
                if (immediateCommit) {
                    server.commit();
                }
            } catch (SolrServerException e) {
                throw new YardException("Error while adding updated Documents to the SolrServer", e);
            } catch (IOException e) {
                throw new YardException("Unable to access Solr server", e);
            }
        }
        long ready = System.currentTimeMillis();
        log.info(String
                .format(
View Full Code Here

     */
    @Override
    public Representation store(Representation representation) throws IllegalArgumentException, YardException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            return yard.store(applyCacheMappings(yard, representation));
        }
    }
View Full Code Here

    @Override
    public Representation update(Representation representation) throws YardException, IllegalArgumentException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            return yard.update(applyCacheMappings(yard, representation));
        }
    }
View Full Code Here

    @Override
    public QueryResultList<Representation> find(FieldQuery query) throws YardException, IllegalArgumentException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            return yard.find(query);
        }
    }
View Full Code Here

    @Override
    public QueryResultList<String> findReferences(FieldQuery query) throws YardException, IllegalArgumentException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            return yard.findReferences(query);
        }
    }
View Full Code Here

    @Override
    public QueryResultList<Representation> findRepresentation(FieldQuery query) throws YardException, IllegalArgumentException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            return yard.findRepresentation(query);
        }
    }
View Full Code Here

    @Override
    public Representation getRepresentation(String id) throws YardException, IllegalArgumentException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            return yard.getRepresentation(id);
        }
    }
View Full Code Here

    @Override
    public boolean isRepresentation(String id) throws YardException, IllegalArgumentException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            return yard.isRepresentation(id);
        }
    }
View Full Code Here

    @Override
    public void remove(String id) throws IllegalArgumentException, YardException {
        Yard yard = getCacheYard();
        if (yard == null) {
            throw new YardException(String.format("The Yard %s for this cache is currently not available", yardId));
        } else {
            yard.remove(id);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.entityhub.servicesapi.yard.YardException

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.