Tabnine Logo
YardException.<init>
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using org.apache.stanbol.entityhub.servicesapi.yard.YardException.<init> (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

/**
 * 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 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: 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: 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

/**
 * @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

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);
origin: org.apache.stanbol/org.apache.stanbol.entityhub.yard.solr

  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);
origin: apache/stanbol

/**
 * Returns the SPARQL result set for a given {@link SparqlFieldQuery} that
 * was executed on this yard
 * @param query the SparqlFieldQuery instance
 * @return the results of the SPARQL query in the yard
 * @throws YardException in case the generated SPARQL query could not be parsed
 * or the generated Query is not an SPARQL SELECT query.
 */
private ResultSet executeSparqlFieldQuery(final SparqlFieldQuery query) throws YardException {
  int limit = QueryUtils.getLimit(query, getConfig().getDefaultQueryResultNumber(), getConfig().getMaxQueryResultNumber());
  SelectQuery sparqlQuery;
  String sparqlQueryString = SparqlQueryUtils.createSparqlSelectQuery(query, false,limit,EndpointTypeEnum.Standard);
  try {
    sparqlQuery = (SelectQuery)QueryParser.getInstance().parse(sparqlQueryString);
  } catch (ParseException e) {
    log.error("ParseException for SPARQL Query in findRepresentation");
    log.error("FieldQuery: "+query);
    log.error("SPARQL Query: "+sparqlQueryString);
    throw new YardException("Unable to parse SPARQL query generated for the parse FieldQuery",e);
  } catch (ClassCastException e){
    log.error("ClassCastExeption because parsed SPARQL Query is not of Type "+SelectQuery.class);
    log.error("FieldQuery: "+query);
    log.error("SPARQL Query: "+sparqlQueryString);
    throw new YardException("Unable to parse SPARQL SELECT query generated for the parse FieldQuery",e);
  }
  return tcManager.executeSparqlQuery(sparqlQuery, graph);
}
@Override
origin: apache/stanbol

@Override
public Representation getRepresentation(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 EMTPY!");
  }
  RepositoryConnection con = null;
  try {
    con = repository.getConnection();
    con.begin();
    Representation rep = getRepresentation(con, sesameFactory.createURI(id), true);
    con.commit();
    return rep;
  } catch (RepositoryException e) {
    throw new YardException("Unable to get Representation "+id, e);
  } finally {
    if(con != null){
      try {
        con.close();
      } catch (RepositoryException ignore) {}
    }
  }
}
/**
origin: apache/stanbol

@Override
public boolean isRepresentation(String id) throws YardException {
  if(id == null) {
    throw new IllegalArgumentException("The parsed id MUST NOT be NULL!");
  }
  if(id.isEmpty()){
    throw new IllegalArgumentException("The parsed id MUST NOT be EMPTY!");
  }
  RepositoryConnection con = null;
  try {
    con = repository.getConnection();
    con.begin();
    boolean state = isRepresentation(con, sesameFactory.createURI(id));
    con.commit();
    return state;
  } catch (RepositoryException e) {
    throw new YardException("Unable to check for Representation "+id, e);
  } finally {
    if(con != null){
      try {
        con.close();
      } catch (RepositoryException ignore) {}
    }
  }
}
/**
origin: apache/stanbol

Exception e = pae.getException();
if(e instanceof SolrServerException){
  throw new YardException("Error while performing query on the SolrServer (query: "
      + query.getQuery()+")!", e);
} else if(e instanceof IOException){
  throw new YardException("Unable to access SolrServer",e);
} else {
  throw RuntimeException.class.cast(e);
origin: apache/stanbol

log.error("FieldQuery: "+query);
log.error("SPARQL Query: "+sparqlQueryString);
throw new YardException("Unable to parse SPARQL query generated for the parse FieldQuery",e);
log.error("FieldQuery: "+query);
log.error("SPARQL Query: "+sparqlQueryString);
throw new YardException("Unable to process results of Query");
origin: org.apache.stanbol/org.apache.stanbol.entityhub.yard.solr

Exception e = pae.getException();
if(e instanceof SolrServerException){
  throw new YardException("Error while performing query on the SolrServer (query: "
      + query.getQuery()+")!", e);
} else if(e instanceof IOException){
  throw new YardException("Unable to access SolrServer",e);
} else {
  throw RuntimeException.class.cast(e);
origin: apache/stanbol

  return added;
} catch (RepositoryException e) {
  throw new YardException("Unable to remove parsed Representations", e);
} catch (IllegalArgumentException e) {
  try { 
origin: apache/stanbol

@Override
public void remove(String id) throws YardException, IllegalArgumentException {
  if(id == null) {
    throw new IllegalArgumentException("The parsed Representation id MUST NOT be NULL!");
  }
  RepositoryConnection con = null;
  try {
    con = repository.getConnection();
    con.begin();
    remove(con, sesameFactory.createURI(id));
    con.commit();
  } catch (RepositoryException e) {
    throw new YardException("Unable to remove for Representation "+id, e);
  } finally {
    if(con != null){
      try {
        con.close();
      } catch (RepositoryException ignore) {}
    }
  }
}
/**
origin: apache/stanbol

@Override
public final void remove(Iterable<String> ids) throws IllegalArgumentException, YardException {
  if(ids == null){
    throw new IllegalArgumentException("The parsed Iterable over the IDs to remove MUST NOT be NULL!");
  }
  RepositoryConnection con = null;
  try {
    con = repository.getConnection();
    con.begin();
    for(String id : ids){
      if(id != null){
        remove(con, sesameFactory.createURI(id));
      }
    }
    con.commit();
  } catch (RepositoryException e) {
    throw new YardException("Unable to remove parsed Representations", e);
  } finally {
    if(con != null){
      try {
        con.close();
      } catch (RepositoryException ignore) {}
    }
  }
}
@Override
origin: apache/stanbol

@Override
public final void removeAll() throws YardException {
  RepositoryConnection con = null;
  try {
    con = repository.getConnection();
    con.begin();
    con.clear(contexts); //removes everything
    con.commit();
  } catch (RepositoryException e) {
    throw new YardException("Unable to remove parsed Representations", e);
  } finally {
    if(con != null){
      try {
        con.close();
      } catch (RepositoryException ignore) {}
    }
  }
}
@Override
origin: apache/stanbol

  return added;
} catch (RepositoryException e) {
  throw new YardException("Unable to remove parsed Representations", e);
} catch (IllegalArgumentException e) {
  try { 
org.apache.stanbol.entityhub.servicesapi.yardYardException<init>

Javadoc

Creates an exception with a message and a cause

Popular methods of YardException

  • getMessage

Popular in Java

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • Menu (java.awt)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Notification (javax.management)
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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