Tabnine Logo
YardException
Code IndexAdd Tabnine to your IDE (free)

How to use
YardException
in
org.apache.stanbol.entityhub.servicesapi.yard

Best Java code snippets using org.apache.stanbol.entityhub.servicesapi.yard.YardException (Showing top 20 results out of 315)

origin: org.apache.stanbol/org.apache.stanbol.entityhub.yard.solr

/**
 * This will case the SolrIndex to be optimised
 * @throws YardException on any error while optimising
 */
public final void optimize() throws YardException {
  if(closed){
    throw new IllegalStateException("The SolrYard is already closed!");
  }
  try {
    server.optimize();
  } catch (SolrServerException e) {
    throw new YardException("Unable to optimise SolrIndex!", e);
  } catch (IOException e) {
    throw new YardException("Unable to optimise SolrIndex!", e);
  }
}
/**
origin: apache/stanbol

@Override
public QueryResultList<String> findReferences(FieldQuery query) throws ManagedSiteException {
  try {
    return getYard().findReferences(query);
  } catch (YardException e) {
    throw new ManagedSiteException(e.getMessage(), e);
  }
}
origin: apache/stanbol

/**
 * This will case the SolrIndex to be optimised
 * @throws YardException on any error while optimising
 */
public final void optimize() throws YardException {
  if(closed){
    throw new IllegalStateException("The SolrYard is already closed!");
  }
  try {
    server.optimize();
  } catch (SolrServerException e) {
    throw new YardException("Unable to optimise SolrIndex!", e);
  } catch (IOException e) {
    throw new YardException("Unable to optimise SolrIndex!", e);
  }
}
/**
origin: apache/stanbol

@Override
public QueryResultList<Representation> find(FieldQuery query) throws ManagedSiteException {
  try {
    return getYard().find(query);
  } catch (YardException e) {
    throw new ManagedSiteException(e.getMessage(), e);
  }
}
origin: apache/stanbol

@Override
public final boolean isRepresentation(String id) throws YardException {
  if (id == null) {
    throw new IllegalArgumentException("The parsed Representation id MUST NOT be NULL!");
  }
  if (id.isEmpty()) {
    throw new IllegalArgumentException("The parsed Representation id MUST NOT be empty!");
  }
  try {
    return getSolrDocument(id, Arrays.asList(fieldMapper.getDocumentIdField())) != null;
  } catch (SolrServerException e) {
    throw new YardException("Error while performing getDocumentByID request for id " + id, e);
  } catch (IOException e) {
    throw new YardException("Unable to access SolrServer", e);
  }
}
origin: apache/stanbol

@Override
public void delete(String id) throws ManagedSiteException {
  try {
    getYard().remove(id);
  }  catch (YardException e) {
    throw new ManagedSiteException(e.getMessage(), e);
  }
}
origin: org.apache.stanbol/org.apache.stanbol.entityhub.yard.solr

@Override
public final boolean isRepresentation(String id) throws YardException {
  if (id == null) {
    throw new IllegalArgumentException("The parsed Representation id MUST NOT be NULL!");
  }
  if (id.isEmpty()) {
    throw new IllegalArgumentException("The parsed Representation id MUST NOT be empty!");
  }
  try {
    return getSolrDocument(id, Arrays.asList(fieldMapper.getDocumentIdField())) != null;
  } catch (SolrServerException e) {
    throw new YardException("Error while performing getDocumentByID request for id " + id, e);
  } catch (IOException e) {
    throw new YardException("Unable to access SolrServer", e);
  }
}
origin: apache/stanbol

@Override
public void deleteAll() throws ManagedSiteException {
  try {
    getYard().removeAll();
  }  catch (YardException e) {
    throw new ManagedSiteException(e.getMessage(), e);
  }
}
origin: apache/stanbol

Exception e = pae.getException();
if(e instanceof SolrServerException){
  throw new YardException("Error while deleting documents from the Solr server", e);
} else if(e instanceof IOException){
  throw new YardException("Unable to access SolrServer",e);
} else if(e instanceof YardException){
  throw (YardException)e;
origin: apache/stanbol

/**
 * Stores the parsed representation to the Yard and also applies the
 * configured {@link #getFieldMapper() FieldMappings}.
 * @param The representation to store
 */
@Override
public void store(Representation representation) throws ManagedSiteException {
  try {
    Yard yard = getYard();
    fieldMapper.applyMappings(representation, representation, yard.getValueFactory());
    yard.store(representation);
  }  catch (YardException e) {
    throw new ManagedSiteException(e.getMessage(), e);
  }
  
}
/**
origin: org.apache.stanbol/org.apache.stanbol.entityhub.yard.solr

Exception e = pae.getException();
if(e instanceof SolrServerException){
  throw new YardException("Error while deleting documents from the Solr server", e);
} else if(e instanceof IOException){
  throw new YardException("Unable to access SolrServer",e);
} else if(e instanceof YardException){
  throw (YardException)e;
origin: apache/stanbol

@Override
public Entity getEntity(String id) throws ManagedSiteException {
  Representation rep;
  try {
    rep = getYard().getRepresentation(id);
  } catch (YardException e) {
    throw new ManagedSiteException(e.getMessage(), e);
  }
  if(rep != null){
    Entity entity = new EntityImpl(config.getId(), rep, null);
    SiteUtils.initEntityMetadata(entity, siteMetadata, null);
    return entity;
  } else {
    return null;
  }
}

origin: apache/stanbol

/**
 * @return
 * @throws YardException
 */
private Lock writeLockGraph() throws YardException {
  if (immutable) {
     throw new YardException("Unable modify data in ClerezzaYard '"+getId()
      + "' because the backing RDF graph '"+yardGraphUri
      + "' is read-only!");
  }
  final Lock writeLock;
  writeLock = graph.getLock().writeLock();
  writeLock.lock();
  return writeLock;
}
@Override
origin: apache/stanbol

throw new ManagedSiteException(e.getMessage(), e);
origin: apache/stanbol

Exception e = pae.getException();
if(e instanceof SolrServerException){
  throw new YardException("Error while deleting documents from the Solr server", e);
} else if(e instanceof IOException){
  throw new YardException("Unable to access SolrServer",e);
} else {
  throw RuntimeException.class.cast(e);
origin: apache/stanbol

@Override
public QueryResultList<Entity> findEntities(FieldQuery query) throws ManagedSiteException {
  QueryResultList<Representation> results;
  try {
    results = getYard().findRepresentation(query);
  } catch (YardException e) {
    throw new ManagedSiteException(e.getMessage(), e);
  }
  return new QueryResultListImpl<Entity>(results.getQuery(),
      new AdaptingIterator<Representation,Entity>(
          results.iterator(), 
          new AdaptingIterator.Adapter<Representation,Entity>() {
            private final String siteId = config.getId();
            @Override
            public Entity adapt(Representation value, Class<Entity> type) {
              Entity entity = new EntityImpl(siteId,value,null);
              SiteUtils.initEntityMetadata(entity, siteMetadata, null);
              return entity;
            }
          }, Entity.class),Entity.class);
}
origin: apache/stanbol

Exception e = pae.getException();
if(e instanceof SolrServerException){
  throw new YardException("Error while deleting document " + id + " from the Solr server", e);
} else if(e instanceof IOException){
  throw new YardException("Unable to access SolrServer",e);
} else {
  throw RuntimeException.class.cast(e);
origin: org.apache.stanbol/org.apache.stanbol.entityhub.yard.solr

Exception e = pae.getException();
if(e instanceof SolrServerException){
  throw new YardException("Error while deleting document " + id + " from the Solr server", e);
} else if(e instanceof IOException){
  throw new YardException("Unable to access SolrServer",e);
} else {
  throw RuntimeException.class.cast(e);
origin: org.apache.stanbol/org.apache.stanbol.entityhub.yard.solr

Exception e = pae.getException();
if(e instanceof SolrServerException){
  throw new YardException("Error while deleting documents from the Solr server", e);
} else if(e instanceof IOException){
  throw new YardException("Unable to access SolrServer",e);
} else {
  throw RuntimeException.class.cast(e);
origin: apache/stanbol

  doc = getSolrDocument(id);
} catch (SolrServerException e) {
  throw new YardException("Error while getting SolrDocument for id" + id, e);
} catch (IOException e) {
  throw new YardException("Unable to access SolrServer", e);
org.apache.stanbol.entityhub.servicesapi.yardYardException

Javadoc

Used to indicate an error while performing an operation on a yard

Most used methods

  • <init>
    Creates an exception with a message and a cause
  • getMessage

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • Menu (java.awt)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now