gpt4 book ai didi

org.apache.stanbol.entityhub.servicesapi.yard.YardException类的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 02:17:31 28 4
gpt4 key购买 nike

本文整理了Java中org.apache.stanbol.entityhub.servicesapi.yard.YardException类的一些代码示例,展示了YardException类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YardException类的具体详情如下:
包路径:org.apache.stanbol.entityhub.servicesapi.yard.YardException
类名称:YardException

YardException介绍

[英]Used to indicate an error while performing an operation on a yard
[中]用于指示在场地上执行操作时出现错误

代码示例

代码示例来源: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);

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com